2011-10-07 [colin] 3.7.10cvs26
[claws.git] / src / gtk / gtkutils.h
index 80123b52d4e1fe49190f2f0199c9aee0fc146e05..7ce1fdab8db0870e8a098cc05e1dca42783aaea6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include "main.h"
 #endif
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmctree.h"
+#endif
+
+#ifndef GDK_KEY_Escape
+#include "gdkkeysyms-new.h"
+#endif
 
 #define GTK_EVENTS_FLUSH() \
 { \
                gtk_main_iteration(); \
 }
 
-#define PIXMAP_CREATE(widget, pixmap, mask, xpm_d) \
-{ \
-       if (!pixmap) { \
-               GtkStyle *style = gtk_widget_get_style(widget); \
-               pixmap = gdk_pixmap_create_from_xpm_d \
-                       (widget->window, &mask, \
-                        &style->bg[GTK_STATE_NORMAL], xpm_d); \
-       } \
-}
-
-#define PIXMAP_CREATE_FROM_FILE(widget, pixmap, mask, filename) \
-{ \
-       if (!pixmap) { \
-               GtkStyle *style = gtk_widget_get_style(widget); \
-               pixmap = gdk_pixmap_create_from_xpm \
-                       (widget->window, &mask, \
-                        &style->bg[GTK_STATE_NORMAL], filename); \
-       } \
-}
-
 #define GTK_WIDGET_PTR(wid)    (*(GtkWidget **)wid)
 
 #define GTKUT_CTREE_NODE_SET_ROW_DATA(node, d) \
@@ -112,6 +98,7 @@ 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,
@@ -133,6 +120,7 @@ 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);
@@ -230,6 +218,8 @@ gboolean gtkut_list_view_select_row(GtkWidget *list, gint row);
 GtkUIManager *gtkut_create_ui_manager(void);
 GtkUIManager *gtkut_ui_manager(void);
 
+GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *pixbuf, int box_width,
+                                    int box_height);
 gint
 claws_input_add    (gint             source,
                    GdkInputCondition condition,
@@ -253,6 +243,12 @@ claws_input_add    (gint         source,
        gtk_tooltips_set_tip(GTK_TOOLTIPS(tips), widget,        \
                            tip, 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)
+#define gtk_text_view_get_vadjustment(x) ((x)->vadjustment)
+#define gdk_drag_context_get_suggested_action(x) ((x)->suggested_action)
+#define gtk_button_get_event_window(x) ((x)->event_window)
 #endif
 #endif /* __GTKUTILS_H__ */