summaryrefslogtreecommitdiff
path: root/chrome/content/gdk-pixbuf.js
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-01-28 17:39:18 +0100
committerJavier <dev.git@javispedro.com>2014-01-28 17:39:18 +0100
commit2231b514e3646c6762818926b45b836e4263c0ea (patch)
treecef1607e512e9b71961ae64e6c8d29d00fd72ed7 /chrome/content/gdk-pixbuf.js
downloadtopmenu-mozilla-2231b514e3646c6762818926b45b836e4263c0ea.tar.gz
topmenu-mozilla-2231b514e3646c6762818926b45b836e4263c0ea.zip
initial import
Diffstat (limited to 'chrome/content/gdk-pixbuf.js')
-rw-r--r--chrome/content/gdk-pixbuf.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/chrome/content/gdk-pixbuf.js b/chrome/content/gdk-pixbuf.js
new file mode 100644
index 0000000..3e58a4c
--- /dev/null
+++ b/chrome/content/gdk-pixbuf.js
@@ -0,0 +1,28 @@
+var EXPORTED_SYMBOLS = [ "gdk_pixbuf" ];
+
+const LIBNAME = "gdk_pixbuf_xlib-2.0";
+const ABIS = [ 0 ];
+
+const Cu = Components.utils;
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+
+Cu.import("resource://gre/modules/ctypes.jsm");
+Cu.import("chrome://topmenu/content/ctypes-utils.js");
+Cu.import("chrome://topmenu/content/glib.js");
+Cu.import("chrome://topmenu/content/gobject.js");
+
+function defines(lib) {
+ this.GdkPixbuf = gobject.GObject;
+ this.GdkPixbufDestroyNotify = ctypes.FunctionType(ctypes.default_abi,
+ ctypes.void_t,
+ [glib.guchar.ptr, glib.gpointer]);
+ this.GdkColorspace = glib.guint;
+ this.GDK_COLORSPACE_RGB = 0;
+
+ lib.lazy_bind("gdk_pixbuf_new", this.GdkPixbuf.ptr, this.GdkColorspace, glib.gboolean, glib.gint, glib.gint, glib.gint);
+ lib.lazy_bind("gdk_pixbuf_new_from_data", this.GdkPixbuf.ptr, glib.guchar.ptr, this.GdkColorspace, glib.gboolean, glib.gint, glib.gint, glib.gint, glib.gint, this.GdkPixbufDestroyNotify.ptr, glib.gpointer);
+ lib.lazy_bind("gdk_pixbuf_copy", this.GdkPixbuf.ptr, this.GdkPixbuf.ptr);
+}
+
+new ctypes_library(LIBNAME, ABIS, defines, this);