[Commits] Makefile.am 1.20.2.28 1.20.2.29 colorlabel.c 1.2.2.37 1.2.2.38 combobox.c 1.1.2.26 1.1.2.27 combobox.h 1.1.2.16 1.1.2.17 gtkcmclist.c 1.1.2.23 1.1.2.24 gtkcmclist.h 1.1.2.9 1.1.2.10 gtkcmctree.c 1.1.2.32 1.1.2.33 gtksctree.c 1.1.4.65 1.1.4.66 gtkshruler.c 1.1.4.23 1.1.4.24 gtkutils.c 1.5.2.105 1.5.2.106 gtkutils.h 1.4.2.67 1.4.2.68 inputdialog.c 1.2.2.48 1.2.2.49 quicksearch.c 1.1.2.119 1.1.2.120

colin at claws-mail.org colin at claws-mail.org
Thu Nov 15 14:41:08 CET 2012


Update of /home/claws-mail/claws/src/gtk
In directory srv:/tmp/cvs-serv26188/src/gtk

Modified Files:
      Tag: gtk2
	Makefile.am colorlabel.c combobox.c combobox.h gtkcmclist.c 
	gtkcmclist.h gtkcmctree.c gtksctree.c gtkshruler.c gtkutils.c 
	gtkutils.h inputdialog.c quicksearch.c 
Log Message:
2012-11-15 [colin]	3.9.0cvs4

	* src/Makefile.am
	* src/action.c
	* src/addr_compl.c
	* src/addressbook.c
	* src/addrgather.c
	* src/compose.c
	* src/editaddress.c
	* src/editgroup.c
	* src/main.c
	* src/mainwindow.c
	* src/message_search.c
	* src/prefs_display_header.c
	* src/prefs_filtering_action.c
	* src/prefs_matcher.c
	* src/prefs_other.c
	* src/prefs_toolbar.c
	* src/printing.c
	* src/stock_pixmap.c
	* src/summary_search.c
	* src/summaryview.c
	* src/textview.c
	* src/gtk/Makefile.am
	* src/gtk/colorlabel.c
	* src/gtk/combobox.c
	* src/gtk/combobox.h
	* src/gtk/gtkcmclist.c
	* src/gtk/gtkcmclist.h
	* src/gtk/gtkcmctree.c
	* src/gtk/gtksctree.c
	* src/gtk/gtkshruler.c
	* src/gtk/gtkutils.c
	* src/gtk/gtkutils.h
	* src/gtk/inputdialog.c
	* src/gtk/quicksearch.c
	* src/plugins/pgpcore/Makefile.am
	* src/plugins/pgpinline/Makefile.am
	* src/plugins/pgpmime/Makefile.am
	* src/plugins/smime/Makefile.am
		Big GTK+3 patch from Hanno Meyer-Thurow

Index: combobox.h
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/combobox.h,v
retrieving revision 1.1.2.16
retrieving revision 1.1.2.17
diff -u -d -r1.1.2.16 -r1.1.2.17
--- combobox.h	27 May 2012 17:31:06 -0000	1.1.2.16
+++ combobox.h	15 Nov 2012 13:41:06 -0000	1.1.2.17
@@ -61,9 +61,17 @@
 
 gint combobox_get_active_data	(GtkComboBox 		*combobox);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
 void combobox_unset_popdown_strings(GtkComboBox		*combobox);
 void combobox_set_popdown_strings(GtkComboBox		*combobox,
 				 GList       *list);
