[Xfce4-commits] r24259 - in xfce4-panel/branches/4_5_nick: . libxfce4panel panel plugins/tasklist

Nick Schermer nick at xfce.org
Wed Jan 3 19:20:48 CET 2007


Author: nick
Date: 2007-01-03 18:20:48 +0000 (Wed, 03 Jan 2007)
New Revision: 24259

Modified:
   xfce4-panel/branches/4_5_nick/configure.in.in
   xfce4-panel/branches/4_5_nick/libxfce4panel/libxfce4panel-1.0.pc.in
   xfce4-panel/branches/4_5_nick/libxfce4panel/xfce-panel-plugin.h
   xfce4-panel/branches/4_5_nick/panel/Makefile.am
   xfce4-panel/branches/4_5_nick/panel/main.c
   xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.c
   xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.h
   xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c
   xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.h
Log:
Add g_thread_init (same commit from trunk).
Cleanup tasklist a bit more and fix my previous commit.


Modified: xfce4-panel/branches/4_5_nick/configure.in.in
===================================================================
--- xfce4-panel/branches/4_5_nick/configure.in.in	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/configure.in.in	2007-01-03 18:20:48 UTC (rev 24259)
@@ -101,7 +101,8 @@
 dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.4])
+XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.4])
 XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.99.2])
 XDT_CHECK_PACKAGE([LIBEXO], [exo-0.3], [0.3.1.11])
 XDT_CHECK_PACKAGE(LIBXFCE4MCS_MANAGER, libxfce4mcs-manager-1.0, 4.3.99.2)

Modified: xfce4-panel/branches/4_5_nick/libxfce4panel/libxfce4panel-1.0.pc.in
===================================================================
--- xfce4-panel/branches/4_5_nick/libxfce4panel/libxfce4panel-1.0.pc.in	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/libxfce4panel/libxfce4panel-1.0.pc.in	2007-01-03 18:20:48 UTC (rev 24259)
@@ -5,7 +5,7 @@
 
 Name: libxfce4panel
 Description: Library for the Xfce Panel
-Requires: gtk+-2.0 libxfce4util-1.0
+Requires: gthread-2.0 gtk+-2.0 libxfce4util-1.0
 Version: @PACKAGE_VERSION@
 Libs: -L${libdir} -lxfce4panel
 Cflags: -I${includedir}/xfce4/

Modified: xfce4-panel/branches/4_5_nick/libxfce4panel/xfce-panel-plugin.h
===================================================================
--- xfce4-panel/branches/4_5_nick/libxfce4panel/xfce-panel-plugin.h	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/libxfce4panel/xfce-panel-plugin.h	2007-01-03 18:20:48 UTC (rev 24259)
@@ -21,6 +21,7 @@
 #ifndef __XFCE_PANEL_PLUGIN_H__
 #define __XFCE_PANEL_PLUGIN_H__
 
+#include <glib.h>
 #include <libxfce4panel/xfce-panel-enums.h>
 #include <libxfce4panel/xfce-panel-macros.h>
 #include <libxfce4panel/xfce-panel-plugin-iface.h>
