[Xfce4-commits] [xfce/exo] 01/01: Minimal gtk3 library alongside gtk2.

noreply at xfce.org noreply at xfce.org
Mon May 25 21:36:42 CEST 2015


This is an automated email from the git hooks/post-receive script.

bluesabre pushed a commit to branch master
in repository xfce/exo.

commit cd1611c78a1641a0917d3528c2d592ec32d1c323
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Feb 4 13:28:37 2013 +0100

    Minimal gtk3 library alongside gtk2.
    
    Library with the initial components that we need for
    Thunar without any widgets.
    
    Signed-off-by: Sean Davis <smd.seandavis at gmail.com>
---
 configure.ac.in   |    9 +++++++++
 exo/Makefile.am   |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 exo/exo-2.pc.in   |   13 +++++++++++++
 exo/exo-private.c |    7 ++-----
 exo/exo-utils.h   |    5 +++++
 exo/exo.h         |   23 ++++++++++++++++-------
 6 files changed, 98 insertions(+), 12 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index de978b7..d1b3ee7 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -171,6 +171,14 @@ XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.10.0])
 XDT_CHECK_OPTIONAL_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.30.0], [gio-unix], [GIO-Unix features])
 
+dnl ***********************************************************
+dnl *** Optional support for a GTK+3 version of the library ***
+dnl ***********************************************************
+XDT_CHECK_OPTIONAL_PACKAGE([GTK3],
+                           [gtk+-3.0], [3.6.0], [gtk3],
+                           [GTK+ 3 support])
+AM_CONDITIONAL([ENABLE_GTK3_LIBRARY], [test "x$GTK3_FOUND" = "xyes"])
+
 dnl *********************
 dnl *** Check for X11 ***
 dnl *********************
@@ -238,6 +246,7 @@ docs/reference/Makefile
 docs/reference/version.xml
 exo/Makefile
 exo/exo-1.pc
+exo/exo-2.pc
 exo/exo-config.h
 exo-csource/Makefile
 exo-desktop-item-edit/Makefile
diff --git a/exo/Makefile.am b/exo/Makefile.am
index 7176722..8203177 100644
--- a/exo/Makefile.am
+++ b/exo/Makefile.am
@@ -111,6 +111,59 @@ libexo_1_la_LIBADD =							\
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = exo-$(LIBEXO_VERSION_API).pc
 
+##
+## GTK+ 3 support library
+##
+if ENABLE_GTK3_LIBRARY
+
+libexo_2_includedir = $(includedir)/exo-2/exo
+
+lib_LTLIBRARIES += libexo-2.la
+
+libexo_2_include_HEADERS =						\
+	exo.h								\
+	exo-config.h							\
+	exo-gdk-pixbuf-extensions.h					\
+	exo-job.h							\
+	exo-simple-job.h						\
+	exo-string.h							\
+	exo-utils.h
+
+libexo_2_la_SOURCES =							\
+	$(libexo_2_include_HEADERS)					\
+	exo-marshal.c							\
+	exo-marshal.h							\
+	exo-private.c							\
+	exo-private.h							\
+	exo-config.c							\
+	exo-gdk-pixbuf-extensions.c					\
+	exo-job.c							\
+	exo-simple-job.c						\
+	exo-string.c							\
+	exo-utils.c
+
+libexo_2_la_CFLAGS =							\
+	$(LIBXFCE4UTIL_CFLAGS)						\
+	$(GIO_CFLAGS)							\
+	$(GTK3_CFLAGS)							\
+	$(LIBX11_CFLAGS)
+
+libexo_2_la_LDFLAGS =							\
+	-export-dynamic							\
+	-version-info $(LIBEXO_VERINFO)					\
+	-export-symbols-regex "^[^_].*"					\
+	-no-undefined
+
+libexo_2_la_LIBADD =							\
+	$(LIBXFCE4UTIL_LIBS)						\
+	$(GIO_LIBS)							\
+	$(GTK3_LIBS)							\
+	$(LIBX11_LIBS)							\
+	-lm
+
+pkgconfig_DATA += exo-2.pc
+
+endif
 
 ##
 ## Rules to auto-generate built sources
diff --git a/exo/exo-2.pc.in b/exo/exo-2.pc.in
new file mode 100644
index 0000000..3a0c03d
--- /dev/null
+++ b/exo/exo-2.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+exo_api_version=2
+
+Name: @PACKAGE_TARNAME@
+Description: Extension library for Xfce
+Requires: gtk+-2.0 libxfce4util-2.0
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lexo-${exo_api_version}
+Cflags: -I${includedir}/exo-${exo_api_version}
diff --git a/exo/exo-private.c b/exo/exo-private.c
index a9025ac..e1c98b9 100644
--- a/exo/exo-private.c
+++ b/exo/exo-private.c
@@ -62,14 +62,11 @@ _exo_gtk_widget_send_focus_change (GtkWidget *widget,
 
   g_object_ref (G_OBJECT (widget));
 
- if (in)
-    GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-  else
-    GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
+  gtk_widget_set_can_focus (widget, in);
 
   fevent = gdk_event_new (GDK_FOCUS_CHANGE);
   fevent->focus_change.type = GDK_FOCUS_CHANGE;
-  fevent->focus_change.window = g_object_ref (widget->window);
+  fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget));
   fevent->focus_change.in = in;
 
   gtk_widget_event (widget, fevent);
diff --git a/exo/exo-utils.h b/exo/exo-utils.h
index 441a881..2c88aa5 100644
--- a/exo/exo-utils.h
+++ b/exo/exo-utils.h
@@ -25,6 +25,7 @@
 #define __EXO_UTILS_H__
 
 #include <glib.h>
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
@@ -35,6 +36,8 @@ gpointer                exo_noop_null   (void) G_GNUC_PURE;
 gboolean                exo_noop_true   (void) G_GNUC_PURE;
 gboolean                exo_noop_false  (void) G_GNUC_PURE;
 
+#if !GTK_CHECK_VERSION (3, 0, 0)
+
 /* inline function implementations */
 #if (defined(G_CAN_INLINE) && defined(__GNUC__) && defined(__i386__) && defined(__OPTIMIZE__)) || defined(__EXO_UTILS_C__)
 
@@ -106,6 +109,8 @@ exo_atomic_dec (gint *value)
 
 #endif /* (G_CAN_INLINE && __GNUC__ && __i386__ && __OPTIMIZE__) || __EXO_UTILS_C__ */
 
+#endif
+
 G_END_DECLS
 
 #endif /* !__EXO_UTILS_H__ */
diff --git a/exo/exo.h b/exo/exo.h
index 0dffb4e..91750fc 100644
--- a/exo/exo.h
+++ b/exo/exo.h
@@ -29,34 +29,43 @@
 #include <glib/gi18n.h>
 #endif
 
-#include <libxfce4util/libxfce4util.h>
+#include <gtk/gtk.h>
 
 #define EXO_INSIDE_EXO_H
 
 #include <exo/exo-config.h>
 
+#include <exo/exo-gdk-pixbuf-extensions.h>
+#include <exo/exo-job.h>
+#include <exo/exo-simple-job.h>
+#include <exo/exo-string.h>
+#include <exo/exo-utils.h>
+
+
+#if !GTK_CHECK_VERSION (3, 0, 0)
+#include <libxfce4util/libxfce4util.h>
+
+#include <exo/exo-enum-types.h>
 #include <exo/exo-binding.h>
 #include <exo/exo-cell-renderer-ellipsized-text.h>
 #include <exo/exo-cell-renderer-icon.h>
 #include <exo/exo-execute.h>
-#include <exo/exo-enum-types.h>
-#include <exo/exo-gdk-pixbuf-extensions.h>
 #include <exo/exo-gtk-extensions.h>
 #include <exo/exo-gobject-extensions.h>
 #include <exo/exo-icon-bar.h>
 #include <exo/exo-icon-chooser-dialog.h>
 #include <exo/exo-icon-view.h>
-#include <exo/exo-job.h>
-#include <exo/exo-simple-job.h>
-#include <exo/exo-string.h>
 #include <exo/exo-toolbars-editor.h>
 #include <exo/exo-toolbars-editor-dialog.h>
 #include <exo/exo-toolbars-model.h>
 #include <exo/exo-toolbars-view.h>
 #include <exo/exo-tree-view.h>
-#include <exo/exo-utils.h>
 #include <exo/exo-wrap-table.h>
 #include <exo/exo-xsession-client.h>
+#endif
+
+
+
 
 #undef EXO_INSIDE_EXO_H
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list