gdl r471 - in trunk: . gdl



Author: jhs
Date: Tue May  6 11:49:16 2008
New Revision: 471
URL: http://svn.gnome.org/viewvc/gdl?rev=471&view=rev

Log:
2008-05-06  Johannes Schmid  <jhs gnome org>

	reviewed by: <delete if not using a buddy>

	* configure.in: Bump version to 2.23.0 (following GNOME cycle),
	bumped Gtk+ requirement to 2.12.0 and readded DISABLE_DEPRECATED
	
	Patch from Jan Arne Petersen
	* gdl/gdl-dock-bar.c (gdl_dock_bar_instance_init),
	(gdl_dock_bar_destroy), (gdl_dock_bar_add_item):
	* gdl/gdl-dock-item-grip.c (gdl_dock_item_grip_destroy),
	(gdl_dock_item_grip_instance_init):
	* gdl/gdl-switcher.c (button_new), (button_free),
	(gdl_switcher_class_init), (gdl_switcher_add_button),
	(set_switcher_style_internal):
	
	Port to the GtkTooltip API (fixes #457562)
	
	* gdl/gdl-switcher.c:
	Use smaller buttons to waste less space
	
	* gdl/gdl-dock-item.c
	gtk_notebook_set_page() -> gtk_notebook_set_current_page() to fix build

Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/gdl/gdl-dock-bar.c
   trunk/gdl/gdl-dock-item-grip.c
   trunk/gdl/gdl-dock-item.c
   trunk/gdl/gdl-switcher.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue May  6 11:49:16 2008
@@ -9,9 +9,9 @@
 AC_INIT(gdl)
 AM_CONFIG_HEADER(config.h)
 
-GDL_MAJOR_VERSION=0
-GDL_MINOR_VERSION=7
-GDL_MICRO_VERSION=11
+GDL_MAJOR_VERSION=2
+GDL_MINOR_VERSION=23
+GDL_MICRO_VERSION=0
 PACKAGE=gdl
 GDL_VERSION=$GDL_MAJOR_VERSION.$GDL_MINOR_VERSION.$GDL_MICRO_VERSION
 
@@ -31,7 +31,7 @@
 SNAPSHOT=0_`date +%Y%m%d_%H%M%S`_cvs
 AC_SUBST(SNAPSHOT)
 
-GTK_REQUIRED=2.4.0
+GTK_REQUIRED=2.12.0
 GNOME_REQUIRED=2.6.0
 XML_REQUIRED=2.2.8
 LIBGLADE_REQUIRED=2.0.0
@@ -107,11 +107,10 @@
 
 AM_CONDITIONAL(HAVE_GNOME, [test x$gnome = xyes])
 
-# Do not set deprecated flags as long as #457562 is not fixed
-#if test x$MAINT = x; then
-#	DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED -DBONOBO_UI_DISABLE_DEPRECATED"
-#	AC_SUBST(DEPRECATED_FLAGS)
-#fi
+if test x$MAINT = x; then
+	DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED -DBONOBO_UI_DISABLE_DEPRECATED"
+	AC_SUBST(DEPRECATED_FLAGS)
+fi
 
 AC_MSG_CHECKING([for native Win32])
 case "$host" in

Modified: trunk/gdl/gdl-dock-bar.c
==============================================================================
--- trunk/gdl/gdl-dock-bar.c	(original)
+++ trunk/gdl/gdl-dock-bar.c	Tue May  6 11:49:16 2008
@@ -65,7 +65,6 @@
 struct _GdlDockBarPrivate {
     GdlDockMaster   *master;
     GSList          *items;
-    GtkTooltips     *tooltips;
     GtkOrientation   orientation;
     GdlDockBarStyle  dockbar_style;
 };
@@ -130,11 +129,8 @@
     dockbar->_priv = g_new0 (GdlDockBarPrivate, 1);
     dockbar->_priv->master = NULL;
     dockbar->_priv->items = NULL;
-    dockbar->_priv->tooltips = gtk_tooltips_new ();
     dockbar->_priv->orientation = GTK_ORIENTATION_VERTICAL;
     dockbar->_priv->dockbar_style = GDL_DOCK_BAR_BOTH;
-    g_object_ref (dockbar->_priv->tooltips);
-    gtk_object_sink (GTK_OBJECT (dockbar->_priv->tooltips));
 }
 
 static void
@@ -208,11 +204,6 @@
             priv->master = NULL;
         }
 
-        if (priv->tooltips) {
-            g_object_unref (priv->tooltips);
-            priv->tooltips = NULL;
-        }
-        
         dockbar->_priv = NULL;
 
         g_free (priv);
