[Commits] Makefile.am 1.20.2.24 1.20.2.25 colorlabel.c 1.2.2.34 1.2.2.35 gtkutils.c 1.5.2.97 1.5.2.98 gtkutils.h 1.4.2.57 1.4.2.58 logwindow.c 1.1.4.39 1.1.4.40 menu.c 1.5.2.43 1.5.2.44 menu.h 1.4.2.24 1.4.2.25 quicksearch.c 1.1.2.104 1.1.2.105 spell_entry.c 1.1.2.11 1.1.2.12
colin at claws-mail.org
colin at claws-mail.org
Fri Oct 7 11:40:18 CEST 2011
Update of /home/claws-mail/claws/src/gtk
In directory claws-mail:/tmp/cvs-serv26650/src/gtk
Modified Files:
Tag: gtk2
Makefile.am colorlabel.c gtkutils.c gtkutils.h logwindow.c
menu.c menu.h quicksearch.c spell_entry.c
Log Message:
2011-10-07 [colin] 3.7.10cvs21
* configure.ac
* src/action.c
* src/addr_compl.c
* src/addrgather.c
* src/compose.c
* src/compose.h
* src/editldap.c
* src/mainwindow.c
* src/message_search.c
* src/mimeview.c
* src/mimeview.h
* src/prefs_account.c
* src/prefs_compose_writing.c
* src/prefs_filtering_action.c
* src/prefs_folder_item.c
* src/prefs_logging.c
* src/prefs_matcher.c
* src/prefs_message.c
* src/prefs_other.c
* src/prefs_receive.c
* src/prefs_summaries.c
* src/prefs_wrapping.c
* src/printing.c
* src/ssl_manager.c
* src/statusbar.c
* src/stock_pixmap.c
* src/summary_search.c
* src/textview.c
* src/gtk/Makefile.am
* src/gtk/colorlabel.c
* src/gtk/gtkutils.c
* src/gtk/gtkutils.h
* src/gtk/logwindow.c
* src/gtk/menu.c
* src/gtk/menu.h
* src/gtk/quicksearch.c
* src/gtk/spell_entry.c
* src/plugins/bogofilter/bogofilter_gtk.c
* src/plugins/dillo_viewer/dillo_viewer.c
* src/plugins/pgpcore/prefs_gpg.c
* src/plugins/spamassassin/spamassassin_gtk.c
Bug #2371, "Port to GTK+ 3.0". Third patch from Hanno, starting
the real job. GtkCMOptionMenu and GTKHSRuler disabled, should be
ported (especially GtkCMOptionMenu)
Index: spell_entry.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/spell_entry.c,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -d -r1.1.2.11 -r1.1.2.12
--- spell_entry.c 16 Feb 2011 07:16:22 -0000 1.1.2.11
+++ spell_entry.c 7 Oct 2011 09:40:16 -0000 1.1.2.12
@@ -45,9 +45,15 @@
static void claws_spell_entry_init (ClawsSpellEntry *entry);
static void claws_spell_entry_editable_init (GtkEditableClass *iface);
static void claws_spell_entry_finalize (GObject *object);
+#if !GTK_CHECK_VERSION(3, 0, 0)
static void claws_spell_entry_destroy (GtkObject *object);
static gint claws_spell_entry_expose (GtkWidget *widget,
GdkEventExpose *event);
+#else
+static void claws_spell_entry_destroy (GtkWidget *object);
+static gint claws_spell_entry_expose (GtkWidget *widget,
+ cairo_t *cr);
+#endif
static gint claws_spell_entry_button_press (GtkWidget *widget,
GdkEventButton *event);
static gboolean claws_spell_entry_popup_menu (GtkWidget *widget,
@@ -76,7 +82,9 @@
static void claws_spell_entry_class_init(ClawsSpellEntryClass *klass)
{
GObjectClass *g_object_class;
+#if !GTK_CHECK_VERSION(3, 0, 0)
GtkObjectClass *gtk_object_class;
+#endif
GtkWidgetClass *widget_class;
parent_class = g_type_class_peek_parent(klass);
@@ -84,12 +92,19 @@
g_object_class = G_OBJECT_CLASS(klass);
g_object_class->finalize = claws_spell_entry_finalize;
+#if !GTK_CHECK_VERSION(3, 0, 0)
gtk_object_class = GTK_OBJECT_CLASS(klass);
gtk_object_class->destroy = claws_spell_entry_destroy;
+#endif
widget_class = GTK_WIDGET_CLASS(klass);
- widget_class->expose_event = claws_spell_entry_expose;
widget_class->button_press_event = claws_spell_entry_button_press;
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ widget_class->expose_event = claws_spell_entry_expose;
+#else
+ widget_class->draw = claws_spell_entry_expose;
+ widget_class->destroy = claws_spell_entry_destroy;
+#endif
g_type_class_add_private(g_object_class,
sizeof(struct _ClawsSpellEntryPriv));
@@ -129,10 +144,17 @@
G_OBJECT_CLASS(parent_class)->finalize(object);
}
+#if !GTK_CHECK_VERSION(3, 0, 0)
static void claws_spell_entry_destroy(GtkObject *object)
{
GTK_OBJECT_CLASS(parent_class)->destroy(object);
}
+#else
+static void claws_spell_entry_destroy(GtkWidget *object)
+{
+ GTK_WIDGET_CLASS(parent_class)->destroy(object);
+}
+#endif
GtkWidget *claws_spell_entry_new(void)
{
@@ -436,7 +458,11 @@
}
}
+#if !GTK_CHECK_VERSION(3, 0, 0)
static gint claws_spell_entry_expose(GtkWidget *widget, GdkEventExpose *event)
+#else
+static gint claws_spell_entry_expose(GtkWidget *widget, cairo_t *cr)
+#endif
{
ClawsSpellEntry *entry = CLAWS_SPELL_ENTRY(widget);
GtkEntry *gtk_entry = GTK_ENTRY(widget);
@@ -447,7 +473,11 @@
pango_layout_set_attributes(layout, entry->priv->attr_list);
}
+#if !GTK_CHECK_VERSION(3, 0, 0)
return GTK_WIDGET_CLASS(parent_class)->expose_event (widget, event);
+#else
+ return GTK_WIDGET_CLASS(parent_class)->draw (widget, cr);
+#endif
}
static gint claws_spell_entry_button_press(GtkWidget *widget, GdkEventButton *event)
Index: colorlabel.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/colorlabel.c,v
retrieving revision 1.2.2.34
retrieving revision 1.2.2.35
diff -u -d -r1.2.2.34 -r1.2.2.35
--- colorlabel.c 7 Oct 2011 09:08:57 -0000 1.2.2.34
+++ colorlabel.c 7 Oct 2011 09:40:15 -0000 1.2.2.35
@@ -189,20 +189,28 @@
}
static gboolean colorlabel_drawing_area_expose_event_cb
+#if !GTK_CHECK_VERSION(3, 0, 0)
(GtkWidget *widget, GdkEventExpose *expose, gpointer data)
+#else
+ (GtkWidget *widget, cairo_t *cr, gpointer data)
+#endif
{
- GdkDrawable *drawable = gtk_widget_get_window(widget);
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ cairo_t *cr;
+ GdkWindow *drawable = gtk_widget_get_window(widget);
+#endif
GtkAllocation allocation;
gulong c = (gulong) GPOINTER_TO_INT(data);
GdkColor color;
- cairo_t *cr;
INTCOLOR_TO_GDKCOLOR(c, color)
+#if !GTK_CHECK_VERSION(3, 0, 0)
gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &color, FALSE, TRUE);
+ cr = gdk_cairo_create(drawable);
+#endif
gtk_widget_get_allocation(widget, &allocation);
- cr = gdk_cairo_create(drawable);
cairo_set_source_rgb(cr, 0., 0., 0.);
cairo_rectangle(cr, 0, 0,
allocation.width - 1,
@@ -213,7 +221,9 @@
allocation.width - 2,
allocation.height - 2);
cairo_fill(cr);
+#if !GTK_CHECK_VERSION(3, 0, 0)
cairo_destroy(cr);
+#endif
return FALSE;
}
@@ -231,11 +241,19 @@
(CL(g) << (gulong) 8) | \
(CL(b)))
+#if !GTK_CHECK_VERSION(3, 0, 0)
g_signal_connect(G_OBJECT(widget), "expose_event",
G_CALLBACK
(colorlabel_drawing_area_expose_event_cb),
GINT_TO_POINTER
((gint)CR(color.red, color.green, color.blue)));
+#else
+ g_signal_connect(G_OBJECT(widget), "draw",
+ G_CALLBACK
+ (colorlabel_drawing_area_expose_event_cb),
+ GINT_TO_POINTER
+ ((gint)CR(color.red, color.green, color.blue)));
+#endif
return widget;
}
Index: gtkutils.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtkutils.c,v
retrieving revision 1.5.2.97
retrieving revision 1.5.2.98
diff -u -d -r1.5.2.97 -r1.5.2.98
--- gtkutils.c 7 Oct 2011 09:17:51 -0000 1.5.2.97
+++ gtkutils.c 7 Oct 2011 09:40:16 -0000 1.5.2.98
@@ -26,7 +26,9 @@
#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>
@@ -49,7 +51,9 @@
#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"
@@ -1215,9 +1219,11 @@
{
GtkWidget *btn;
GtkWidget *btn_label;
+#if !GTK_CHECK_VERSION(3, 0, 0)
GdkColormap *cmap;
- GdkColor uri_color[2] = {{0, 0, 0, 0xffff}, {0, 0xffff, 0, 0}};
gboolean success[2];
+#endif
+ GdkColor uri_color[2] = {{0, 0, 0, 0xffff}, {0, 0xffff, 0, 0}};
gchar *local_url = NULL;
if (!url)
return NULL;
@@ -1230,9 +1236,11 @@
btn = gtk_button_new_with_label(label?label:url);
gtk_button_set_relief(GTK_BUTTON(btn), GTK_RELIEF_NONE);
btn_label = gtk_bin_get_child(GTK_BIN((btn)));
+#if !GTK_CHECK_VERSION(3, 0, 0)
cmap = gdk_drawable_get_colormap(gtk_widget_get_window(window));
gdk_colormap_alloc_colors(cmap, uri_color, 2, FALSE, TRUE, success);
if (success[0] == TRUE && success[1] == TRUE) {
+#endif
GtkStyle *style;
gtk_widget_ensure_style(btn_label);
style = gtk_style_copy
@@ -1241,8 +1249,10 @@
style->fg[GTK_STATE_ACTIVE] = uri_color[1];
style->fg[GTK_STATE_PRELIGHT] = uri_color[0];
gtk_widget_set_style(btn_label, style);
+#if !GTK_CHECK_VERSION(3, 0, 0)
} else
g_warning("about_create(): color allocation failed.\n");
+#endif
g_signal_connect(G_OBJECT(btn), "enter",
G_CALLBACK(link_btn_enter), window);
Index: gtkutils.h
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtkutils.h,v
retrieving revision 1.4.2.57
retrieving revision 1.4.2.58
diff -u -d -r1.4.2.57 -r1.4.2.58
--- gtkutils.h 29 Aug 2011 08:12:11 -0000 1.4.2.57
+++ gtkutils.h 7 Oct 2011 09:40:16 -0000 1.4.2.58
@@ -42,7 +42,9 @@
#include "main.h"
#endif
+#if !GTK_CHECK_VERSION(3, 0, 0)
#include "gtkcmctree.h"
+#endif
#define GTK_EVENTS_FLUSH() \
{ \
@@ -92,6 +94,7 @@
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,
@@ -113,6 +116,7 @@
GtkCMCTreeNode *node);
void gtkut_ctree_set_focus_row (GtkCMCTree *ctree,
GtkCMCTreeNode *node);
+#endif
void gtkut_clist_set_focus_row (GtkCMCList *clist,
gint row);
Index: quicksearch.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/quicksearch.c,v
retrieving revision 1.1.2.104
retrieving revision 1.1.2.105
diff -u -d -r1.1.2.104 -r1.1.2.105
--- quicksearch.c 7 Oct 2011 09:17:51 -0000 1.1.2.104
+++ quicksearch.c 7 Oct 2011 09:40:16 -0000 1.1.2.105
@@ -29,7 +29,9 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
#include "gtkcmoptionmenu.h"
+#endif
#include "utils.h"
#include "combobox.h"
#include "menu.h"
@@ -57,7 +59,9 @@
{
GtkWidget *hbox_search;
GtkWidget *search_type;
+#if !GTK_CHECK_VERSION(3, 0, 0)
GtkWidget *search_type_opt;
+#endif
GtkWidget *search_string_entry;
GtkWidget *search_condition_expression;
GtkWidget *search_description;
@@ -113,6 +117,7 @@
static void quicksearch_set_type(QuickSearch *quicksearch, gint type)
{
+#if !GTK_CHECK_VERSION(3, 0, 0)
gint index;
quicksearch->request->type = type;
if (quicksearch->gui == FALSE)
@@ -121,6 +126,7 @@
GINT_TO_POINTER(type),
NULL);
gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(quicksearch->search_type_opt), index);
+#endif
}
static gchar *quicksearch_get_text(QuickSearch * quicksearch)
@@ -679,7 +685,9 @@
QuickSearch *quicksearch;
GtkWidget *hbox_search;
+#if !GTK_CHECK_VERSION(3, 0, 0)
GtkWidget *search_type_opt;
+#endif
GtkWidget *search_type;
GtkWidget *search_string_entry;
GtkWidget *search_hbox;
@@ -696,9 +704,11 @@
/* quick search */
hbox_search = gtk_hbox_new(FALSE, 0);
+#if !GTK_CHECK_VERSION(3, 0, 0)
search_type_opt = gtk_cmoption_menu_new();
gtk_widget_show(search_type_opt);
gtk_box_pack_start(GTK_BOX(hbox_search), search_type_opt, FALSE, FALSE, 0);
+#endif
search_type = gtk_menu_new();
MENUITEM_ADD (search_type, menuitem,
@@ -777,9 +787,11 @@
G_CALLBACK(searchtype_autorun_changed),
quicksearch);
+#if !GTK_CHECK_VERSION(3, 0, 0)
gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(search_type_opt), search_type);
quicksearch->search_type_opt = search_type_opt;
+#endif
quicksearch_set_type(quicksearch, prefs_common.summary_quicksearch_type);
gtk_widget_show(search_type);
@@ -980,10 +992,16 @@
static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
{
+#if !GTK_CHECK_VERSION(3, 0, 0)
static GdkColor yellow;
static GdkColor red;
static GdkColor black;
static gboolean colors_initialised = FALSE;
+#else
+ static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
+ static GdkColor red = { (guint32)0, (guint16)0xff, (guint16)0x70, (guint16)0x70 };
+ static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
+#endif
gboolean error = FALSE;
@@ -991,6 +1009,7 @@
if (quicksearch->gui == FALSE)
return;
+#if !GTK_CHECK_VERSION(3, 0, 0)
if (!colors_initialised) {
gdk_color_parse("#f5f6be", &yellow);
gdk_color_parse("#000000", &black);
@@ -1002,6 +1021,7 @@
colors_initialised &= gdk_colormap_alloc_color(
gdk_colormap_get_system(), &red, FALSE, TRUE);
}
+#endif
if (active &&
(prefs_common.summary_quicksearch_type == QUICK_SEARCH_EXTENDED
@@ -1010,14 +1030,18 @@
if (active) {
gtk_widget_set_sensitive(quicksearch->clear_search, TRUE);
+#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, error ? &red : &yellow);
gtk_widget_modify_text(
gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
GTK_STATE_NORMAL, &black);
+#if !GTK_CHECK_VERSION(3, 0, 0)
}
+#endif
} else {
gtk_widget_set_sensitive(quicksearch->clear_search, FALSE);
if (colors_initialised) {
@@ -1027,7 +1051,9 @@
gtk_widget_modify_text(
gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
GTK_STATE_NORMAL, NULL);
+#if !GTK_CHECK_VERSION(3, 0, 0)
}
+#endif
}
if (!active) {
Index: logwindow.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/logwindow.c,v
retrieving revision 1.1.4.39
retrieving revision 1.1.4.40
diff -u -d -r1.1.4.39 -r1.1.4.40
--- logwindow.c 7 Oct 2011 09:17:51 -0000 1.1.4.39
+++ logwindow.c 7 Oct 2011 09:40:16 -0000 1.1.4.40
@@ -155,9 +155,11 @@
void log_window_init(LogWindow *logwin)
{
GtkTextBuffer *buffer;
+#if !GTK_CHECK_VERSION(3, 0, 0)
GdkColormap *colormap;
- GdkColor color[LOG_COLORS];
gboolean success[LOG_COLORS];
+#endif
+ GdkColor color[LOG_COLORS];
gint i;
gtkut_convert_int_to_gdk_color(prefs_common.log_msg_color, &color[0]);
@@ -178,6 +180,7 @@
logwin->status_nok_color = color[6];
logwin->status_skip_color = color[7];
+#if !GTK_CHECK_VERSION(3, 0, 0)
colormap = gdk_drawable_get_colormap(gtk_widget_get_window(logwin->window));
gdk_colormap_alloc_colors(colormap, color, LOG_COLORS, FALSE, TRUE, success);
@@ -195,6 +198,7 @@
break;
}
}
+#endif
buffer = logwin->buffer;
gtk_text_buffer_create_tag(buffer, "message",
Index: Makefile.am
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Makefile.am,v
retrieving revision 1.20.2.24
retrieving revision 1.20.2.25
diff -u -d -r1.20.2.24 -r1.20.2.25
--- Makefile.am 9 Feb 2010 07:46:41 -0000 1.20.2.24
+++ Makefile.am 7 Oct 2011 09:40:15 -0000 1.20.2.25
@@ -15,11 +15,6 @@
filesel.c \
foldersort.c \
gtkaspell.c \
- gtkcmctree.c \
- gtkcmclist.c \
- gtkcmoptionmenu.c \
- gtkshruler.c \
- gtksctree.c \
gtkutils.c \
gtkvscrollbutton.c \
icon_legend.c \
@@ -46,11 +41,6 @@
filesel.h \
foldersort.h \
gtkaspell.h \
- gtkcmctree.h \
- gtkcmclist.h \
- gtkcmoptionmenu.h \
- gtksctree.h \
- gtkshruler.h \
gtkutils.h \
gtkvscrollbutton.h \
headers.h \
@@ -67,6 +57,22 @@
sslcertwindow.h \
claws-marshal.h
+if GTK2
+libclawsgtk_la_SOURCES += \
+ gtkcmctree.c \
+ gtkcmclist.c \
+ gtkcmoptionmenu.c \
+ gtksctree.c \
+ gtkshruler.c
+
+clawsgtkinclude_HEADERS += \
+ gtkcmctree.h \
+ gtkcmclist.h \
+ gtkcmoptionmenu.h \
+ gtksctree.h \
+ gtkshruler.h
+endif
+
AM_CPPFLAGS = \
-I$(srcdir)/../common \
-I../common \
Index: menu.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/menu.c,v
retrieving revision 1.5.2.43
retrieving revision 1.5.2.44
diff -u -d -r1.5.2.43 -r1.5.2.44
--- menu.c 7 Oct 2011 09:08:57 -0000 1.5.2.43
+++ menu.c 7 Oct 2011 09:40:16 -0000 1.5.2.44
@@ -25,7 +25,9 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
#include "gtkcmoptionmenu.h"
+#endif
#include "menu.h"
#include "utils.h"
#include "gtkutils.h"
@@ -169,6 +171,7 @@
*y -= mreq.height;
}
+#if !GTK_CHECK_VERSION(3, 0, 0)
gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
GCompareFunc func)
{
@@ -198,3 +201,4 @@
return -1;
}
+#endif
Index: menu.h
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/menu.h,v
retrieving revision 1.4.2.24
retrieving revision 1.4.2.25
diff -u -d -r1.4.2.24 -r1.4.2.25
--- menu.h 16 Feb 2011 07:16:21 -0000 1.4.2.24
+++ menu.h 7 Oct 2011 09:40:16 -0000 1.4.2.25
@@ -22,7 +22,9 @@
#include <glib.h>
#include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
#include "gtkcmoptionmenu.h"
+#endif
#define MENU_VAL_ID "Claws::Menu::ValueID"
#define MENU_VAL_DATA "Claws::Menu::ValueDATA"
@@ -92,8 +94,10 @@
void cm_menu_set_sensitive_full(GtkUIManager *gui_manager, gchar *menu, gboolean sensitive);
void cm_toggle_menu_set_active_full(GtkUIManager *gui_manager, gchar *menu, gboolean active);
+#if !GTK_CHECK_VERSION(3, 0, 0)
gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
GCompareFunc func);
+#endif
void menu_button_position (GtkMenu *menu,
gint *x,
More information about the Commits
mailing list