@@ -44,6 +45,9 @@
     {                                                              \
         GtkWidget *plugin;                                         \
                                                                    \
+        if (!g_thread_supported ())                                \
+            g_thread_init (NULL);                                  \
+                                                                   \
         gtk_init (&argc, &argv);                                   \
                                                                    \
         plugin = xfce_external_panel_plugin_new (argc, argv,       \
@@ -81,6 +85,9 @@
         GtkWidget            *plugin;                                   \
         XfcePanelPluginCheck  test = (XfcePanelPluginCheck)check;       \
                                                                         \
+        if (!g_thread_supported ())                                     \
+            g_thread_init (NULL);                                       \
+                                                                        \
         gtk_init (&argc, &argv);                                        \
                                                                         \
         if (G_UNLIKELY (test(gdk_screen_get_default()) == FALSE))       \

Modified: xfce4-panel/branches/4_5_nick/panel/Makefile.am
===================================================================
--- xfce4-panel/branches/4_5_nick/panel/Makefile.am	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/panel/Makefile.am	2007-01-03 18:20:48 UTC (rev 24259)
@@ -38,6 +38,7 @@
 
 xfce4_panel_CFLAGS =								\
 	$(LIBX11_CFLAGS)							\
+	$(GTHREAD_CFLAGS)							\
 	$(LIBSTARTUP_NOTIFICATION_CFLAGS)					\
 	$(LIBXFCE4UTIL_CFLAGS)							\
 	$(LIBXFCEGUI4_CFLAGS)							\
@@ -49,6 +50,7 @@
 
 xfce4_panel_LDADD =								\
 	$(top_builddir)/libxfce4panel/libxfce4panel.la				\
+	$(GTHREAD_LIBS)								\
 	$(LIBXFCE4UTIL_LIBS)							\
 	$(LIBXFCEGUI4_LIBS)							\
 	$(LIBSTARTUP_NOTIFICATION_LIBS)						\

Modified: xfce4-panel/branches/4_5_nick/panel/main.c
===================================================================
--- xfce4-panel/branches/4_5_nick/panel/main.c	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/panel/main.c	2007-01-03 18:20:48 UTC (rev 24259)
@@ -34,6 +34,7 @@
 #include <locale.h>
 #endif
 
+#include <glib.h>
 #include <gtk/gtk.h>
 #include <libxfce4util/libxfce4util.h>
 
@@ -80,6 +81,10 @@
 
     /* application name */
     g_set_application_name (PACKAGE_NAME);
+    
+    /* initialize the GThread system */
+    if (!g_thread_supported ())
+        g_thread_init (NULL);
 
     TIMER_ELAPSED ("start gtk_init_with_args ()");
 

Modified: xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.c	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.c	2007-01-03 18:20:48 UTC (rev 24259)
@@ -1,6 +1,6 @@
 /*  $Id$
  *
- *  Copyright © 2005-2007 Jasper Huijsmans <jasper at xfce.org>
+ *  Copyright (c) 2005-2007 Jasper Huijsmans <jasper at xfce.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU Library General Public License as published
@@ -24,9 +24,32 @@
 #include "tasklist.h"
 #include "tasklist-dialogs.h"
 
+
+
+/* prototypes */
+static void        tasklist_all_workspaces_toggled     (GtkToggleButton *tb,
+                                                        Tasklist        *tasklist);
+static void        tasklist_grouping_changed           (GtkComboBox     *cb,
+                                                        Tasklist        *tasklist);
+static void        tasklist_show_label_toggled         (GtkToggleButton *tb,
+                                                        Tasklist        *tasklist);
+static void        tasklist_expand_toggled             (GtkToggleButton *tb,
+                                                        Tasklist        *tasklist);
+static void        tasklist_flat_buttons_toggled       (GtkToggleButton *tb,
+                                                       Tasklist         *tasklist);
+static void        tasklist_show_handle_toggled        (GtkToggleButton *tb,
+                                                       Tasklist         *tasklist);
+static void        tasklist_width_changed              (GtkSpinButton   *sb,
+                                                        Tasklist        *tasklist);
+static void        tasklist_dialog_response            (GtkWidget       *dlg,
+                                                        gint             reponse,
+                                                        Tasklist        *tasklist);
+
+
+
 static void
-all_workspaces_toggled (GtkToggleButton *tb,
-                        Tasklist        *tasklist)
+tasklist_all_workspaces_toggled (GtkToggleButton *tb,
+                                 Tasklist        *tasklist)
 {
     tasklist->all_workspaces = gtk_toggle_button_get_active (tb);
 
@@ -37,8 +60,8 @@
 
 
 static void
-grouping_changed (GtkComboBox *cb,
-                  Tasklist    *tasklist)
+tasklist_grouping_changed (GtkComboBox *cb,
+                           Tasklist    *tasklist)
 {
     tasklist->grouping = gtk_combo_box_get_active (cb);
 
@@ -49,8 +72,8 @@
 
 
 static void
-show_label_toggled (GtkToggleButton *tb,
-                    Tasklist        *tasklist)
+tasklist_show_label_toggled (GtkToggleButton *tb,
+                             Tasklist        *tasklist)
 {
     tasklist->show_label = gtk_toggle_button_get_active (tb);
 
@@ -61,8 +84,8 @@
 
 
 static void
-expand_toggled (GtkToggleButton *tb,
-                Tasklist        *tasklist)
+tasklist_expand_toggled (GtkToggleButton *tb,
+                         Tasklist        *tasklist)
 {
     tasklist->expand = gtk_toggle_button_get_active (tb);
 
@@ -72,8 +95,8 @@
 
 
 static void
-flat_buttons_toggled (GtkToggleButton *tb,
-                      Tasklist        *tasklist)
+tasklist_flat_buttons_toggled (GtkToggleButton *tb,
+                               Tasklist        *tasklist)
 {
     tasklist->flat_buttons = gtk_toggle_button_get_active (tb);
 
@@ -85,8 +108,8 @@
 
 
 static void
-show_handles_toggled (GtkToggleButton *tb,
-                      Tasklist        *tasklist)
+tasklist_show_handle_toggled (GtkToggleButton *tb,
+                              Tasklist        *tasklist)
 {
     tasklist->show_handles = gtk_toggle_button_get_active (tb);
 
@@ -99,8 +122,8 @@
 
 
 static void
-width_changed (GtkSpinButton *sb,
-               Tasklist      *tasklist)
+tasklist_width_changed (GtkSpinButton *sb,
+                        Tasklist      *tasklist)
 {
     tasklist->width = gtk_spin_button_get_value_as_int (sb);
 
@@ -171,8 +194,8 @@
     spin = gtk_spin_button_new_with_range (100, 4000, 10);
     gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 0);
     gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), tasklist->width);
-    g_signal_connect (spin, "value-changed", G_CALLBACK (width_changed),
-                      tasklist);
+    g_signal_connect (G_OBJECT (spin), "value-changed",
+                      G_CALLBACK (tasklist_width_changed), tasklist);
 
     if (tasklist_using_xinerama (tasklist->plugin))
     {
@@ -180,20 +203,20 @@
         gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->expand);
         g_signal_connect (G_OBJECT (cb), "toggled",
-                          G_CALLBACK (expand_toggled), tasklist);
+                          G_CALLBACK (tasklist_expand_toggled), tasklist);
     }
 
     cb = gtk_check_button_new_with_mnemonic (_("Use flat buttons"));
     gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->flat_buttons);
     g_signal_connect (G_OBJECT (cb), "toggled",
-                      G_CALLBACK (flat_buttons_toggled), tasklist);
+                      G_CALLBACK (tasklist_flat_buttons_toggled), tasklist);
 
-    cb = gtk_check_button_new_with_mnemonic (_("Show handles"));
+    cb = gtk_check_button_new_with_mnemonic (_("Show handle"));
     gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->show_handles);
     g_signal_connect (G_OBJECT (cb), "toggled",
-                      G_CALLBACK (show_handles_toggled), tasklist);
+                      G_CALLBACK (tasklist_show_handle_toggled), tasklist);
 
     /* Tasks */
     vbox = gtk_vbox_new (FALSE, 8);
