[dconf] Editor: optionally support gtk3 from git
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] Editor: optionally support gtk3 from git
- Date: Mon, 4 Oct 2010 12:26:25 +0000 (UTC)
commit b21639a83eb7262a28270ee776c15cd1ee71cbe1
Author: Ryan Lortie <desrt desrt ca>
Date: Mon Oct 4 08:25:34 2010 -0400
Editor: optionally support gtk3 from git
Also, from tarballs if you care to rebuild your .c files.
configure.ac | 1 +
editor/Makefile.am | 5 +++--
editor/dconf-view.vala | 12 ++++++++++++
3 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index afc89b5..e9b9281 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,7 @@ case "$with_gtk" in
GTK_REQUIRED=2.90.7
;;
esac
+AC_SUBST(GTK_API_VERSION)
AC_ARG_ENABLE(editor,
AC_HELP_STRING([--disable-editor],
diff --git a/editor/Makefile.am b/editor/Makefile.am
index cb65004..bba695f 100644
--- a/editor/Makefile.am
+++ b/editor/Makefile.am
@@ -1,6 +1,7 @@
bin_PROGRAMS = dconf-editor
-AM_CFLAGS = $(gtk_CFLAGS) $(libxml_CFLAGS) -I$(top_srcdir)/common -I$(top_srcdir)/client
-AM_VALAFLAGS = --vapidir ../client --pkg gtk+-2.0 --pkg libxml-2.0 --pkg dconf
+AM_CFLAGS = $(gtk_CFLAGS) $(libxml_CFLAGS) -I$(top_srcdir)/common -I$(top_srcdir)/client
+AM_VALAFLAGS = --vapidir ../client --pkg gtk+-$(GTK_API_VERSION) --pkg libxml-2.0 --pkg dconf -D GTK$(GTK_API_VERSION:.0=)
+CFLAGS += -Wno-error
dconf_editor_LDADD = ../client/libdconf.so.0 $(gtk_LIBS) $(gee_LIBS) $(libxml_LIBS)
dconf_editor_SOURCES = dconf-editor.vala dconf-model.vala dconf-schema.vala dconf-view.vala
diff --git a/editor/dconf-view.vala b/editor/dconf-view.vala
index fc6a1ef..cdeda7b 100644
--- a/editor/dconf-view.vala
+++ b/editor/dconf-view.vala
@@ -159,6 +159,7 @@ private class KeyValueRenderer: Gtk.CellRenderer
renderer.get_size(widget, cell_area, out x_offset, out y_offset, out width, out height);
}
+#if GTK2
public override void render(Gdk.Window window,
Gtk.Widget widget,
Gdk.Rectangle background_area,
@@ -168,6 +169,17 @@ private class KeyValueRenderer: Gtk.CellRenderer
{
renderer.render(window, widget, background_area, cell_area, expose_area, flags);
}
+#else
+ public override void render(Cairo.Context context,
+ Gtk.Widget widget,
+ Gdk.Rectangle background_area,
+ Gdk.Rectangle cell_area,
+ Gtk.CellRendererState flags)
+ {
+ renderer.render(context, widget, background_area, cell_area, flags);
+ }
+#endif
+
public override bool activate(Gdk.Event event,
Gtk.Widget widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]