[Pkg-mozext-commits] [firetray] 65/399: drop gdk_visual_get_depth() only available since GTK 2.22

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:23:15 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch dfsg-clean
in repository firetray.

commit 077528763b9971fa4146c4c580c0c71e1978b5da
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Mon Oct 3 11:03:57 2011 +0200

    drop gdk_visual_get_depth() only available since GTK 2.22
    
    As of 2011-09, Debian Squeeze shipped with GTK 2.20
---
 src/install.rdf                   |    2 +-
 src/modules/FiretrayIconLinux.jsm |    2 +-
 src/modules/gdk.jsm               |    3 +--
 src/modules/gobject.jsm           |   18 +++++++++++++++++-
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/install.rdf b/src/install.rdf
index 7f432a8..7cc8a13 100644
--- a/src/install.rdf
+++ b/src/install.rdf
@@ -5,7 +5,7 @@
     <em:unpack>true</em:unpack> <!-- needed for embedded icons -->
     <em:type>2</em:type>
     <em:name>FireTray</em:name>
-    <em:version>0.4.0a2</em:version>
+    <em:version>0.4.0a3</em:version>
     <em:creator>Hua Luo, Francesco Solero, Foudil BRÉTEL</em:creator>
     <em:contributor>Hua Luo, Francesco Solero (Firetray original authors)</em:contributor>
     <em:homepageURL>https://github.com/foudfou/firetray</em:homepageURL>
diff --git a/src/modules/FiretrayIconLinux.jsm b/src/modules/FiretrayIconLinux.jsm
index f0ef805..f1670f2 100644
--- a/src/modules/FiretrayIconLinux.jsm
+++ b/src/modules/FiretrayIconLinux.jsm
@@ -201,7 +201,7 @@ firetray.IconLinux = {
       // prepare colors/alpha
       let colorMap = gdk.gdk_screen_get_system_colormap(gdk.gdk_screen_get_default());
       let visual = gdk.gdk_colormap_get_visual(colorMap);
-      let visualDepth = gdk.gdk_visual_get_depth(visual);
+      let visualDepth = visual.contents.depth;
       LOG("colorMap="+colorMap+" visual="+visual+" visualDepth="+visualDepth);
       let fore = new gdk.GdkColor;
       fore.pixel = fore.red = fore.green = fore.blue = 0;
diff --git a/src/modules/gdk.jsm b/src/modules/gdk.jsm
index 35f3535..31583f3 100644
--- a/src/modules/gdk.jsm
+++ b/src/modules/gdk.jsm
@@ -59,7 +59,7 @@ function gdk_defines(lib) {
   this.GdkByteOrder = ctypes.int; // enum
   this.GdkVisualType = ctypes.int; // enum
   this.GdkVisual = ctypes.StructType("GdkVisual", [
-    { "parent_instance": ctypes.void_t.ptr }, // gobject.GObject }, // FIXME !!
+    { "parent_instance": gobject.GObject },
     { "type": this.GdkVisualType },
     { "depth": gobject.gint },
     { "byte": this.GdkByteOrder },
@@ -126,7 +126,6 @@ function gdk_defines(lib) {
   lib.lazy_bind("gdk_pixbuf_composite", ctypes.void_t, this.GdkPixbuf.ptr, this.GdkPixbuf.ptr, ctypes.int, ctypes.int, ctypes.int, ctypes.int, ctypes.double, ctypes.double, ctypes.double, ctypes.double, ctypes.int, ctypes.int);
   lib.lazy_bind("gdk_screen_get_system_colormap", this.GdkColormap.ptr, this.GdkScreen.ptr);
   lib.lazy_bind("gdk_colormap_get_visual", this.GdkVisual.ptr, this.GdkColormap.ptr);
-  lib.lazy_bind("gdk_visual_get_depth", gobject.gint, this.GdkVisual.ptr);
   lib.lazy_bind("gdk_color_parse", gobject.gboolean, gobject.gchar.ptr, this.GdkColor.ptr);
   lib.lazy_bind("gdk_colormap_alloc_color", gobject.gboolean, this.GdkColormap.ptr, this.GdkColor.ptr, gobject.gboolean, gobject.gboolean);
   lib.lazy_bind("gdk_pixmap_new", this.GdkPixmap.ptr, this.GdkDrawable.ptr, gobject.gint, gobject.gint, gobject.gint);
diff --git a/src/modules/gobject.jsm b/src/modules/gobject.jsm
index 6eb25a4..53fe463 100644
--- a/src/modules/gobject.jsm
+++ b/src/modules/gobject.jsm
@@ -50,7 +50,7 @@ Cu.import("resource://gre/modules/ctypes.jsm");
 Cu.import("resource://firetray/ctypes-utils.jsm");
 
 function gobject_defines(lib) {
-  this.GObject = ctypes.StructType("GObject");
+
   this.gpointer = ctypes.voidptr_t;
   this.gulong = ctypes.unsigned_long;
   this.guint = ctypes.unsigned_int;
@@ -61,12 +61,28 @@ function gobject_defines(lib) {
   this.guchar = ctypes.unsigned_char;
   this.gboolean = this.gint;
   this.gfloat = ctypes.float;
+  this.gsize = ctypes.unsigned_long;
   this.GCallback = ctypes.voidptr_t;
   this.GClosureNotify = this.gpointer;
   this.GConnectFlags = this.guint;
   this.GFunc = ctypes.void_t.ptr;
   this.GList = ctypes.StructType("GList");
 
+  this.GType = this.gsize;
+  this.GData = ctypes.StructType("GData");
+  this._GTypeClass = ctypes.StructType("_GTypeClass", [
+    {g_type: this.GType}]);
+  this._GTypeInstance = ctypes.StructType("_GTypeInstance", [
+    {g_class: this._GTypeClass.ptr}]);
+  /* "All the fields in the GObject structure are private to the GObject
+   * implementation and should never be accessed directly." but we need to tell
+   * something about it to access GdkVisual fields */
+  this.GObject = ctypes.StructType("GObject", [
+    { g_type_instance: this._GTypeInstance },
+    { ref_count: this.guint },
+    { qdata: this.GData.ptr },
+  ]);
+
   /* NOTE: if we needed more/different args, we'd need to implement another
      FunctionType */
   this.GCallback_t = ctypes.FunctionType(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git



More information about the Pkg-mozext-commits mailing list