Commit 97e3d9b2 authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Upstream version 0.8.4

parent 5f0b60e2
Pipeline #1744 failed with stages
gintro (0.8.4+parrot0) rolling-testing; urgency=medium
* Upstream new release
-- Nong Hoang Tu <dmknght@parrotsec.org> Tue, 05 Jan 2021 02:33:32 +0700
gintro (0.8.0+parrot2) rolling-testing; urgency=medium
* Rebuild package
......
# Package
version = "0.7.9"
version = "0.8.4"
author = "Stefan Salewski"
description = "High level GObject-Introspection based GTK3/GTK4 bindings"
license = "MIT"
......@@ -36,6 +36,7 @@ proc prep =
cpFile(this / "tests" / "gen.nim", td / wd / "gen.nim")
cpFile(this / "tests" / "combinatorics.nim", td / wd / "combinatorics.nim")
cpFile(this / "tests" / "maxby.nim", td / wd / "maxby.nim")
cd(td)
cd(wd)
......
This diff is collapsed.
......@@ -7,8 +7,6 @@
const Lib = "libcairo-gobject.so.2"
{.pragma: libprag, cdecl, dynlib: Lib.}
from gobject import boxedFree
from glib import GType
......@@ -31,6 +29,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_context_get_type(), cast[ptr Context00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var Context) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoContext)
type
Device00* {.pure.} = object
Device* = ref object
......@@ -50,6 +54,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_device_get_type(), cast[ptr Device00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var Device) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoDevice)
type
Surface00* {.pure.} = object
Surface* = ref object
......@@ -69,6 +79,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_surface_get_type(), cast[ptr Surface00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var Surface) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoSurface)
type
Matrix00* {.pure.} = object
Matrix* = ref object
......@@ -94,6 +110,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_pattern_get_type(), cast[ptr Pattern00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var Pattern) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoPattern)
type
Region00* {.pure.} = object
Region* = ref object
......@@ -113,6 +135,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_region_get_type(), cast[ptr Region00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var Region) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoRegion)
type
Status* {.size: sizeof(cint), pure.} = enum
success = 0
......@@ -276,6 +304,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_font_options_get_type(), cast[ptr FontOptions00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var FontOptions) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoFontOptions)
type
FontType* {.size: sizeof(cint), pure.} = enum
toy = 0
......@@ -391,6 +425,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_font_face_get_type(), cast[ptr FontFace00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var FontFace) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoFontFace)
type
ScaledFont00* {.pure.} = object
ScaledFont* = ref object
......@@ -410,6 +450,12 @@ when defined(gcDestructors):
boxedFree(cairo_gobject_scaled_font_get_type(), cast[ptr ScaledFont00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var ScaledFont) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeCairoScaledFont)
type
Path00* {.pure.} = object
Path* = ref object
......
import gobject
import macros, strutils
include gisup3
include gimplgobj
......@@ -7,8 +7,6 @@
const Lib = ""
{.pragma: libprag, cdecl, dynlib: Lib.}
type
Pattern00* {.pure.} = object
Pattern* = ref object
......
......@@ -7,8 +7,6 @@
const Lib = ""
{.pragma: libprag, cdecl, dynlib: Lib.}
type
Bitmap00* {.pure.} = object
Bitmap* = ref object
......
This diff is collapsed.
......@@ -13,10 +13,6 @@ import gobject, gio, glib, gmodule
const Lib = "libgdk_pixbuf-2.0.so.0"
{.pragma: libprag, cdecl, dynlib: Lib.}
type
uint8Array* = pointer
proc finalizeGObject*[T](o: ref T) =
if not o.ignoreFinalizer:
gobject.g_object_remove_toggle_ref(o.impl, gobject.toggleNotify, addr(o[]))
......@@ -36,11 +32,11 @@ const PIXBUF_FEATURES_H* = 1'i32
const PIXBUF_MAJOR* = 2'i32
const PIXBUF_MICRO* = 0'i32
const PIXBUF_MICRO* = 2'i32
const PIXBUF_MINOR* = 40'i32
const PIXBUF_MINOR* = 42'i32
const PIXBUF_VERSION* = "2.40.0"
const PIXBUF_VERSION* = "2.42.2"
type
Pixbuf* = ref object of gobject.Object
......@@ -402,14 +398,14 @@ proc initPixbufFromFileAtSize*[T](result: var T; filename: cstring; width: int;
assert(g_object_get_qdata(result.impl, Quark) == nil)
g_object_set_qdata(result.impl, Quark, addr(result[]))
proc gdk_pixbuf_new_from_inline(dataLength: int32; data: uint8Array; copyPixels: gboolean;
proc gdk_pixbuf_new_from_inline(dataLength: int32; data: ptr uint8; copyPixels: gboolean;
error: ptr ptr glib.Error = nil): ptr Pixbuf00 {.
importc, libprag.}
proc newPixbufFromInline*(data: seq[uint8] | string; copyPixels: bool): Pixbuf {.deprecated.} =
let dataLength = int(data.len)
var gerror: ptr glib.Error
let gobj = gdk_pixbuf_new_from_inline(int32(dataLength), unsafeaddr(data[0]), gboolean(copyPixels), addr gerror)
let gobj = gdk_pixbuf_new_from_inline(int32(dataLength), cast[ptr uint8](unsafeaddr(data[0])), gboolean(copyPixels), addr gerror)
if gerror != nil:
let msg = $gerror.message
g_error_free(gerror[])
......@@ -433,7 +429,7 @@ proc newPixbufFromInline*(tdesc: typedesc; data: seq[uint8] | string; copyPixels
let dataLength = int(data.len)
var gerror: ptr glib.Error
assert(result is Pixbuf)
let gobj = gdk_pixbuf_new_from_inline(int32(dataLength), unsafeaddr(data[0]), gboolean(copyPixels), addr gerror)
let gobj = gdk_pixbuf_new_from_inline(int32(dataLength), cast[ptr uint8](unsafeaddr(data[0])), gboolean(copyPixels), addr gerror)
if gerror != nil:
let msg = $gerror.message
g_error_free(gerror[])
......@@ -457,7 +453,7 @@ proc initPixbufFromInline*[T](result: var T; data: seq[uint8] | string; copyPixe
let dataLength = int(data.len)
var gerror: ptr glib.Error
assert(result is Pixbuf)
let gobj = gdk_pixbuf_new_from_inline(int32(dataLength), unsafeaddr(data[0]), gboolean(copyPixels), addr gerror)
let gobj = gdk_pixbuf_new_from_inline(int32(dataLength), cast[ptr uint8](unsafeaddr(data[0])), gboolean(copyPixels), addr gerror)
if gerror != nil:
let msg = $gerror.message
g_error_free(gerror[])
......@@ -843,7 +839,7 @@ proc initPixbufFromStreamFinish*[T](result: var T; asyncResult: gio.AsyncResult)
assert(g_object_get_qdata(result.impl, Quark) == nil)
g_object_set_qdata(result.impl, Quark, addr(result[]))
proc gdk_pixbuf_new_from_xpm_data(data: cstringArray): ptr Pixbuf00 {.
proc gdk_pixbuf_new_from_xpm_data(data: ptr cstring): ptr Pixbuf00 {.
importc, libprag.}
proc newPixbufFromXpmData*(data: varargs[string, `$`]): Pixbuf =
......@@ -921,12 +917,6 @@ proc getFileInfoAsync*(filename: cstring; cancellable: gio.Cancellable = nil;
callback: AsyncReadyCallback; userData: pointer) =
gdk_pixbuf_get_file_info_async(filename, if cancellable.isNil: nil else: cast[ptr gio.Cancellable00](cancellable.impl), callback, userData)
proc getFormats*(): ptr pointer {.
importc: "gdk_pixbuf_get_formats", libprag.}
proc formats*(): ptr pointer {.
importc: "gdk_pixbuf_get_formats", libprag.}
proc gdk_pixbuf_init_modules(path: cstring; error: ptr ptr glib.Error = nil): gboolean {.
importc, libprag.}
......@@ -1184,9 +1174,6 @@ proc gdk_pixbuf_get_option(self: ptr Pixbuf00; key: cstring): cstring {.
proc getOption*(self: Pixbuf; key: cstring): string =
result = $gdk_pixbuf_get_option(cast[ptr Pixbuf00](self.impl), key)
proc option*(self: Pixbuf; key: cstring): string =
result = $gdk_pixbuf_get_option(cast[ptr Pixbuf00](self.impl), key)
proc gdk_pixbuf_get_options(self: ptr Pixbuf00): ptr HashTable00 {.
importc, libprag.}
......@@ -1196,18 +1183,14 @@ proc getOptions*(self: Pixbuf): ptr HashTable00 =
proc options*(self: Pixbuf): ptr HashTable00 =
gdk_pixbuf_get_options(cast[ptr Pixbuf00](self.impl))
proc gdk_pixbuf_get_pixels_with_length(self: ptr Pixbuf00; length: var uint32): uint8Array {.
proc gdk_pixbuf_get_pixels_with_length(self: ptr Pixbuf00; length: var uint32): ptr uint8 {.
importc, libprag.}
proc getPixels*(self: Pixbuf; length: var int): seq[uint8] =
var length_00 = uint32(length)
result = uint8ArrayZT2seq(gdk_pixbuf_get_pixels_with_length(cast[ptr Pixbuf00](self.impl), length_00))
length = int(length_00)
proc pixels*(self: Pixbuf; length: var int): seq[uint8] =
var length_00 = uint32(length)
result = uint8ArrayZT2seq(gdk_pixbuf_get_pixels_with_length(cast[ptr Pixbuf00](self.impl), length_00))
length = int(length_00)
var length_00: uint32
result = uint8ArrayToSeq(gdk_pixbuf_get_pixels_with_length(cast[ptr Pixbuf00](self.impl), length_00), length.int)
if length.addr != nil:
length = int(length_00)
proc gdk_pixbuf_get_rowstride(self: ptr Pixbuf00): int32 {.
importc, libprag.}
......@@ -1277,8 +1260,8 @@ proc saturateAndPixelate*(self: Pixbuf; dest: Pixbuf; saturation: cfloat;
gdk_pixbuf_saturate_and_pixelate(cast[ptr Pixbuf00](self.impl), cast[ptr Pixbuf00](dest.impl), saturation, gboolean(pixelate))
proc gdk_pixbuf_save_to_streamv(self: ptr Pixbuf00; stream: ptr gio.OutputStream00;
`type`: cstring; optionKeys: cstringArray; optionValues: cstringArray;
cancellable: ptr gio.Cancellable00; error: ptr ptr glib.Error = nil): gboolean {.
`type`: cstring; optionKeys: ptr cstring; optionValues: ptr cstring; cancellable: ptr gio.Cancellable00;
error: ptr ptr glib.Error = nil): gboolean {.
importc, libprag.}
proc saveToStreamv*(self: Pixbuf; stream: gio.OutputStream; `type`: cstring;
......@@ -1296,8 +1279,8 @@ proc saveToStreamv*(self: Pixbuf; stream: gio.OutputStream; `type`: cstring;
result = toBool(resul0)
proc gdk_pixbuf_save_to_streamv_async(self: ptr Pixbuf00; stream: ptr gio.OutputStream00;
`type`: cstring; optionKeys: cstringArray; optionValues: cstringArray;
cancellable: ptr gio.Cancellable00; callback: AsyncReadyCallback; userData: pointer) {.
`type`: cstring; optionKeys: ptr cstring; optionValues: ptr cstring; cancellable: ptr gio.Cancellable00;
callback: AsyncReadyCallback; userData: pointer) {.
importc, libprag.}
proc saveToStreamvAsync*(self: Pixbuf; stream: gio.OutputStream;
......@@ -1310,7 +1293,7 @@ proc saveToStreamvAsync*(self: Pixbuf; stream: gio.OutputStream;
gdk_pixbuf_save_to_streamv_async(cast[ptr Pixbuf00](self.impl), cast[ptr gio.OutputStream00](stream.impl), `type`, seq2CstringArray(optionKeys, fs469n23), seq2CstringArray(optionValues, fs469n232), if cancellable.isNil: nil else: cast[ptr gio.Cancellable00](cancellable.impl), callback, userData)
proc gdk_pixbuf_savev(self: ptr Pixbuf00; filename: cstring; `type`: cstring;
optionKeys: cstringArray; optionValues: cstringArray; error: ptr ptr glib.Error = nil): gboolean {.
optionKeys: ptr cstring; optionValues: ptr cstring; error: ptr ptr glib.Error = nil): gboolean {.
importc, libprag.}
proc savev*(self: Pixbuf; filename: cstring; `type`: cstring; optionKeys: openArray[string];
......@@ -1385,6 +1368,12 @@ when defined(gcDestructors):
boxedFree(gdk_pixbuf_format_get_type(), cast[ptr PixbufFormat00](self.impl))
self.impl = nil
proc newWithFinalizer*(x: var PixbufFormat) =
when defined(gcDestructors):
new(x)
else:
new(x, gBoxedFreeGdkPixbufFormat)
proc gdk_pixbuf_format_free(self: ptr PixbufFormat00) {.
importc, libprag.}
......@@ -1415,7 +1404,7 @@ proc description*(self: PixbufFormat): string =
result = $resul0
cogfree(resul0)
proc gdk_pixbuf_format_get_extensions(self: ptr PixbufFormat00): cstringArray {.
proc gdk_pixbuf_format_get_extensions(self: ptr PixbufFormat00): ptr cstring {.
importc, libprag.}
proc getExtensions*(self: PixbufFormat): seq[string] =
......@@ -1441,7 +1430,7 @@ proc license*(self: PixbufFormat): string =
result = $resul0
cogfree(resul0)
proc gdk_pixbuf_format_get_mime_types(self: ptr PixbufFormat00): cstringArray {.
proc gdk_pixbuf_format_get_mime_types(self: ptr PixbufFormat00): ptr cstring {.
importc, libprag.}
proc getMimeTypes*(self: PixbufFormat): seq[string] =
......@@ -1504,19 +1493,8 @@ proc `disabled=`*(self: PixbufFormat; disabled: bool) =
proc gdk_pixbuf_get_file_info(filename: cstring; width: var int32; height: var int32): ptr PixbufFormat00 {.
importc, libprag.}
proc getFileInfo*(filename: cstring; width: var int; height: var int): PixbufFormat =
var width_00 = int32(width)
var height_00 = int32(height)
let impl0 = gdk_pixbuf_get_file_info(filename, width_00, height_00)
if impl0.isNil:
return nil
fnew(result, gBoxedFreeGdkPixbufFormat)
result.impl = impl0
result.ignoreFinalizer = true
width = int(width_00)
height = int(height_00)
proc fileInfo*(filename: cstring; width: var int; height: var int): PixbufFormat =
proc getFileInfo*(filename: cstring; width: var int = cast[var int](nil);
height: var int = cast[var int](nil)): PixbufFormat =
var width_00 = int32(width)
var height_00 = int32(height)
let impl0 = gdk_pixbuf_get_file_info(filename, width_00, height_00)
......@@ -1548,21 +1526,8 @@ proc getFileInfoFinish*(asyncResult: gio.AsyncResult; width: var int;
width = int(width_00)
height = int(height_00)
proc fileInfoFinish*(asyncResult: gio.AsyncResult; width: var int;
height: var int): PixbufFormat =
var gerror: ptr glib.Error
var width_00 = int32(width)
var height_00 = int32(height)
let impl0 = gdk_pixbuf_get_file_info_finish(cast[ptr gio.AsyncResult00](asyncResult.impl), width_00, height_00, addr gerror)
if gerror != nil:
let msg = $gerror.message
g_error_free(gerror[])
raise newException(GException, msg)
fnew(result, gBoxedFreeGdkPixbufFormat)
result.impl = impl0
result.ignoreFinalizer = true
width = int(width_00)
height = int(height_00)
proc getPixbufFormats*(): ptr glib.SList {.
importc: "gdk_pixbuf_get_formats", libprag.}
type
PixbufRotation* {.size: sizeof(cint), pure.} = enum
......@@ -1984,7 +1949,7 @@ when defined(gcDestructors):
proc gdk_pixbuf_animation_iter_advance(self: ptr PixbufAnimationIter00; currentTime: glib.TimeVal): gboolean {.
importc, libprag.}
proc advance*(self: PixbufAnimationIter; currentTime: glib.TimeVal = cast[ptr glib.TimeVal](nil)[]): bool =
proc advance*(self: PixbufAnimationIter; currentTime: glib.TimeVal = cast[var glib.TimeVal](nil)): bool =
toBool(gdk_pixbuf_animation_iter_advance(cast[ptr PixbufAnimationIter00](self.impl), currentTime))
proc gdk_pixbuf_animation_iter_get_delay_time(self: ptr PixbufAnimationIter00): int32 {.
......@@ -2040,24 +2005,7 @@ proc onCurrentlyLoadingFrame*(self: PixbufAnimationIter): bool =
proc gdk_pixbuf_animation_get_iter(self: ptr PixbufAnimation00; startTime: glib.TimeVal): ptr PixbufAnimationIter00 {.
importc, libprag.}
proc getIter*(self: PixbufAnimation; startTime: glib.TimeVal = cast[ptr glib.TimeVal](nil)[]): PixbufAnimationIter =
let gobj = gdk_pixbuf_animation_get_iter(cast[ptr PixbufAnimation00](self.impl), startTime)
let qdata = g_object_get_qdata(gobj, Quark)
if qdata != nil:
result = cast[type(result)](qdata)
assert(result.impl == gobj)
else:
fnew(result, gdkpixbuf.finalizeGObject)
result.impl = gobj
GC_ref(result)
if g_object_is_floating(result.impl).int != 0:
discard g_object_ref_sink(result.impl)
g_object_add_toggle_ref(result.impl, toggleNotify, addr(result[]))
g_object_unref(result.impl)
assert(g_object_get_qdata(result.impl, Quark) == nil)
g_object_set_qdata(result.impl, Quark, addr(result[]))
proc iter*(self: PixbufAnimation; startTime: glib.TimeVal = cast[ptr glib.TimeVal](nil)[]): PixbufAnimationIter =
proc getIter*(self: PixbufAnimation; startTime: glib.TimeVal = cast[var glib.TimeVal](nil)): PixbufAnimationIter =
let gobj = gdk_pixbuf_animation_get_iter(cast[ptr PixbufAnimation00](self.impl), startTime)
let qdata = g_object_get_qdata(gobj, Quark)
if qdata != nil:
......@@ -2075,9 +2023,9 @@ proc iter*(self: PixbufAnimation; startTime: glib.TimeVal = cast[ptr glib.TimeVa
g_object_set_qdata(result.impl, Quark, addr(result[]))
type
PixbufDestroyNotify* = proc (pixels: uint8Array; data: pointer) {.cdecl.}
PixbufDestroyNotify* = proc (pixels: ptr uint8; data: pointer) {.cdecl.}
proc gdk_pixbuf_new_from_data(data: uint8Array; colorspace: Colorspace; hasAlpha: gboolean;
proc gdk_pixbuf_new_from_data(data: ptr uint8; colorspace: Colorspace; hasAlpha: gboolean;
bitsPerSample: int32; width: int32; height: int32; rowstride: int32; destroyFn: PixbufDestroyNotify;
destroyFnData: pointer): ptr Pixbuf00 {.
importc, libprag.}
......@@ -2085,7 +2033,7 @@ proc gdk_pixbuf_new_from_data(data: uint8Array; colorspace: Colorspace; hasAlpha
proc newPixbufFromData*(data: seq[uint8] | string; colorspace: Colorspace;
hasAlpha: bool; bitsPerSample: int; width: int; height: int; rowstride: int;
destroyFn: PixbufDestroyNotify; destroyFnData: pointer): Pixbuf =
let gobj = gdk_pixbuf_new_from_data(unsafeaddr(data[0]), colorspace, gboolean(hasAlpha), int32(bitsPerSample), int32(width), int32(height), int32(rowstride), destroyFn, destroyFnData)
let gobj = gdk_pixbuf_new_from_data(cast[ptr uint8](unsafeaddr(data[0])), colorspace, gboolean(hasAlpha), int32(bitsPerSample), int32(width), int32(height), int32(rowstride), destroyFn, destroyFnData)
let qdata = g_object_get_qdata(gobj, Quark)
if qdata != nil:
result = cast[type(result)](qdata)
......@@ -2105,7 +2053,7 @@ proc newPixbufFromData*(tdesc: typedesc; data: seq[uint8] | string; colorspace:
hasAlpha: bool; bitsPerSample: int; width: int; height: int; rowstride: int;
destroyFn: PixbufDestroyNotify; destroyFnData: pointer): tdesc =
assert(result is Pixbuf)
let gobj = gdk_pixbuf_new_from_data(unsafeaddr(data[0]), colorspace, gboolean(hasAlpha), int32(bitsPerSample), int32(width), int32(height), int32(rowstride), destroyFn, destroyFnData)
let gobj = gdk_pixbuf_new_from_data(cast[ptr uint8](unsafeaddr(data[0])), colorspace, gboolean(hasAlpha), int32(bitsPerSample), int32(width), int32(height), int32(rowstride), destroyFn, destroyFnData)
let qdata = g_object_get_qdata(gobj, Quark)
if qdata != nil:
result = cast[type(result)](qdata)
......@@ -2125,7 +2073,7 @@ proc initPixbufFromData*[T](result: var T; data: seq[uint8] | string; colorspace
hasAlpha: bool; bitsPerSample: int; width: int; height: int; rowstride: int;
destroyFn: PixbufDestroyNotify; destroyFnData: pointer) {.deprecated.} =
assert(result is Pixbuf)
let gobj = gdk_pixbuf_new_from_data(unsafeaddr(data[0]), colorspace, gboolean(hasAlpha), int32(bitsPerSample), int32(width), int32(height), int32(rowstride), destroyFn, destroyFnData)
let gobj = gdk_pixbuf_new_from_data(cast[ptr uint8](unsafeaddr(data[0])), colorspace, gboolean(hasAlpha), int32(bitsPerSample), int32(width), int32(height), int32(rowstride), destroyFn, destroyFnData)
let qdata = g_object_get_qdata(gobj, Quark)
if qdata != nil:
result = cast[type(result)](qdata)
......@@ -2483,14 +2431,14 @@ proc gdk_pixbuf_loader_set_size(self: ptr PixbufLoader00; width: int32; height:
proc setSize*(self: PixbufLoader; width: int; height: int) =
gdk_pixbuf_loader_set_size(cast[ptr PixbufLoader00](self.impl), int32(width), int32(height))
proc gdk_pixbuf_loader_write(self: ptr PixbufLoader00; buf: uint8Array; count: uint64;
proc gdk_pixbuf_loader_write(self: ptr PixbufLoader00; buf: ptr uint8; count: uint64;
error: ptr ptr glib.Error = nil): gboolean {.
importc, libprag.}
proc write*(self: PixbufLoader; buf: seq[uint8] | string): bool =
let count = uint64(buf.len)
var gerror: ptr glib.Error
let resul0 = gdk_pixbuf_loader_write(cast[ptr PixbufLoader00](self.impl), unsafeaddr(buf[0]), count, addr gerror)
let resul0 = gdk_pixbuf_loader_write(cast[ptr PixbufLoader00](self.impl), cast[ptr uint8](unsafeaddr(buf[0])), count, addr gerror)
if gerror != nil:
let msg = $gerror.message
g_error_free(gerror[])
......@@ -2511,10 +2459,10 @@ proc writeBytes*(self: PixbufLoader; buffer: glib.Bytes): bool =
result = toBool(resul0)
type
PixbufSaveFunc* = proc (buf: uint8Array; count: uint64; error: var ptr glib.Error; data: pointer): gboolean {.cdecl.}
PixbufSaveFunc* = proc (buf: ptr uint8; count: uint64; error: var ptr glib.Error; data: pointer): gboolean {.cdecl.}
proc gdk_pixbuf_save_to_callbackv(self: ptr Pixbuf00; saveFunc: PixbufSaveFunc;
userData: pointer; `type`: cstring; optionKeys: cstringArray; optionValues: cstringArray;
userData: pointer; `type`: cstring; optionKeys: ptr cstring; optionValues: ptr cstring;
error: ptr ptr glib.Error = nil): gboolean {.
importc, libprag.}
......
......@@ -2,12 +2,13 @@
# xlib-2.0
# GLib-2.0
# GdkPixbuf-2.0
# Gdk-3.0
# HarfBuzz-0.0
# GModule-2.0
# cairo-1.0
# GObject-2.0
# Pango-1.0
# Gio-2.0
# Gdk-3.0
# immediate dependencies:
# xlib-2.0
# Pango-1.0
......@@ -17,14 +18,10 @@
# libraries:
# libgdk-3.so.0
{.warning[UnusedImport]: off.}
import xlib, glib, gdkpixbuf, gdk, gmodule, cairo, gobject, pango, gio
import xlib, glib, gdkpixbuf, harfbuzz, gmodule, cairo, gobject, pango, gio, gdk
const Lib = "libgdk-3.so.0"
{.pragma: libprag, cdecl, dynlib: Lib.}
type
uint8Array* = pointer
proc finalizeGObject*[T](o: ref T) =
if not o.ignoreFinalizer:
gobject.g_object_remove_toggle_ref(o.impl, gobject.toggleNotify, addr(o[]))
......@@ -162,19 +159,13 @@ proc gdk_x11_display_get_glx_version(display: ptr gdk.Display00; major: var int3
proc getGlxVersion*(display: gdk.Display; major: var int;
minor: var int): bool =
var major_00 = int32(major)
var minor_00 = int32(minor)
var major_00: int32
var minor_00: int32
result = toBool(gdk_x11_display_get_glx_version(cast[ptr gdk.Display00](display.impl), major_00, minor_00))
major = int(major_00)
minor = int(minor_00)
proc glxVersion*(display: gdk.Display; major: var int;
minor: var int): bool =
var major_00 = int32(major)
var minor_00 = int32(minor)
result = toBool(gdk_x11_display_get_glx_version(cast[ptr gdk.Display00](display.impl), major_00, minor_00))
major = int(major_00)
minor = int(minor_00)
if major.addr != nil:
major = int(major_00)
if minor.addr != nil:
minor = int(minor_00)
proc gdk_x11_display_error_trap_pop(self: ptr X11Display00): int32 {.
importc, libprag.}
......@@ -259,30 +250,31 @@ proc `windowScale=`*(self: X11Display; scale: int) =
gdk_x11_display_set_window_scale(cast[ptr X11Display00](self.impl), int32(scale))
proc gdk_x11_display_string_to_compound_text(self: ptr X11Display00; str: cstring;
encoding: var ptr gdk.Atom00; format: var int32; ctext: var uint8Array;
length: var int32): int32 {.
encoding: var gdk.Atom; format: var int32; ctext: var ptr uint8; length: var int32): int32 {.
importc, libprag.}
proc stringToCompoundText*(self: X11Display; str: cstring;
encoding: var ptr gdk.Atom00; format: var int; ctext: var (seq[uint8] | string);
encoding: var gdk.Atom; format: var int; ctext: var (seq[uint8] | string);
length: var int): int =
var length_00 = int32(length)
var format_00 = int32(format)
var ctext_00: pointer
var length_00: int32
var format_00: int32
var ctext_00: ptr uint8
result = int(gdk_x11_display_string_to_compound_text(cast[ptr X11Display00](self.impl), str, encoding, format_00, ctext_00, length_00))
length = int(length_00)
format = int(format_00)
if length.addr != nil:
length = int(length_00)
if format.addr != nil:
format = int(format_00)
ctext.setLen(length)
copyMem(unsafeaddr ctext[0], ctext_00, length.int * sizeof(ctext[0]))
cogfree(ctext_00)
proc gdk_x11_display_text_property_to_text_list(self: ptr X11Display00; encoding: ptr gdk.Atom00;
proc gdk_x11_display_text_property_to_text_list(self: ptr X11Display00; encoding: gdk.Atom;
format: int32; text: ptr uint8; length: int32; list: cstring): int32 {.
importc, libprag.}
proc textPropertyToTextList*(self: X11Display; encoding: gdk.Atom;
format: int; text: ptr uint8; length: int; list: cstring): int =
int(gdk_x11_display_text_property_to_text_list(cast[ptr X11Display00](self.impl), cast[ptr gdk.Atom00](encoding.impl), int32(format), text, int32(length), list))
int(gdk_x11_display_text_property_to_text_list(cast[ptr X11Display00](self.impl), encoding, int32(format), text, int32(length), list))
proc gdk_x11_display_ungrab(self: ptr X11Display00) {.
importc, libprag.}
......@@ -291,19 +283,20 @@ proc ungrab*(self: X11Display) =
gdk_x11_display_ungrab(cast[ptr X11Display00](self.impl))
proc gdk_x11_display_utf8_to_compound_text(self: ptr X11Display00; str: cstring;
encoding: var ptr gdk.Atom00; format: var int32; ctext: var uint8Array;