@@ -205,13 +228,13 @@
     gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->all_workspaces);
     g_signal_connect (G_OBJECT (cb), "toggled",
-                      G_CALLBACK (all_workspaces_toggled), tasklist);
+                      G_CALLBACK (tasklist_all_workspaces_toggled), tasklist);
 
     cb = gtk_check_button_new_with_mnemonic (_("Show application _names"));
     gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->show_label);
     g_signal_connect (G_OBJECT (cb), "toggled",
-                      G_CALLBACK (show_label_toggled), tasklist);
+                      G_CALLBACK (tasklist_show_label_toggled), tasklist);
 
     cb = gtk_combo_box_new_text ();
     gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
@@ -224,7 +247,7 @@
     gtk_combo_box_set_active (GTK_COMBO_BOX (cb), tasklist->grouping);
 
     g_signal_connect (G_OBJECT (cb), "changed",
-                      G_CALLBACK (grouping_changed), tasklist);
+                      G_CALLBACK (tasklist_grouping_changed), tasklist);
 
     gtk_widget_show_all (dlg);
 }

Modified: xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.h
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.h	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist-dialogs.h	2007-01-03 18:20:48 UTC (rev 24259)
@@ -1,6 +1,6 @@
 /*  $Id$
  *
- *  Copyright © 2005-2007 Jasper Huijsmans <jasper at xfce.org>
+ *  Copyright (c) 2005-2007 Jasper Huijsmans <jasper at xfce.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU Library General Public License as published
@@ -20,7 +20,6 @@
 #ifndef __TASKLIST_DIALOGS_H__
 #define __TASKLIST_DIALOGS_H__
 
-void
-tasklist_properties_dialog (Tasklist *tasklist) G_GNUC_INTERNAL;
+void        tasklist_properties_dialog       (Tasklist *tasklist) G_GNUC_INTERNAL;
 
 #endif /* !__TASKLIST_DIALOGS_H__ */

