further enhancements for the GTK wrapper
This commit is contained in:
parent
df672f5b9a
commit
4ee65a08dd
84 changed files with 7864 additions and 1288 deletions
0
lib/oldwrappers/cairo/cairo.nim
Normal file → Executable file
0
lib/oldwrappers/cairo/cairo.nim
Normal file → Executable file
0
lib/oldwrappers/cairo/cairoft.nim
Normal file → Executable file
0
lib/oldwrappers/cairo/cairoft.nim
Normal file → Executable file
0
lib/oldwrappers/cairo/cairowin32.nim
Normal file → Executable file
0
lib/oldwrappers/cairo/cairowin32.nim
Normal file → Executable file
0
lib/oldwrappers/cairo/cairoxlib.nim
Normal file → Executable file
0
lib/oldwrappers/cairo/cairoxlib.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/atk.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/atk.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gdk2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gdk2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gdk2pixbuf.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gdk2pixbuf.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gdkglext.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gdkglext.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/glib2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/glib2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gtk2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gtk2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gtkglext.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gtkglext.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gtkhtml.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/gtkhtml.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/libglade2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/libglade2.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/pango.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/pango.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/pangoutils.nim
Normal file → Executable file
0
lib/oldwrappers/gtk/pangoutils.nim
Normal file → Executable file
0
lib/oldwrappers/iup.nim
Normal file → Executable file
0
lib/oldwrappers/iup.nim
Normal file → Executable file
0
lib/oldwrappers/libcurl.nim
Normal file → Executable file
0
lib/oldwrappers/libcurl.nim
Normal file → Executable file
0
lib/oldwrappers/lua/lauxlib.nim
Normal file → Executable file
0
lib/oldwrappers/lua/lauxlib.nim
Normal file → Executable file
0
lib/oldwrappers/lua/lua.nim
Normal file → Executable file
0
lib/oldwrappers/lua/lua.nim
Normal file → Executable file
0
lib/oldwrappers/lua/lualib.nim
Normal file → Executable file
0
lib/oldwrappers/lua/lualib.nim
Normal file → Executable file
0
lib/oldwrappers/mysql.nim
Normal file → Executable file
0
lib/oldwrappers/mysql.nim
Normal file → Executable file
0
lib/oldwrappers/odbcsql.nim
Normal file → Executable file
0
lib/oldwrappers/odbcsql.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/gl.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/gl.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glext.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glext.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glu.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glu.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glut.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glut.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glx.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/glx.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/wingl.nim
Normal file → Executable file
0
lib/oldwrappers/opengl/wingl.nim
Normal file → Executable file
0
lib/oldwrappers/pcre/pcre.nim
Normal file → Executable file
0
lib/oldwrappers/pcre/pcre.nim
Normal file → Executable file
0
lib/oldwrappers/pcre/pcre_all.c
Normal file → Executable file
0
lib/oldwrappers/pcre/pcre_all.c
Normal file → Executable file
0
lib/oldwrappers/postgres.nim
Normal file → Executable file
0
lib/oldwrappers/postgres.nim
Normal file → Executable file
0
lib/oldwrappers/python.nim
Normal file → Executable file
0
lib/oldwrappers/python.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_gfx.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_gfx.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_image.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_image.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_mixer.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_mixer.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_mixer_nosmpeg.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_mixer_nosmpeg.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_net.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_net.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_ttf.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/sdl_ttf.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/smpeg.nim
Normal file → Executable file
0
lib/oldwrappers/sdl/smpeg.nim
Normal file → Executable file
0
lib/oldwrappers/sqlite3.nim
Normal file → Executable file
0
lib/oldwrappers/sqlite3.nim
Normal file → Executable file
0
lib/oldwrappers/tcl.nim
Normal file → Executable file
0
lib/oldwrappers/tcl.nim
Normal file → Executable file
0
lib/oldwrappers/x11/cursorfont.nim
Normal file → Executable file
0
lib/oldwrappers/x11/cursorfont.nim
Normal file → Executable file
0
lib/oldwrappers/x11/keysym.nim
Normal file → Executable file
0
lib/oldwrappers/x11/keysym.nim
Normal file → Executable file
0
lib/oldwrappers/x11/x.nim
Normal file → Executable file
0
lib/oldwrappers/x11/x.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xatom.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xatom.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xcms.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xcms.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xf86dga.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xf86dga.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xf86vmode.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xf86vmode.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xi.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xi.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xinerama.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xinerama.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xkb.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xkb.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xkblib.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xkblib.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xlib.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xlib.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xrandr.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xrandr.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xrender.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xrender.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xresource.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xresource.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xshm.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xshm.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xutil.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xutil.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xv.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xv.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xvlib.nim
Normal file → Executable file
0
lib/oldwrappers/x11/xvlib.nim
Normal file → Executable file
0
lib/oldwrappers/zip/libzip.nim
Normal file → Executable file
0
lib/oldwrappers/zip/libzip.nim
Normal file → Executable file
0
lib/oldwrappers/zip/zlib.nim
Normal file → Executable file
0
lib/oldwrappers/zip/zlib.nim
Normal file → Executable file
0
lib/oldwrappers/zip/zzip.nim
Normal file → Executable file
0
lib/oldwrappers/zip/zzip.nim
Normal file → Executable file
|
|
@ -1371,7 +1371,27 @@ proc peg*(pattern: string): TPeg =
|
|||
## peg"{\ident} \s* '=' \s* {.*}"
|
||||
result = parsePeg(pattern, "pattern")
|
||||
|
||||
proc escapePeg*(s: string): string =
|
||||
## escapes `s` so that it is matched verbatim when used as a peg.
|
||||
result = ""
|
||||
var inQuote = false
|
||||
for c in items(s):
|
||||
case c
|
||||
of '\0'..'\31', '\'', '"', '\\':
|
||||
if inQuote:
|
||||
result.add('\'')
|
||||
inQuote = false
|
||||
result.add("\\x")
|
||||
result.add(toHex(ord(c), 2))
|
||||
else:
|
||||
if not inQuote:
|
||||
result.add('\'')
|
||||
inQuote = true
|
||||
result.add(c)
|
||||
if inQuote: result.add('\'')
|
||||
|
||||
when isMainModule:
|
||||
assert escapePeg("abc''def'") == r"'abc'\x27\x27'def'\x27"
|
||||
assert match("(a b c)", peg"'(' @ ')'")
|
||||
assert match("W_HI_Le", peg"\y 'while'")
|
||||
assert(not match("W_HI_L", peg"\y 'while'"))
|
||||
|
|
|
|||
|
|
@ -273,6 +273,18 @@ proc split*(s: string, sep: TRegEx): seq[string] =
|
|||
## Splits the string `s` into substrings.
|
||||
accumulateResult(split(s, sep))
|
||||
|
||||
proc escapeRe*(s: string): string =
|
||||
## escapes `s` so that it is matched verbatim when used as a regular
|
||||
## expression.
|
||||
result = ""
|
||||
for c in items(s):
|
||||
case c
|
||||
of 'a'..'z', 'A'..'Z', '0'..'9', '_':
|
||||
result.add(c)
|
||||
else:
|
||||
result.add("\\x")
|
||||
result.add(toHex(ord(c), 2))
|
||||
|
||||
const ## common regular expressions
|
||||
reIdentifier* = r"\b[a-zA-Z_]+[a-zA-Z_0-9]*\b" ## describes an identifier
|
||||
reNatural* = r"\b\d+\b" ## describes a natural number
|
||||
|
|
|
|||
|
|
@ -1012,11 +1012,11 @@ proc layout_line*(drawable: PDrawable, gc: PGC, x: gint, y: gint,
|
|||
proc layout*(drawable: PDrawable, gc: PGC, x: gint, y: gint,
|
||||
layout: PLayout){.cdecl, dynlib: lib,
|
||||
importc: "gdk_draw_layout".}
|
||||
proc layout_line_with_colors*(drawable: PDrawable, gc: PGC, x: gint,
|
||||
proc layout_line*(drawable: PDrawable, gc: PGC, x: gint,
|
||||
y: gint, line: PLayoutLine,
|
||||
foreground: PColor, background: PColor){.
|
||||
cdecl, dynlib: lib, importc: "gdk_draw_layout_line_with_colors".}
|
||||
proc layout_with_colors*(drawable: PDrawable, gc: PGC, x: gint, y: gint,
|
||||
proc layout*(drawable: PDrawable, gc: PGC, x: gint, y: gint,
|
||||
layout: PLayout, foreground: PColor,
|
||||
background: PColor){.cdecl, dynlib: lib,
|
||||
importc: "gdk_draw_layout_with_colors".}
|
||||
|
|
@ -1210,7 +1210,7 @@ proc GC_GET_CLASS*(obj: Pointer): PGCClass
|
|||
proc gc_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_gc_get_type".}
|
||||
proc gc_new*(drawable: PDrawable): PGC{.cdecl, dynlib: lib,
|
||||
importc: "gdk_gc_new".}
|
||||
proc gc_new_with_values*(drawable: PDrawable, values: PGCValues,
|
||||
proc gc_new*(drawable: PDrawable, values: PGCValues,
|
||||
values_mask: TGCValuesMask): PGC{.cdecl, dynlib: lib,
|
||||
importc: "gdk_gc_new_with_values".}
|
||||
proc get_values*(gc: PGC, values: PGCValues){.cdecl, dynlib: lib,
|
||||
|
|
@ -2844,7 +2844,7 @@ proc offset*(region: PRegion, dx: gint, dy: gint){.cdecl, dynlib: lib,
|
|||
importc: "gdk_region_offset".}
|
||||
proc shrink*(region: PRegion, dx: gint, dy: gint){.cdecl, dynlib: lib,
|
||||
importc: "gdk_region_shrink".}
|
||||
proc union_with_rect*(region: PRegion, rect: PRectangle){.cdecl,
|
||||
proc union*(region: PRegion, rect: PRectangle){.cdecl,
|
||||
dynlib: lib, importc: "gdk_region_union_with_rect".}
|
||||
proc intersect*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib,
|
||||
importc: "gdk_region_intersect".}
|
||||
|
|
@ -3133,15 +3133,15 @@ const
|
|||
bm_TWindowObject_destroyed* = 0x0018'i16
|
||||
bp_TWindowObject_destroyed* = 3'i16
|
||||
|
||||
proc WindowObject_guffaw_gravity*(a: var TWindowObject): guint
|
||||
proc WindowObject_set_guffaw_gravity*(a: var TWindowObject,
|
||||
proc WindowObject_guffaw_gravity*(a: PWindowObject): guint
|
||||
proc WindowObject_set_guffaw_gravity*(a: PWindowObject,
|
||||
`guffaw_gravity`: guint)
|
||||
proc WindowObject_input_only*(a: var TWindowObject): guint
|
||||
proc WindowObject_set_input_only*(a: var TWindowObject, `input_only`: guint)
|
||||
proc WindowObject_modal_hint*(a: var TWindowObject): guint
|
||||
proc WindowObject_set_modal_hint*(a: var TWindowObject, `modal_hint`: guint)
|
||||
proc WindowObject_destroyed*(a: var TWindowObject): guint
|
||||
proc WindowObject_set_destroyed*(a: var TWindowObject, `destroyed`: guint)
|
||||
proc WindowObject_input_only*(a: PWindowObject): guint
|
||||
proc WindowObject_set_input_only*(a: PWindowObject, `input_only`: guint)
|
||||
proc WindowObject_modal_hint*(a: PWindowObject): guint
|
||||
proc WindowObject_set_modal_hint*(a: PWindowObject, `modal_hint`: guint)
|
||||
proc WindowObject_destroyed*(a: PWindowObject): guint
|
||||
proc WindowObject_set_destroyed*(a: PWindowObject, `destroyed`: guint)
|
||||
proc window_object_get_type*(): GType{.cdecl, dynlib: lib,
|
||||
importc: "gdk_window_object_get_type".}
|
||||
proc new*(parent: PWindow, attributes: PWindowAttr, attributes_mask: gint): PWindow{.
|
||||
|
|
@ -3800,39 +3800,39 @@ proc WINDOW_GET_CLASS*(obj: Pointer): PWindowObjectClass =
|
|||
proc WINDOW_OBJECT*(anObject: Pointer): PWindowObject =
|
||||
result = cast[PWindowObject](WINDOW(anObject))
|
||||
|
||||
proc WindowObject_guffaw_gravity*(a: var TWindowObject): guint =
|
||||
proc WindowObject_guffaw_gravity*(a: PWindowObject): guint =
|
||||
result = (a.flag0 and bm_TWindowObject_guffaw_gravity) shr
|
||||
bp_TWindowObject_guffaw_gravity
|
||||
|
||||
proc WindowObject_set_guffaw_gravity*(a: var TWindowObject,
|
||||
proc WindowObject_set_guffaw_gravity*(a: PWindowObject,
|
||||
`guffaw_gravity`: guint) =
|
||||
a.flag0 = a.flag0 or
|
||||
(int16(`guffaw_gravity` shl bp_TWindowObject_guffaw_gravity) and
|
||||
bm_TWindowObject_guffaw_gravity)
|
||||
|
||||
proc WindowObject_input_only*(a: var TWindowObject): guint =
|
||||
proc WindowObject_input_only*(a: PWindowObject): guint =
|
||||
result = (a.flag0 and bm_TWindowObject_input_only) shr
|
||||
bp_TWindowObject_input_only
|
||||
|
||||
proc WindowObject_set_input_only*(a: var TWindowObject, `input_only`: guint) =
|
||||
proc WindowObject_set_input_only*(a: PWindowObject, `input_only`: guint) =
|
||||
a.flag0 = a.flag0 or
|
||||
(int16(`input_only` shl bp_TWindowObject_input_only) and
|
||||
bm_TWindowObject_input_only)
|
||||
|
||||
proc WindowObject_modal_hint*(a: var TWindowObject): guint =
|
||||
proc WindowObject_modal_hint*(a: PWindowObject): guint =
|
||||
result = (a.flag0 and bm_TWindowObject_modal_hint) shr
|
||||
bp_TWindowObject_modal_hint
|
||||
|
||||
proc WindowObject_set_modal_hint*(a: var TWindowObject, `modal_hint`: guint) =
|
||||
proc WindowObject_set_modal_hint*(a: PWindowObject, `modal_hint`: guint) =
|
||||
a.flag0 = a.flag0 or
|
||||
(int16(`modal_hint` shl bp_TWindowObject_modal_hint) and
|
||||
bm_TWindowObject_modal_hint)
|
||||
|
||||
proc WindowObject_destroyed*(a: var TWindowObject): guint =
|
||||
proc WindowObject_destroyed*(a: PWindowObject): guint =
|
||||
result = (a.flag0 and bm_TWindowObject_destroyed) shr
|
||||
bp_TWindowObject_destroyed
|
||||
|
||||
proc WindowObject_set_destroyed*(a: var TWindowObject, `destroyed`: guint) =
|
||||
proc WindowObject_set_destroyed*(a: PWindowObject, `destroyed`: guint) =
|
||||
a.flag0 = a.flag0 or
|
||||
(int16(`destroyed` shl bp_TWindowObject_destroyed) and
|
||||
bm_TWindowObject_destroyed)
|
||||
|
|
|
|||
271
lib/wrappers/gtk/gdk2pixbuf.nim
Executable file
271
lib/wrappers/gtk/gdk2pixbuf.nim
Executable file
|
|
@ -0,0 +1,271 @@
|
|||
{.deadCodeElim: on.}
|
||||
import
|
||||
glib2
|
||||
|
||||
when defined(win32):
|
||||
const
|
||||
pixbuflib = "libgdk_pixbuf-2.0-0.dll"
|
||||
elif defined(darwin):
|
||||
const
|
||||
pixbuflib = "gdk_pixbuf-2.0.0"
|
||||
# linklib gtk-x11-2.0
|
||||
# linklib gdk-x11-2.0
|
||||
# linklib pango-1.0.0
|
||||
# linklib glib-2.0.0
|
||||
# linklib gobject-2.0.0
|
||||
# linklib gdk_pixbuf-2.0.0
|
||||
# linklib atk-1.0.0
|
||||
else:
|
||||
const
|
||||
pixbuflib = "libgdk_pixbuf-2.0.so"
|
||||
type
|
||||
PPixbuf* = pointer
|
||||
PPixbufAnimation* = pointer
|
||||
PPixbufAnimationIter* = pointer
|
||||
PPixbufAlphaMode* = ptr TPixbufAlphaMode
|
||||
TPixbufAlphaMode* = enum
|
||||
PIXBUF_ALPHA_BILEVEL, PIXBUF_ALPHA_FULL
|
||||
PColorspace* = ptr TColorspace
|
||||
TColorspace* = enum
|
||||
COLORSPACE_RGB
|
||||
TPixbufDestroyNotify* = proc (pixels: Pguchar, data: gpointer){.cdecl.}
|
||||
PPixbufError* = ptr TPixbufError
|
||||
TPixbufError* = enum
|
||||
PIXBUF_ERROR_CORRUPT_IMAGE, PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
||||
PIXBUF_ERROR_BAD_OPTION, PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
PIXBUF_ERROR_UNSUPPORTED_OPERATION, PIXBUF_ERROR_FAILED
|
||||
PInterpType* = ptr TInterpType
|
||||
TInterpType* = enum
|
||||
INTERP_NEAREST, INTERP_TILES, INTERP_BILINEAR, INTERP_HYPER
|
||||
|
||||
proc TYPE_PIXBUF*(): GType
|
||||
proc PIXBUF*(anObject: pointer): PPixbuf
|
||||
proc IS_PIXBUF*(anObject: pointer): bool
|
||||
proc TYPE_PIXBUF_ANIMATION*(): GType
|
||||
proc PIXBUF_ANIMATION*(anObject: pointer): PPixbufAnimation
|
||||
proc IS_PIXBUF_ANIMATION*(anObject: pointer): bool
|
||||
proc TYPE_PIXBUF_ANIMATION_ITER*(): GType
|
||||
proc PIXBUF_ANIMATION_ITER*(anObject: pointer): PPixbufAnimationIter
|
||||
proc IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool
|
||||
proc PIXBUF_ERROR*(): TGQuark
|
||||
proc pixbuf_error_quark*(): TGQuark{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_error_quark".}
|
||||
proc pixbuf_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_get_type".}
|
||||
when not defined(PIXBUF_DISABLE_DEPRECATED):
|
||||
proc pixbuf_ref*(pixbuf: PPixbuf): PPixbuf{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_ref".}
|
||||
proc pixbuf_unref*(pixbuf: PPixbuf){.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_unref".}
|
||||
proc get_colorspace*(pixbuf: PPixbuf): TColorspace{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_get_colorspace".}
|
||||
proc get_n_channels*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_get_n_channels".}
|
||||
proc get_has_alpha*(pixbuf: PPixbuf): gboolean{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_get_has_alpha".}
|
||||
proc get_bits_per_sample*(pixbuf: PPixbuf): int32{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_get_bits_per_sample".}
|
||||
proc get_pixels*(pixbuf: PPixbuf): Pguchar{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_get_pixels".}
|
||||
proc get_width*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_get_width".}
|
||||
proc get_height*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_get_height".}
|
||||
proc get_rowstride*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_get_rowstride".}
|
||||
proc pixbuf_new*(colorspace: TColorspace, has_alpha: gboolean,
|
||||
bits_per_sample: int32, width: int32, height: int32): PPixbuf{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_new".}
|
||||
proc copy*(pixbuf: PPixbuf): PPixbuf{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_copy".}
|
||||
proc new_subpixbuf*(src_pixbuf: PPixbuf, src_x: int32, src_y: int32,
|
||||
width: int32, height: int32): PPixbuf{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_subpixbuf".}
|
||||
proc pixbuf_new_from_file*(filename: cstring, error: pointer): PPixbuf{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file".}
|
||||
proc pixbuf_new_from_data*(data: Pguchar, colorspace: TColorspace,
|
||||
has_alpha: gboolean, bits_per_sample: int32,
|
||||
width: int32, height: int32, rowstride: int32,
|
||||
destroy_fn: TPixbufDestroyNotify,
|
||||
destroy_fn_data: gpointer): PPixbuf{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_data".}
|
||||
proc pixbuf_new_from_xpm_data*(data: PPchar): PPixbuf{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_new_from_xpm_data".}
|
||||
proc pixbuf_new_from_inline*(data_length: gint, a: var guint8,
|
||||
copy_pixels: gboolean, error: pointer): PPixbuf{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_inline".}
|
||||
proc pixbuf_new_from_file_at_size*(filename: cstring, width, height: gint,
|
||||
error: pointer): PPixbuf{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file_at_size".}
|
||||
proc pixbuf_new_from_file_at_scale*(filename: cstring, width, height: gint,
|
||||
preserve_aspect_ratio: gboolean,
|
||||
error: pointer): PPixbuf{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file_at_scale".}
|
||||
proc fill*(pixbuf: PPixbuf, pixel: guint32){.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_fill".}
|
||||
proc save*(pixbuf: PPixbuf, filename: cstring, `type`: cstring,
|
||||
error: pointer): gboolean{.cdecl, varargs, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_save".}
|
||||
proc savev*(pixbuf: PPixbuf, filename: cstring, `type`: cstring,
|
||||
option_keys: PPchar, option_values: PPchar, error: pointer): gboolean{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_savev".}
|
||||
proc add_alpha*(pixbuf: PPixbuf, substitute_color: gboolean, r: guchar,
|
||||
g: guchar, b: guchar): PPixbuf{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_add_alpha".}
|
||||
proc copy_area*(src_pixbuf: PPixbuf, src_x: int32, src_y: int32,
|
||||
width: int32, height: int32, dest_pixbuf: PPixbuf,
|
||||
dest_x: int32, dest_y: int32){.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_copy_area".}
|
||||
proc saturate_and_pixelate*(src: PPixbuf, dest: PPixbuf,
|
||||
saturation: gfloat, pixelate: gboolean){.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_saturate_and_pixelate".}
|
||||
proc scale*(src: PPixbuf, dest: PPixbuf, dest_x: int32, dest_y: int32,
|
||||
dest_width: int32, dest_height: int32, offset_x: float64,
|
||||
offset_y: float64, scale_x: float64, scale_y: float64,
|
||||
interp_type: TInterpType){.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_scale".}
|
||||
proc composite*(src: PPixbuf, dest: PPixbuf, dest_x: int32,
|
||||
dest_y: int32, dest_width: int32, dest_height: int32,
|
||||
offset_x: float64, offset_y: float64, scale_x: float64,
|
||||
scale_y: float64, interp_type: TInterpType,
|
||||
overall_alpha: int32){.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_composite".}
|
||||
proc composite_color*(src: PPixbuf, dest: PPixbuf, dest_x: int32,
|
||||
dest_y: int32, dest_width: int32,
|
||||
dest_height: int32, offset_x: float64,
|
||||
offset_y: float64, scale_x: float64,
|
||||
scale_y: float64, interp_type: TInterpType,
|
||||
overall_alpha: int32, check_x: int32,
|
||||
check_y: int32, check_size: int32, color1: guint32,
|
||||
color2: guint32){.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_composite_color".}
|
||||
proc scale_simple*(src: PPixbuf, dest_width: int32, dest_height: int32,
|
||||
interp_type: TInterpType): PPixbuf{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_scale_simple".}
|
||||
proc composite_color_simple*(src: PPixbuf, dest_width: int32,
|
||||
dest_height: int32,
|
||||
interp_type: TInterpType,
|
||||
overall_alpha: int32, check_size: int32,
|
||||
color1: guint32, color2: guint32): PPixbuf{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_composite_color_simple".}
|
||||
proc pixbuf_animation_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_animation_get_type".}
|
||||
proc pixbuf_animation_new_from_file*(filename: cstring, error: pointer): PPixbufAnimation{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_new_from_file".}
|
||||
when not defined(PIXBUF_DISABLE_DEPRECATED):
|
||||
proc pixbuf_animation_ref*(animation: PPixbufAnimation): PPixbufAnimation{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_ref".}
|
||||
proc pixbuf_animation_unref*(animation: PPixbufAnimation){.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_animation_unref".}
|
||||
proc get_width*(animation: PPixbufAnimation): int32{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_width".}
|
||||
proc get_height*(animation: PPixbufAnimation): int32{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_height".}
|
||||
proc is_static_image*(animation: PPixbufAnimation): gboolean{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_is_static_image".}
|
||||
proc get_static_image*(animation: PPixbufAnimation): PPixbuf{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_static_image".}
|
||||
proc get_iter*(animation: PPixbufAnimation, e: var TGTimeVal): PPixbufAnimationIter{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_iter".}
|
||||
proc pixbuf_animation_iter_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_animation_iter_get_type".}
|
||||
proc iter_get_delay_time*(iter: PPixbufAnimationIter): int32{.
|
||||
cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_animation_iter_get_delay_time".}
|
||||
proc iter_get_pixbuf*(iter: PPixbufAnimationIter): PPixbuf{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_iter_get_pixbuf".}
|
||||
proc pixbuf_animation_iter_on_currently_loading_frame*(
|
||||
iter: PPixbufAnimationIter): gboolean{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_animation_iter_on_currently_loading_frame".}
|
||||
proc iter_advance*(iter: PPixbufAnimationIter, e: var TGTimeVal): gboolean{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_iter_advance".}
|
||||
proc get_option*(pixbuf: PPixbuf, key: cstring): cstring{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_get_option".}
|
||||
type
|
||||
PPixbufLoader* = ptr TPixbufLoader
|
||||
TPixbufLoader*{.final, pure.} = object
|
||||
parent_instance*: TGObject
|
||||
priv*: gpointer
|
||||
|
||||
PPixbufLoaderClass* = ptr TPixbufLoaderClass
|
||||
TPixbufLoaderClass*{.final, pure.} = object
|
||||
parent_class*: TGObjectClass
|
||||
area_prepared*: proc (loader: PPixbufLoader){.cdecl.}
|
||||
area_updated*: proc (loader: PPixbufLoader, x: int32, y: int32,
|
||||
width: int32, height: int32){.cdecl.}
|
||||
closed*: proc (loader: PPixbufLoader){.cdecl.}
|
||||
|
||||
|
||||
proc TYPE_PIXBUF_LOADER*(): GType
|
||||
proc PIXBUF_LOADER*(obj: pointer): PPixbufLoader
|
||||
proc PIXBUF_LOADER_CLASS*(klass: pointer): PPixbufLoaderClass
|
||||
proc IS_PIXBUF_LOADER*(obj: pointer): bool
|
||||
proc IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool
|
||||
proc PIXBUF_LOADER_GET_CLASS*(obj: pointer): PPixbufLoaderClass
|
||||
proc pixbuf_loader_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_loader_get_type".}
|
||||
proc pixbuf_loader_new*(): PPixbufLoader{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_loader_new".}
|
||||
proc pixbuf_loader_new*(image_type: cstring, error: pointer): PPixbufLoader{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_new_with_type".}
|
||||
proc write*(loader: PPixbufLoader, buf: Pguchar, count: gsize,
|
||||
error: pointer): gboolean{.cdecl, dynlib: pixbuflib,
|
||||
importc: "gdk_pixbuf_loader_write".}
|
||||
proc get_pixbuf*(loader: PPixbufLoader): PPixbuf{.cdecl,
|
||||
dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_pixbuf".}
|
||||
proc get_animation*(loader: PPixbufLoader): PPixbufAnimation{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_animation".}
|
||||
proc close*(loader: PPixbufLoader, error: pointer): gboolean{.
|
||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_close".}
|
||||
proc TYPE_PIXBUF_LOADER*(): GType =
|
||||
result = pixbuf_loader_get_type()
|
||||
|
||||
proc PIXBUF_LOADER*(obj: pointer): PPixbufLoader =
|
||||
result = cast[PPixbufLoader](G_TYPE_CHECK_INSTANCE_CAST(obj,
|
||||
TYPE_PIXBUF_LOADER()))
|
||||
|
||||
proc PIXBUF_LOADER_CLASS*(klass: pointer): PPixbufLoaderClass =
|
||||
result = cast[PPixbufLoaderClass](G_TYPE_CHECK_CLASS_CAST(klass,
|
||||
TYPE_PIXBUF_LOADER()))
|
||||
|
||||
proc IS_PIXBUF_LOADER*(obj: pointer): bool =
|
||||
result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_PIXBUF_LOADER())
|
||||
|
||||
proc IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool =
|
||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_PIXBUF_LOADER())
|
||||
|
||||
proc PIXBUF_LOADER_GET_CLASS*(obj: pointer): PPixbufLoaderClass =
|
||||
result = cast[PPixbufLoaderClass](G_TYPE_INSTANCE_GET_CLASS(obj,
|
||||
TYPE_PIXBUF_LOADER()))
|
||||
|
||||
proc TYPE_PIXBUF*(): GType =
|
||||
result = pixbuf_get_type()
|
||||
|
||||
proc PIXBUF*(anObject: pointer): PPixbuf =
|
||||
result = cast[PPixbuf](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_PIXBUF()))
|
||||
|
||||
proc IS_PIXBUF*(anObject: pointer): bool =
|
||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF())
|
||||
|
||||
proc TYPE_PIXBUF_ANIMATION*(): GType =
|
||||
result = pixbuf_animation_get_type()
|
||||
|
||||
proc PIXBUF_ANIMATION*(anObject: pointer): PPixbufAnimation =
|
||||
result = cast[PPixbufAnimation](G_TYPE_CHECK_INSTANCE_CAST(anObject,
|
||||
TYPE_PIXBUF_ANIMATION()))
|
||||
|
||||
proc IS_PIXBUF_ANIMATION*(anObject: pointer): bool =
|
||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF_ANIMATION())
|
||||
|
||||
proc TYPE_PIXBUF_ANIMATION_ITER*(): GType =
|
||||
result = pixbuf_animation_iter_get_type()
|
||||
|
||||
proc PIXBUF_ANIMATION_ITER*(anObject: pointer): PPixbufAnimationIter =
|
||||
result = cast[PPixbufAnimationIter](G_TYPE_CHECK_INSTANCE_CAST(anObject,
|
||||
TYPE_PIXBUF_ANIMATION_ITER()))
|
||||
|
||||
proc IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool =
|
||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF_ANIMATION_ITER())
|
||||
|
||||
proc PIXBUF_ERROR*(): TGQuark =
|
||||
result = pixbuf_error_quark()
|
||||
4498
lib/wrappers/gtk/glib2.nim
Executable file
4498
lib/wrappers/gtk/glib2.nim
Executable file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
111
lib/wrappers/gtk/libglade2.nim
Executable file
111
lib/wrappers/gtk/libglade2.nim
Executable file
|
|
@ -0,0 +1,111 @@
|
|||
{.deadCodeElim: on.}
|
||||
import
|
||||
glib2, gtk2
|
||||
|
||||
when defined(win32):
|
||||
const
|
||||
LibGladeLib = "libglade-2.0-0.dll"
|
||||
else:
|
||||
const
|
||||
LibGladeLib = "libglade-2.0.so"
|
||||
type
|
||||
PLongint* = ptr int32
|
||||
PSmallInt* = ptr int16
|
||||
PByte* = ptr int8
|
||||
PWord* = ptr int16
|
||||
PDWord* = ptr int32
|
||||
PDouble* = ptr float64
|
||||
|
||||
proc init*(){.cdecl, dynlib: LibGladeLib, importc: "glade_init".}
|
||||
proc require*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib,
|
||||
importc: "glade_require".}
|
||||
proc provide*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib,
|
||||
importc: "glade_provide".}
|
||||
type
|
||||
PXMLPrivate* = pointer
|
||||
PXML* = ptr TXML
|
||||
TXML* = object of TGObject
|
||||
filename*: cstring
|
||||
priv*: PXMLPrivate
|
||||
|
||||
PXMLClass* = ptr TXMLClass
|
||||
TXMLClass* = object of TGObjectClass
|
||||
TXMLConnectFunc* = proc (handler_name: cstring, anObject: PGObject,
|
||||
signal_name: cstring, signal_data: cstring,
|
||||
connect_object: PGObject, after: gboolean,
|
||||
user_data: gpointer){.cdecl.}
|
||||
|
||||
proc TYPE_XML*(): GType
|
||||
proc XML*(obj: pointer): PXML
|
||||
proc XML_CLASS*(klass: pointer): PXMLClass
|
||||
proc IS_XML*(obj: pointer): gboolean
|
||||
proc IS_XML_CLASS*(klass: pointer): gboolean
|
||||
proc XML_GET_CLASS*(obj: pointer): PXMLClass
|
||||
proc xml_get_type*(): GType{.cdecl, dynlib: LibGladeLib,
|
||||
importc: "glade_xml_get_type".}
|
||||
proc xml_new*(fname: cstring, root: cstring, domain: cstring): PXML{.cdecl,
|
||||
dynlib: LibGladeLib, importc: "glade_xml_new".}
|
||||
proc xml_new_from_buffer*(buffer: cstring, size: int32, root: cstring,
|
||||
domain: cstring): PXML{.cdecl, dynlib: LibGladeLib,
|
||||
importc: "glade_xml_new_from_buffer".}
|
||||
proc construct*(self: PXML, fname: cstring, root: cstring, domain: cstring): gboolean{.
|
||||
cdecl, dynlib: LibGladeLib, importc: "glade_xml_construct".}
|
||||
proc signal_connect*(self: PXML, handlername: cstring, func: TGCallback){.
|
||||
cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect".}
|
||||
proc signal_connect_data*(self: PXML, handlername: cstring,
|
||||
func: TGCallback, user_data: gpointer){.cdecl,
|
||||
dynlib: LibGladeLib, importc: "glade_xml_signal_connect_data".}
|
||||
proc signal_autoconnect*(self: PXML){.cdecl, dynlib: LibGladeLib,
|
||||
importc: "glade_xml_signal_autoconnect".}
|
||||
proc signal_connect_full*(self: PXML, handler_name: cstring,
|
||||
func: TXMLConnectFunc, user_data: gpointer){.
|
||||
cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect_full".}
|
||||
proc signal_autoconnect_full*(self: PXML, func: TXMLConnectFunc,
|
||||
user_data: gpointer){.cdecl,
|
||||
dynlib: LibGladeLib, importc: "glade_xml_signal_autoconnect_full".}
|
||||
proc get_widget*(self: PXML, name: cstring): gtk2.PWidget{.cdecl,
|
||||
dynlib: LibGladeLib, importc: "glade_xml_get_widget".}
|
||||
proc get_widget_prefix*(self: PXML, name: cstring): PGList{.cdecl,
|
||||
dynlib: LibGladeLib, importc: "glade_xml_get_widget_prefix".}
|
||||
proc relative_file*(self: PXML, filename: cstring): cstring{.cdecl,
|
||||
dynlib: LibGladeLib, importc: "glade_xml_relative_file".}
|
||||
proc get_widget_name*(widget: gtk2.PWidget): cstring{.cdecl, dynlib: LibGladeLib,
|
||||
importc: "glade_get_widget_name".}
|
||||
proc get_widget_tree*(widget: gtk2.PWidget): PXML{.cdecl, dynlib: LibGladeLib,
|
||||
importc: "glade_get_widget_tree".}
|
||||
type
|
||||
PXMLCustomWidgetHandler* = ptr TXMLCustomWidgetHandler
|
||||
TXMLCustomWidgetHandler* = gtk2.TWidget
|
||||
|
||||
proc set_custom_handler*(handler: TXMLCustomWidgetHandler, user_data: gpointer){.
|
||||
cdecl, dynlib: LibGladeLib, importc: "glade_set_custom_handler".}
|
||||
proc gnome_init*() =
|
||||
init()
|
||||
|
||||
proc bonobo_init*() =
|
||||
init()
|
||||
|
||||
proc xml_new*(fname: cstring, root: cstring, domain: cstring): PXML =
|
||||
result = xml_new(fname, root, domain)
|
||||
|
||||
proc xml_new_from_memory*(buffer: cstring, size: int32, root: cstring,
|
||||
domain: cstring): PXML =
|
||||
result = xml_new_from_buffer(buffer, size, root, domain)
|
||||
|
||||
proc TYPE_XML*(): GType =
|
||||
result = xml_get_type()
|
||||
|
||||
proc XML*(obj: pointer): PXML =
|
||||
result = cast[PXML](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_XML()))
|
||||
|
||||
proc XML_CLASS*(klass: pointer): PXMLClass =
|
||||
result = cast[PXMLClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_XML()))
|
||||
|
||||
proc IS_XML*(obj: pointer): gboolean =
|
||||
result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_XML())
|
||||
|
||||
proc IS_XML_CLASS*(klass: pointer): gboolean =
|
||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_XML())
|
||||
|
||||
proc XML_GET_CLASS*(obj: pointer): PXMLClass =
|
||||
result = cast[PXMLClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_XML()))
|
||||
1157
lib/wrappers/gtk/pango.nim
Executable file
1157
lib/wrappers/gtk/pango.nim
Executable file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue