1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-11-15 13:25:04 -05:00

Merge branch 'gtk-version'

This commit is contained in:
foudfou 2012-10-19 22:11:46 +02:00
commit 630b36b05e
4 changed files with 16 additions and 1 deletions

View File

@ -89,6 +89,7 @@ firetray.Handler = {
VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.correctMailServerTypes); VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.correctMailServerTypes);
VersionChange.applyHooksAndWatchUninstall(); VersionChange.applyHooksAndWatchUninstall();
firetray.Window.init();
firetray.StatusIcon.init(); firetray.StatusIcon.init();
firetray.Handler.showHideIcon(); firetray.Handler.showHideIcon();
log.debug('StatusIcon initialized'); log.debug('StatusIcon initialized');

View File

@ -302,6 +302,7 @@ function gdk_defines(lib) {
lib.lazy_bind("gdk_window_get_user_data", ctypes.void_t, this.GdkWindow.ptr, gobject.gpointer.ptr); lib.lazy_bind("gdk_window_get_user_data", ctypes.void_t, this.GdkWindow.ptr, gobject.gpointer.ptr);
lib.lazy_bind("gdk_atom_intern", this.GdkAtom, gobject.gchar.ptr, gobject.gboolean); lib.lazy_bind("gdk_atom_intern", this.GdkAtom, gobject.gchar.ptr, gobject.gboolean);
lib.lazy_bind("gdk_property_change", ctypes.void_t, this.GdkWindow.ptr, this.GdkAtom, this.GdkAtom, gobject.gint, this.GdkPropMode, gobject.guchar.ptr, gobject.gint); lib.lazy_bind("gdk_property_change", ctypes.void_t, this.GdkWindow.ptr, this.GdkAtom, this.GdkAtom, gobject.gint, this.GdkPropMode, gobject.guchar.ptr, gobject.gint);
lib.lazy_bind("gdk_window_get_toplevel", this.GdkWindow.ptr, this.GdkWindow.ptr);
lib.lazy_bind("gdk_window_get_effective_toplevel", this.GdkWindow.ptr, this.GdkWindow.ptr); lib.lazy_bind("gdk_window_get_effective_toplevel", this.GdkWindow.ptr, this.GdkWindow.ptr);
lib.lazy_bind("gdk_display_get_n_screens", gobject.gint, this.GdkDisplay.ptr); lib.lazy_bind("gdk_display_get_n_screens", gobject.gint, this.GdkDisplay.ptr);

View File

@ -17,6 +17,10 @@ Cu.import("resource://firetray/ctypes/linux/gobject.jsm");
Cu.import("resource://firetray/ctypes/linux/pango.jsm"); Cu.import("resource://firetray/ctypes/linux/pango.jsm");
function gtk_defines(lib) { function gtk_defines(lib) {
this.FIRETRAY_REQUIRED_GTK_MAJOR_VERSION = 2;
this.FIRETRAY_REQUIRED_GTK_MINOR_VERSION = 20;
this.FIRETRAY_REQUIRED_GTK_MICRO_VERSION = 0;
this.GTK_ICON_SIZE_MENU = 1; // enum GtkIconSize this.GTK_ICON_SIZE_MENU = 1; // enum GtkIconSize
this.GTK_WINDOW_TOPLEVEL = 0; // enum GtkWindowType this.GTK_WINDOW_TOPLEVEL = 0; // enum GtkWindowType
@ -78,6 +82,7 @@ function gtk_defines(lib) {
ctypes.default_abi, gobject.gboolean, ctypes.default_abi, gobject.gboolean,
[this.GtkWidget.ptr, gdk.GdkEventFocus.ptr, gobject.gpointer]).ptr; [this.GtkWidget.ptr, gdk.GdkEventFocus.ptr, gobject.gpointer]).ptr;
lib.lazy_bind("gtk_check_version", gobject.gchar.ptr, gobject.guint, gobject.guint, gobject.guint);
lib.lazy_bind("gtk_icon_theme_get_default", this.GtkIconTheme.ptr); lib.lazy_bind("gtk_icon_theme_get_default", this.GtkIconTheme.ptr);
lib.lazy_bind("gtk_icon_theme_get_for_screen", this.GtkIconTheme.ptr, gdk.GdkScreen.ptr); lib.lazy_bind("gtk_icon_theme_get_for_screen", this.GtkIconTheme.ptr, gdk.GdkScreen.ptr);

View File

@ -60,6 +60,14 @@ firetray.Handler.gtkPopupMenuWindowItems = new ctypesMap(gtk.GtkImageMenuItem.pt
firetray.Window = { firetray.Window = {
init: function() { init: function() {
let gtkVersionCheck = gtk.gtk_check_version(
gtk.FIRETRAY_REQUIRED_GTK_MAJOR_VERSION,
gtk.FIRETRAY_REQUIRED_GTK_MINOR_VERSION,
gtk.FIRETRAY_REQUIRED_GTK_MICRO_VERSION
);
if (!gtkVersionCheck.isNull())
log.error("gtk_check_version="+gtkVersionCheck.readString());
this.initialized = true; this.initialized = true;
}, },
@ -157,7 +165,7 @@ firetray.Window = {
getGdkWindowFromNativeHandle: function(nativeHandle) { getGdkWindowFromNativeHandle: function(nativeHandle) {
let gdkw = new gdk.GdkWindow.ptr(ctypes.UInt64(nativeHandle)); // a new pointer to the GdkWindow let gdkw = new gdk.GdkWindow.ptr(ctypes.UInt64(nativeHandle)); // a new pointer to the GdkWindow
gdkw = gdk.gdk_window_get_effective_toplevel(gdkw); gdkw = gdk.gdk_window_get_toplevel(gdkw);
log.debug("gdkw="+gdkw+" *gdkw="+this.addrPointedByInHex(gdkw)); log.debug("gdkw="+gdkw+" *gdkw="+this.addrPointedByInHex(gdkw));
return gdkw; return gdkw;
}, },