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/topmenu-client.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 chrome/content/topmenu-client.js (limited to 'chrome/content/topmenu-client.js') diff --git a/chrome/content/topmenu-client.js b/chrome/content/topmenu-client.js new file mode 100644 index 0000000..a5d7ab2 --- /dev/null +++ b/chrome/content/topmenu-client.js @@ -0,0 +1,27 @@ +var EXPORTED_SYMBOLS = [ "topmenu_client" ]; + +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"); +Cu.import("chrome://topmenu/content/gdk.js"); +Cu.import("chrome://topmenu/content/gtk.js"); + +function defines(lib) { + lib.lazy_bind("topmenu_client_connect_window_widget", ctypes.void_t, gdk.GdkWindow.ptr, gtk.GtkWidget.ptr); + lib.lazy_bind("topmenu_client_disconnect_window", ctypes.void_t, gdk.GdkWindow.ptr); + + this.TopMenuAppMenuBar = gobject.GObject; + lib.lazy_bind("topmenu_app_menu_bar_new", this.TopMenuAppMenuBar.ptr); + lib.lazy_bind("topmenu_app_menu_bar_set_app_menu", ctypes.void_t, this.TopMenuAppMenuBar.ptr, gtk.GtkWidget.ptr); + + this.TopMenuMonitor = gobject.GObject; + lib.lazy_bind("topmenu_monitor_get_instance", this.TopMenuMonitor.ptr); + lib.lazy_bind("topmenu_monitor_is_topmenu_available", glib.gboolean, this.TopMenuMonitor.ptr); +} + +new ctypes_library("topmenu-client", [ 0 ], defines, this); -- cgit v1.2.3