@@ -330,7 +321,7 @@
     gtk_container_add (GTK_CONTAINER (button), box);
     gtk_box_pack_start (GTK_BOX (dockbar), button, FALSE, FALSE, 0);
 
-    gtk_tooltips_set_tip (priv->tooltips, button, name, name);
+    gtk_widget_set_tooltip_text (button, name);
     g_free (name);
 
     g_object_set_data (G_OBJECT (item), "GdlDockBar", dockbar);

Modified: trunk/gdl/gdl-dock-item-grip.c
==============================================================================
--- trunk/gdl/gdl-dock-item-grip.c	(original)
+++ trunk/gdl/gdl-dock-item-grip.c	Tue May  6 11:49:16 2008
@@ -18,7 +18,6 @@
 #include <string.h>
 #include <glib-object.h>
 #include <gtk/gtkbutton.h>
-#include <gtk/gtktooltips.h>
 #include <gtk/gtkimage.h>
 #include "gdl-dock-item.h"
 #include "gdl-dock-item-grip.h"
@@ -35,7 +34,6 @@
 struct _GdlDockItemGripPrivate {
     GtkWidget   *close_button;
     GtkWidget   *iconify_button;
-    GtkTooltips *tooltips;
 
     gboolean     icon_pixbuf_valid;
     GdkPixbuf   *icon_pixbuf;
@@ -246,11 +244,6 @@
             priv->icon_pixbuf = NULL;
         }
 
-        if (priv->tooltips) {
-            g_object_unref (priv->tooltips);
-            priv->tooltips = NULL;
-        }
-
         if (grip->item)
             g_signal_handlers_disconnect_by_func (grip->item,
                                                   gdl_dock_item_grip_item_notify,
@@ -368,13 +361,10 @@
     g_signal_connect (G_OBJECT (grip->_priv->iconify_button), "clicked",
                       G_CALLBACK (gdl_dock_item_grip_iconify_clicked), grip);
 
-    grip->_priv->tooltips = gtk_tooltips_new ();
-    g_object_ref (grip->_priv->tooltips);
-    gtk_object_sink (GTK_OBJECT (grip->_priv->tooltips));
-    gtk_tooltips_set_tip (grip->_priv->tooltips, grip->_priv->iconify_button,
-                          _("Iconify"), _("Iconify this dock"));
-    gtk_tooltips_set_tip (grip->_priv->tooltips, grip->_priv->close_button,
-                          _("Close"), _("Close this dock"));
+    gtk_widget_set_tooltip_text (grip->_priv->iconify_button,
+                          _("Iconify this dock"));
+    gtk_widget_set_tooltip_text (grip->_priv->close_button,
+                          _("Close this dock"));
 }
 
 static void

Modified: trunk/gdl/gdl-dock-item.c
==============================================================================
--- trunk/gdl/gdl-dock-item.c	(original)
+++ trunk/gdl/gdl-dock-item.c	Tue May  6 11:49:16 2008
@@ -1353,7 +1353,7 @@
     {
         /* Activate the page we just added */
         GdlDockItem* notebook = GDL_DOCK_ITEM (gdl_dock_object_get_parent_object (requestor));
-        gtk_notebook_set_page (GTK_NOTEBOOK (notebook->child), 
+        gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook->child), 
                                gtk_notebook_page_num (GTK_NOTEBOOK (notebook->child), GTK_WIDGET (requestor)));
     }
                                

Modified: trunk/gdl/gdl-switcher.c
==============================================================================
--- trunk/gdl/gdl-switcher.c	(original)
+++ trunk/gdl/gdl-switcher.c	Tue May  6 11:49:16 2008
@@ -78,7 +78,6 @@
     GtkWidget *icon;
     GtkWidget *arrow;
     GtkWidget *hbox;
-    GtkTooltips *tooltips;
     int id;
 } Button;
 
@@ -107,7 +106,7 @@
 
 static Button *
 button_new (GtkWidget *button_widget, GtkWidget *label, GtkWidget *icon,
-            GtkTooltips *tooltips, GtkWidget *arrow, GtkWidget *hbox, int id)
+            GtkWidget *arrow, GtkWidget *hbox, int id)
 {
     Button *button = g_new (Button, 1);
 
@@ -116,7 +115,6 @@
     button->icon = icon;
     button->arrow = arrow;
     button->hbox = hbox;
-    button->tooltips = tooltips;
     button->id = id;
 
     g_object_ref (button_widget);
@@ -124,7 +122,6 @@
     g_object_ref (icon);
     g_object_ref (arrow);
     g_object_ref (hbox);
-    g_object_ref (tooltips);
 
     return button;
 }
