added missing wrappers

This commit is contained in:
Araq 2010-08-28 22:56:27 +02:00
commit c96f4e042e
8 changed files with 2576 additions and 0 deletions

35
lib/wrappers/cairo/cairoft.nim Executable file
View file

@ -0,0 +1,35 @@
#
# Translation of cairo-ft.h
# by Jeffrey Pohlmeyer
# updated to version 1.4 by Luiz Américo Pereira Câmara 2007
#
import
cairo, freetypeh
#todo: properly define FcPattern:
#It will require translate FontConfig header
#*
#typedef struct _XftPattern {
# int num;
# int size;
# XftPatternElt *elts;
# } XftPattern;
# typedef FcPattern XftPattern;
#
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_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.}

View file

@ -0,0 +1,37 @@
#
# Translation of cairo-win32.h version 1.4
# by Luiz Américo Pereira Câmara 2007
#
import
cairo, windows
proc win32_surface_create*(hdc: HDC): PSurface{.cdecl,
importc: "cairo_win32_surface_create", dynlib: LIB_CAIRO.}
proc win32_surface_create_with_ddb*(hdc: HDC, format: TFormat,
width, height: int32): PSurface{.cdecl,
importc: "cairo_win32_surface_create_with_ddb", dynlib: LIB_CAIRO.}
proc win32_surface_create_with_dib*(format: TFormat, width, height: int32): PSurface{.
cdecl, importc: "cairo_win32_surface_create_with_dib", dynlib: LIB_CAIRO.}
proc win32_surface_get_dc*(surface: PSurface): HDC{.cdecl,
importc: "cairo_win32_surface_get_dc", dynlib: LIB_CAIRO.}
proc win32_surface_get_image*(surface: PSurface): PSurface{.cdecl,
importc: "cairo_win32_surface_get_image", dynlib: LIB_CAIRO.}
proc win32_font_face_create_for_logfontw*(logfont: pLOGFONTW): PFontFace{.cdecl,
importc: "cairo_win32_font_face_create_for_logfontw", dynlib: LIB_CAIRO.}
proc win32_font_face_create_for_hfont*(font: HFONT): PFontFace{.cdecl,
importc: "cairo_win32_font_face_create_for_hfont", dynlib: LIB_CAIRO.}
proc win32_scaled_font_select_font*(scaled_font: PScaledFont, hdc: HDC): TStatus{.
cdecl, importc: "cairo_win32_scaled_font_select_font", dynlib: LIB_CAIRO.}
proc win32_scaled_font_done_font*(scaled_font: PScaledFont){.cdecl,
importc: "cairo_win32_scaled_font_done_font", dynlib: LIB_CAIRO.}
proc win32_scaled_font_get_metrics_factor*(scaled_font: PScaledFont): float64{.
cdecl, importc: "cairo_win32_scaled_font_get_metrics_factor",
dynlib: LIB_CAIRO.}
proc win32_scaled_font_get_logical_to_device*(scaled_font: PScaledFont,
logical_to_device: PMatrix){.cdecl, importc: "cairo_win32_scaled_font_get_logical_to_device",
dynlib: LIB_CAIRO.}
proc win32_scaled_font_get_device_to_logical*(scaled_font: PScaledFont,
device_to_logical: PMatrix){.cdecl, importc: "cairo_win32_scaled_font_get_device_to_logical",
dynlib: LIB_CAIRO.}
# implementation

View file

@ -0,0 +1,39 @@
#
# Translation of cairo-xlib.h version 1.4
# by Jeffrey Pohlmeyer
# updated to version 1.4 by Luiz Américo Pereira Câmara 2007
#
import
cairo, x, xlib, xrender
proc xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, visual: PVisual,
width, height: int32): PSurface{.cdecl,
importc: "cairo_xlib_surface_create", dynlib: LIB_CAIRO.}
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.}
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.}
proc xlib_surface_get_depth*(surface: PSurface): int32{.cdecl,
importc: "cairo_xlib_surface_get_depth", dynlib: LIB_CAIRO.}
proc xlib_surface_get_display*(surface: PSurface): PDisplay{.cdecl,
importc: "cairo_xlib_surface_get_display", dynlib: LIB_CAIRO.}
proc xlib_surface_get_drawable*(surface: PSurface): TDrawable{.cdecl,
importc: "cairo_xlib_surface_get_drawable", dynlib: LIB_CAIRO.}
proc xlib_surface_get_height*(surface: PSurface): int32{.cdecl,
importc: "cairo_xlib_surface_get_height", dynlib: LIB_CAIRO.}
proc xlib_surface_get_screen*(surface: PSurface): PScreen{.cdecl,
importc: "cairo_xlib_surface_get_screen", dynlib: LIB_CAIRO.}
proc xlib_surface_get_visual*(surface: PSurface): PVisual{.cdecl,
importc: "cairo_xlib_surface_get_visual", dynlib: LIB_CAIRO.}
proc xlib_surface_get_width*(surface: PSurface): int32{.cdecl,
importc: "cairo_xlib_surface_get_width", dynlib: LIB_CAIRO.}
proc xlib_surface_set_size*(surface: PSurface, width, height: int32){.cdecl,
importc: "cairo_xlib_surface_set_size", dynlib: LIB_CAIRO.}
proc xlib_surface_set_drawable*(surface: PSurface, drawable: TDrawable,
width, height: int32){.cdecl,
importc: "cairo_xlib_surface_set_drawable", dynlib: LIB_CAIRO.}
# implementation