Modified: xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c	2007-01-03 18:20:48 UTC (rev 24259)
@@ -1,6 +1,6 @@
 /*  $Id$
  *
- *  Copyright © 2005-2007 Jasper Huijsmans <jasper at xfce.org>
+ *  Copyright (c) 2005-2007 Jasper Huijsmans <jasper at xfce.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU Library General Public License as published
@@ -29,10 +29,8 @@
 
 
 /* prototypes */
-static void        tasklist_orientation_changed     (Tasklist       *tasklist,
-                                                     GtkOrientation  orientation);
-static gboolean    tasklist_set_size                (Tasklist       *tasklist,
-                                                     gint             size);
+static void        tasklist_orientation_changed     (Tasklist        *tasklist,
+                                                     GtkOrientation   orientation);
 static void        tasklist_free_data               (Tasklist        *tasklist);
 static void        tasklist_read_rc_file            (Tasklist        *tasklist);
 static gboolean    tasklist_handle_exposed          (GtkWidget       *widget,
@@ -61,7 +59,7 @@
 
 
 
-static gboolean
+gboolean
 tasklist_set_size (Tasklist *tasklist,
                    gint      size)
 {
@@ -125,12 +123,12 @@
         if (G_UNLIKELY (rc != NULL))
         {
             /* read user settings */
-            tasklist->grouping       = xfce_rc_read_int_entry (rc, "grouping", tasklist->grouping);
+            tasklist->grouping       = xfce_rc_read_int_entry  (rc, "grouping", tasklist->grouping);
             tasklist->all_workspaces = xfce_rc_read_bool_entry (rc, "all_workspaces", tasklist->all_workspaces);
             tasklist->show_label     = xfce_rc_read_bool_entry (rc, "show_label", tasklist->show_label);
             tasklist->flat_buttons   = xfce_rc_read_bool_entry (rc, "flat_buttons", tasklist->flat_buttons);
             tasklist->show_handles   = xfce_rc_read_bool_entry (rc, "show_handles", tasklist->show_handles);
-            tasklist->width          = xfce_rc_read_int_entry (rc, "width",tasklist->width);
+            tasklist->width          = xfce_rc_read_int_entry  (rc, "width",tasklist->width);
 
             if (tasklist_using_xinerama (tasklist->plugin))
                 tasklist->expand = xfce_rc_read_int_entry (rc, "expand", tasklist->expand);
@@ -228,10 +226,10 @@
 tasklist_screen_changed (Tasklist  *tasklist,
                          GdkScreen *screen)
 {
-	NetkScreen *ns;
+    NetkScreen *ns;
 	
-	/* get the new screen */
-	screen = gtk_widget_get_screen (GTK_WIDGET (tasklist->plugin));
+    /* get the new screen */
+    screen = gtk_widget_get_screen (GTK_WIDGET (tasklist->plugin));
 	
 	/* be secure */
     if (G_UNLIKELY (screen == NULL))

Modified: xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.h
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.h	2007-01-03 18:19:17 UTC (rev 24258)
+++ xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.h	2007-01-03 18:20:48 UTC (rev 24259)
@@ -1,6 +1,6 @@
 /*  $Id$
  *
- *  Copyright © 2005-2007 Jasper Huijsmans <jasper at xfce.org>
+ *  Copyright (c) 2005-2007 Jasper Huijsmans <jasper at xfce.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU Library General Public License as published
@@ -30,13 +30,16 @@
 {
     XfcePanelPlugin          *plugin;
 
+    /* widgets */
     GtkWidget                *box;
     GtkWidget                *handle;
     GtkWidget                *list;
 
-    gint                      width;
+    /* signals */
     gint                      screen_changed_id;
 
+    /* settings */
+    gint                      width;
     NetkTasklistGroupingType  grouping;
     guint                     all_workspaces : 1;
     guint                     show_label : 1;
@@ -46,6 +49,8 @@
 };
 
 void        tasklist_write_rc_file           (Tasklist        *tasklist) G_GNUC_INTERNAL;
+gboolean    tasklist_set_size                (Tasklist        *tasklist,
+                                              gint             size)     G_GNUC_INTERNAL;
 gboolean    tasklist_using_xinerama          (XfcePanelPlugin *plugin)   G_GNUC_INTERNAL;
 
 #endif /* !__TASKLIST_H__ */



More information about the Xfce4-commits mailing list