2012-11-15 [colin] 3.9.0cvs4
authorColin Leroy <colin@colino.net>
Thu, 15 Nov 2012 13:41:07 +0000 (13:41 +0000)
committerColin Leroy <colin@colino.net>
Thu, 15 Nov 2012 13:41:07 +0000 (13:41 +0000)
* 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

41 files changed:
ChangeLog
PATCHSETS
configure.ac
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/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/main.c
src/mainwindow.c
src/message_search.c
src/plugins/pgpcore/Makefile.am
src/plugins/pgpinline/Makefile.am
src/plugins/pgpmime/Makefile.am
src/plugins/smime/Makefile.am
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

index 4bb0870..0010578 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+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
+
 2012-11-15 [wwp]       3.9.0cvs3
 
        * doc/man/claws-mail.1
index 4a05924..efc9583 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.9.2.25 -r 1.9.2.26 po/cs.po;  cvs diff -u -r 1.1.2.28 -r 1.1.2.29 po/fi.po;  cvs diff -u -r 1.2.2.36 -r 1.2.2.37 po/sk.po;  ) > 3.9.0cvs1.patchset
 ( cvs diff -u -r 1.3.2.39 -r 1.3.2.40 src/ssl_manager.c;  cvs diff -u -r 1.9.2.37 -r 1.9.2.38 src/gtk/sslcertwindow.c;  ) > 3.9.0cvs2.patchset
 ( cvs diff -u -r 1.1.2.12 -r 1.1.2.13 doc/man/claws-mail.1;  cvs diff -u -r 1.115.2.259 -r 1.115.2.260 src/main.c;  ) > 3.9.0cvs3.patchset
+( cvs diff -u -r 1.155.2.103 -r 1.155.2.104 src/Makefile.am;  cvs diff -u -r 1.12.2.77 -r 1.12.2.78 src/action.c;  cvs diff -u -r 1.27.2.65 -r 1.27.2.66 src/addr_compl.c;  cvs diff -u -r 1.60.2.152 -r 1.60.2.153 src/addressbook.c;  cvs diff -u -r 1.5.10.39 -r 1.5.10.40 src/addrgather.c;  cvs diff -u -r 1.382.2.617 -r 1.382.2.618 src/compose.c;  cvs diff -u -r 1.14.2.65 -r 1.14.2.66 src/editaddress.c;  cvs diff -u -r 1.11.2.30 -r 1.11.2.31 src/editgroup.c;  cvs diff -u -r 1.115.2.260 -r 1.115.2.261 src/main.c;  cvs diff -u -r 1.274.2.354 -r 1.274.2.355 src/mainwindow.c;  cvs diff -u -r 1.3.12.43 -r 1.3.12.44 src/message_search.c;  cvs diff -u -r 1.16.2.46 -r 1.16.2.47 src/prefs_display_header.c;  cvs diff -u -r 1.1.4.79 -r 1.1.4.80 src/prefs_filtering_action.c;  cvs diff -u -r 1.43.2.96 -r 1.43.2.97 src/prefs_matcher.c;  cvs diff -u -r 1.1.2.48 -r 1.1.2.49 src/prefs_other.c;  cvs diff -u -r 1.30.2.75 -r 1.30.2.76 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.40 -r 1.1.2.41 src/printing.c;  cvs diff -u -r 1.25.2.76 -r 1.25.2.77 src/stock_pixmap.c;  cvs diff -u -r 1.15.2.74 -r 1.15.2.75 src/summary_search.c;  cvs diff -u -r 1.395.2.456 -r 1.395.2.457 src/summaryview.c;  cvs diff -u -r 1.96.2.254 -r 1.96.2.255 src/textview.c;  cvs diff -u -r 1.20.2.28 -r 1.20.2.29 src/gtk/Makefile.am;  cvs diff -u -r 1.2.2.37 -r 1.2.2.38 src/gtk/colorlabel.c;  cvs diff -u -r 1.1.2.26 -r 1.1.2.27 src/gtk/combobox.c;  cvs diff -u -r 1.1.2.16 -r 1.1.2.17 src/gtk/combobox.h;  cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/gtk/gtkcmclist.c;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/gtk/gtkcmclist.h;  cvs diff -u -r 1.1.2.32 -r 1.1.2.33 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.4.65 -r 1.1.4.66 src/gtk/gtksctree.c;  cvs diff -u -r 1.1.4.23 -r 1.1.4.24 src/gtk/gtkshruler.c;  cvs diff -u -r 1.5.2.105 -r 1.5.2.106 src/gtk/gtkutils.c;  cvs diff -u -r 1.4.2.67 -r 1.4.2.68 src/gtk/gtkutils.h;  cvs diff -u -r 1.2.2.48 -r 1.2.2.49 src/gtk/inputdialog.c;  cvs diff -u -r 1.1.2.119 -r 1.1.2.120 src/gtk/quicksearch.c;  cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/plugins/pgpcore/Makefile.am;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/plugins/pgpinline/Makefile.am;  cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/plugins/pgpmime/Makefile.am;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/plugins/smime/Makefile.am;  ) > 3.9.0cvs4.patchset
index 488badf..2ab5b3e 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=9
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=3
+EXTRA_VERSION=4
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index bb162be..785cbdb 100644 (file)
@@ -15,7 +15,7 @@ install-exec-hook:
        @ln -s claws-mail $(DESTDIR)$(bindir)/sylpheed-claws
 
 if PLATFORM_WIN32
-LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
      `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
      sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
 
index 60dfc72..0862743 100644 (file)
@@ -1432,7 +1432,7 @@ static void create_io_dialog(Children *children)
                gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(progress_bar),
                                GTK_PROGRESS_LEFT_TO_RIGHT);
 #else
-               gtk_orientable_set_orientation(GTK_PROGRESS_BAR(progress_bar),
+               gtk_orientable_set_orientation(GTK_ORIENTABLE(progress_bar),
                                GTK_ORIENTATION_HORIZONTAL);
                gtk_progress_bar_set_inverted(GTK_PROGRESS_BAR(progress_bar),
                                FALSE);
index 89f1b56..de6731e 100644 (file)
@@ -859,11 +859,20 @@ static void addrcompl_resize_window( CompletionWindow *cw ) {
        gint x, y, width, height, depth;
 
        /* Get current geometry of window */
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gdk_window_get_geometry( gtk_widget_get_window( cw->window ), &x, &y, &width, &height, &depth );
+#else
+       gdk_window_get_geometry( gtk_widget_get_window( cw->window ), &x, &y, &width, &height );
+#endif
 
        /* simple _hide breaks size requisition !? */
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_widget_hide_all( cw->window );
        gtk_widget_show_all( cw->window );
+#else
+       gtk_widget_hide( cw->window );
+       gtk_widget_show( cw->window );
+#endif
        gtk_widget_size_request( cw->list_view, &r );
 
        /* Adjust window height to available screen space */
@@ -1369,7 +1378,11 @@ static void address_completion_create_completion_window( GtkEntry *entry_ )
                GTK_SHADOW_OUT);
        /* Use entry widget to create initial window */
        gdkwin = gtk_widget_get_window(entry),
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gdk_window_get_geometry(gdkwin, &x, &y, &width, &height, &depth);
+#else
+       gdk_window_get_geometry(gdkwin, &x, &y, &width, &height);
+#endif
        gdk_window_get_origin (gdkwin, &x, &y);
        y += height;
        gtk_window_move(GTK_WINDOW(window), x, y);
index 92b79e5..56dbd23 100644 (file)
@@ -1068,7 +1068,7 @@ static void addressbook_create(void)
        /* Address list */
        clist = gtk_sctree_new_with_titles(N_LIST_COLS, 0, list_titles);
        gtk_container_add(GTK_CONTAINER(clist_swin), clist);
-       gtk_cmclist_set_selection_mode(GTK_CMCLIST(clist), GTK_SELECTION_EXTENDED);
+       gtk_cmclist_set_selection_mode(GTK_CMCLIST(clist), GTK_SELECTION_MULTIPLE);
        gtk_cmctree_set_line_style(GTK_CMCTREE(clist), GTK_CMCTREE_LINES_NONE);
        gtk_cmctree_set_expander_style(GTK_CMCTREE(clist),
                             GTK_CMCTREE_EXPANDER_TRIANGLE);
index cc87e35..fc04382 100644 (file)
@@ -324,7 +324,7 @@ static void addrgather_page_fields(gint pageNum, gchar *pageLbl)
 #ifndef USE_NEW_ADDRBOOK
        GtkWidget *hboxs;
        GtkWidget *spinbtnFolder;
-       GtkObject *adjFolder;
+       GtkWidget *adjFolder;
 #endif
        GtkWidget *checkRecurse;
        gint top;
index 4520069..ac7614c 100644 (file)
@@ -4758,8 +4758,11 @@ compose_current_mail_account(void)
 static void compose_select_account(Compose *compose, PrefsAccount *account,
                                   gboolean init)
 {
-       gchar *from = NULL, *header;
+       gchar *from = NULL, *header = NULL;
        ComposeHeaderEntry *header_entry;
+#if GTK_CHECK_VERSION(2, 24, 0)
+       GtkTreeIter iter;
+#endif
 
        cm_return_if_fail(account != NULL);
 
@@ -4798,7 +4801,13 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
        }
        
        header_entry = (ComposeHeaderEntry *) compose->header_list->data;
+#if !GTK_CHECK_VERSION(2, 24, 0)
        header = gtk_combo_box_get_active_text(GTK_COMBO_BOX(header_entry->combo));
+#else
+       if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(header_entry->combo), &iter))
+               gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(
+                       header_entry->combo)), &iter, COMBOBOX_TEXT, &header, -1);
+#endif
        
        if (header && !strlen(gtk_entry_get_text(GTK_ENTRY(header_entry->entry)))) {
                if (account->protocol == A_NNTP) {
@@ -6661,9 +6670,11 @@ static void compose_create_header_entry(Compose *compose)
        
        headerentry = g_new0(ComposeHeaderEntry, 1);
 
-       /* Combo box */
+       /* Combo box model */
        model = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN);
+#if !GTK_CHECK_VERSION(2, 24, 0)
        combo = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(model), 0);
+#endif
        COMBOBOX_ADD(model, prefs_common_translated_header_name("To:"),
                        COMPOSE_TO);
        COMBOBOX_ADD(model, prefs_common_translated_header_name("Cc:"),
@@ -6678,6 +6689,14 @@ static void compose_create_header_entry(Compose *compose)
                        COMPOSE_FOLLOWUPTO);
        compose_add_extra_header_entries(model);
 
+       /* Combo box */
+#if GTK_CHECK_VERSION(2, 24, 0)
+       combo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(model));
+       GtkCellRenderer *cell = gtk_cell_renderer_text_new();
+       gtk_cell_renderer_set_alignment(cell, 0.0, 0.5);
+       gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE);
+       gtk_combo_box_set_entry_text_column(combo, 0);
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(combo))), "grab_focus",
                         G_CALLBACK(compose_grab_focus_cb), compose);
@@ -7034,7 +7053,11 @@ static GtkWidget *compose_create_others(Compose *compose)
        g_signal_connect(G_OBJECT(savemsg_checkbtn), "toggled",
                         G_CALLBACK(compose_savemsg_checkbtn_cb), compose);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        savemsg_combo = gtk_combo_box_entry_new_text();
+#else
+       savemsg_combo = gtk_combo_box_text_new_with_entry();
+#endif
        compose->savemsg_checkbtn = savemsg_checkbtn;
        compose->savemsg_combo = savemsg_combo;
        gtk_widget_show(savemsg_combo);
@@ -8878,7 +8901,11 @@ static void compose_attach_property_create(gboolean *cancelled)
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, (0 + 1), 
                         GTK_FILL, 0, 0, 0); 
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        mimetype_entry = gtk_combo_box_entry_new_text(); 
+#else
+       mimetype_entry = gtk_combo_box_text_new_with_entry();
+#endif
        gtk_table_attach(GTK_TABLE(table), mimetype_entry, 1, 2, 0, (0 + 1), 
                         GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
                         
@@ -8900,7 +8927,11 @@ static void compose_attach_property_create(gboolean *cancelled)
 
        for (mime_type_list = strlist; mime_type_list != NULL; 
                mime_type_list = mime_type_list->next) {
+#if !GTK_CHECK_VERSION(2, 24, 0)
                gtk_combo_box_append_text(GTK_COMBO_BOX(mimetype_entry), mime_type_list->data);
+#else
+               gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(mimetype_entry), mime_type_list->data);
+#endif
                g_free(mime_type_list->data);
        }
        g_list_free(strlist);
@@ -9344,8 +9375,12 @@ static void account_activated(GtkComboBox *optmenu, gpointer data)
        GSList *list, *saved_list = NULL;
        HeaderEntryState *state;
        GtkRcStyle *style = NULL;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        static GdkColor yellow;
        static gboolean color_set = FALSE;
+#else
+       static GdkColor yellow = { (guint32)0, (guint32)0xf5, (guint32)0xf6, (guint32)0xbe };
+#endif
 
        /* Get ID of active account in the combo box */
        menu = gtk_combo_box_get_model(optmenu);
@@ -9373,12 +9408,14 @@ static void account_activated(GtkComboBox *optmenu, gpointer data)
                                        GTK_EDITABLE(hentry->entry), 0, -1);
                        state->type = hentry->type;
                                
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        if (!color_set) {
                                gdk_color_parse("#f5f6be", &yellow);
                                color_set = gdk_colormap_alloc_color(
                                                        gdk_colormap_get_system(),
                                                        &yellow, FALSE, TRUE);
                        }
+#endif
                                
                        style = gtk_widget_get_modifier_style(hentry->entry);
                        state->entry_marked = gdk_color_equal(&yellow,
index a901a03..b4f8ce5 100644 (file)
@@ -1328,7 +1328,11 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        entry_name = gtk_combo_box_entry_new_text ();
+#else
+       entry_name = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_table_attach(GTK_TABLE(table), entry_name, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
 
        /* Next row */
@@ -1344,7 +1348,11 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        entry_name = gtk_combo_box_entry_new_text ();
+#else
+       entry_name = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_table_attach(GTK_TABLE(table), entry_name, 1, 2, 0, 1, GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
 
        /* Next row */
index fd3f391..517c7a9 100644 (file)
@@ -356,7 +356,7 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
        gtk_cmctree_set_expander_style(GTK_CMCTREE(clist_group),
                             GTK_CMCTREE_EXPANDER_TRIANGLE);
        gtk_sctree_set_stripes(GTK_SCTREE(clist_group), prefs_common.use_stripes_in_summaries);
-       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_group), GTK_SELECTION_EXTENDED );
+       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_group), GTK_SELECTION_MULTIPLE );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_group), GROUP_COL_NAME, GROUP_COL_WIDTH_NAME );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_group), GROUP_COL_EMAIL, GROUP_COL_WIDTH_EMAIL );
        gtk_cmclist_set_compare_func( GTK_CMCLIST(clist_group), edit_group_list_compare_func );
@@ -388,7 +388,7 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
        gtk_cmctree_set_line_style(GTK_CMCTREE(clist_avail), GTK_CMCTREE_LINES_NONE);
        gtk_cmctree_set_expander_style(GTK_CMCTREE(clist_avail),
                             GTK_CMCTREE_EXPANDER_TRIANGLE);
-       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_avail), GTK_SELECTION_EXTENDED );
+       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_avail), GTK_SELECTION_MULTIPLE );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_avail), GROUP_COL_NAME, GROUP_COL_WIDTH_NAME );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_avail), GROUP_COL_EMAIL, GROUP_COL_WIDTH_EMAIL );
        gtk_cmclist_set_compare_func( GTK_CMCLIST(clist_avail), edit_group_list_compare_func );
index 706ef25..5e7ee67 100644 (file)
@@ -8,10 +8,7 @@ EXTRA_DIST = \
 
 if GTK2
 gtk2_sources = \
-       gtkcmctree.c \
-       gtkcmclist.c \
-       gtkcmoptionmenu.c \
-       gtksctree.c
+       gtkcmoptionmenu.c
 endif
 
 libclawsgtk_la_SOURCES = \
@@ -23,6 +20,9 @@ libclawsgtk_la_SOURCES = \
        filesel.c \
        foldersort.c \
        gtkaspell.c \
+       gtkcmctree.c \
+       gtkcmclist.c \
+       gtksctree.c \
        gtkunit.c \
        $(gtk2_sources) \
        gtkshruler.c \
index bcfcc11..0a36610 100644 (file)
@@ -376,9 +376,15 @@ static void refresh_menu (GtkWidget *menushell, gpointer data)
 {
        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 5f04f43..db0e68f 100644 (file)
@@ -45,16 +45,31 @@ GtkWidget *combobox_text_new(const gboolean with_entry, const gchar *text, ...)
        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 @@ void combobox_select_by_data(GtkComboBox *combobox, gint data)
 {
        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 @@ static gboolean _select_by_text_func(GtkTreeModel *model,   GtkTreePath *path,
        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 @@ void combobox_select_by_text(GtkComboBox *combobox, const gchar *data)
 {
        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 combobox_get_active_data(GtkComboBox *combobox)
        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 @@ gint combobox_get_active_data(GtkComboBox *combobox)
        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 @@ gboolean combobox_set_value_from_arrow_key(GtkComboBox *combobox,
                /* 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
index 3722c70..0218ece 100644 (file)
@@ -61,9 +61,17 @@ void combobox_select_by_text (GtkComboBox            *combobox,
 
 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 7f09cb3..db17f9d 100644 (file)
@@ -185,7 +185,11 @@ static GObject* gtk_cmclist_constructor (GType                  type,
                                       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_realize         (GtkWidget        *widget);
 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 @@ static void
 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 @@ gtk_cmclist_class_init (GtkCMCListClass *klass)
   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 @@ gtk_cmclist_class_init (GtkCMCListClass *klass)
                                "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 @@ gtk_cmclist_class_init (GtkCMCListClass *klass)
                              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 @@ gtk_cmclist_class_init (GtkCMCListClass *klass)
                                "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 @@ gtk_cmclist_set_foreground (GtkCMCList       *clist,
     {
       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 @@ gtk_cmclist_set_background (GtkCMCList       *clist,
     {
       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 @@ sync_selection (GtkCMCList *clist,
  *   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 @@ gtk_cmclist_destroy (GtkObject *object)
        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 @@ gtk_cmclist_realize (GtkWidget *widget)
   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 @@ gtk_cmclist_realize (GtkWidget *widget)
   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 @@ gtk_cmclist_realize (GtkWidget *widget)
        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 @@ gtk_cmclist_realize (GtkWidget *widget)
          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 @@ gtk_cmclist_unmap (GtkWidget *widget)
     }
 }
 
+#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 @@ gtk_cmclist_expose (GtkWidget      *widget,
       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 @@ gtk_cmclist_motion (GtkWidget      *widget,
   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 bf92390..b2518c2 100644 (file)
 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 a88f365..ca65ca8 100644 (file)
@@ -957,14 +957,22 @@ static void
 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 @@ ctree_attach_styles (GtkCMCTree     *ctree,
     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 @@ ctree_attach_styles (GtkCMCTree     *ctree,
       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_node_set_foreground (GtkCMCTree       *ctree,
     {
       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_node_set_background (GtkCMCTree       *ctree,
     {
       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 2861ea0..f08a8b8 100644 (file)
@@ -1188,7 +1188,7 @@ gtk_sctree_sort_recursive (GtkCMCTree     *ctree,
 
        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_sctree_sort_node (GtkCMCTree     *ctree,
 
        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 @@ gtk_sctree_unlink (GtkCMCTree     *ctree,
 
        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 @@ gtk_sctree_link (GtkCMCTree     *ctree,
 
        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 2a00bdb..9060106 100644 (file)
@@ -150,14 +150,27 @@ static void          gtk_shruler_map           (GtkWidget      *widget);
 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 @@ gtk_shruler_class_init (GtkSHRulerClass *klass)
   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 @@ gtk_shruler_init (GtkSHRuler *ruler)
   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 @@ gtk_shruler_size_allocate (GtkWidget     *widget,
     }
 }
 
+#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 @@ gtk_shruler_motion_notify (GtkWidget      *widget,
   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 e981b6d..3bb9141 100644 (file)
@@ -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 @@ static void gtkut_clist_bindings_add(GtkWidget *clist)
                                     "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 69863a4..47d8561 100644 (file)
@@ -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 @@ void gtkut_stock_with_text_button_set_create(GtkWidget **bbox,
                                   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 @@ gboolean gtkut_ctree_node_is_parent (GtkCMCTreeNode         *parent,
                                         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 @@ claws_input_add    (gint         source,
                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 09b6046..6f3a8df 100644 (file)
@@ -373,7 +373,11 @@ static void input_dialog_create(gboolean is_password)
        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 e6bd7af..c485c9d 100644 (file)
@@ -714,7 +714,11 @@ QuickSearch *quicksearch_new()
 
        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 @@ static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
 #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 6e9b246..daa8ae6 100644 (file)
@@ -1116,7 +1116,9 @@ int main(int argc, char *argv[])
 
 #ifdef CRASH_DIALOG
        if (cmd.crash) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_set_locale();
+#endif
                gtk_init(&argc, &argv);
                crash_main(cmd.crash_params);
 #ifdef G_OS_WIN32
@@ -1145,7 +1147,9 @@ int main(int argc, char *argv[])
 
        reset_statistics();
        
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_set_locale();
+#endif
        gtk_init(&argc, &argv);
 
 #ifdef G_OS_WIN32
@@ -1200,9 +1204,11 @@ int main(int argc, char *argv[])
        hildon_program = HILDON_PROGRAM(hildon_program_get_instance());
        static_osso_context = osso_context;
 #endif 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_widget_set_default_colormap(
                gdk_screen_get_system_colormap(
                        gdk_screen_get_default()));
+#endif
 
        gtkut_create_ui_manager();
 
index 47aee19..ac02149 100644 (file)
@@ -1177,7 +1177,7 @@ static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refr
        accel_path = g_strdup_printf("<ClawsColorLabels>/None");
        gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
        g_free(accel_path);
-       gtk_accel_map_add_entry("<ClawsColorLabels>/None", GDK_0, GDK_CONTROL_MASK);
+       gtk_accel_map_add_entry("<ClawsColorLabels>/None", GDK_KEY_0, GDK_CONTROL_MASK);
 
        item = gtk_menu_item_new();
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
@@ -1197,7 +1197,7 @@ static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refr
                accel_path = g_strdup_printf("<ClawsColorLabels>/%d", i+1);
                gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
                if (i < 9)
-                       gtk_accel_map_add_entry(accel_path, GDK_1+i, GDK_CONTROL_MASK);
+                       gtk_accel_map_add_entry(accel_path, GDK_KEY_1+i, GDK_CONTROL_MASK);
                g_free(accel_path);
                g_signal_connect (gtk_ui_manager_get_accel_group(mainwin->ui_manager), 
                        "accel-changed", G_CALLBACK (mainwin_accel_changed_cb), item);
@@ -1302,7 +1302,7 @@ static void mainwindow_tags_menu_create(MainWindow *mainwin, gboolean refresh)
        accel_path = g_strdup_printf("<ClawsTags>/ApplyTags");
        gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
        g_free(accel_path);
-       gtk_accel_map_add_entry("<ClawsTags>/ApplyTags", GDK_T, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
+       gtk_accel_map_add_entry("<ClawsTags>/ApplyTags", GDK_KEY_T, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
 
        g_slist_free(orig);
        gtk_widget_show(menu);
index f470b73..37ac1cb 100644 (file)
@@ -186,7 +186,11 @@ static void message_search_create(void)
        gtk_widget_show (body_label);
        gtk_box_pack_start (GTK_BOX (hbox1), body_label, FALSE, FALSE, 0);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        body_entry = gtk_combo_box_entry_new_text ();
+#else
+       body_entry = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(body_entry), -1);
        if (prefs_common.message_search_history)
                combobox_set_popdown_strings(GTK_COMBO_BOX(body_entry),
@@ -275,7 +279,11 @@ static void message_search_execute(gboolean backward)
        gboolean all_searched = FALSE;
        gchar *body_str;
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        body_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
+#else
+       body_str = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(search_window.body_entry));
+#endif
        if (!body_str)
                body_str = gtk_editable_get_chars(
                                GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.body_entry))),0,-1);
index 3d645cd..680253d 100644 (file)
@@ -2,7 +2,7 @@ EXTRA_DIST = version.rc plugin.def claws.def
 
 if OS_WIN32
 
-LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
      `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
      sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
 
index ba56c3f..0690ae4 100644 (file)
@@ -3,7 +3,7 @@ EXTRA_DIST = version.rc plugin.def claws.def mypgpcore.def pgpinline.deps
 
 if OS_WIN32
 
-LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
      `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
      sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
 
index 4290257..0cf7269 100644 (file)
@@ -2,7 +2,7 @@ EXTRA_DIST = version.rc plugin.def claws.def mypgpcore.def pgpmime.deps
 
 if OS_WIN32
 
-LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
      `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
      sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
 
index ccfb23f..b7894ea 100644 (file)
@@ -3,7 +3,7 @@ EXTRA_DIST = version.rc plugin.def claws.def mypgpcore.def smime.deps
 
 if OS_WIN32
 
-LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
      `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
      sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
 
index 0e8af23..5ea5252 100644 (file)
@@ -275,9 +275,17 @@ static void prefs_display_header_create(void)
        gtk_widget_show (hdr_label);
        gtk_box_pack_start (GTK_BOX (hbox1), hdr_label, FALSE, FALSE, 0);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        hdr_combo = gtk_combo_box_entry_new_text();
+#else
+       hdr_combo = gtk_combo_box_text_new_with_entry();
+#endif
        for(i=0; i < 9 ; i++)
+#if !GTK_CHECK_VERSION(2, 24, 0)
                gtk_combo_box_append_text(GTK_COMBO_BOX (hdr_combo),
+#else
+               gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (hdr_combo),
+#endif
                        (*defaults[i] == '-') ? defaults[i]+1 : defaults[i]);
        gtk_combo_box_set_active(GTK_COMBO_BOX(hdr_combo), 0);
        gtk_widget_show (hdr_combo);
@@ -579,7 +587,11 @@ static void prefs_display_header_list_view_set_row(gboolean hidden)
        gchar *entry_text;
        GtkTreeModel *model;
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        entry_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(dispheader.hdr_combo));
+#else
+       entry_text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(dispheader.hdr_combo));
+#endif
        if (!entry_text)
                entry_text = gtk_editable_get_chars(
                                GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(dispheader.hdr_combo))),0,-1);
index 597b9b9..7c01caa 100644 (file)
@@ -488,14 +488,22 @@ static void prefs_filtering_action_create(void)
        gtk_table_attach(GTK_TABLE(table), hbox1, 1, 2, 1, 2, 
                         GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        account_combo = gtk_combo_box_new_text ();
+#else
+       account_combo = gtk_combo_box_text_new ();
+#endif
        gtk_size_group_add_widget(size_action, account_combo);
 
        for (accounts = account_get_list() ; accounts != NULL;
             accounts = accounts->next) {
                PrefsAccount *ac = (PrefsAccount *)accounts->data;
                gchar *name = g_strdup(ac->account_name);
+#if !GTK_CHECK_VERSION(2, 24, 0)
                gtk_combo_box_append_text(GTK_COMBO_BOX(account_combo), (gpointer) name);
+#else
+               gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), (gpointer) name);
+#endif
                g_free(name);
        }
 
@@ -533,14 +541,22 @@ static void prefs_filtering_action_create(void)
        gtk_box_pack_start(GTK_BOX(hbox1), color_optmenu, FALSE, FALSE, 0);
 #endif
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        tags_combo = gtk_combo_box_new_text ();
+#else
+       tags_combo = gtk_combo_box_text_new ();
+#endif
        gtk_size_group_add_widget(size_action, tags_combo);
 
        for (tmp = tags = tags_get_list() ; tmp != NULL;
             tmp = tmp->next) {
                gchar *name = g_strdup(tags_get_tag(GPOINTER_TO_INT(tmp->data)));
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
                gtk_combo_box_append_text(GTK_COMBO_BOX(tags_combo), (gpointer) name);
+#else
+               gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(tags_combo), (gpointer) name);
+#endif
                g_free(name);
        }
        g_slist_free(tags);
@@ -966,7 +982,11 @@ static FilteringAction * prefs_filtering_action_dialog_to_action(gboolean alert)
                break;
        case ACTION_SET_TAG:
        case ACTION_UNSET_TAG:
+#if !GTK_CHECK_VERSION(2, 24, 0)
                destination = gtk_combo_box_get_active_text(GTK_COMBO_BOX(filtering_action.tags_combo));
+#else
+               destination = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(filtering_action.tags_combo));
+#endif
                if (!destination || *destination == '\0') {
                        if (alert)
                                 alertpanel_error(_("Tag name is empty."));
@@ -1308,10 +1328,12 @@ static void prefs_filtering_action_enable_widget(GtkWidget* widget, const gboole
                        gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
                else if(GTK_IS_SPIN_BUTTON(widget))
                        gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), 0);
-               else if(GTK_IS_ENTRY(widget)) {
+               else if(GTK_IS_ENTRY(widget))
                        gtk_entry_set_text(GTK_ENTRY(widget), "");
-               } else if(GTK_IS_CMOPTION_MENU(widget))
+#if !GTK_CHECK_VERSION(3, 0, 0)
+               else if(GTK_IS_CMOPTION_MENU(widget))
                        gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(widget), 0);
+#endif
                
                gtk_widget_set_sensitive(widget, TRUE);
                gtk_widget_show(widget);
index 5de48d5..bb5cc87 100644 (file)
@@ -534,7 +534,9 @@ static void prefs_matcher_create(void)
 
        GtkWidget *test_btn;
        GtkWidget *addressbook_select_btn;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *color_optmenu;
+#endif
 
        static GdkGeometry geometry;
        GtkSizeGroup *size_group;
@@ -641,7 +643,11 @@ static void prefs_matcher_create(void)
        gtk_box_pack_start(GTK_BOX(upper_hbox), criteria_label2, FALSE, FALSE, 0);
 
        /* headers combo box entry */
+#if !GTK_CHECK_VERSION(2, 24, 0)
        headers_combo = gtk_combo_box_entry_new_with_model(matcher.model_headers, 0);
+#else
+       headers_combo = gtk_combo_box_new_with_model_and_entry(matcher.model_headers);
+#endif
        gtk_widget_set_size_request(headers_combo, 100, -1);
        gtk_box_pack_start(GTK_BOX(upper_hbox), headers_combo, TRUE, TRUE, 0);
        header_entry = gtk_bin_get_child(GTK_BIN((headers_combo)));
@@ -842,7 +848,9 @@ static void prefs_matcher_create(void)
 #ifndef USE_NEW_ADDRBOOK
        matcher.addressbook_select_btn = addressbook_select_btn;
 #endif
+#if !GTK_CHECK_VERSION(3, 0, 0)
        matcher.color_optmenu = color_optmenu;
+#endif
        matcher.match_label = match_label;
        matcher.criteria_label2 = criteria_label2;
        matcher.headers_combo = headers_combo;
index 53d3566..8ff9ff5 100644 (file)
@@ -399,7 +399,11 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Actions>/Menu/Edit/Advanced/DelForwWord",            "<alt>D"}, /* - */
        };
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(keybind.combo));
+#else
+       text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(keybind.combo));
+#endif
 
        if (!strcmp(text, _("Default"))) {
                menurc = default_menurc;
index a437dcc..792a7f0 100644 (file)
@@ -368,7 +368,11 @@ static void prefs_toolbar_set_displayed(ToolbarPage *prefs_toolbar)
 
 static void add_item_to_plugin_combo(gpointer key, gpointer data, gpointer combo_box)
 {
+#if !GTK_CHECK_VERSION(2, 24, 0)
        gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), (const gchar*)key);
+#else
+       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), (const gchar*)key);
+#endif
 }
 
 static void prefs_toolbar_populate(ToolbarPage *prefs_toolbar)
@@ -387,8 +391,13 @@ static void prefs_toolbar_populate(ToolbarPage *prefs_toolbar)
                        act = (gchar *)cur->data;
                        get_action_name(act, &act_name);
                        
+#if !GTK_CHECK_VERSION(2, 24, 0)
                        gtk_combo_box_append_text(
                                GTK_COMBO_BOX(prefs_toolbar->item_action_combo),
+#else
+                       gtk_combo_box_text_append_text(
+                               GTK_COMBO_BOX_TEXT(prefs_toolbar->item_action_combo),
+#endif
                                act_name);
 
                        g_free(act_name);
@@ -510,7 +519,11 @@ static void prefs_toolbar_register(GtkButton *button, ToolbarPage *prefs_toolbar
                }
                                
                if (item_type == ITEM_FUNCTION) {
+#if !GTK_CHECK_VERSION(2, 24, 0)
                        event = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
+#else
+                       event = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
+#endif
                                                prefs_toolbar->item_func_combo));
                                                
                        if (is_duplicate(prefs_toolbar, event)) {
@@ -596,7 +609,11 @@ static void prefs_toolbar_substitute(GtkButton *button, ToolbarPage *prefs_toolb
                                                  -1);
                
                if (item_type == ITEM_FUNCTION) {
+#if !GTK_CHECK_VERSION(2, 24, 0)
                        icon_event = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
+#else
+                       icon_event = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
+#endif
                                                prefs_toolbar->item_func_combo));
                                                
                        if (is_duplicate(prefs_toolbar, icon_event)
@@ -790,7 +807,11 @@ static void item_type_changed(GtkComboBox *item_type_combo,
 static void action_selection_changed(GtkComboBox *action_combo,
                                ToolbarPage *prefs_toolbar)
 {
+#if !GTK_CHECK_VERSION(2, 24, 0)
        gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
+#else
+       gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
+#endif
                           prefs_toolbar->item_action_combo));
 
        if(text != NULL) { /* action */
@@ -802,7 +823,11 @@ static void action_selection_changed(GtkComboBox *action_combo,
 static void plugin_selection_changed(GtkComboBox *action_combo,
                 ToolbarPage *prefs_toolbar)
 {
+#if !GTK_CHECK_VERSION(2, 24, 0)
        gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(prefs_toolbar->item_plugin_combo));
+#else
+       gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(prefs_toolbar->item_plugin_combo));
+#endif
 
        if (text != NULL) { /* action */
                gtk_entry_set_text(GTK_ENTRY(prefs_toolbar->item_text_entry), text);
@@ -813,7 +838,11 @@ static void plugin_selection_changed(GtkComboBox *action_combo,
 static void func_selection_changed(GtkComboBox *action_combo,
                                ToolbarPage *prefs_toolbar)
 {
+#if !GTK_CHECK_VERSION(2, 24, 0)
        gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
+#else
+       gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
+#endif
                           prefs_toolbar->item_func_combo));
 
        if(text != NULL) { /* action */
@@ -921,21 +950,33 @@ static void prefs_toolbar_create(ToolbarPage *prefs_toolbar)
                          (GtkAttachOptions) (GTK_FILL),
                          (GtkAttachOptions) (0), 0, 0);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        item_action_combo = gtk_combo_box_new_text();
+#else
+       item_action_combo = gtk_combo_box_text_new();
+#endif
        gtk_widget_set_size_request(item_action_combo, 200, -1);
        gtk_table_attach (GTK_TABLE (table), item_action_combo, 1, 3, 1, 2,
                          (GtkAttachOptions) (GTK_FILL),
                          (GtkAttachOptions) (0), 0, 0);
                          
        /* available internal functions */
+#if !GTK_CHECK_VERSION(2, 24, 0)
        item_func_combo = gtk_combo_box_new_text();
+#else
+       item_func_combo = gtk_combo_box_text_new();
+#endif
        gtk_widget_set_size_request(item_func_combo, 200, -1);
        gtk_table_attach (GTK_TABLE (table), item_func_combo, 1, 3, 1, 2,
                          (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                          (GtkAttachOptions) (0), 0, 0);
        
        /* plugin-registered items */
+#if !GTK_CHECK_VERSION(2, 24, 0)
        item_plugin_combo = gtk_combo_box_new_text();
+#else
+       item_plugin_combo = gtk_combo_box_text_new();
+#endif
        gtk_widget_set_size_request(item_plugin_combo, 200, -1);
        gtk_table_attach(GTK_TABLE(table), item_plugin_combo, 1, 3, 1, 2,
                         (GtkAttachOptions) (GTK_FILL),
index c48a6d3..f118b28 100644 (file)
@@ -658,7 +658,7 @@ static void cb_preview_got_page_size(GtkPrintOperationPreview *preview,
 static gboolean cb_preview_expose(GtkWidget *widget, GdkEventExpose *event,
                                  gpointer data)
 #else
-static gboolean cb_preview_expose(GtkWidget *widget, cairo_t *event,
+static gboolean cb_preview_expose(GtkWidget *widget, cairo_t *cr,
                                  gpointer data)
 #endif
 {
@@ -677,8 +677,6 @@ static gboolean cb_preview_expose(GtkWidget *widget, cairo_t *event,
        cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
 #if !GTK_CHECK_VERSION(3, 0, 0)
        cairo_rectangle(cr, event->area.x, event->area.y, event->area.width, event->area.height);
-#else
-       cairo_rectangle(cr, 0, 0, event->area.width, event->area.height);
 #endif
        cairo_fill(cr);
 
index 46ea5fe..8cc23ff 100644 (file)
@@ -770,9 +770,11 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
        stock_wid = stock_pixmap_widget(window, icon);
        gtk_widget_get_requisition(stock_wid, &requisition);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        if (gtk_image_get_storage_type(GTK_IMAGE(stock_wid)) == GTK_IMAGE_PIXMAP)
                data->is_pixmap = TRUE;
        else
+#endif
                data->is_pixmap = FALSE;
 
        if (data->is_pixmap) {
index 338fc40..6c6ba49 100644 (file)
@@ -171,7 +171,11 @@ static gchar* add_history_get(GtkWidget *from, GList **history)
 {
        gchar *result;
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        result = gtk_combo_box_get_active_text(GTK_COMBO_BOX(from));
+#else
+       result = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(from));
+#endif
        if (!result)
                result = gtk_editable_get_chars(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(from))), 0, -1);
 
@@ -300,7 +304,11 @@ static void summary_search_create(void)
        gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
        gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        from_entry = gtk_combo_box_entry_new_text ();
+#else
+       from_entry = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(from_entry), -1);
        if (prefs_common.summary_search_from_history)
                combobox_set_popdown_strings(GTK_COMBO_BOX(from_entry),
@@ -315,7 +323,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((from_entry)))),
                         "focus_out_event", G_CALLBACK(from_entry_focus_evt_out), NULL);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        to_entry = gtk_combo_box_entry_new_text ();
+#else
+       to_entry = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(to_entry), -1);
        if (prefs_common.summary_search_to_history)
                combobox_set_popdown_strings(GTK_COMBO_BOX(to_entry),
@@ -330,7 +342,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((to_entry)))),
                         "focus_out_event", G_CALLBACK(to_entry_focus_evt_out), NULL);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        subject_entry = gtk_combo_box_entry_new_text ();
+#else
+       subject_entry = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(subject_entry), -1);
        if (prefs_common.summary_search_subject_history)
                combobox_set_popdown_strings(GTK_COMBO_BOX(subject_entry),
@@ -345,7 +361,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((subject_entry)))),
                         "focus_out_event", G_CALLBACK(subject_entry_focus_evt_out), NULL);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        body_entry = gtk_combo_box_entry_new_text ();
+#else
+       body_entry = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(body_entry), -1);
        if (prefs_common.summary_search_body_history)
                combobox_set_popdown_strings(GTK_COMBO_BOX(body_entry),
@@ -360,7 +380,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((body_entry)))),
                         "focus_out_event", G_CALLBACK(body_entry_focus_evt_out), NULL);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        adv_condition_entry = gtk_combo_box_entry_new_text ();
+#else
+       adv_condition_entry = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(adv_condition_entry), -1);
        if (prefs_common.summary_search_adv_condition_history)
                combobox_set_popdown_strings(GTK_COMBO_BOX(adv_condition_entry),
@@ -874,7 +898,11 @@ static void adv_condition_btn_clicked(GtkButton *button, gpointer data)
 
        /* re-use the current search value if it's a condition expression,
           otherwise ignore it silently */
+#if !GTK_CHECK_VERSION(2, 24, 0)
        cond_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
+#else
+       cond_str = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(search_window.adv_condition_entry));
+#endif
        if (cond_str && *cond_str != '\0') {
                matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
        }
index 5441055..b78ccbf 100644 (file)
@@ -6001,7 +6001,11 @@ static void summary_colorlabel_menu_create(SummaryView *summaryview, gboolean re
        accel_path = g_strdup_printf("<ClawsColorLabels>/None");
        gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
        g_free(accel_path);
+#if !GTK_CHECK_VERSION(2, 24, 0)
        gtk_accel_map_add_entry("<ClawsColorLabels>/None", GDK_0, GDK_CONTROL_MASK);
+#else
+       gtk_accel_map_add_entry("<ClawsColorLabels>/None", GDK_KEY_0, GDK_CONTROL_MASK);
+#endif
 
        item = gtk_menu_item_new();
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
@@ -6021,7 +6025,11 @@ static void summary_colorlabel_menu_create(SummaryView *summaryview, gboolean re
                accel_path = g_strdup_printf("<ClawsColorLabels>/%d", i+1);
                gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
                if (i < 9)
+#if !GTK_CHECK_VERSION(2, 24, 0)
                        gtk_accel_map_add_entry(accel_path, GDK_1+i, GDK_CONTROL_MASK);
+#else
+                       gtk_accel_map_add_entry(accel_path, GDK_KEY_1+i, GDK_CONTROL_MASK);
+#endif
                g_free(accel_path);
                g_signal_connect (gtk_ui_manager_get_accel_group(mainwindow_get_mainwindow()->ui_manager), 
                        "accel-changed", G_CALLBACK (mainwin_accel_changed_cb), item);
@@ -6415,7 +6423,7 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
        if (prefs_common.show_col_headers == FALSE)
                gtk_cmclist_column_titles_hide(GTK_CMCLIST(ctree));
 
-       gtk_cmclist_set_selection_mode(GTK_CMCLIST(ctree), GTK_SELECTION_EXTENDED);
+       gtk_cmclist_set_selection_mode(GTK_CMCLIST(ctree), GTK_SELECTION_MULTIPLE);
        gtk_cmclist_set_column_justification(GTK_CMCLIST(ctree), col_pos[S_COL_MARK],
                                           GTK_JUSTIFY_CENTER);
        gtk_cmclist_set_column_justification(GTK_CMCLIST(ctree), col_pos[S_COL_STATUS],
index 8c4b6e7..01215be 100644 (file)
@@ -2128,6 +2128,7 @@ static void textview_show_contact_pic(TextView *textview)
        GError *error = NULL;
        GdkPixbuf *picture = NULL;
        gint w, h;
+       GtkAllocation allocation;
                                
        if (prefs_common.display_header_pane
        ||  !prefs_common.display_xface)
@@ -2172,7 +2173,8 @@ static void textview_show_contact_pic(TextView *textview)
 
        gtk_widget_show(textview->image);
        
-       x = textview->text->allocation.width - WIDTH -5;
+       gtk_widget_get_allocation(textview->text, &allocation);
+       x = allocation.width - WIDTH -5;
 
        gtk_text_view_add_child_in_window(text, textview->image, 
                GTK_TEXT_WINDOW_TEXT, x, 5);