+#else
+/* these two functions require a GtkComboBoxText, so let the compiler warn */
+void combobox_unset_popdown_strings(GtkComboBoxText	*combobox);
+void combobox_set_popdown_strings(GtkComboBoxText	*combobox,
+				 GList       *list);
+#endif
+
 gboolean combobox_set_value_from_arrow_key(GtkComboBox *combobox,
 				 guint keyval);
 void combobox_set_sensitive	(GtkComboBox *combobox,

Index: colorlabel.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/colorlabel.c,v
retrieving revision 1.2.2.37
retrieving revision 1.2.2.38
diff -u -d -r1.2.2.37 -r1.2.2.38
--- colorlabel.c	27 May 2012 17:31:06 -0000	1.2.2.37
+++ colorlabel.c	15 Nov 2012 13:41:06 -0000	1.2.2.38
@@ -376,9 +376,15 @@
 {
 	GtkMenu *menu = (GtkMenu *)data;
 	GtkWidget *widget = gtk_menu_get_attach_widget(menu);
+#if !GTK_CHECK_VERSION(3, 0, 0)
 	gtk_widget_hide_all(widget);
 	gtk_widget_unrealize(widget);
 	gtk_widget_show_all(widget);
+#else
+	gtk_widget_hide(widget);
+	gtk_widget_unrealize(widget);
+	gtk_widget_show(widget);
+#endif
 	gtk_widget_queue_draw(widget);
 }
 

Index: gtkcmctree.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/gtkcmctree.c,v
retrieving revision 1.1.2.32
retrieving revision 1.1.2.33
diff -u -d -r1.1.2.32 -r1.1.2.33
--- gtkcmctree.c	12 Oct 2012 12:47:27 -0000	1.1.2.32
+++ gtkcmctree.c	15 Nov 2012 13:41:06 -0000	1.1.2.33
@@ -957,14 +957,22 @@
 gtk_cmctree_class_init (GtkCMCTreeClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+#if !GTK_CHECK_VERSION(3, 0, 0)
   GtkObjectClass *object_class;
+#else /* for simplicity */
+  GtkWidgetClass *object_class;
+#endif
   GtkWidgetClass *widget_class;
   GtkCMCListClass *clist_class;
   GtkBindingSet *binding_set;
 
   gobject_class->constructor = gtk_cmctree_constructor;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
   object_class = (GtkObjectClass *) klass;
+#else /* for simplicity */
+  object_class = (GtkWidgetClass *) klass;
+#endif
   widget_class = (GtkWidgetClass *) klass;
   container_class = (GtkContainerClass *) klass;
   clist_class = (GtkCMCListClass *) klass;
@@ -1321,6 +1329,7 @@
     GTK_CMCTREE_ROW (node)->row.style =
       gtk_style_attach (GTK_CMCTREE_ROW (node)->row.style, clist->clist_window);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
   if (GTK_CMCTREE_ROW (node)->row.fg_set || GTK_CMCTREE_ROW (node)->row.bg_set)
     {
       GdkColormap *colormap;
@@ -1331,6 +1340,7 @@
       if (GTK_CMCTREE_ROW (node)->row.bg_set)
 	gdk_colormap_alloc_color (colormap, &(GTK_CMCTREE_ROW (node)->row.background), TRUE, TRUE);
     }
+#endif
 
   for (i = 0; i < clist->columns; i++)
     if  (GTK_CMCTREE_ROW (node)->row.cell[i].style)
@@ -4472,9 +4482,11 @@
     {
       GTK_CMCTREE_ROW (node)->row.foreground = *color;
       GTK_CMCTREE_ROW (node)->row.fg_set = TRUE;
+#if !GTK_CHECK_VERSION(3, 0, 0)
       if (gtk_widget_get_realized (GTK_WIDGET(ctree)))
 	gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
 			 &GTK_CMCTREE_ROW (node)->row.foreground, TRUE, TRUE);
+#endif
     }
   else
     GTK_CMCTREE_ROW (node)->row.fg_set = FALSE;
@@ -4494,9 +4506,11 @@
     {
       GTK_CMCTREE_ROW (node)->row.background = *color;
       GTK_CMCTREE_ROW (node)->row.bg_set = TRUE;
+#if !GTK_CHECK_VERSION(3, 0, 0)
       if (gtk_widget_get_realized (GTK_WIDGET(ctree)))
 	gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
 			 &GTK_CMCTREE_ROW (node)->row.background, TRUE, TRUE);
+#endif
     }
   else
     GTK_CMCTREE_ROW (node)->row.bg_set = FALSE;

Index: gtkshruler.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtkshruler.c,v
retrieving revision 1.1.4.23
retrieving revision 1.1.4.24
diff -u -d -r1.1.4.23 -r1.1.4.24
--- gtkshruler.c	16 Sep 2012 21:56:21 -0000	1.1.4.23
+++ gtkshruler.c	15 Nov 2012 13:41:06 -0000	1.1.4.24
@@ -150,14 +150,27 @@
 static void          gtk_shruler_unmap         (GtkWidget      *widget);
 static void          gtk_shruler_size_allocate (GtkWidget      *widget,
                                               GtkAllocation  *allocation);
+#if GTK_CHECK_VERSION(3, 0, 0)
+static void gtk_shruler_get_preferred_height (GtkWidget *widget,
+                                 gint      *minimal_height,
+                                 gint      *natural_height);
+static void gtk_shruler_get_preferred_width (GtkWidget *widget,
+                                 gint      *minimal_width,
+                                 gint      *natural_width);
+#endif
 static void          gtk_shruler_size_request  (GtkWidget      *widget,
                                               GtkRequisition *requisition);
 static void          gtk_shruler_style_set     (GtkWidget      *widget,
                                               GtkStyle       *prev_style);
 static gboolean      gtk_shruler_motion_notify (GtkWidget      *widget,
                                               GdkEventMotion *event);
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gboolean      gtk_shruler_expose        (GtkWidget      *widget,
                                               GdkEventExpose *event);
+#else
+static gboolean      gtk_shruler_expose        (GtkWidget *widget,
+                                              cairo_t *cr);
+#endif
 
 static void          gtk_shruler_draw_ticks    (GtkSHRuler      *ruler);
 static void          gtk_shruler_make_pixmap   (GtkSHRuler      *ruler);
@@ -186,10 +199,19 @@
   widget_class->map                 = gtk_shruler_map;
   widget_class->unmap               = gtk_shruler_unmap;
   widget_class->size_allocate       = gtk_shruler_size_allocate;
+#if !GTK_CHECK_VERSION(3, 0, 0)
   widget_class->size_request        = gtk_shruler_size_request;
+#else
+  widget_class->get_preferred_width = gtk_shruler_get_preferred_width;
+  widget_class->get_preferred_height = gtk_shruler_get_preferred_height;
+#endif
   widget_class->style_set           = gtk_shruler_style_set;
   widget_class->motion_notify_event = gtk_shruler_motion_notify;
+#if !GTK_CHECK_VERSION(3, 0, 0)
   widget_class->expose_event        = gtk_shruler_expose;
+#else
+  widget_class->draw                = gtk_shruler_expose;
+#endif
 
   g_type_class_add_private (object_class, sizeof (GtkSHRulerPrivate));
 
@@ -268,7 +290,11 @@
   gtkut_widget_set_has_window (GTK_WIDGET (ruler), FALSE);
 
   priv->orientation   = GTK_ORIENTATION_HORIZONTAL;
+#if !GTK_CHECK_VERSION(3, 0, 0)
   priv->unit          = GTK_PIXELS;
+#else
+  priv->unit          = 0;
+#endif
   priv->lower         = 0;
   priv->upper         = 0;
   priv->position      = 0;
@@ -684,6 +710,32 @@
     }
 }
 
+#if GTK_CHECK_VERSION(3, 0, 0)
+static void
+gtk_shruler_get_preferred_width (GtkWidget *widget,
+                                 gint      *minimal_width,
+                                 gint      *natural_width)
+{
+  GtkRequisition requisition;
+
+  gtk_shruler_size_request (widget, &requisition);
+
+  *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+gtk_shruler_get_preferred_height (GtkWidget *widget,
+                                  gint      *minimal_height,
+                                  gint      *natural_height)
+{
+  GtkRequisition requisition;
+
+  gtk_shruler_size_request (widget, &requisition);
+
+  *minimal_height = *natural_height = requisition.height;
+}
+#endif
+
 static void
 gtk_shruler_size_request (GtkWidget      *widget,
                          GtkRequisition *requisition)
@@ -743,30 +795,44 @@
   return FALSE;
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gboolean
 gtk_shruler_expose (GtkWidget      *widget,
                    GdkEventExpose *event)
+#else
+static gboolean
+gtk_shruler_expose (GtkWidget *widget,
+                    cairo_t   *cr)
+#endif
 {
   if (gtk_widget_is_drawable (widget))
     {
       GtkSHRuler        *ruler = GTK_SHRULER (widget);
       GtkSHRulerPrivate *priv  = GTK_SHRULER_GET_PRIVATE (ruler);
       GtkAllocation     allocation;
+#if !GTK_CHECK_VERSION(3, 0, 0)
       cairo_t          *cr;
+#endif
 
       gtk_shruler_draw_ticks (ruler);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
       cr = gdk_cairo_create (gtk_widget_get_window (widget));
       gdk_cairo_region (cr, event->region);
       cairo_clip (cr);
+#endif
 
       gtk_widget_get_allocation (widget, &allocation);
+#if !GTK_CHECK_VERSION(3, 0, 0)
       cairo_translate (cr, allocation.x, allocation.y);
+#endif
 
       cairo_set_source_surface (cr, priv->backing_store, 0, 0);
       cairo_paint (cr);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
       cairo_destroy (cr);
+#endif
     }
 
   return FALSE;

Index: inputdialog.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/inputdialog.c,v
retrieving revision 1.2.2.48
retrieving revision 1.2.2.49
diff -u -d -r1.2.2.48 -r1.2.2.49
--- inputdialog.c	14 Sep 2012 07:31:55 -0000	1.2.2.48
+++ inputdialog.c	15 Nov 2012 13:41:06 -0000	1.2.2.49
@@ -373,7 +373,11 @@
 	g_signal_connect(G_OBJECT(entry), "activate",
 			 G_CALLBACK(entry_activated), NULL);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
 	combo = gtk_combo_box_entry_new_text();
+#else
+	combo = gtk_combo_box_text_new_with_entry();
+#endif
 	gtk_box_pack_start(GTK_BOX(vbox), combo, FALSE, FALSE, 0);
 	g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((combo)))), "activate",
 			 G_CALLBACK(combo_activated), NULL);

Index: gtkcmclist.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/gtkcmclist.c,v
retrieving revision 1.1.2.23
retrieving revision 1.1.2.24
diff -u -d -r1.1.2.23 -r1.1.2.24
--- gtkcmclist.c	25 Oct 2011 23:00:05 -0000	1.1.2.23
+++ gtkcmclist.c	15 Nov 2012 13:41:06 -0000	1.1.2.24
@@ -185,7 +185,11 @@
 				       GObjectConstructParam *construct_params);
 
 /* GtkObject Methods */
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void gtk_cmclist_destroy  (GtkObject *object);
+#else
+static void gtk_cmclist_destroy  (GtkWidget *object);
+#endif
 static void gtk_cmclist_finalize (GObject   *object);
 static void gtk_cmclist_set_arg  (GObject *object,
 				guint      arg_id,
@@ -204,14 +208,27 @@
 static void gtk_cmclist_unrealize       (GtkWidget        *widget);
 static void gtk_cmclist_map             (GtkWidget        *widget);
 static void gtk_cmclist_unmap           (GtkWidget        *widget);
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gint gtk_cmclist_expose          (GtkWidget        *widget,
-			               GdkEventExpose   *event);
+                                         GdkEventExpose   *event);
+#else
+static gint gtk_cmclist_expose          (GtkWidget *widget,
+                                         cairo_t *event);
+#endif
 static gint gtk_cmclist_button_press    (GtkWidget        *widget,
 				       GdkEventButton   *event);
 static gint gtk_cmclist_button_release  (GtkWidget        *widget,
 				       GdkEventButton   *event);
 static gint gtk_cmclist_motion          (GtkWidget        *widget, 
 			               GdkEventMotion   *event);
+#if GTK_CHECK_VERSION(3, 0, 0)
+static void gtk_cmclist_get_preferred_height (GtkWidget *widget,
+                                 gint      *minimal_height,
+                                 gint      *natural_height);
+static void gtk_cmclist_get_preferred_width (GtkWidget *widget,
+                                 gint      *minimal_width,
+                                 gint      *natural_width);
+#endif
 static void gtk_cmclist_size_request    (GtkWidget        *widget,
 				       GtkRequisition   *requisition);
 static void gtk_cmclist_size_allocate   (GtkWidget        *widget,
@@ -487,21 +504,29 @@
 gtk_cmclist_class_init (GtkCMCListClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
+#if !GTK_CHECK_VERSION(3, 0, 0)
   GtkObjectClass *gtk_object_class;
+#endif
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
   GtkBindingSet *binding_set;
 
   object_class->constructor = gtk_cmclist_constructor;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
   gtk_object_class = (GtkObjectClass *) klass;
+#endif
   widget_class = (GtkWidgetClass *) klass;
   container_class = (GtkContainerClass *) klass;
 
   parent_class = g_type_class_peek (GTK_TYPE_CONTAINER);
 
   object_class->finalize = gtk_cmclist_finalize;
+#if !GTK_CHECK_VERSION(3, 0, 0)
   gtk_object_class->destroy = gtk_cmclist_destroy;
+#else
+  widget_class->destroy = gtk_cmclist_destroy;
+#endif
   object_class->set_property = gtk_cmclist_set_arg;
   object_class->get_property = gtk_cmclist_get_arg;
   
@@ -513,8 +538,17 @@
   widget_class->button_press_event = gtk_cmclist_button_press;
   widget_class->button_release_event = gtk_cmclist_button_release;
   widget_class->motion_notify_event = gtk_cmclist_motion;
+#if !GTK_CHECK_VERSION(3, 0, 0)
   widget_class->expose_event = gtk_cmclist_expose;
+#else
+  widget_class->draw = gtk_cmclist_expose;
+#endif
+#if !GTK_CHECK_VERSION(3, 0, 0)
   widget_class->size_request = gtk_cmclist_size_request;
+#else
+  widget_class->get_preferred_width = gtk_cmclist_get_preferred_width;
+  widget_class->get_preferred_height = gtk_cmclist_get_preferred_height;
+#endif
   widget_class->size_allocate = gtk_cmclist_size_allocate;
   widget_class->focus_in_event = gtk_cmclist_focus_in;
   widget_class->focus_out_event = gtk_cmclist_focus_out;
@@ -623,6 +657,7 @@
 				"sort-type",
 				GTK_TYPE_SORT_TYPE, 0,
 				G_PARAM_READWRITE));
+#if !GTK_CHECK_VERSION(3, 0, 0)
   widget_class->set_scroll_adjustments_signal =
  		g_signal_new ("set_scroll_adjustments",
 			      G_TYPE_FROM_CLASS (object_class),
@@ -632,6 +667,7 @@
 			      claws_marshal_VOID__OBJECT_OBJECT,
 			      G_TYPE_NONE, 2,
 			      GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
+#endif
 
   clist_signals[SELECT_ROW] =
  		g_signal_new ("select_row",
@@ -922,9 +958,9 @@
 				"toggle_add_mode", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, GDK_CONTROL_MASK,
 				"toggle_add_mode", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK,
 				"select_all", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_KP_Divide, GDK_CONTROL_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Divide, GDK_CONTROL_MASK,
 				"select_all", 0);
   gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
 				"unselect_all", 0);
@@ -3273,9 +3309,11 @@
     {
       clist_row->foreground = *color;
       clist_row->fg_set = TRUE;
+#if !GTK_CHECK_VERSION(3, 0, 0)
       if (gtk_widget_get_realized (GTK_WIDGET(clist)))
 	gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
 			 &clist_row->foreground, TRUE, TRUE);
+#endif
     }
   else
     clist_row->fg_set = FALSE;
@@ -3302,9 +3340,11 @@
     {
       clist_row->background = *color;
       clist_row->bg_set = TRUE;
+#if !GTK_CHECK_VERSION(3, 0, 0)
       if (gtk_widget_get_realized (GTK_WIDGET(clist)))
 	gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
 			 &clist_row->background, TRUE, TRUE);
+#endif
     }
   else
     clist_row->bg_set = FALSE;
@@ -4411,7 +4451,11 @@
  *   gtk_cmclist_finalize
  */
 static void
+#if !GTK_CHECK_VERSION(3, 0, 0)
 gtk_cmclist_destroy (GtkObject *object)
+#else
+gtk_cmclist_destroy (GtkWidget *object)
+#endif
 {
   gint i;
   GtkCMCList *clist;
@@ -4459,8 +4503,13 @@
 	clist->column[i].button = NULL;
       }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
   if (GTK_OBJECT_CLASS (parent_class)->destroy)
     (*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+#else
+  if (GTK_WIDGET_CLASS (parent_class)->destroy)
+    (*GTK_WIDGET_CLASS (parent_class)->destroy) (object);
+#endif
 }
 
 static void
@@ -4526,13 +4575,19 @@
   attributes.height = allocation.height - border_width * 2;
   attributes.wclass = GDK_INPUT_OUTPUT;
   attributes.visual = gtk_widget_get_visual (widget);
+#if !GTK_CHECK_VERSION(3, 0, 0)
   attributes.colormap = gtk_widget_get_colormap (widget);
+#endif
   attributes.event_mask = gtk_widget_get_events (widget);
   attributes.event_mask |= (GDK_EXPOSURE_MASK |
 			    GDK_BUTTON_PRESS_MASK |
 			    GDK_BUTTON_RELEASE_MASK |
 			    GDK_KEY_RELEASE_MASK);
+#if !GTK_CHECK_VERSION(3, 0, 0)
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+#else
+  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+#endif
 
   /* main window */
   window = gtk_widget_get_window (widget);
@@ -4584,8 +4639,13 @@
   gdk_window_set_background (clist->clist_window,
 			     &style->base[GTK_STATE_NORMAL]);
   gdk_window_show (clist->clist_window);
+#if GTK_CHECK_VERSION(2,24,0)
+  clist->clist_window_width = gdk_window_get_width(clist->clist_window);
+  clist->clist_window_height = gdk_window_get_height(clist->clist_window);
+#else
   gdk_drawable_get_size (clist->clist_window, &clist->clist_window_width,
 		       &clist->clist_window_height);
+#endif
 
   /* create resize windows */
   attributes.wclass = GDK_INPUT_ONLY;
@@ -4626,6 +4686,7 @@
 	clist_row->style = gtk_style_attach (clist_row->style,
 					     clist->clist_window);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
       if (clist_row->fg_set || clist_row->bg_set)
 	{
 	  GdkColormap *colormap;
@@ -4636,6 +4697,7 @@
 	  if (clist_row->bg_set)
 	    gdk_colormap_alloc_color (colormap, &clist_row->background, TRUE, TRUE);
 	}
+#endif
       
       for (j = 0; j < clist->columns; j++)
 	if  (clist_row->cell[j].style)
@@ -4806,9 +4868,15 @@
     }
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gint
 gtk_cmclist_expose (GtkWidget      *widget,
 		  GdkEventExpose *event)
+#else
+static gint
+gtk_cmclist_expose (GtkWidget *widget,
+          cairo_t *event)
+#endif
 {
   GtkCMCList *clist;
 
@@ -4820,19 +4888,40 @@
       clist = GTK_CMCLIST (widget);
 
       /* exposure events on the list */
+#if !GTK_CHECK_VERSION(3, 0, 0)
       if (event->window == clist->clist_window)
 	draw_rows (clist, &event->area);
+#else
+      if (gtk_cairo_should_draw_window (event, clist->clist_window))
+        {
+	GdkRectangle area;
 
+	/* FIXME: get proper area */
+	if (gdk_cairo_get_clip_rectangle (event, &area))
+	  draw_rows (clist, &area);
+        }
+#endif
+
+#if !GTK_CHECK_VERSION(3, 0, 0)
       if (event->window == clist->title_window)
+#else
+      if (gtk_cairo_should_draw_window (event, clist->title_window))
+#endif
 	{
 	  gint i;
 	  
 	  for (i = 0; i < clist->columns; i++)
 	    {
 	      if (clist->column[i].button) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
 		gtk_container_propagate_expose (GTK_CONTAINER (clist),
 						clist->column[i].button,
 						event);
+#else
+		gtk_container_propagate_draw (GTK_CONTAINER (clist),
+						clist->column[i].button,
+						event);
+#endif
 	      }
 	    }
 	}
@@ -5361,6 +5450,32 @@
   return FALSE;
 }
 
+#if GTK_CHECK_VERSION(3, 0, 0)
+static void
+gtk_cmclist_get_preferred_width (GtkWidget *widget,
+                                 gint      *minimal_width,
+                                 gint      *natural_width)
+{
+  GtkRequisition requisition;
+
+  gtk_cmclist_size_request (widget, &requisition);
+
+  *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+gtk_cmclist_get_preferred_height (GtkWidget *widget,
+                                  gint      *minimal_height,
+                                  gint      *natural_height)
+{
+  GtkRequisition requisition;
+
+  gtk_cmclist_size_request (widget, &requisition);
+
+  *minimal_height = *natural_height = requisition.height;
+}
+#endif
+
 static void
 gtk_cmclist_size_request (GtkWidget      *widget,
 			GtkRequisition *requisition)

Index: gtkutils.h
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtkutils.h,v
retrieving revision 1.4.2.67
retrieving revision 1.4.2.68
diff -u -d -r1.4.2.67 -r1.4.2.68
--- gtkutils.h	7 Jul 2012 07:30:57 -0000	1.4.2.67
+++ gtkutils.h	15 Nov 2012 13:41:06 -0000	1.4.2.68
@@ -42,9 +42,7 @@
 #include "main.h"
 #endif
 
-#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmctree.h"
-#endif
 
 #ifndef GDK_KEY_Escape
 #include "gdkkeysyms-new.h"
@@ -98,7 +96,6 @@
 				   GtkWidget **button2, const gchar *label2, const gchar *text2,
 				   GtkWidget **button3, const gchar *label3, const gchar *text3);
 
-#if !GTK_CHECK_VERSION(3, 0, 0)
 void gtkut_ctree_node_move_if_on_the_edge
 					(GtkCMCTree	*ctree,
 					 GtkCMCTreeNode	*node,
@@ -120,7 +117,6 @@
 					 GtkCMCTreeNode 	*node);
 void gtkut_ctree_set_focus_row		(GtkCMCTree	*ctree,
 					 GtkCMCTreeNode	*node);
-#endif
 
 void gtkut_clist_set_focus_row		(GtkCMCList	*clist,
 					 gint		 row);
@@ -224,6 +220,24 @@
 		gtk_widget_set_has_tooltip(GTK_WIDGET(widget), FALSE);	\
 }
 
+#if GTK_CHECK_VERSION (3, 2, 0)
+#define GTK_TYPE_VBOX GTK_TYPE_BOX
+#define GtkVBox GtkBox
+#define GtkVBoxClass GtkBoxClass
+#define gtk_vbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
+    "homogeneous", hmg, "spacing", spc, \
+    "orientation", GTK_ORIENTATION_VERTICAL, NULL)
+#define GTK_TYPE_HBOX GTK_TYPE_BOX
+#define GtkHBox GtkBox
+#define GtkHBoxClass GtkBoxClass
+#define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
+    "homogeneous", hmg, "spacing", spc, \
+    "orientation", GTK_ORIENTATION_HORIZONTAL, NULL)
+#define gtk_hseparator_new() g_object_new (GTK_TYPE_SEPARATOR, NULL)
+#define gtk_hpaned_new() g_object_new (GTK_TYPE_PANED, NULL)
+#define gtk_vpaned_new() g_object_new (GTK_TYPE_PANED, \
+    "orientation", GTK_ORIENTATION_VERTICAL, NULL)
+#endif
 #if !GTK_CHECK_VERSION(2,22,0)
 #define gdk_drag_context_get_selected_action(x) ((x)->action)
 #define gdk_drag_context_get_actions(x) ((x)->actions)

Index: gtksctree.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtksctree.c,v
retrieving revision 1.1.4.65
retrieving revision 1.1.4.66
diff -u -d -r1.1.4.65 -r1.1.4.66
--- gtksctree.c	12 Oct 2012 12:47:27 -0000	1.1.4.65
+++ gtksctree.c	15 Nov 2012 13:41:06 -0000	1.1.4.66
@@ -1188,7 +1188,7 @@
 
 	gtk_cmclist_freeze (clist);
 
-	if (clist->selection_mode == GTK_SELECTION_EXTENDED) {
+	if (clist->selection_mode == GTK_SELECTION_MULTIPLE) {
 		GTK_CMCLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
       
 		g_list_free (clist->undo_selection);
@@ -1231,7 +1231,7 @@
 
 	gtk_cmclist_freeze (clist);
 
-	if (clist->selection_mode == GTK_SELECTION_EXTENDED) {
+	if (clist->selection_mode == GTK_SELECTION_MULTIPLE) {
 		GTK_CMCLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
 
 		g_list_free (clist->undo_selection);
@@ -1278,7 +1278,7 @@
 
 	clist = GTK_CMCLIST (ctree);
   
-	if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED) {
+	if (update_focus_row && clist->selection_mode == GTK_SELECTION_MULTIPLE) {
 		GTK_CMCLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
 
 		g_list_free (clist->undo_selection);
@@ -1388,7 +1388,7 @@
 
 	clist = GTK_CMCLIST (ctree);
 
-	if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED) {
+	if (update_focus_row && clist->selection_mode == GTK_SELECTION_MULTIPLE) {
 		GTK_CMCLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
 
 		g_list_free (clist->undo_selection);

Index: quicksearch.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/quicksearch.c,v
retrieving revision 1.1.2.119
retrieving revision 1.1.2.120
diff -u -d -r1.1.2.119 -r1.1.2.120
--- quicksearch.c	8 Nov 2012 09:09:37 -0000	1.1.2.119
+++ quicksearch.c	15 Nov 2012 13:41:06 -0000	1.1.2.120
@@ -714,7 +714,11 @@
 
 	gtk_widget_show(search_type);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
 	search_string_entry = gtk_combo_box_entry_new_text ();
+#else
+	search_string_entry = gtk_combo_box_text_new_with_entry ();
+#endif
 	gtk_combo_box_set_active(GTK_COMBO_BOX(search_string_entry), -1);
 
 	vbox = gtk_vbox_new(TRUE, 0);
@@ -942,7 +946,9 @@
 #endif
 	} else {
 		gtk_widget_set_sensitive(quicksearch->clear_search, FALSE);
+#if !GTK_CHECK_VERSION(3, 0, 0)
 		if (colors_initialised) {
+#endif
 			gtk_widget_modify_base(
 				gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
 				GTK_STATE_NORMAL, NULL);

Index: gtkutils.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtkutils.c,v
retrieving revision 1.5.2.105
retrieving revision 1.5.2.106
diff -u -d -r1.5.2.105 -r1.5.2.106
--- gtkutils.c	8 Nov 2012 11:42:27 -0000	1.5.2.105
+++ gtkutils.c	15 Nov 2012 13:41:06 -0000	1.5.2.106
@@ -27,9 +27,7 @@
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
-#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtk/gtksctree.h"
-#endif
 #include <stdlib.h>
 #include <stdarg.h>
 #include <sys/stat.h>
@@ -52,9 +50,7 @@
 #include "defs.h"
 #include "gtkutils.h"
 #include "utils.h"
-#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtksctree.h"
-#endif
 #include "codeconv.h"
 #include "stock_pixmap.h"
 #include "menu.h"
@@ -674,7 +670,7 @@
 				     "scroll_vertical", 2,
 				     G_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
 				     G_TYPE_FLOAT, 0.0);
-	gtk_binding_entry_add_signal(binding_set, GDK_p, GDK_CONTROL_MASK,
+	gtk_binding_entry_add_signal(binding_set, GDK_KEY_p, GDK_CONTROL_MASK,
 				     "scroll_vertical", 2,
 				     G_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
 				     G_TYPE_FLOAT, 0.0);

Index: gtkcmclist.h
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/gtkcmclist.h,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -d -r1.1.2.9 -r1.1.2.10
--- gtkcmclist.h	23 Oct 2011 22:22:19 -0000	1.1.2.9
+++ gtkcmclist.h	15 Nov 2012 13:41:06 -0000	1.1.2.10
@@ -35,6 +35,16 @@
 G_BEGIN_DECLS
 
 
+#if GTK_CHECK_VERSION(3, 0, 0)
+/* Generic visibility flags */
+typedef enum
+{
+  GTK_VISIBILITY_NONE,
+  GTK_VISIBILITY_PARTIAL,
+  GTK_VISIBILITY_FULL
+} GtkVisibility;
+#endif
+
 /* clist flags */
 enum {
   GTK_CMCLIST_IN_DRAG             = 1 <<  0,

Index: Makefile.am
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Makefile.am,v
retrieving revision 1.20.2.28
retrieving revision 1.20.2.29
diff -u -d -r1.20.2.28 -r1.20.2.29
--- Makefile.am	17 Oct 2011 09:01:27 -0000	1.20.2.28
+++ Makefile.am	15 Nov 2012 13:41:06 -0000	1.20.2.29
@@ -8,10 +8,7 @@
 
 if GTK2
 gtk2_sources = \
-	gtkcmctree.c \
-	gtkcmclist.c \
-	gtkcmoptionmenu.c \
-	gtksctree.c
+	gtkcmoptionmenu.c
 endif
 
 libclawsgtk_la_SOURCES = \
@@ -23,6 +20,9 @@
 	filesel.c \
 	foldersort.c \
 	gtkaspell.c \
+	gtkcmctree.c \
+	gtkcmclist.c \
+	gtksctree.c \
 	gtkunit.c \
 	$(gtk2_sources) \
 	gtkshruler.c \

Index: combobox.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/combobox.c,v
retrieving revision 1.1.2.26
retrieving revision 1.1.2.27
diff -u -d -r1.1.2.26 -r1.1.2.27
--- combobox.c	7 Jul 2012 07:09:34 -0000	1.1.2.26
+++ combobox.c	15 Nov 2012 13:41:06 -0000	1.1.2.27
@@ -45,16 +45,31 @@
 	if(text == NULL)
 		return NULL;
 	
+#if !GTK_CHECK_VERSION(2, 24, 0)
 	if (with_entry)
 		combo = gtk_combo_box_entry_new_text();
 	else
 		combo = gtk_combo_box_new_text();
+#else
+	if (with_entry)
+		combo = gtk_combo_box_text_new_with_entry();
+	else
+		combo = gtk_combo_box_text_new();
+#endif
 	gtk_widget_show(combo);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
 	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), text);
+#else
+	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), text);
+#endif
 	va_start(args, text);
 	while ((string = va_arg(args, gchar*)) != NULL)
+#if !GTK_CHECK_VERSION(2, 24, 0)
 		gtk_combo_box_append_text(GTK_COMBO_BOX(combo), string);
+#else
+		gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), string);
+#endif
 	va_end(args);
 		
 	gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
@@ -82,7 +97,9 @@
 {
 	GtkTreeModel *model;
 	ComboboxSelCtx *ctx = NULL;
+
 	cm_return_if_fail(combobox != NULL);
+	cm_return_if_fail(GTK_IS_COMBO_BOX (combobox));
 
 	model = gtk_combo_box_get_model(combobox);
 
@@ -102,6 +119,9 @@
 	const gchar *data = ctx->cdata;
 	const gchar *curdata;
 
+	cm_return_val_if_fail(combobox != NULL, FALSE);
+	cm_return_val_if_fail(GTK_IS_COMBO_BOX (combobox), FALSE);
+
 	gtk_tree_model_get (GTK_TREE_MODEL(model), iter, 0, &curdata, -1);
 	if (!g_utf8_collate(data, curdata)) {
 		gtk_combo_box_set_active_iter(combobox, iter);
@@ -115,13 +135,19 @@
 {
 	GtkTreeModel *model;
 	ComboboxSelCtx *ctx = NULL;
+#if !GTK_CHECK_VERSION(2, 24, 0)
 	GtkComboBoxClass *class;
+#endif
 
 	cm_return_if_fail(combobox != NULL);
+#if !GTK_CHECK_VERSION(2, 24, 0)
 	class = GTK_COMBO_BOX_GET_CLASS (combobox);
 
 	/* we can do that only with gtk_combo_box_new_text() combo boxes */
 	cm_return_if_fail(class->get_active_text != NULL);
+#else
+	cm_return_if_fail(GTK_IS_COMBO_BOX (combobox));
+#endif
 
 	model = gtk_combo_box_get_model(combobox);
 
@@ -141,7 +167,7 @@
 	gint data;
 
 	cm_return_val_if_fail(combobox != NULL, -1);
-
+	cm_return_val_if_fail(GTK_IS_COMBO_BOX (combobox), -1);
 	cm_return_val_if_fail(gtk_combo_box_get_active_iter(combobox, &iter), -1);
 
 	model = gtk_combo_box_get_model(combobox);
@@ -151,28 +177,51 @@
 	return data;
 }
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
 void combobox_unset_popdown_strings(GtkComboBox *combobox)
+#else
+void combobox_unset_popdown_strings(GtkComboBoxText *combobox)
+#endif
 {
 	GtkTreeModel *model;
 	gint count, i;
 
 	cm_return_if_fail(combobox != NULL);
+#if GTK_CHECK_VERSION(2, 24, 0)
+	cm_return_if_fail(GTK_IS_COMBO_BOX_TEXT (combobox));
+#endif
 
-	model = gtk_combo_box_get_model(combobox);
+	model = gtk_combo_box_get_model(GTK_COMBO_BOX(combobox));
 	count = gtk_tree_model_iter_n_children(model, NULL);
 	for (i = 0; i < count; i++)
+#if !GTK_CHECK_VERSION(2, 24, 0)
 		gtk_combo_box_remove_text(combobox, 0);
+#else
+		gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(combobox), 0);
+#endif
 }
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
 void combobox_set_popdown_strings(GtkComboBox *combobox,
+#else
+void combobox_set_popdown_strings(GtkComboBoxText *combobox,
+#endif
 				 GList       *list)
 {
 	GList *cur;
 
 	cm_return_if_fail(combobox != NULL);
+#if GTK_CHECK_VERSION(2, 24, 0)
+	cm_return_if_fail(GTK_IS_COMBO_BOX_TEXT (combobox));
+#endif
 
 	for (cur = list; cur != NULL; cur = g_list_next(cur))
+#if !GTK_CHECK_VERSION(2, 24, 0)
 		gtk_combo_box_append_text(combobox, (const gchar*) cur->data);
+#else
+		gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox),
+						(const gchar*) cur->data);
+#endif
 }
 
 gboolean combobox_set_value_from_arrow_key(GtkComboBox *combobox,
@@ -205,9 +254,14 @@
 		/* if current text is in list, get prev or next one */
 
 		if (keyval == GDK_KEY_Up) {
+#if !GTK_CHECK_VERSION(2, 24, 0)
 			gchar *text = gtk_combo_box_get_active_text(combobox);
 			if (!text)
 				text = gtk_editable_get_chars(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(combobox))),0,-1);
+#else
+			gchar *text = NULL;
+			gtk_tree_model_get(model, &iter, 0, &text, -1);
+#endif
 			valid = gtkut_tree_model_text_iter_prev(model, &iter, text);
 			g_free(text);
 		} else



More information about the Commits mailing list