From 2231b514e3646c6762818926b45b836e4263c0ea Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 28 Jan 2014 17:39:18 +0100 Subject: initial import --- chrome/content/glib.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 chrome/content/glib.js (limited to 'chrome/content/glib.js') diff --git a/chrome/content/glib.js b/chrome/content/glib.js new file mode 100644 index 0000000..fed4caf --- /dev/null +++ b/chrome/content/glib.js @@ -0,0 +1,35 @@ +var EXPORTED_SYMBOLS = [ "glib" ]; + +const LIBNAME = "glib-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"); + +function defines(lib) { + this.gpointer = ctypes.voidptr_t; + this.gulong = ctypes.unsigned_long; + this.guint = ctypes.unsigned_int; + this.guint8 = ctypes.uint8_t; + this.guint16 = ctypes.uint16_t; + this.guint32 = ctypes.uint32_t; + this.gint = ctypes.int; + this.gint8 = ctypes.int8_t; + this.gint16 = ctypes.int16_t; + this.gint32 = ctypes.int32_t; + this.gchar = ctypes.char; + this.guchar = ctypes.unsigned_char; + this.gboolean = this.gint; + this.gfloat = ctypes.float; + this.gdouble = ctypes.double; + this.gsize = ctypes.unsigned_long; + this.GCallback = ctypes.voidptr_t; + this.GClosureNotify = this.gpointer; + this.GFunc = ctypes.void_t.ptr; +}; + +new ctypes_library(LIBNAME, ABIS, defines, this); -- cgit v1.2.3