Added pkg-config support to xlib, xrender, cairo, cairoxlib
This commit is contained in:
parent
37b660dd78
commit
a080277f84
4 changed files with 704 additions and 884 deletions
|
|
@ -7,33 +7,46 @@
|
|||
import
|
||||
cairo, x, xlib, xrender
|
||||
|
||||
when defined(pkclibcairo):
|
||||
{.passl: gorge("pkg-config cairo --libs").}
|
||||
{.pragma: libcairo, cdecl.}
|
||||
else:
|
||||
when defined(windows):
|
||||
const LIB_CAIRO* = "libcairo-2.dll"
|
||||
elif defined(macosx):
|
||||
const LIB_CAIRO* = "libcairo.dylib"
|
||||
else:
|
||||
const LIB_CAIRO* = "libcairo.so(|.2)"
|
||||
{.pragma: libcairo, cdecl, dynlib: LIB_CAIRO.}
|
||||
|
||||
|
||||
proc xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, visual: PVisual,
|
||||
width, height: int32): PSurface{.cdecl,
|
||||
importc: "cairo_xlib_surface_create", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_create", libcairo.}
|
||||
proc xlib_surface_create_for_bitmap*(dpy: PDisplay, bitmap: TPixmap,
|
||||
screen: PScreen, width, height: int32): PSurface{.
|
||||
cdecl, importc: "cairo_xlib_surface_create_for_bitmap", dynlib: LIB_CAIRO.}
|
||||
cdecl, importc: "cairo_xlib_surface_create_for_bitmap", libcairo.}
|
||||
proc xlib_surface_create_with_xrender_format*(dpy: PDisplay,
|
||||
drawable: TDrawable, screen: PScreen, format: PXRenderPictFormat,
|
||||
width, height: int32): PSurface{.cdecl, importc: "cairo_xlib_surface_create_with_xrender_format",
|
||||
dynlib: LIB_CAIRO.}
|
||||
libcairo.}
|
||||
proc xlib_surface_get_depth*(surface: PSurface): int32{.cdecl,
|
||||
importc: "cairo_xlib_surface_get_depth", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_get_depth", libcairo.}
|
||||
proc xlib_surface_get_display*(surface: PSurface): PDisplay{.cdecl,
|
||||
importc: "cairo_xlib_surface_get_display", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_get_display", libcairo.}
|
||||
proc xlib_surface_get_drawable*(surface: PSurface): TDrawable{.cdecl,
|
||||
importc: "cairo_xlib_surface_get_drawable", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_get_drawable", libcairo.}
|
||||
proc xlib_surface_get_height*(surface: PSurface): int32{.cdecl,
|
||||
importc: "cairo_xlib_surface_get_height", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_get_height", libcairo.}
|
||||
proc xlib_surface_get_screen*(surface: PSurface): PScreen{.cdecl,
|
||||
importc: "cairo_xlib_surface_get_screen", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_get_screen", libcairo.}
|
||||
proc xlib_surface_get_visual*(surface: PSurface): PVisual{.cdecl,
|
||||
importc: "cairo_xlib_surface_get_visual", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_get_visual", libcairo.}
|
||||
proc xlib_surface_get_width*(surface: PSurface): int32{.cdecl,
|
||||
importc: "cairo_xlib_surface_get_width", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_get_width", libcairo.}
|
||||
proc xlib_surface_set_size*(surface: PSurface, width, height: int32){.cdecl,
|
||||
importc: "cairo_xlib_surface_set_size", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_set_size", libcairo.}
|
||||
proc xlib_surface_set_drawable*(surface: PSurface, drawable: TDrawable,
|
||||
width, height: int32){.cdecl,
|
||||
importc: "cairo_xlib_surface_set_drawable", dynlib: LIB_CAIRO.}
|
||||
importc: "cairo_xlib_surface_set_drawable", libcairo.}
|
||||
# implementation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue