From 3ce8980bd4db7fcf9fe58adc50c38345a29479cc Mon Sep 17 00:00:00 2001 From: Artur Skawina Date: Thu, 2 Feb 2012 00:20:52 +0100 Subject: [PATCH] Improve Cogl module fixups. --- girtod.d | 12 ++++++++++-- mixin/Cogl__MODULE_HEAD.d | 9 ++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/girtod.d b/girtod.d index 18d939b..ff5f443 100644 --- a/girtod.d +++ b/girtod.d @@ -143,12 +143,14 @@ string Dtype(scope string gt, scope string ct, bool signals=false) { } // Ditto for pointers; note - only the ctype has the right type // (number of '*'). Keep in mind arrays of pointers exist. - if (ct.length>=1 && ct[$-1]=='*' && gt[$-1]!='*') { + if (ct.length>=1 && ct[$-1]=='*') { size_t alen; auto apos = std.string.indexOf(ct, '*'); if (apos>=0) alen = ct.length - apos; string suf = ct[$-alen..$]; + if (gt==ct) + gt = gt[0..$-alen]; return Dtype(gt, ct[0..$-alen]) ~ suf; } @@ -204,6 +206,7 @@ version (None) { if (gt=="gulong" && ct=="gulong") return "c_ulong"; if (gt=="gulong" && ct=="unsigned long") return "c_ulong"; + if ( ct=="size_t") return "size_t"; if (gt=="gsize" && ct=="gsize") return "size_t"; if (gt=="gssize" && ct=="gssize") return "ssize_t"; if (gt=="gint64" && ct=="goffset") return "long"; // signed 64bit int, C99: off64_t @@ -290,6 +293,11 @@ version (None) { if (gt=="cairo.Content" && ct=="cairo_content_t") return "cairo.Content"; // in gdk if (gt=="cairo.Pattern" && ct=="cairo_pattern_t") return "cairo.Pattern"; // in gdk + // Cogl: + if (ct=="CoglDisplay") return "Cogl.Display"; + if (ct=="CoglContext") return "Cogl.Context"; + if (ct=="CoglRenderer") return "Cogl.Renderer"; + // Clutter: if (gt=="cairo.RectangleInt" && ct=="cairo_rectangle_int_t") return "cairo.RectangleInt"; @@ -347,7 +355,7 @@ version (None) { } // ATK needs this one, as the datatype is missing both name and definition; this lets it build. - if (gt=="AtkPropertyValues*" && ct=="AtkPropertyValues*") return "_PropertyValues*"; + if (gt=="AtkPropertyValues" && ct=="AtkPropertyValues") return "_PropertyValues"; // GDK: if (gt=="GdkPixbuf2.PixbufAlphaMode" && ct=="GdkPixbuf2AlphaMode") return "GdkPixbuf2.PixbufAlphaMode"; diff --git a/mixin/Cogl__MODULE_HEAD.d b/mixin/Cogl__MODULE_HEAD.d index af92def..a16f258 100644 --- a/mixin/Cogl__MODULE_HEAD.d +++ b/mixin/Cogl__MODULE_HEAD.d @@ -1,12 +1,7 @@ -// Private typedefs that let this module compile. -// Better than removing the mostly unintrospectable functions. - -private alias void CoglContext; -private alias void CoglRenderer; +// Cogl-1.0.gir as of 1.9.4 is missing some things; +// let's add just enough to make it usable: // Really X11, but this will do for now. -private alias void Display; private alias void XVisualInfo; private alias void XEvent; - -- 2.11.4.GIT