From 7bc93b400101b5842fb0e853861216302d73e147 Mon Sep 17 00:00:00 2001 From: shuerhaaken Date: Wed, 19 Jan 2011 10:45:30 +0100 Subject: [PATCH] More actions to make valaunch gtk+3.0 ready --- plugins/applications/Makefile.am | 8 +++++++- plugins/files/Makefile.am | 8 +++++++- plugins/recent/Makefile.am | 8 +++++++- src/Makefile.am | 3 +++ src/valaunch-frame.vala | 14 +++++++------- src/valaunch-window.vala | 10 +++++----- 6 files changed, 36 insertions(+), 15 deletions(-) diff --git a/plugins/applications/Makefile.am b/plugins/applications/Makefile.am index 7de79c5..26f93b6 100644 --- a/plugins/applications/Makefile.am +++ b/plugins/applications/Makefile.am @@ -13,7 +13,13 @@ INCLUDES = \ -DPLUGINSDIR=\"$(libdir)/valaunch\" \ -DLICENSEDIR=\"$(datadir)/valaunch/license/\" \ -DLOCALE_DIR=\"${datarootdir}/locale\" \ - -I$(top_srcdir)/src + -I$(top_srcdir)/src \ + -DGTK_DISABLE_DEPRECATED=1 \ + -DGDK_DISABLE_DEPRECATED=1 \ + -DGDK_PIXBUF_DISABLE_DEPRECATED=1 \ + -DG_DISABLE_DEPRECATED=1 \ + -DPANGO_DISABLE_DEPRECATED=1 \ + -DGSEAL_ENABLE=1 \ $(NULL) libapplicationsdir = $(libdir)/valaunch diff --git a/plugins/files/Makefile.am b/plugins/files/Makefile.am index 1efca80..af65305 100644 --- a/plugins/files/Makefile.am +++ b/plugins/files/Makefile.am @@ -13,7 +13,13 @@ INCLUDES = \ -DPLUGINSDIR=\"$(libdir)/valaunch\" \ -DLICENSEDIR=\"$(datadir)/valaunch/license/\" \ -DLOCALE_DIR=\"${datarootdir}/locale\" \ - -I$(top_srcdir)/src + -I$(top_srcdir)/src \ + -DGTK_DISABLE_DEPRECATED=1 \ + -DGDK_DISABLE_DEPRECATED=1 \ + -DGDK_PIXBUF_DISABLE_DEPRECATED=1 \ + -DG_DISABLE_DEPRECATED=1 \ + -DPANGO_DISABLE_DEPRECATED=1 \ + -DGSEAL_ENABLE=1 \ $(NULL) libfilesdir = $(libdir)/valaunch diff --git a/plugins/recent/Makefile.am b/plugins/recent/Makefile.am index 5ccc5aa..03f34f3 100644 --- a/plugins/recent/Makefile.am +++ b/plugins/recent/Makefile.am @@ -13,7 +13,13 @@ INCLUDES = \ -DPLUGINSDIR=\"$(libdir)/valaunch\" \ -DLICENSEDIR=\"$(datadir)/valaunch/license/\" \ -DLOCALE_DIR=\"${datarootdir}/locale\" \ - -I$(top_srcdir)/src + -I$(top_srcdir)/src \ + -DGTK_DISABLE_DEPRECATED=1 \ + -DGDK_DISABLE_DEPRECATED=1 \ + -DGDK_PIXBUF_DISABLE_DEPRECATED=1 \ + -DG_DISABLE_DEPRECATED=1 \ + -DPANGO_DISABLE_DEPRECATED=1 \ + -DGSEAL_ENABLE=1 \ $(NULL) librecentdir = $(libdir)/valaunch diff --git a/src/Makefile.am b/src/Makefile.am index 03dc837..7103667 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,6 +2,8 @@ NULL = bin_PROGRAMS = valaunch +#-DGTK_DISABLE_SINGLE_INCLUDES=1 does not work on ubuntu + INCLUDES = \ -include $(CONFIG_HEADER) \ $(VALAUNCH_CFLAGS) \ @@ -15,6 +17,7 @@ INCLUDES = \ -DGDK_PIXBUF_DISABLE_DEPRECATED=1 \ -DG_DISABLE_DEPRECATED=1 \ -DPANGO_DISABLE_DEPRECATED=1 \ + -DGSEAL_ENABLE=1 \ $(NULL) valaunchdir = $(includedir)/valaunch-1.0 diff --git a/src/valaunch-frame.vala b/src/valaunch-frame.vala index 4dd5fe4..7ed33fd 100644 --- a/src/valaunch-frame.vala +++ b/src/valaunch-frame.vala @@ -212,7 +212,7 @@ private class Valaunch.Frame : Gtk.Bin { radius = this.radius; } - cr = Gdk.cairo_create(this.window); + cr = Gdk.cairo_create(this.get_window()); cr.rectangle(x, y, width, height); cr.clip(); @@ -255,8 +255,8 @@ private class Valaunch.Frame : Gtk.Bin { requisition.width = 0; requisition.height = 0; - if(this.child != null && this.child.visible) { - this.child.size_request(out cr); + if(this.get_child() != null && this.get_child().visible) { + this.get_child().size_request(out cr); requisition.width = int.max(requisition.width, cr.width); requisition.height += cr.height; @@ -267,7 +267,7 @@ private class Valaunch.Frame : Gtk.Bin { public override void size_allocate(Gdk.Rectangle allocation) { Gtk.Allocation new_alloc = {}; - this.allocation = (Gtk.Allocation)allocation; + this.set_allocation((Gtk.Allocation)allocation); new_alloc.x = (int)(this.border_width + this.style.xthickness); new_alloc.width = int.max(1, ((int) allocation.width - new_alloc.x * 2)); new_alloc.y = (int)(this.border_width + this.style.ythickness); @@ -276,11 +276,11 @@ private class Valaunch.Frame : Gtk.Bin { new_alloc.y += allocation.y; if((new_alloc.x != this.child_alloc.x || new_alloc.y != this.child_alloc.y || new_alloc.width != this.child_alloc.width || new_alloc.height != this.child_alloc.height)) { - this.window.invalidate_rect(allocation, false); + this.get_window().invalidate_rect(allocation, false); } - if(((Gtk.Bin)this).child != null && ((Gtk.Bin)this).child.visible) - ((Gtk.Bin)this).child.size_allocate ((Gdk.Rectangle)new_alloc); + if(this.get_child() != null && this.get_child().visible) + ((Gtk.Bin)this).get_child().size_allocate ((Gdk.Rectangle)new_alloc); this.child_alloc = new_alloc; } diff --git a/src/valaunch-window.vala b/src/valaunch-window.vala index 77aa7d0..005d214 100644 --- a/src/valaunch-window.vala +++ b/src/valaunch-window.vala @@ -297,7 +297,7 @@ private class Valaunch.Window : Gtk.Window { if(!this.transparent) { Gtk.paint_box(this.style, - this.window, + this.get_window(), Gtk.StateType.NORMAL, Gtk.ShadowType.IN, event.area, @@ -307,7 +307,7 @@ private class Valaunch.Window : Gtk.Window { return false; } - cr = Gdk.cairo_create(this.window); + cr = Gdk.cairo_create(this.get_window()); cr.rectangle(event.area.x, @@ -757,7 +757,7 @@ private class Valaunch.Window : Gtk.Window { private bool grab() { unowned Gdk.Window gdk_window; uint32 time; - gdk_window = this.window; + gdk_window = this.get_window(); time = Gdk.x11_get_server_time(gdk_window); if((Gdk.pointer_grab(gdk_window, true, Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | @@ -805,9 +805,9 @@ private class Valaunch.Window : Gtk.Window { private bool get_is_visible() { bool visible = this.visible; - if(this.window != null) { + if(this.get_window() != null) { bool iconified; - iconified = (this.window.get_state() & Gdk.WindowState.ICONIFIED) == Gdk.WindowState.ICONIFIED; + iconified = (this.get_window().get_state() & Gdk.WindowState.ICONIFIED) == Gdk.WindowState.ICONIFIED; visible = visible && !iconified; } return visible; -- 2.1.4