mirror of
https://github.com/moparisthebest/FireTray
synced 2024-11-10 19:15:08 -05:00
drop gdk_visual_get_depth() only available since GTK 2.22
As of 2011-09, Debian Squeeze shipped with GTK 2.20
This commit is contained in:
parent
64a7e2f65d
commit
077528763b
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user