@@ -136,7 +133,6 @@
     g_object_unref (button->label);
     g_object_unref (button->icon);
     g_object_unref (button->hbox);
-    g_object_unref (button->tooltips);
     g_free (button);
 }
 
@@ -706,6 +702,15 @@
                            GDL_TYPE_SWITCHER_STYLE,
                            GDL_SWITCHER_STYLE_BOTH,
                            G_PARAM_READWRITE));
+    
+    gtk_rc_parse_string ("style \"gdl-button-style\"\n"
+                         "{\n"
+                         "GtkWidget::focus-padding = 1\n"
+                         "GtkWidget::focus-line-width = 1\n"
+                         "xthickness = 0\n"
+                         "ythickness = 0\n"
+                         "}\n"
+                         "widget \"*.gdl-button\" style \"gdl-button-style\"");
 }
 
 static void
@@ -747,14 +752,16 @@
                          const gchar *tooltips, const gchar *stock_id,
                          gint switcher_id)
 {
+    GtkWidget *event_box;
     GtkWidget *button_widget;
     GtkWidget *hbox;
     GtkWidget *icon_widget;
     GtkWidget *label_widget;
     GtkWidget *arrow;
-    GtkTooltips *button_tooltips;
     
     button_widget = gtk_toggle_button_new ();
+    gtk_widget_set_name (button_widget, "gdl-button");
+    gtk_button_set_relief (GTK_BUTTON(button_widget), GTK_RELIEF_HALF);
     if (switcher->priv->show)
         gtk_widget_show (button_widget);
     g_signal_connect (button_widget, "toggled",
@@ -777,24 +784,22 @@
     }
     gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
     gtk_widget_show (label_widget);
-    button_tooltips = gtk_tooltips_new();
-    gtk_tooltips_set_tip (GTK_TOOLTIPS (button_tooltips), button_widget,
-                          tooltips, NULL);        
-
+    
+    
+    gtk_widget_set_tooltip_text (button_widget,
+                                 tooltips);
+    
     switch (INTERNAL_MODE (switcher)) {
     case GDL_SWITCHER_STYLE_TEXT:
         gtk_box_pack_start (GTK_BOX (hbox), label_widget, TRUE, TRUE, 0);
-        gtk_tooltips_disable (button_tooltips);
         break;
     case GDL_SWITCHER_STYLE_ICON:
         gtk_box_pack_start (GTK_BOX (hbox), icon_widget, TRUE, TRUE, 0);
-        gtk_tooltips_enable (button_tooltips);
         break;
     case GDL_SWITCHER_STYLE_BOTH:
     default:
         gtk_box_pack_start (GTK_BOX (hbox), icon_widget, FALSE, TRUE, 0);
         gtk_box_pack_start (GTK_BOX (hbox), label_widget, TRUE, TRUE, 0);
-        gtk_tooltips_disable (button_tooltips);
         break;
     }
     arrow = gtk_arrow_new (GTK_ARROW_UP, GTK_SHADOW_NONE);
@@ -804,10 +809,10 @@
     switcher->priv->buttons =
         g_slist_append (switcher->priv->buttons,
                         button_new (button_widget, label_widget,
-                                    icon_widget, button_tooltips,
+                                    icon_widget,
                                     arrow, hbox, switcher_id));
+    
     gtk_widget_set_parent (button_widget, GTK_WIDGET (switcher));
-
     gtk_widget_queue_resize (GTK_WIDGET (switcher));
 }
 
@@ -899,7 +904,6 @@
                 gtk_box_pack_start (GTK_BOX (button->hbox), button->label,
                                     TRUE, TRUE, 0);
                 gtk_widget_show (button->label);
-                gtk_tooltips_disable (button->tooltips);
             }
             break;
         case GDL_SWITCHER_STYLE_ICON:
@@ -912,7 +916,6 @@
             } else
                 gtk_container_child_set (GTK_CONTAINER (button->hbox),
                                          button->icon, "expand", TRUE, NULL);
-            gtk_tooltips_enable (button->tooltips);
             break;
         case GDL_SWITCHER_STYLE_BOTH:
             if (INTERNAL_MODE (switcher)
@@ -927,7 +930,6 @@
                                          button->icon, "expand", FALSE, NULL);
             }
 
-            gtk_tooltips_disable (button->tooltips);
             gtk_box_pack_start (GTK_BOX (button->hbox), button->label, TRUE,
                                 TRUE, 0);
             gtk_widget_show (button->label);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]