Moved complex pragmas for xlib and cairo into separate included files. Fixed xkb bindings.
This commit is contained in:
parent
f54cb2e323
commit
02ca9e3b59
8 changed files with 263 additions and 322 deletions
|
|
@ -47,20 +47,8 @@
|
|||
# By Luiz Américo Pereira Câmara
|
||||
# October 2007
|
||||
#
|
||||
when defined(use_pkg_config) or defined(use_pkg_config_static):
|
||||
{.pragma: libcairo, cdecl.}
|
||||
when defined(use_pkg_config_static):
|
||||
{.passl: gorge("pkg-config cairo --libs --static").}
|
||||
else:
|
||||
{.passl: gorge("pkg-config cairo --libs").}
|
||||
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.}
|
||||
|
||||
include "cairo_pragma.nim"
|
||||
|
||||
type
|
||||
PByte = cstring
|
||||
|
|
|
|||
16
lib/wrappers/cairo/cairo_pragma.nim
Normal file
16
lib/wrappers/cairo/cairo_pragma.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# included by cairo bindings
|
||||
|
||||
when defined(use_pkg_config) or defined(use_pkg_config_static):
|
||||
{.pragma: libcairo, cdecl.}
|
||||
when defined(use_pkg_config_static):
|
||||
{.passl: gorge("pkg-config cairo --libs --static").}
|
||||
else:
|
||||
{.passl: gorge("pkg-config cairo --libs").}
|
||||
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.}
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
import
|
||||
cairo, freetypeh
|
||||
|
||||
include "cairo_pragma.nim"
|
||||
#todo: properly define FcPattern:
|
||||
#It will require translate FontConfig header
|
||||
|
||||
|
|
@ -23,13 +24,13 @@ type
|
|||
FcPattern* = Pointer
|
||||
PFcPattern* = ptr FcPattern
|
||||
|
||||
proc ft_font_face_create_for_pattern*(pattern: PFcPattern): PFontFace{.cdecl,
|
||||
importc: "cairo_ft_font_face_create_for_pattern", dynlib: LIB_CAIRO.}
|
||||
proc ft_font_face_create_for_pattern*(pattern: PFcPattern): PFontFace{.libcairo,
|
||||
importc: "cairo_ft_font_face_create_for_pattern".}
|
||||
proc ft_font_options_substitute*(options: PFontOptions, pattern: PFcPattern){.
|
||||
cdecl, importc: "cairo_ft_font_options_substitute", dynlib: LIB_CAIRO.}
|
||||
proc ft_font_face_create_for_ft_face*(face: TFT_Face, load_flags: int32): PFontFace{.
|
||||
cdecl, importc: "cairo_ft_font_face_create_for_ft_face", dynlib: LIB_CAIRO.}
|
||||
proc ft_scaled_font_lock_face*(scaled_font: PScaledFont): TFT_Face{.cdecl,
|
||||
importc: "cairo_ft_scaled_font_lock_face", dynlib: LIB_CAIRO.}
|
||||
proc ft_scaled_font_unlock_face*(scaled_font: PScaledFont){.cdecl,
|
||||
importc: "cairo_ft_scaled_font_unlock_face", dynlib: LIB_CAIRO.}
|
||||
libcairo, importc: "cairo_ft_font_options_substitute".}
|
||||
proc ft_font_face_create_for_ft_face*(face: TFT_Face, load_flags: int32): PFontFace{.libcairo,
|
||||
importc: "cairo_ft_font_face_create_for_ft_face".}
|
||||
proc ft_scaled_font_lock_face*(scaled_font: PScaledFont): TFT_Face{.libcairo,
|
||||
importc: "cairo_ft_scaled_font_lock_face".}
|
||||
proc ft_scaled_font_unlock_face*(scaled_font: PScaledFont){.libcairo,
|
||||
importc: "cairo_ft_scaled_font_unlock_face".}
|
||||
|
|
|
|||
|
|
@ -7,17 +7,7 @@
|
|||
import
|
||||
cairo, x, xlib, xrender
|
||||
|
||||
when defined(use_pkg_config) or defined(use_pkg_config_static):
|
||||
{.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.}
|
||||
|
||||
include "cairo_pragma.nim"
|
||||
|
||||
proc xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, visual: PVisual,
|
||||
width, height: int32): PSurface{.cdecl,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue