[Xfce4-commits] <xfce4-indicator-plugin:master> Merge remote-tracking branch 'origin/andrzejr/gtk3'

Mark Trompell noreply at xfce.org
Sun Apr 14 23:04:07 CEST 2013


Updating branch refs/heads/master
         to 12b1f59174a5903b99f8ec9a4e7ddca2e505f82e (commit)
       from 8080d72773dd00b9bf1b5e1aae2f7995606912b0 (commit)

commit 12b1f59174a5903b99f8ec9a4e7ddca2e505f82e
Merge: 8080d72 8fa31fb
Author: Mark Trompell <mark at foresightlinux.org>
Date:   Sun Apr 14 22:54:11 2013 +0200

    Merge remote-tracking branch 'origin/andrzejr/gtk3'

commit 8fa31fbcabbbdc2d7dd685fdc0a733bcc3402888
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Mon Apr 8 23:38:19 2013 +0100

    Making the plugin display indicator icons.

commit 84ab84c4f70b6c011b225a72e7cce9dd426155c3
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Apr 7 23:52:11 2013 +0100

    Some exo fixes to make config settings work

commit ed35886b41b7d1b7059822773ce423c3e3dbe962
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Apr 7 22:44:44 2013 +0100

    Changes needed for the plugin not to crash at load time.
    
    For some reason X-XFCE-Gtk3 has to be FALSE (an error in
    the corresponding panel changes).

commit 72a3de8c1c84b89a242519e87de6f597dc5a93d3
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Apr 7 01:15:10 2013 +0100

    Initial port to gtk3
    
    Doesn't work yet - needs a modified gtk2 xfce4-panel that loads wrapper3
    on demand.

 configure.ac.in                   |   13 +++++----
 panel-plugin/Makefile.am          |    4 +--
 panel-plugin/indicator-box.c      |   48 +++++++++++++++++++++++++++++++++----
 panel-plugin/indicator-button.c   |    9 ++++--
 panel-plugin/indicator-config.c   |   31 ++++++++++++++---------
 panel-plugin/indicator-dialog.c   |   23 ++++++++++++-----
 panel-plugin/indicator.desktop.in |    1 +
 7 files changed, 93 insertions(+), 36 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 7a99b63..255de50 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -72,13 +72,14 @@ XDT_CHECK_LIBX11_REQUIRE()
 dnl ***********************************
 dnl *** Check for required packages ***
 dnl ***********************************
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
-XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.2])
+XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.6.0])
+dnl XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.9.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-2.0], [4.10.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
-XDT_CHECK_PACKAGE([INDICATOR], [indicator], [0.3.0], [indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], [indicator-0.4], [0.3.90], [indicator_pkgname=indicator-0.4], [])])
+XDT_CHECK_PACKAGE([INDICATOR], [indicator3], [0.4.0], [indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], [indicator3-0.4], [0.3.90], [indicator_pkgname=indicator3-0.4], [])])
+dnl XDT_CHECK_PACKAGE([INDICATOR], [indicator3-0.4], [0.4.0])
 
 dnl ***********************************
 dnl *** Check for debugging support ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index fcec7f7..4229737 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -32,7 +32,6 @@ libindicator_plugin_la_SOURCES = \
 
 libindicator_plugin_la_CFLAGS = \
 	$(GTK_CFLAGS) \
-	$(EXO_CFLAGS) \
 	$(LIBXFCE4UTIL_CFLAGS)						\
 	$(LIBXFCE4UI_CFLAGS) \
 	$(LIBXFCE4PANEL_CFLAGS)						\
@@ -52,7 +51,6 @@ libindicator_plugin_la_LDFLAGS = \
 
 libindicator_plugin_la_LIBADD = \
 	$(GTK_LIBS) \
-	$(EXO_LIBS) \
 	$(LIBXFCE4UTIL_LIBS)						\
 	$(LIBXFCE4UI_LIBS) \
 	$(LIBXFCE4PANEL_LIBS)						\
@@ -87,7 +85,7 @@ DISTCLEANFILES += \
 	$(libindicator_built_sources)
 
 indicator-dialog_ui.h: indicator-dialog.glade
-	$(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=indicator_dialog_ui $< >$@
+	$(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=indicator_dialog_ui $< >$@
 endif
 
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index c181009..6651d3c 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -26,7 +26,7 @@
 
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <exo/exo.h>
+//#include <exo/exo.h>
 #include <libxfce4panel/libxfce4panel.h>
 #include <libindicator/indicator-object.h>
 
@@ -47,6 +47,12 @@ static void                 xfce_indicator_box_forall         (GtkContainer
 static GType                xfce_indicator_box_child_type     (GtkContainer     *container);
 static void                 xfce_indicator_box_size_request   (GtkWidget        *widget,
                                                                GtkRequisition   *requisition);
+static void                 xfce_indicator_box_get_preferred_width (GtkWidget   *widget,
+                                                                    gint        *minimal_width,
+                                                                    gint        *natural_width);
+static void                 xfce_indicator_box_get_preferred_height (GtkWidget   *widget,
+                                                                     gint        *minimal_height,
+                                                                     gint        *natural_height);
 static void                 xfce_indicator_box_size_allocate  (GtkWidget        *widget,
                                                                GtkAllocation    *allocation);
 
@@ -91,7 +97,9 @@ xfce_indicator_box_class_init (XfceIndicatorBoxClass *klass)
   gobject_class->finalize = xfce_indicator_box_finalize;
 
   gtkwidget_class = GTK_WIDGET_CLASS (klass);
-  gtkwidget_class->size_request = xfce_indicator_box_size_request;
+  //gtkwidget_class->size_request = xfce_indicator_box_size_request;
+  gtkwidget_class->get_preferred_width = xfce_indicator_box_get_preferred_width;
+  gtkwidget_class->get_preferred_height = xfce_indicator_box_get_preferred_height;
   gtkwidget_class->size_allocate = xfce_indicator_box_size_allocate;
 
   gtkcontainer_class = GTK_CONTAINER_CLASS (klass);
@@ -106,8 +114,7 @@ xfce_indicator_box_class_init (XfceIndicatorBoxClass *klass)
 static void
 xfce_indicator_box_init (XfceIndicatorBox *box)
 {
-  GTK_WIDGET_SET_FLAGS (box, GTK_NO_WINDOW);
-
+  gtk_widget_set_has_window (GTK_WIDGET (box), FALSE);
   gtk_widget_set_can_focus(GTK_WIDGET(box), TRUE);
   gtk_container_set_border_width(GTK_CONTAINER(box), 0);
 
@@ -217,7 +224,7 @@ xfce_indicator_box_add (GtkContainer *container,
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
-  g_return_if_fail (child->parent == NULL);
+  g_return_if_fail (gtk_widget_get_parent (GTK_WIDGET (child)) == NULL);
 
   io_name = xfce_indicator_button_get_io_name (button);
   li = g_hash_table_lookup (box->children, io_name);
@@ -403,6 +410,35 @@ xfce_indicator_box_size_request (GtkWidget      *widget,
 
 
 static void
+xfce_indicator_box_get_preferred_width (GtkWidget *widget,
+                                        gint      *minimal_width,
+                                        gint      *natural_width)
+{
+  GtkRequisition requisition;
+
+  xfce_indicator_box_size_request (widget, &requisition);
+
+  *minimal_width = *natural_width = requisition.width;
+}
+
+
+
+static void
+xfce_indicator_box_get_preferred_height (GtkWidget *widget,
+                                         gint      *minimal_height,
+                                         gint      *natural_height)
+{
+  GtkRequisition requisition;
+
+  xfce_indicator_box_size_request (widget, &requisition);
+
+  *minimal_height = *natural_height = requisition.height;
+}
+
+
+
+
+static void
 xfce_indicator_box_size_allocate (GtkWidget     *widget,
                                   GtkAllocation *allocation)
 {
@@ -427,6 +463,8 @@ xfce_indicator_box_size_allocate (GtkWidget     *widget,
   x0 = allocation->x;
   y0 = allocation->y;
 
+  gtk_widget_set_allocation (widget, allocation);
+
   panel_size = indicator_config_get_panel_size (box->config);
   panel_orientation = indicator_config_get_panel_orientation (box->config);
   nrows = panel_size / xfce_indicator_box_get_row_size (box);
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 25a3572..ca1458c 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -103,7 +103,9 @@ xfce_indicator_button_class_init (XfceIndicatorButtonClass *klass)
 static void
 xfce_indicator_button_init (XfceIndicatorButton *button)
 {
-  GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (button), GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
+  //GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (button), GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
+  gtk_widget_set_can_focus(GTK_WIDGET(button), FALSE);
+  gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
   gtk_button_set_use_underline (GTK_BUTTON (button),TRUE);
   gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
@@ -126,7 +128,8 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   gtk_container_add (GTK_CONTAINER (button), button->align_box);
   gtk_widget_show (button->align_box);
 
-  button->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 1);
+  //button->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 1);
+  button->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
   gtk_container_add (GTK_CONTAINER (button->align_box), button->box);
   gtk_widget_show (button->box);
 }
@@ -526,7 +529,7 @@ xfce_indicator_configuration_changed (XfceIndicatorButton *button,
 {
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (config));
-  g_return_if_fail (GTK_WIDGET (button)->parent != NULL);
+  g_return_if_fail (gtk_widget_get_parent (GTK_WIDGET (button)) != NULL);
 
   if (button->orig_icon != NULL)
     xfce_indicator_button_update_icon (button);
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index d5f5cda..06fb0a9 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -36,7 +36,7 @@
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4ui/libxfce4ui.h>
 #include <xfconf/xfconf.h>
-#include <exo/exo.h>
+//#include <exo/exo.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 
 #include "indicator.h"
@@ -156,32 +156,38 @@ indicator_config_class_init (IndicatorConfigClass *klass)
                                                       1,
                                                       128,
                                                       DEFAULT_ICON_SIZE_MAX,
-                                                      EXO_PARAM_READWRITE));
+                                                      G_PARAM_READWRITE |
+                                                      G_PARAM_STATIC_STRINGS));
+
   g_object_class_install_property (gobject_class,
                                    PROP_ALIGN_LEFT,
                                    g_param_spec_boolean ("align-left", NULL, NULL,
                                                          DEFAULT_ALIGN_LEFT,
-                                                         EXO_PARAM_READWRITE));
+                                                         G_PARAM_READWRITE |
+                                                         G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
                                    PROP_MODE_WHITELIST,
                                    g_param_spec_boolean ("mode-whitelist", NULL, NULL,
                                                          DEFAULT_MODE_WHITELIST,
-                                                         EXO_PARAM_READWRITE));
+                                                         G_PARAM_READWRITE |
+                                                         G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
                                    PROP_BLACKLIST,
                                    g_param_spec_boxed ("blacklist",
                                                        NULL, NULL,
                                                        XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY,
-                                                       EXO_PARAM_READWRITE));
+                                                       G_PARAM_READWRITE |
+                                                       G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
                                    PROP_WHITELIST,
                                    g_param_spec_boxed ("whitelist",
                                                        NULL, NULL,
                                                        XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY,
-                                                       EXO_PARAM_READWRITE));
+                                                       G_PARAM_READWRITE |
+                                                       G_PARAM_STATIC_STRINGS));
 
 
   g_object_class_install_property (gobject_class,
@@ -189,7 +195,8 @@ indicator_config_class_init (IndicatorConfigClass *klass)
                                    g_param_spec_boxed ("known-indicators",
                                                        NULL, NULL,
                                                        XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY,
-                                                       EXO_PARAM_READWRITE));
+                                                       G_PARAM_READWRITE |
+                                                       G_PARAM_STATIC_STRINGS));
 
 
   indicator_config_signals[CONFIGURATION_CHANGED] =
@@ -584,7 +591,7 @@ indicator_config_blacklist_set (IndicatorConfig *config,
   gchar *name_copy;
 
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (config));
-  g_return_if_fail (!exo_str_is_empty (name));
+  //g_return_if_fail (!exo_str_is_empty (name));
 
   if (add)
     {
@@ -611,7 +618,7 @@ indicator_config_whitelist_set (IndicatorConfig *config,
   gchar *name_copy;
 
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (config));
-  g_return_if_fail (!exo_str_is_empty (name));
+  //g_return_if_fail (!exo_str_is_empty (name));
 
   if (add)
     {
@@ -660,7 +667,7 @@ indicator_config_add_known_indicator (IndicatorConfig *config,
   GList    *li;
 
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (config));
-  g_return_if_fail (!exo_str_is_empty (name));
+  //g_return_if_fail (!exo_str_is_empty (name));
 
   /* check if the indicator is already known */
   for(li = config->known_indicators; li != NULL; li = li->next)
@@ -684,8 +691,8 @@ indicator_config_swap_known_indicators (IndicatorConfig *config,
   GList       *li, *li_tmp;
 
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (config));
-  g_return_if_fail (!exo_str_is_empty (name1));
-  g_return_if_fail (!exo_str_is_empty (name2));
+  //g_return_if_fail (!exo_str_is_empty (name1));
+  //g_return_if_fail (!exo_str_is_empty (name2));
 
   for(li = config->known_indicators; li != NULL; li = li->next)
     if (g_strcmp0 (li->data, name1) == 0)
diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 39280b5..af1964b 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -35,7 +35,7 @@
 
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4ui/libxfce4ui.h>
-#include <exo/exo.h>
+//#include <exo/exo.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 
 #include "indicator-dialog.h"
@@ -478,18 +478,27 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
       object = gtk_builder_get_object (builder, "size-max");
       g_return_if_fail (GTK_IS_WIDGET (object));
-      exo_mutual_binding_new (G_OBJECT (dialog->config), "icon-size-max",
-                              G_OBJECT (object), "value");
+      //exo_mutual_binding_new (G_OBJECT (dialog->config), "icon-size-max",
+      //                        G_OBJECT (object), "value");
+      g_object_bind_property (G_OBJECT (dialog->config), "icon-size-max",
+                              G_OBJECT (object), "value",
+                              G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
 
       object = gtk_builder_get_object (builder, "checkbutton-align-left");
       g_return_if_fail (GTK_IS_WIDGET (object));
-      exo_mutual_binding_new (G_OBJECT (dialog->config), "align-left",
-                              G_OBJECT (object), "active");
+      //exo_mutual_binding_new (G_OBJECT (dialog->config), "align-left",
+      //                        G_OBJECT (object), "active");
+      g_object_bind_property (G_OBJECT (dialog->config), "align-left",
+                              G_OBJECT (object), "active",
+                              G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
 
       object = gtk_builder_get_object (builder, "checkbutton-whitelist");
       g_return_if_fail (GTK_IS_WIDGET (object));
-      exo_mutual_binding_new (G_OBJECT (dialog->config), "mode-whitelist",
-                              G_OBJECT (object), "active");
+      //exo_mutual_binding_new (G_OBJECT (dialog->config), "mode-whitelist",
+      //                        G_OBJECT (object), "active");
+      g_object_bind_property (G_OBJECT (dialog->config), "mode-whitelist",
+                              G_OBJECT (object), "active",
+                              G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
       g_signal_connect (G_OBJECT (object), "toggled",
                         G_CALLBACK (indicator_dialog_mode_whitelist_toggled), dialog);
       indicator_dialog_mode_whitelist_toggled (GTK_CHECK_BUTTON (object), dialog);
diff --git a/panel-plugin/indicator.desktop.in b/panel-plugin/indicator.desktop.in
index b0a757d..aba66ee 100644
--- a/panel-plugin/indicator.desktop.in
+++ b/panel-plugin/indicator.desktop.in
@@ -6,3 +6,4 @@ _Comment=An indicator of something that needs your attention on the desktop
 Icon=xfce4-indicator-plugin
 X-XFCE-Module=indicator-plugin
 X-XFCE-Internal=FALSE
+X-XFCE-Gtk3=FALSE


More information about the Xfce4-commits mailing list