Fixed libX11, libXrender bindings for macos and linux.

This commit is contained in:
Yury Benesh
2013-07-04 17:45:44 +03:00
parent 3e4dec3cf4
commit 37b660dd78
2 changed files with 29 additions and 18 deletions

View File

@@ -2,8 +2,12 @@
import
x
const
libX11* = "libX11.so"
when defined(macosx):
const
libX11* = "libX11.dylib"
else:
const
libX11* = "libX11.so"
type
cunsigned* = cint

View File

@@ -2,8 +2,15 @@
import
x, xlib
when defined(macosx):
const
libXrender* = "libXrender.dylib"
else:
const
libXrender* = "libXrender.so"
#const
# libX11* = "libX11.so"
# libXrender* = "libXrender.so"
#
# Automatically converted by H2Pas 0.99.15 from xrender.h
@@ -188,44 +195,44 @@ type
proc XRenderQueryExtension*(dpy: PDisplay, event_basep: ptr int32,
error_basep: ptr int32): TBool{.cdecl,
dynlib: libX11, importc.}
dynlib: libXrender, importc.}
proc XRenderQueryVersion*(dpy: PDisplay, major_versionp: ptr int32,
minor_versionp: ptr int32): TStatus{.cdecl,
dynlib: libX11, importc.}
proc XRenderQueryFormats*(dpy: PDisplay): TStatus{.cdecl, dynlib: libX11,
dynlib: libXrender, importc.}
proc XRenderQueryFormats*(dpy: PDisplay): TStatus{.cdecl, dynlib: libXrender,
importc.}
proc XRenderFindVisualFormat*(dpy: PDisplay, visual: PVisual): PXRenderPictFormat{.
cdecl, dynlib: libX11, importc.}
cdecl, dynlib: libXrender, importc.}
proc XRenderFindFormat*(dpy: PDisplay, mask: int32,
`template`: PXRenderPictFormat, count: int32): PXRenderPictFormat{.
cdecl, dynlib: libX11, importc.}
cdecl, dynlib: libXrender, importc.}
proc XRenderCreatePicture*(dpy: PDisplay, drawable: TDrawable,
format: PXRenderPictFormat, valuemask: int32,
attributes: PXRenderPictureAttributes): TPicture{.
cdecl, dynlib: libX11, importc.}
cdecl, dynlib: libXrender, importc.}
proc XRenderChangePicture*(dpy: PDisplay, picture: TPicture, valuemask: int32,
attributes: PXRenderPictureAttributes){.cdecl,
dynlib: libX11, importc.}
dynlib: libXrender, importc.}
proc XRenderFreePicture*(dpy: PDisplay, picture: TPicture){.cdecl,
dynlib: libX11, importc.}
dynlib: libXrender, importc.}
proc XRenderComposite*(dpy: PDisplay, op: int32, src: TPicture, mask: TPicture,
dst: TPicture, src_x: int32, src_y: int32, mask_x: int32,
mask_y: int32, dst_x: int32, dst_y: int32, width: int32,
height: int32){.cdecl, dynlib: libX11, importc.}
height: int32){.cdecl, dynlib: libXrender, importc.}
proc XRenderCreateGlyphSet*(dpy: PDisplay, format: PXRenderPictFormat): TGlyphSet{.
cdecl, dynlib: libX11, importc.}
cdecl, dynlib: libXrender, importc.}
proc XRenderReferenceGlyphSet*(dpy: PDisplay, existing: TGlyphSet): TGlyphSet{.
cdecl, dynlib: libX11, importc.}
cdecl, dynlib: libXrender, importc.}
proc XRenderFreeGlyphSet*(dpy: PDisplay, glyphset: TGlyphSet){.cdecl,
dynlib: libX11, importc.}
dynlib: libXrender, importc.}
proc XRenderAddGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph,
glyphs: PXGlyphInfo, nglyphs: int32, images: cstring,
nbyte_images: int32){.cdecl, dynlib: libX11, importc.}
nbyte_images: int32){.cdecl, dynlib: libXrender, importc.}
proc XRenderFreeGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph,
nglyphs: int32){.cdecl, dynlib: libX11, importc.}
nglyphs: int32){.cdecl, dynlib: libXrender, importc.}
proc XRenderCompositeString8*(dpy: PDisplay, op: int32, src: TPicture,
dst: TPicture, maskFormat: PXRenderPictFormat,
glyphset: TGlyphSet, xSrc: int32, ySrc: int32,
xDst: int32, yDst: int32, str: cstring,
nchar: int32){.cdecl, dynlib: libX11, importc.}
nchar: int32){.cdecl, dynlib: libXrender, importc.}
# implementation