2010-03-24 [pawel] 3.7.5cvs38
authorPaweł Pękala <c0rn@gazeta.pl>
Wed, 24 Mar 2010 18:19:39 +0000 (18:19 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Wed, 24 Mar 2010 18:19:39 +0000 (18:19 +0000)
* src/addr_compl.c
* src/compose.c
* src/folderview.c
* src/grouplistdialog.c
* src/headerview.c
* src/mainwindow.c
* src/mimeview.c
* src/prefs_account.c
* src/gtk/gtkcmclist.c
* src/gtk/gtkcmctree.c
* src/gtk/gtkcmoptionmenu.c
* src/gtk/gtksctree.c
* src/gtk/gtkshruler.c
* src/gtk/gtkutils.c
* src/gtk/gtkutils.h
* src/gtk/gtkvscrollbutton.c
* src/gtk/inputdialog.c
* src/gtk/spell_entry.c
* src/plugins/trayicon/trayicon.c
* src/plugins/trayicon/libeggtrayicon/Makefile.am
* src/plugins/trayicon/libeggtrayicon/eggtrayicon.c
* src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
Fix build with GTK+ 2.19

25 files changed:
ChangeLog
PATCHSETS
configure.ac
src/addr_compl.c
src/compose.c
src/folderview.c
src/grouplistdialog.c
src/gtk/gtkcmclist.c
src/gtk/gtkcmctree.c
src/gtk/gtkcmoptionmenu.c
src/gtk/gtksctree.c
src/gtk/gtkshruler.c
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/gtk/gtkvscrollbutton.c
src/gtk/inputdialog.c
src/gtk/spell_entry.c
src/headerview.c
src/mainwindow.c
src/mimeview.c
src/plugins/trayicon/libeggtrayicon/Makefile.am
src/plugins/trayicon/libeggtrayicon/eggtrayicon.c
src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
src/plugins/trayicon/trayicon.c
src/prefs_account.c

index 36759769126a2c32453c6fe5fb3ad98511795c97..92e0f257d6cf21d4ca15da452f5531065b798b25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2010-03-24 [pawel]     3.7.5cvs38
+
+       * src/addr_compl.c
+       * src/compose.c
+       * src/folderview.c
+       * src/grouplistdialog.c
+       * src/headerview.c
+       * src/mainwindow.c
+       * src/mimeview.c
+       * src/prefs_account.c
+       * src/gtk/gtkcmclist.c
+       * src/gtk/gtkcmctree.c
+       * src/gtk/gtkcmoptionmenu.c
+       * src/gtk/gtksctree.c
+       * src/gtk/gtkshruler.c
+       * src/gtk/gtkutils.c
+       * src/gtk/gtkutils.h
+       * src/gtk/gtkvscrollbutton.c
+       * src/gtk/inputdialog.c
+       * src/gtk/spell_entry.c
+       * src/plugins/trayicon/trayicon.c
+       * src/plugins/trayicon/libeggtrayicon/Makefile.am
+       * src/plugins/trayicon/libeggtrayicon/eggtrayicon.c
+       * src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
+               Fix build with GTK+ 2.19
+
 2010-03-23 [pawel]     3.7.5cvs37
 
        * src/mainwindow.c
index 7622fd7f873f9a192933202c5dc6cc37437a54ad..70e74316c8723280c40f8e954617947bb7b01268 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.5.10.30 -r 1.5.10.31 src/addrgather.c;  cvs diff -u -r 1.83.2.160 -r 1.83.2.161 src/mimeview.c;  cvs diff -u -r 1.36.2.183 -r 1.36.2.184 src/common/utils.c;  ) > 3.7.5cvs35.patchset
 ( cvs diff -u -r 1.14.2.24 -r 1.14.2.25 src/grouplistdialog.c;  cvs diff -u -r 1.204.2.194 -r 1.204.2.195 src/prefs_common.c;  cvs diff -u -r 1.103.2.127 -r 1.103.2.128 src/prefs_common.h;  ) > 3.7.5cvs36.patchset
 ( cvs diff -u -r 1.274.2.307 -r 1.274.2.308 src/mainwindow.c;  cvs diff -u -r 1.83.2.161 -r 1.83.2.162 src/mimeview.c;  cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/gtk/gtkcmctree.c;  ) > 3.7.5cvs37.patchset
+( cvs diff -u -r 1.27.2.46 -r 1.27.2.47 src/addr_compl.c;  cvs diff -u -r 1.382.2.547 -r 1.382.2.548 src/compose.c;  cvs diff -u -r 1.207.2.215 -r 1.207.2.216 src/folderview.c;  cvs diff -u -r 1.14.2.25 -r 1.14.2.26 src/grouplistdialog.c;  cvs diff -u -r 1.8.2.30 -r 1.8.2.31 src/headerview.c;  cvs diff -u -r 1.274.2.308 -r 1.274.2.309 src/mainwindow.c;  cvs diff -u -r 1.83.2.162 -r 1.83.2.163 src/mimeview.c;  cvs diff -u -r 1.105.2.158 -r 1.105.2.159 src/prefs_account.c;  cvs diff -u -r 1.1.2.11 -r 1.1.2.12 src/gtk/gtkcmclist.c;  cvs diff -u -r 1.1.2.15 -r 1.1.2.16 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/gtk/gtkcmoptionmenu.c;  cvs diff -u -r 1.1.4.57 -r 1.1.4.58 src/gtk/gtksctree.c;  cvs diff -u -r 1.1.4.11 -r 1.1.4.12 src/gtk/gtkshruler.c;  cvs diff -u -r 1.5.2.89 -r 1.5.2.90 src/gtk/gtkutils.c;  cvs diff -u -r 1.4.2.48 -r 1.4.2.49 src/gtk/gtkutils.h;  cvs diff -u -r 1.5.2.18 -r 1.5.2.19 src/gtk/gtkvscrollbutton.c;  cvs diff -u -r 1.2.2.37 -r 1.2.2.38 src/gtk/inputdialog.c;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/gtk/spell_entry.c;  cvs diff -u -r 1.14.2.70 -r 1.14.2.71 src/plugins/trayicon/trayicon.c;  cvs diff -u -r 1.2.2.2 -r 1.2.2.3 src/plugins/trayicon/libeggtrayicon/Makefile.am;  cvs diff -u -r 1.1.4.10 -r 1.1.4.11 src/plugins/trayicon/libeggtrayicon/eggtrayicon.c;  cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c;  ) > 3.7.5cvs38.patchset
index 2fb832ce1573f77fc222c227fedabd4a414a487c..af0b7b1dd0f307fb22fef4304f02df7ada40f1b8 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=37
+EXTRA_VERSION=38
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e16d33c3ba1ab9f71e7672a843c9acddfb10a856..41107c5f86cdd1f6cb0cd643a4bb5a8227ffa1fc 100644 (file)
@@ -41,6 +41,7 @@
 #include "prefs_common.h"
 #include "claws.h"
 #include "hooks.h"
+#include "gtkutils.h"
 #include <pthread.h>
 
 /*!
@@ -1260,7 +1261,7 @@ static gboolean address_completion_complete_address_in_entry(GtkEntry *entry,
 
        cm_return_val_if_fail(entry != NULL, FALSE);
 
-       if (!GTK_WIDGET_HAS_FOCUS(entry)) return FALSE;
+       if (!gtkut_widget_has_focus(GTK_WIDGET(entry))) return FALSE;
 
        /* get an address component from the cursor */
        searchTerm = get_address_from_edit( entry, &cursor_pos );
index 80fc6fc4e6a52ac4796beeae68c444d4f6e77d0c..dca67d9249fe59a4e9688b5e5fd26f38e3f92133 100644 (file)
@@ -9917,7 +9917,7 @@ static void compose_cut_cb(GtkAction *action, gpointer data)
        Compose *compose = (Compose *)data;
        if (compose->focused_editable 
 #ifndef GENERIC_UMPC
-           && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+           && gtkut_widget_has_focus(compose->focused_editable)
 #endif
            )
                entry_cut_clipboard(compose->focused_editable);
@@ -9928,7 +9928,7 @@ static void compose_copy_cb(GtkAction *action, gpointer data)
        Compose *compose = (Compose *)data;
        if (compose->focused_editable 
 #ifndef GENERIC_UMPC
-           && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+           && gtkut_widget_has_focus(compose->focused_editable)
 #endif
            )
                entry_copy_clipboard(compose->focused_editable);
@@ -9941,14 +9941,14 @@ static void compose_paste_cb(GtkAction *action, gpointer data)
        GtkTextBuffer *buffer;
        BLOCK_WRAP();
        if (compose->focused_editable &&
-           GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
+           gtkut_widget_has_focus(compose->focused_editable))
                entry_paste_clipboard(compose, compose->focused_editable, 
                                prefs_common.linewrap_pastes,
                                GDK_SELECTION_CLIPBOARD, NULL);
        UNBLOCK_WRAP();
 
 #ifdef USE_ENCHANT
-       if (GTK_WIDGET_HAS_FOCUS(compose->text) &&
+       if (gtkut_widget_has_focus(compose->text) &&
            compose->gtkaspell && 
             compose->gtkaspell->check_while_typing)
                gtkaspell_highlight_all(compose->gtkaspell);
@@ -9961,7 +9961,7 @@ static void compose_paste_as_quote_cb(GtkAction *action, gpointer data)
        gint wrap_quote = prefs_common.linewrap_quote;
        if (compose->focused_editable 
 #ifndef GENERIC_UMPC
-           && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+           && gtkut_widget_has_focus(compose->focused_editable)
 #endif
            ) {
                /* let text_insert() (called directly or at a later time
@@ -9990,7 +9990,7 @@ static void compose_paste_no_wrap_cb(GtkAction *action, gpointer data)
        BLOCK_WRAP();
        if (compose->focused_editable 
 #ifndef GENERIC_UMPC
-           && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+           && gtkut_widget_has_focus(compose->focused_editable)
 #endif
            )
                entry_paste_clipboard(compose, compose->focused_editable, FALSE,
@@ -9998,7 +9998,7 @@ static void compose_paste_no_wrap_cb(GtkAction *action, gpointer data)
        UNBLOCK_WRAP();
 
 #ifdef USE_ENCHANT
-       if (GTK_WIDGET_HAS_FOCUS(compose->text) &&
+       if (gtkut_widget_has_focus(compose->text) &&
            compose->gtkaspell && 
             compose->gtkaspell->check_while_typing)
                gtkaspell_highlight_all(compose->gtkaspell);
@@ -10013,7 +10013,7 @@ static void compose_paste_wrap_cb(GtkAction *action, gpointer data)
        BLOCK_WRAP();
        if (compose->focused_editable 
 #ifndef GENERIC_UMPC
-           && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+           && gtkut_widget_has_focus(compose->focused_editable)
 #endif
            )
                entry_paste_clipboard(compose, compose->focused_editable, TRUE,
@@ -10021,7 +10021,7 @@ static void compose_paste_wrap_cb(GtkAction *action, gpointer data)
        UNBLOCK_WRAP();
 
 #ifdef USE_ENCHANT
-       if (GTK_WIDGET_HAS_FOCUS(compose->text) &&
+       if (gtkut_widget_has_focus(compose->text) &&
            compose->gtkaspell &&
             compose->gtkaspell->check_while_typing)
                gtkaspell_highlight_all(compose->gtkaspell);
@@ -10033,7 +10033,7 @@ static void compose_allsel_cb(GtkAction *action, gpointer data)
        Compose *compose = (Compose *)data;
        if (compose->focused_editable 
 #ifndef GENERIC_UMPC
-           && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+           && gtkut_widget_has_focus(compose->focused_editable)
 #endif
            )
                entry_allsel(compose->focused_editable);
@@ -10337,7 +10337,7 @@ static void compose_advanced_action_cb(GtkAction *gaction, gpointer data)
                {textview_delete_to_line_end}
        };
 
-       if (!GTK_WIDGET_HAS_FOCUS(text)) return;
+       if (!gtkut_widget_has_focus(GTK_WIDGET(text))) return;
 
        if (action >= COMPOSE_CALL_ADVANCED_ACTION_MOVE_BEGINNING_OF_LINE &&
            action <= COMPOSE_CALL_ADVANCED_ACTION_DELETE_TO_LINE_END) {
@@ -10894,7 +10894,7 @@ static void compose_check_all(GtkAction *action, gpointer data)
        if (!compose->gtkaspell)
                return;
                
-       if (GTK_WIDGET_HAS_FOCUS(compose->subject_entry))
+       if (gtkut_widget_has_focus(compose->subject_entry))
                claws_spell_entry_check_all(
                        CLAWS_SPELL_ENTRY(compose->subject_entry));             
        else
@@ -10919,7 +10919,7 @@ static void compose_check_backwards(GtkAction *action, gpointer data)
                return;
        }
 
-       if (GTK_WIDGET_HAS_FOCUS(compose->subject_entry))
+       if (gtkut_widget_has_focus(compose->subject_entry))
                claws_spell_entry_check_backwards(
                        CLAWS_SPELL_ENTRY(compose->subject_entry));
        else
@@ -10934,7 +10934,7 @@ static void compose_check_forwards_go(GtkAction *action, gpointer data)
                return;
        }
 
-       if (GTK_WIDGET_HAS_FOCUS(compose->subject_entry))
+       if (gtkut_widget_has_focus(compose->subject_entry))
                claws_spell_entry_check_forwards_go(
                        CLAWS_SPELL_ENTRY(compose->subject_entry));
        else
index cb55ea8e86dcc4247bd5d220d7df14f15aee283c..6b73fb1d382b20f7575e67ba738fa4af2287bf43 100644 (file)
@@ -2174,7 +2174,7 @@ static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
                gtk_cmctree_expand(ctree, row);
 
        /* ungrab the mouse event */
-       if (GTK_WIDGET_HAS_GRAB(ctree)) {
+       if (gtkut_widget_has_grab(GTK_WIDGET(ctree))) {
                gtk_grab_remove(GTK_WIDGET(ctree));
                if (gdk_pointer_is_grabbed())
                        gdk_pointer_ungrab(GDK_CURRENT_TIME);
index 1f518dcd077529611e6ba34ef76d3deb7dce5fe9..3bddf372693fafc16410bd73d28add2bcb81a79f 100644 (file)
@@ -94,7 +94,7 @@ GSList *grouplist_dialog(Folder *folder)
        GNode *node;
        FolderItem *item;
 
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                grouplist_dialog_create();
index 04db733cf2ababd7f95ec0207e1c61869229ada0..7f6ae60014865eb7efee59c8cd5c6eb4940bee9a 100644 (file)
@@ -35,6 +35,7 @@
 #include "gtkcmclist.h"
 #include <gdk/gdkkeysyms.h>
 #include "utils.h"
+#include "gtkutils.h"
 
 /* length of button_actions array */
 #define MAX_BUTTON 5
@@ -1028,7 +1029,7 @@ gtk_cmclist_get_arg (GObject *object,
       g_value_set_boolean(value, TRUE);
       for (i = 0; i < clist->columns; i++)
        if (clist->column[i].button &&
-           !GTK_WIDGET_SENSITIVE (clist->column[i].button))
+           !gtkut_widget_get_sensitive (clist->column[i].button))
          {
            g_value_set_boolean(value, FALSE);
            break;
@@ -1331,7 +1332,7 @@ gtk_cmclist_set_shadow_type (GtkCMCList      *clist,
 
   clist->shadow_type = type;
 
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtkut_widget_get_visible (GTK_WIDGET(clist)))
     gtk_widget_queue_resize (GTK_WIDGET (clist));
 }
 
@@ -1454,7 +1455,7 @@ gtk_cmclist_column_title_active (GtkCMCList *clist,
                    0, 0, 0, column_title_passive_func, 0);
 
   GTK_WIDGET_SET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtkut_widget_get_visible (GTK_WIDGET(clist)))
     gtk_widget_queue_draw (clist->column[column].button);
 }
 
@@ -1484,7 +1485,7 @@ gtk_cmclist_column_title_passive (GtkCMCList *clist,
                      G_CALLBACK(column_title_passive_func), NULL);
 
   GTK_WIDGET_UNSET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtkut_widget_get_visible (GTK_WIDGET(clist)))
     gtk_widget_queue_draw (clist->column[column].button);
 }
 
@@ -1570,7 +1571,7 @@ gtk_cmclist_set_column_title (GtkCMCList    *clist,
 
   /* if this button didn't previously exist, then the
    * column button positions have to be re-computed */
-  if (GTK_WIDGET_VISIBLE (clist) && new_button)
+  if (gtkut_widget_get_visible (GTK_WIDGET(clist)) && new_button)
     size_allocate_title_buttons (clist);
 }
 
@@ -1624,7 +1625,7 @@ gtk_cmclist_set_column_widget (GtkCMCList  *clist,
 
   /* if this button didn't previously exist, then the
    * column button positions have to be re-computed */
-  if (GTK_WIDGET_VISIBLE (clist) && new_button)
+  if (gtkut_widget_get_visible (GTK_WIDGET(clist)) && new_button)
     size_allocate_title_buttons (clist);
 }
 
@@ -1745,7 +1746,7 @@ gtk_cmclist_set_column_resizeable (GtkCMCList *clist,
   if (resizeable)
     clist->column[column].auto_resize = FALSE;
 
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtkut_widget_get_visible (GTK_WIDGET(clist)))
     size_allocate_title_buttons (clist);
 }
 
@@ -1774,7 +1775,7 @@ gtk_cmclist_set_column_auto_resize (GtkCMCList *clist,
        }
     }
 
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtkut_widget_get_visible (GTK_WIDGET(clist)))
     size_allocate_title_buttons (clist);
 }
 
@@ -2012,7 +2013,7 @@ size_allocate_title_buttons (GtkCMCList *clist)
   gint last_button = 0;
   gint i;
 
-  if (!GTK_WIDGET_REALIZED (clist))
+  if (!gtkut_widget_get_realized (GTK_WIDGET(clist)))
     return;
 
   button_allocation.x = clist->hoffset;
@@ -2212,7 +2213,7 @@ column_button_create (GtkCMCList *clist,
   gtk_container_set_border_width(GTK_CONTAINER(button), 0);
   gtk_widget_pop_composite_child ();
 
-  if (GTK_WIDGET_REALIZED (clist) && clist->title_window)
+  if (gtkut_widget_get_realized (GTK_WIDGET(clist)) && clist->title_window)
     gtk_widget_set_parent_window (clist->column[column].button,
                                  clist->title_window);
   gtk_widget_set_parent (button, GTK_WIDGET (clist));
@@ -3272,7 +3273,7 @@ gtk_cmclist_set_foreground (GtkCMCList       *clist,
     {
       clist_row->foreground = *color;
       clist_row->fg_set = TRUE;
-      if (GTK_WIDGET_REALIZED (clist))
+      if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
        gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
                         &clist_row->foreground, TRUE, TRUE);
     }
@@ -3301,7 +3302,7 @@ gtk_cmclist_set_background (GtkCMCList       *clist,
     {
       clist_row->background = *color;
       clist_row->bg_set = TRUE;
-      if (GTK_WIDGET_REALIZED (clist))
+      if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
        gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
                         &clist_row->background, TRUE, TRUE);
     }
@@ -3347,7 +3348,7 @@ gtk_cmclist_set_cell_style (GtkCMCList *clist,
 
   if (clist_row->cell[column].style)
     {
-      if (GTK_WIDGET_REALIZED (clist))
+      if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
         gtk_style_detach (clist_row->cell[column].style);
       g_object_unref (clist_row->cell[column].style);
     }
@@ -3358,7 +3359,7 @@ gtk_cmclist_set_cell_style (GtkCMCList *clist,
     {
       g_object_ref (clist_row->cell[column].style);
       
-      if (GTK_WIDGET_REALIZED (clist))
+      if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
         clist_row->cell[column].style =
          gtk_style_attach (clist_row->cell[column].style,
                            clist->clist_window);
@@ -3426,7 +3427,7 @@ gtk_cmclist_set_row_style (GtkCMCList *clist,
 
   if (clist_row->style)
     {
-      if (GTK_WIDGET_REALIZED (clist))
+      if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
         gtk_style_detach (clist_row->style);
       g_object_unref (clist_row->style);
     }
@@ -3437,7 +3438,7 @@ gtk_cmclist_set_row_style (GtkCMCList *clist,
     {
       g_object_ref (clist_row->style);
       
-      if (GTK_WIDGET_REALIZED (clist))
+      if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
         clist_row->style = gtk_style_attach (clist_row->style,
                                             clist->clist_window);
     }
@@ -3669,7 +3670,7 @@ fake_toggle_row (GtkCMCList *clist,
 static gboolean
 clist_has_grab (GtkCMCList *clist)
 {
-  return (GTK_WIDGET_HAS_GRAB (clist) &&
+  return (gtkut_widget_has_grab (GTK_WIDGET(clist)) &&
          gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))));
 }
 
@@ -3986,7 +3987,7 @@ real_undo_selection (GtkCMCList *clist)
                       GPOINTER_TO_INT (work->data), -1, NULL);
     }
 
-  if (GTK_WIDGET_HAS_FOCUS(clist) && clist->focus_row != clist->undo_anchor)
+  if (gtkut_widget_has_focus(GTK_WIDGET(clist)) && clist->focus_row != clist->undo_anchor)
     {
       gtk_cmclist_draw_focus (GTK_WIDGET (clist));
       clist->focus_row = clist->undo_anchor;
@@ -4328,7 +4329,7 @@ end_selection (GtkCMCList *clist)
   cm_return_if_fail (GTK_IS_CMCLIST (clist));
 
   if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))) &&
-      GTK_WIDGET_HAS_FOCUS (clist))
+      gtkut_widget_has_focus (GTK_WIDGET(clist)))
     return;
 
   GTK_CMCLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
@@ -4669,13 +4670,13 @@ gtk_cmclist_unrealize (GtkWidget *widget)
   /* freeze the list */
   clist->freeze_count++;
 
-  if (GTK_WIDGET_MAPPED (widget))
+  if (gtkut_widget_get_mapped (widget))
     gtk_cmclist_unmap (widget);
 
   GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
 
   /* detach optional row/cell styles */
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     {
       GtkCMCListRow *clist_row;
       GList *list;
@@ -4739,7 +4740,7 @@ gtk_cmclist_map (GtkWidget *widget)
 
   clist = GTK_CMCLIST (widget);
 
-  if (!GTK_WIDGET_MAPPED (widget))
+  if (!gtkut_widget_get_mapped (widget))
     {
       GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
 
@@ -4747,8 +4748,8 @@ gtk_cmclist_map (GtkWidget *widget)
       for (i = 0; i < clist->columns; i++)
        {
          if (clist->column[i].button &&
-             GTK_WIDGET_VISIBLE (clist->column[i].button) &&
-             !GTK_WIDGET_MAPPED (clist->column[i].button))
+             gtkut_widget_get_visible (clist->column[i].button) &&
+             !gtkut_widget_get_mapped (clist->column[i].button))
            gtk_widget_map (clist->column[i].button);
        }
       
@@ -4778,7 +4779,7 @@ gtk_cmclist_unmap (GtkWidget *widget)
 
   clist = GTK_CMCLIST (widget);
 
-  if (GTK_WIDGET_MAPPED (widget))
+  if (gtkut_widget_get_mapped (widget))
     {
       GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
 
@@ -4816,7 +4817,7 @@ gtk_cmclist_unmap (GtkWidget *widget)
       /* unmap column buttons */
       for (i = 0; i < clist->columns; i++)
        if (clist->column[i].button &&
-           GTK_WIDGET_MAPPED (clist->column[i].button))
+           gtkut_widget_get_mapped (clist->column[i].button))
          gtk_widget_unmap (clist->column[i].button);
 
       /* freeze the list */
@@ -4833,7 +4834,7 @@ gtk_cmclist_expose (GtkWidget      *widget,
   cm_return_val_if_fail (GTK_IS_CMCLIST (widget), FALSE);
   cm_return_val_if_fail (event != NULL, FALSE);
 
-  if (GTK_WIDGET_DRAWABLE (widget))
+  if (gtkut_widget_is_drawable (widget))
     {
       clist = GTK_CMCLIST (widget);
 
@@ -4891,7 +4892,7 @@ gtk_cmclist_style_set (GtkWidget *widget,
 
   clist = GTK_CMCLIST (widget);
 
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     {
       gtk_style_set_background (widget->style, widget->window, widget->state);
       gtk_style_set_background (widget->style, clist->title_window, GTK_STATE_NORMAL);
@@ -4985,7 +4986,7 @@ gtk_cmclist_button_press (GtkWidget      *widget,
              if (GTK_CMCLIST_ADD_MODE(clist))
                {
                  GTK_CMCLIST_UNSET_FLAG (clist, CMCLIST_ADD_MODE);
-                 if (GTK_WIDGET_HAS_FOCUS(widget))
+                 if (gtkut_widget_has_focus(widget))
                    {
                      gtk_cmclist_draw_focus (widget);
                      gdk_gc_set_line_attributes (clist->xor_gc, 1,
@@ -5002,7 +5003,7 @@ gtk_cmclist_button_press (GtkWidget      *widget,
                }
              else if (row != clist->focus_row)
                {
-                 if (GTK_WIDGET_HAS_FOCUS(widget))
+                 if (gtkut_widget_has_focus(widget))
                    {
                      gtk_cmclist_draw_focus (widget);
                      clist->focus_row = row;
@@ -5013,7 +5014,7 @@ gtk_cmclist_button_press (GtkWidget      *widget,
                }
            }
 
-         if (!GTK_WIDGET_HAS_FOCUS(widget))
+         if (!gtkut_widget_has_focus(widget))
            gtk_widget_grab_focus (widget);
 
          if (button_actions & GTK_CMBUTTON_SELECTS)
@@ -5121,7 +5122,7 @@ gtk_cmclist_button_press (GtkWidget      *widget,
                g_signal_handlers_block_matched(G_OBJECT(clist), G_SIGNAL_MATCH_DATA,
                                        0, 0, 0, 0, drag_data);
 
-       if (!GTK_WIDGET_HAS_FOCUS(widget))
+       if (!gtkut_widget_has_focus(widget))
          gtk_widget_grab_focus (widget);
 
        clist->drag_pos = i;
@@ -5209,7 +5210,7 @@ gtk_cmclist_button_release (GtkWidget      *widget,
            {
            case GTK_SELECTION_MULTIPLE:
              if (!(event->state & GDK_SHIFT_MASK) ||
-                 !GTK_WIDGET_CAN_FOCUS (widget) ||
+                 !gtkut_widget_get_can_focus (widget) ||
                  event->x < 0 || event->x >= clist->clist_window_width ||
                  event->y < 0 || event->y >= clist->clist_window_height)
                GTK_CMCLIST_GET_CLASS (clist)->resync_selection
@@ -5477,7 +5478,7 @@ gtk_cmclist_size_allocate (GtkWidget     *widget,
   widget->allocation = *allocation;
   border_width = GTK_CONTAINER (widget)->border_width;
 
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     {
       gdk_window_move_resize (widget->window,
                              allocation->x + border_width,
@@ -5511,7 +5512,7 @@ gtk_cmclist_size_allocate (GtkWidget     *widget,
   clist->clist_window_width = clist_allocation.width;
   clist->clist_window_height = clist_allocation.height;
   
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     {
       gdk_window_move_resize (clist->clist_window,
                              clist_allocation.x,
@@ -5525,7 +5526,7 @@ gtk_cmclist_size_allocate (GtkWidget     *widget,
   clist->column_title_area.y = widget->style->ythickness;
   clist->column_title_area.width = clist_allocation.width;
   
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     {
       gdk_window_move_resize (clist->title_window,
                              clist->column_title_area.x,
@@ -5699,7 +5700,7 @@ draw_row (GtkCMCList     *clist,
   cm_return_if_fail (clist != NULL);
 
   /* bail now if we arn't drawable yet */
-  if (!GTK_WIDGET_DRAWABLE (clist) || row < 0 || row >= clist->rows)
+  if (!gtkut_widget_is_drawable (GTK_WIDGET(clist)) || row < 0 || row >= clist->rows)
     return;
 
   widget = GTK_WIDGET (clist);
@@ -5930,7 +5931,7 @@ draw_row (GtkCMCList     *clist,
 
   /* draw focus rectangle */
   if (clist->focus_row == row &&
-      GTK_WIDGET_CAN_FOCUS (widget) && GTK_WIDGET_HAS_FOCUS(widget))
+      gtkut_widget_get_can_focus (widget) && gtkut_widget_has_focus(widget))
     {
       if (!area)
        gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
@@ -5962,7 +5963,7 @@ draw_rows (GtkCMCList     *clist,
   cm_return_if_fail (GTK_IS_CMCLIST (clist));
 
   if (clist->row_height == 0 ||
-      !GTK_WIDGET_DRAWABLE (clist))
+      !gtkut_widget_is_drawable (GTK_WIDGET(clist)))
     return;
 
   if (area)
@@ -6194,7 +6195,7 @@ vadjustment_value_changed (GtkAdjustment *adjustment,
   dy = value - clist->voffset;
   clist->voffset = value;
 
-  if (GTK_WIDGET_DRAWABLE (clist))
+  if (gtkut_widget_is_drawable (GTK_WIDGET(clist)))
     {
       gdk_window_scroll (clist->clist_window, 0, dy);
       gdk_window_process_updates (clist->clist_window, FALSE);
@@ -6211,7 +6212,7 @@ typedef struct
 
 /* The window to which widget->window is relative */
 #define ALLOCATION_WINDOW(widget)              \
-   (GTK_WIDGET_NO_WINDOW (widget) ?            \
+   (!gtkut_widget_get_has_window (widget) ?            \
     (widget)->window :                          \
      gdk_window_get_parent ((widget)->window))
 
@@ -6221,9 +6222,9 @@ adjust_allocation_recurse (GtkWidget *widget,
 {
   ScrollData *scroll_data = data;
   
-  if (!GTK_WIDGET_REALIZED (widget))
+  if (!gtkut_widget_get_realized (widget))
     {
-      if (GTK_WIDGET_VISIBLE (widget))
+      if (gtkut_widget_get_visible (widget))
        {
          GdkRectangle tmp_rectangle = widget->allocation;
          tmp_rectangle.x += scroll_data->dx;
@@ -6251,7 +6252,7 @@ adjust_allocation (GtkWidget *widget,
 {
   ScrollData scroll_data;
 
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     scroll_data.window = ALLOCATION_WINDOW (widget);
   else
     scroll_data.window = NULL;
@@ -6286,7 +6287,7 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
 
   dx = -value - clist->hoffset;
 
-  if (GTK_WIDGET_REALIZED (clist))
+  if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
     gdk_window_scroll (clist->title_window, dx, 0);
 
   /* adjust the column button's allocations */
@@ -6296,9 +6297,10 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
 
   clist->hoffset = -value;
 
-  if (GTK_WIDGET_DRAWABLE (clist))
+  if (gtkut_widget_is_drawable (GTK_WIDGET(clist)))
     {
-      if (GTK_WIDGET_CAN_FOCUS(clist) && GTK_WIDGET_HAS_FOCUS(clist) &&
+      if (gtkut_widget_get_can_focus(GTK_WIDGET(clist)) && 
+          gtkut_widget_has_focus(GTK_WIDGET(clist)) &&
           !container->focus_child && GTK_CMCLIST_ADD_MODE(clist))
         {
           y = ROW_TOP_YPIXEL (clist, clist->focus_row);
@@ -6311,7 +6313,8 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
       gdk_window_scroll (clist->clist_window, dx, 0);
       gdk_window_process_updates (clist->clist_window, FALSE);
 
-      if (GTK_WIDGET_CAN_FOCUS(clist) && GTK_WIDGET_HAS_FOCUS(clist) &&
+      if (gtkut_widget_get_can_focus(GTK_WIDGET(clist)) && 
+          gtkut_widget_has_focus(GTK_WIDGET(clist)) &&
           !container->focus_child)
         {
           if (GTK_CMCLIST_ADD_MODE(clist))
@@ -6461,7 +6464,7 @@ row_delete (GtkCMCList    *clist,
        (clist, clist_row, i, GTK_CMCELL_EMPTY, NULL, 0, NULL);
       if (clist_row->cell[i].style)
        {
-         if (GTK_WIDGET_REALIZED (clist))
+         if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
            gtk_style_detach (clist_row->cell[i].style);
          g_object_unref (clist_row->cell[i].style);
        }
@@ -6469,7 +6472,7 @@ row_delete (GtkCMCList    *clist,
 
   if (clist_row->style)
     {
-      if (GTK_WIDGET_REALIZED (clist))
+      if (gtkut_widget_get_realized (GTK_WIDGET(clist)))
         gtk_style_detach (clist_row->style);
       g_object_unref (clist_row->style);
     }
@@ -6519,7 +6522,7 @@ gtk_cmclist_focus (GtkWidget        *widget,
   GtkWidget *focus_child;
   gboolean is_current_focus;
 
-  if (!GTK_WIDGET_IS_SENSITIVE (widget))
+  if (!gtkut_widget_is_sensitive (widget))
     return FALSE;
 
   focus_child = GTK_CONTAINER (widget)->focus_child;
@@ -6601,7 +6604,7 @@ gtk_cmclist_draw_focus (GtkWidget *widget)
 
   cm_return_if_fail (GTK_IS_CMCLIST (widget));
 
-  if (!GTK_WIDGET_DRAWABLE (widget) || !GTK_WIDGET_CAN_FOCUS (widget))
+  if (!gtkut_widget_is_drawable (widget) || !gtkut_widget_get_can_focus (widget))
     return;
 
   clist = GTK_CMCLIST (widget);
@@ -6658,7 +6661,7 @@ focus_column (GtkCMCList *clist, gint column, gint dir)
     {
       return TRUE;
     }
-  else if (GTK_WIDGET_CAN_FOCUS (child))
+  else if (gtkut_widget_get_can_focus (child))
     {
       gtk_widget_grab_focus (child);
       return TRUE;
@@ -6765,7 +6768,7 @@ title_focus_move (GtkCMCList *clist,
   while (!return_val && j >= 0 && j < clist->columns)
     {
       if (clist->column[j].button &&
-         GTK_WIDGET_VISIBLE (clist->column[j].button))
+         gtkut_widget_get_visible (clist->column[j].button))
        {
          if (focus_column (clist, j, dir))
            {
@@ -6785,7 +6788,7 @@ title_focus_move (GtkCMCList *clist,
       while (!return_val && j != i)
        {
          if (clist->column[j].button &&
-             GTK_WIDGET_VISIBLE (clist->column[j].button))
+             gtkut_widget_get_visible (clist->column[j].button))
            {
              if (focus_column (clist, j, dir))
                {
@@ -7143,7 +7146,7 @@ remove_grab (GtkCMCList *clist)
 {
   GtkWidget *widget = GTK_WIDGET (clist);
   
-  if (GTK_WIDGET_HAS_GRAB (clist))
+  if (gtkut_widget_has_grab (widget))
     {
       GdkDisplay *display = gtk_widget_get_display (widget);
       
@@ -7863,7 +7866,7 @@ gtk_cmclist_set_button_actions (GtkCMCList *clist,
   if (button < MAX_BUTTON)
     {
       if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))) || 
-         GTK_WIDGET_HAS_GRAB (clist))
+         gtkut_widget_has_grab (GTK_WIDGET(clist)))
        {
          remove_grab (clist);
          clist->drag_button = 0;
index 175e86c0683d000f569cac7dcc545fb96c1844ad..ecc72f06b25ce6bd27f3a785c976a6563e1950aa 100644 (file)
@@ -35,6 +35,7 @@
 #include "gtkcmctree.h"
 #include "claws-marshal.h"
 #include "utils.h"
+#include "gtkutils.c"
 
 #define PM_SIZE                    8
 #define TAB_SIZE                   (PM_SIZE + 6)
@@ -891,7 +892,7 @@ gtk_cmctree_unrealize (GtkWidget *widget)
   ctree = GTK_CMCTREE (widget);
   clist = GTK_CMCLIST (widget);
 
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     {
       GtkCMCTreeNode *node;
       GtkCMCTreeNode *child;
@@ -1754,7 +1755,7 @@ draw_row (GtkCMCList     *clist,
   cm_return_if_fail (clist != NULL);
 
   /* bail now if we arn't drawable yet */
-  if (!GTK_WIDGET_DRAWABLE (clist) || row < 0 || row >= clist->rows)
+  if (!gtkut_widget_is_drawable (GTK_WIDGET(clist)) || row < 0 || row >= clist->rows)
     return;
 
   widget = GTK_WIDGET (clist);
@@ -2111,7 +2112,7 @@ draw_row (GtkCMCList     *clist,
 
   /* draw focus rectangle */
   if (clist->focus_row == row &&
-      GTK_WIDGET_CAN_FOCUS (widget) && GTK_WIDGET_HAS_FOCUS (widget))
+      gtkut_widget_get_can_focus (widget) && gtkut_widget_has_focus (widget))
     {
       if (!area)
        gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
@@ -2590,7 +2591,7 @@ change_focus_row_expansion (GtkCMCTree          *ctree,
   clist = GTK_CMCLIST (ctree);
 
   if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (ctree))) && 
-      GTK_WIDGET_HAS_GRAB (ctree))
+      gtkut_widget_has_grab (GTK_WIDGET(ctree)))
     return;
   
   if (!(node =
@@ -3303,7 +3304,7 @@ row_delete (GtkCMCTree    *ctree,
        (clist, &(ctree_row->row), i, GTK_CMCELL_EMPTY, NULL, 0, NULL);
       if (ctree_row->row.cell[i].style)
        {
-         if (GTK_WIDGET_REALIZED (ctree))
+         if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
            gtk_style_detach (ctree_row->row.cell[i].style);
          g_object_unref (ctree_row->row.cell[i].style);
        }
@@ -3311,7 +3312,7 @@ row_delete (GtkCMCTree    *ctree,
 
   if (ctree_row->row.style)
     {
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
        gtk_style_detach (ctree_row->row.style);
       g_object_unref (ctree_row->row.style);
     }
@@ -4804,7 +4805,7 @@ static void
 remove_grab (GtkCMCList *clist)
 {
   if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))) && 
-      GTK_WIDGET_HAS_GRAB (clist))
+      gtkut_widget_has_grab (GTK_WIDGET(clist)))
     {
       gtk_grab_remove (GTK_WIDGET (clist));
       gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (clist)),
@@ -5012,7 +5013,7 @@ gtk_cmctree_node_set_cell_style (GtkCMCTree     *ctree,
 
   if (GTK_CMCTREE_ROW (node)->row.cell[column].style)
     {
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
         gtk_style_detach (GTK_CMCTREE_ROW (node)->row.cell[column].style);
       g_object_unref (GTK_CMCTREE_ROW (node)->row.cell[column].style);
     }
@@ -5023,7 +5024,7 @@ gtk_cmctree_node_set_cell_style (GtkCMCTree     *ctree,
     {
       g_object_ref (GTK_CMCTREE_ROW (node)->row.cell[column].style);
       
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
         GTK_CMCTREE_ROW (node)->row.cell[column].style =
          gtk_style_attach (GTK_CMCTREE_ROW (node)->row.cell[column].style,
                            clist->clist_window);
@@ -5084,7 +5085,7 @@ gtk_cmctree_node_set_row_style (GtkCMCTree     *ctree,
 
   if (GTK_CMCTREE_ROW (node)->row.style)
     {
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
         gtk_style_detach (GTK_CMCTREE_ROW (node)->row.style);
       g_object_unref (GTK_CMCTREE_ROW (node)->row.style);
     }
@@ -5095,7 +5096,7 @@ gtk_cmctree_node_set_row_style (GtkCMCTree     *ctree,
     {
       g_object_ref (GTK_CMCTREE_ROW (node)->row.style);
       
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
         GTK_CMCTREE_ROW (node)->row.style =
          gtk_style_attach (GTK_CMCTREE_ROW (node)->row.style,
                            clist->clist_window);
@@ -5134,7 +5135,7 @@ gtk_cmctree_node_set_foreground (GtkCMCTree       *ctree,
     {
       GTK_CMCTREE_ROW (node)->row.foreground = *color;
       GTK_CMCTREE_ROW (node)->row.fg_set = TRUE;
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_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);
     }
@@ -5156,7 +5157,7 @@ gtk_cmctree_node_set_background (GtkCMCTree       *ctree,
     {
       GTK_CMCTREE_ROW (node)->row.background = *color;
       GTK_CMCTREE_ROW (node)->row.bg_set = TRUE;
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_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);
     }
@@ -5349,23 +5350,23 @@ gtk_cmctree_set_line_style (GtkCMCTree          *ctree,
           clist->column[ctree->tree_column].width + 3);
     }
 
-  if (GTK_WIDGET_REALIZED (ctree))
+  if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
     {
       switch (line_style)
        {
        case GTK_CMCTREE_LINES_SOLID:
-         if (GTK_WIDGET_REALIZED (ctree))
+         if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
            gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID, 
                                        GDK_CAP_BUTT, GDK_JOIN_MITER);
          break;
        case GTK_CMCTREE_LINES_DOTTED:
-         if (GTK_WIDGET_REALIZED (ctree))
+         if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
            gdk_gc_set_line_attributes (ctree->lines_gc, 1, 
                                        GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
          gdk_gc_set_dashes (ctree->lines_gc, 0, "\1\1", 2);
          break;
        case GTK_CMCTREE_LINES_TABBED:
-         if (GTK_WIDGET_REALIZED (ctree))
+         if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
            gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID, 
                                        GDK_CAP_BUTT, GDK_JOIN_MITER);
          break;
@@ -5430,7 +5431,7 @@ gtk_cmctree_set_expander_style (GtkCMCTree              *ctree,
       gtk_cmclist_set_column_width (clist, ctree->tree_column, new_width);
     }
 
-  if (GTK_WIDGET_DRAWABLE (clist))
+  if (gtkut_widget_is_drawable (GTK_WIDGET(clist)))
     CLIST_REFRESH (clist);
 }
 
@@ -5761,7 +5762,8 @@ real_undo_selection (GtkCMCList *clist)
     if (GTK_CMCTREE_ROW (work->data)->row.selectable)
       gtk_cmctree_unselect (ctree, GTK_CMCTREE_NODE (work->data));
 
-  if (GTK_WIDGET_HAS_FOCUS (clist) && clist->focus_row != clist->undo_anchor)
+  if (gtkut_widget_has_focus (GTK_WIDGET(clist)) &&
+      clist->focus_row != clist->undo_anchor)
     {
       clist->focus_row = clist->undo_anchor;
       gtk_widget_queue_draw (GTK_WIDGET (clist));
index 322340d61b070686c8e26343f7f37e5344e94074..868554c7e0c65cd566f3150b7940cfdf107cff04 100644 (file)
@@ -32,6 +32,7 @@
 #include "claws-marshal.h"
 #include "gtkcmoptionmenu.h"
 #include "utils.h"
+#include "gtkutils.h"
 
 #define CHILD_LEFT_SPACING        4
 #define CHILD_RIGHT_SPACING       1
@@ -421,7 +422,7 @@ gtk_cmoption_menu_size_request (GtkWidget      *widget,
       
   gtk_cmoption_menu_get_props (option_menu, &props);
  
-  if (GTK_BIN (option_menu)->child && GTK_WIDGET_VISIBLE (GTK_BIN (option_menu)->child))
+  if (GTK_BIN (option_menu)->child && gtkut_widget_get_visible (GTK_BIN (option_menu)->child))
     {
       gtk_widget_size_request (GTK_BIN (option_menu)->child, &child_requisition);
 
@@ -459,13 +460,13 @@ gtk_cmoption_menu_size_allocate (GtkWidget     *widget,
   border_width = GTK_CONTAINER (widget)->border_width;
 
   widget->allocation = *allocation;
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     gdk_window_move_resize (button->event_window,
                            allocation->x + border_width, allocation->y + border_width,
                            allocation->width - border_width * 2, allocation->height - border_width * 2);
 
   child = GTK_BIN (widget)->child;
-  if (child && GTK_WIDGET_VISIBLE (child))
+  if (child && gtkut_widget_get_visible (child))
     {
       gint xthickness = GTK_WIDGET (widget)->style->xthickness;
       gint ythickness = GTK_WIDGET (widget)->style->ythickness;
@@ -497,7 +498,7 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
   cm_return_if_fail (GTK_IS_CMOPTION_MENU (widget));
   cm_return_if_fail (area != NULL);
 
-  if (GTK_WIDGET_DRAWABLE (widget))
+  if (gtkut_widget_is_drawable (widget))
     {
       border_width = GTK_CONTAINER (widget)->border_width;
       gtk_cmoption_menu_get_props (GTK_CMOPTION_MENU (widget), &props);
@@ -507,7 +508,7 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
       button_area.width = widget->allocation.width - 2 * border_width;
       button_area.height = widget->allocation.height - 2 * border_width;
 
-      if (!props.interior_focus && GTK_WIDGET_HAS_FOCUS (widget))
+      if (!props.interior_focus && gtkut_widget_has_focus (widget))
        {
          button_area.x += props.focus_width + props.focus_pad;
          button_area.y += props.focus_width + props.focus_pad;
@@ -516,7 +517,7 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
        }
       
       gtk_paint_box (widget->style, widget->window,
-                    GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
+                    gtkut_widget_get_state (widget), GTK_SHADOW_OUT,
                     area, widget, "optionmenu",
                     button_area.x, button_area.y,
                     button_area.width, button_area.height);
@@ -530,13 +531,13 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
          widget->style->xthickness;
 
       gtk_paint_tab (widget->style, widget->window,
-                    GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
+                    gtkut_widget_get_state (widget), GTK_SHADOW_OUT,
                     area, widget, "optionmenutab",
                     tab_x,
                     button_area.y + (button_area.height - props.indicator_size.height) / 2,
                     props.indicator_size.width, props.indicator_size.height);
       
-      if (GTK_WIDGET_HAS_FOCUS (widget))
+      if (gtkut_widget_has_focus (widget))
        {
          if (props.interior_focus)
            {
@@ -560,7 +561,7 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
              button_area.height += 2 * (props.focus_width + props.focus_pad);
            }
            
-         gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+         gtk_paint_focus (widget->style, widget->window, gtkut_widget_get_state (widget),
                           area, widget, "button",
                           button_area.x, 
                           button_area.y, 
@@ -577,7 +578,7 @@ gtk_cmoption_menu_expose (GtkWidget      *widget,
   cm_return_val_if_fail (GTK_IS_CMOPTION_MENU (widget), FALSE);
   cm_return_val_if_fail (event != NULL, FALSE);
 
-  if (GTK_WIDGET_DRAWABLE (widget))
+  if (gtkut_widget_is_drawable (widget))
     {
       gtk_cmoption_menu_paint (widget, &event->area);
 
@@ -711,7 +712,7 @@ gtk_cmoption_menu_select_first_sensitive (GtkCMOptionMenu *option_menu)
 
       while (children)
        {
-         if (GTK_WIDGET_SENSITIVE (children->data))
+         if (gtkut_widget_get_sensitive (children->data))
            {
              gtk_cmoption_menu_set_history (option_menu, index);
              return;
@@ -730,8 +731,8 @@ gtk_cmoption_menu_item_state_changed_cb (GtkWidget      *widget,
 {
   GtkWidget *child = GTK_BIN (option_menu)->child;
 
-  if (child && GTK_WIDGET_SENSITIVE (child) != GTK_WIDGET_IS_SENSITIVE (widget))
-    gtk_widget_set_sensitive (child, GTK_WIDGET_IS_SENSITIVE (widget));
+  if (child && gtkut_widget_get_sensitive (child) != gtkut_widget_is_sensitive (widget))
+    gtk_widget_set_sensitive (child, gtkut_widget_is_sensitive (widget));
 }
 
 static void
@@ -772,7 +773,7 @@ gtk_cmoption_menu_update_contents (GtkCMOptionMenu *option_menu)
          child = GTK_BIN (option_menu->menu_item)->child;
          if (child)
            {
-             if (!GTK_WIDGET_IS_SENSITIVE (option_menu->menu_item))
+             if (!gtkut_widget_is_sensitive (option_menu->menu_item))
                gtk_widget_set_sensitive (child, FALSE);
              gtk_widget_reparent (child, GTK_WIDGET (option_menu));
            }
@@ -786,7 +787,7 @@ gtk_cmoption_menu_update_contents (GtkCMOptionMenu *option_menu)
          gtk_widget_size_allocate (GTK_WIDGET (option_menu),
                                    &(GTK_WIDGET (option_menu)->allocation));
 
-         if (GTK_WIDGET_DRAWABLE (option_menu))
+         if (gtkut_widget_is_drawable (GTK_WIDGET(option_menu)))
            gtk_widget_queue_draw (GTK_WIDGET (option_menu));
        }
 
@@ -847,7 +848,7 @@ gtk_cmoption_menu_calc_size (GtkCMOptionMenu *option_menu)
          child = children->data;
          children = children->next;
 
-         if (GTK_WIDGET_VISIBLE (child))
+         if (gtkut_widget_get_visible (child))
            {
              GtkWidget *inner = GTK_BIN (child)->child;
 
@@ -912,7 +913,7 @@ gtk_cmoption_menu_position (GtkMenu  *menu,
       if (active == child)
        break;
 
-      if (GTK_WIDGET_VISIBLE (child))
+      if (gtkut_widget_get_visible (child))
        {
          gtk_widget_get_child_requisition (child, &requisition);
          menu_ypos -= requisition.height;
@@ -1011,7 +1012,8 @@ gtk_cmoption_menu_scroll_event (GtkWidget          *widget,
 
          l = g_list_nth (GTK_MENU_SHELL (option_menu->menu)->children, index);
          item = GTK_MENU_ITEM (l->data);
-         if (GTK_WIDGET_VISIBLE (item) && GTK_WIDGET_IS_SENSITIVE (item))
+         if (gtkut_widget_get_visible (GTK_WIDGET(item)) && 
+             gtkut_widget_is_sensitive (GTK_WIDGET(item)))
            {
              gtk_cmoption_menu_set_history (option_menu, index);
              gtk_menu_item_activate (GTK_MENU_ITEM (item));
index 22107f7f343b24069cdb27e80a69235c4e4b73f1..368d162d887d32ad5ca105412a206b9ec21459e4 100644 (file)
@@ -32,6 +32,7 @@
 #include "claws-marshal.h"
 #include "prefs_common.h"
 #include "utils.h"
+#include "gtkutils.h"
 
 #define CLIST_UNFROZEN(clist)     (((GtkCMCList*) (clist))->freeze_count == 0)
 #define CLIST_REFRESH(clist)    G_STMT_START { \
@@ -881,7 +882,7 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
   cm_return_if_fail (clist != NULL);
 
   /* bail now if we arn't drawable yet */
-  if (!GTK_WIDGET_DRAWABLE (clist) || row < 0 || row >= clist->rows)
+  if (!gtkut_widget_is_drawable (GTK_WIDGET(clist)) || row < 0 || row >= clist->rows)
     return;
 
   widget = GTK_WIDGET (clist);
@@ -1251,7 +1252,7 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
 
   /* draw focus rectangle */
   if (clist->focus_row == row &&
-      GTK_WIDGET_CAN_FOCUS (widget) && GTK_WIDGET_HAS_FOCUS (widget))
+      gtkut_widget_get_can_focus (widget) && gtkut_widget_has_focus (widget))
     {
       if (!area)
        gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
@@ -1282,7 +1283,7 @@ gtk_sctree_change_focus_row_expansion (GtkCMCTree          *ctree,
   clist = GTK_CMCLIST (ctree);
 
   if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (ctree))) && 
-      GTK_WIDGET_HAS_GRAB (ctree))
+      gtkut_widget_has_grab (GTK_WIDGET(ctree)))
     return;
   
   if (!(node =
@@ -1642,7 +1643,7 @@ gtk_sctree_button_press (GtkWidget *widget, GdkEventButton *event)
 
        on_row = gtk_cmclist_get_selection_info (clist, event->x, event->y, &row, &col);
 
-       if (on_row && !GTK_WIDGET_HAS_FOCUS(widget))
+       if (on_row && !gtkut_widget_has_focus(widget))
                gtk_widget_grab_focus (widget);
 
        if (gtk_sctree_is_hot_spot (GTK_SCTREE(sctree), event->x, event->y)) {
@@ -2833,7 +2834,7 @@ srow_delete (GtkCMCTree    *ctree,
        (clist, &(ctree_row->row), i, GTK_CMCELL_EMPTY, NULL, 0, NULL);
       if (ctree_row->row.cell[i].style)
        {
-         if (GTK_WIDGET_REALIZED (ctree))
+         if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
            gtk_style_detach (ctree_row->row.cell[i].style);
          g_object_unref (ctree_row->row.cell[i].style);
        }
@@ -2841,7 +2842,7 @@ srow_delete (GtkCMCTree    *ctree,
 
   if (ctree_row->row.style)
     {
-      if (GTK_WIDGET_REALIZED (ctree))
+      if (gtkut_widget_get_realized (GTK_WIDGET(ctree)))
        gtk_style_detach (ctree_row->row.style);
       g_object_unref (ctree_row->row.style);
     }
index 21b5877a5401957f8ac917fa0b235e006a33d8e0..5d10f09b533eb9e5fc09cf6e41c70567f219bf83 100644 (file)
@@ -32,6 +32,7 @@
 #include <gtk/gtk.h>
 #include "gtkshruler.h"
 #include "utils.h"
+#include "gtkutils.h"
 
 #define RULER_HEIGHT          14
 #define MINIMUM_INCR          5
@@ -124,7 +125,7 @@ gtk_shruler_draw_ticks(GtkRuler *ruler)
        cm_return_if_fail (ruler != NULL);
        cm_return_if_fail (GTK_IS_HRULER (ruler));
 
-       if (!GTK_WIDGET_DRAWABLE (ruler)) 
+       if (!gtkut_widget_is_drawable (GTK_WIDGET(ruler))) 
                return;
 
        widget = GTK_WIDGET (ruler);
index e60b92535fa82a50a9da5e15cca48e64b5173852..341c05da597d395ac6646806b2aa08c86e09348a 100644 (file)
@@ -645,7 +645,7 @@ void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py)
 
 void gtkut_widget_draw_now(GtkWidget *widget)
 {
-       if (widget && GTK_WIDGET_VISIBLE(widget) && GTK_WIDGET_DRAWABLE(widget))
+       if (widget && gtkut_widget_get_visible(widget) && gtkut_widget_is_drawable(widget))
                gdk_window_process_updates(widget->window, FALSE);
 }
 
@@ -868,7 +868,7 @@ GtkWidget *gtkut_get_focused_child(GtkContainer *parent)
 
        for (c = child_list; c != NULL; c = g_list_next(c)) {
                if (c->data && GTK_IS_WIDGET(c->data)) {
-                       if (GTK_WIDGET_HAS_FOCUS(GTK_WIDGET(c->data))) {
+                       if (gtkut_widget_has_focus(GTK_WIDGET(c->data))) {
                                result = GTK_WIDGET(c->data);
                                break;
                        }
@@ -1689,3 +1689,111 @@ claws_input_add    (gint              source,
 
   return result;
 }
+
+gboolean gtkut_widget_has_focus(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_has_focus(widget);
+#else
+       return GTK_WIDGET_HAS_FOCUS(widget);
+#endif
+}
+
+gboolean gtkut_widget_get_can_focus(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_get_can_focus(widget);
+#else
+       return GTK_WIDGET_CAN_FOCUS(widget);
+#endif
+}
+
+gboolean gtkut_widget_has_grab(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_has_grab(widget);
+#else
+       return GTK_WIDGET_HAS_GRAB(widget);
+#endif
+}
+
+gboolean gtkut_widget_get_visible(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_get_visible(widget);
+#else
+       return GTK_WIDGET_VISIBLE(widget);
+#endif
+}
+
+gboolean gtkut_widget_get_realized(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,19,0)
+       return gtk_widget_get_realized(widget);
+#else
+       return GTK_WIDGET_REALIZED(widget);
+#endif
+}
+
+gboolean gtkut_widget_is_sensitive(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_is_sensitive(widget);
+#else
+       return GTK_WIDGET_IS_SENSITIVE(widget);
+#endif
+}
+
+gboolean gtkut_widget_get_sensitive(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_get_sensitive(widget);
+#else
+       return GTK_WIDGET_SENSITIVE(widget);
+#endif
+}
+
+gboolean gtkut_widget_is_drawable(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_is_drawable(widget);
+#else
+       return GTK_WIDGET_DRAWABLE(widget);
+#endif
+}
+
+GtkStateType gtkut_widget_get_state(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_get_state(widget);
+#else
+       return GTK_WIDGET_STATE(widget);
+#endif
+}
+
+gboolean gtkut_widget_get_mapped(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,19,0)
+       return gtk_widget_get_mapped(widget);
+#else
+       return GTK_WIDGET_MAPPED(widget);
+#endif
+}
+
+gboolean gtkut_widget_get_has_window(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_get_has_window(widget);
+#else
+       return GTK_WIDGET_NO_WINDOW(widget);
+#endif
+}
+
+gboolean gtkut_widget_get_app_paintable(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+       return gtk_widget_get_app_paintable(widget);
+#else
+       return GTK_WIDGET_APP_PAINTABLE(widget);
+#endif
+}
index c8039dd87cab7a751a88031adf20341c614f44c8..aabc4b338656e3e7b6a6236223540948b7d24bed 100644 (file)
@@ -164,6 +164,19 @@ void gtkut_widget_init                     (void);
 void gtkut_widget_set_app_icon         (GtkWidget      *widget);
 void gtkut_widget_set_composer_icon    (GtkWidget      *widget);
 
+gboolean gtkut_widget_get_app_paintable        (GtkWidget      *widget);
+gboolean gtkut_widget_get_can_focus    (GtkWidget      *widget);
+gboolean gtkut_widget_get_has_window   (GtkWidget      *widget);
+gboolean gtkut_widget_get_mapped       (GtkWidget      *widget);
+gboolean gtkut_widget_get_realized     (GtkWidget      *widget);
+gboolean gtkut_widget_get_sensitive    (GtkWidget      *widget);
+GtkStateType gtkut_widget_get_state    (GtkWidget      *widget);
+gboolean gtkut_widget_get_visible      (GtkWidget      *widget);
+gboolean gtkut_widget_has_grab         (GtkWidget      *widget);
+gboolean gtkut_widget_has_focus                (GtkWidget      *widget);
+gboolean gtkut_widget_is_drawable      (GtkWidget      *widget);
+gboolean gtkut_widget_is_sensitive     (GtkWidget      *widget);
+
 GtkWidget *gtkut_account_menu_new      (GList                  *ac_list,
                                         GCallback               callback,
                                         gpointer                data);
index 33e49df19fbb181fcdb40a3d576af77a19ea3687..3d896e92414b85c8cb8b627a16b6e5e9a375d603 100644 (file)
@@ -36,6 +36,7 @@
 #include <gtk/gtk.h>
 #include "utils.h"
 #include "gtkvscrollbutton.h"
+#include "gtkutils.h"
 
 #define SCROLL_TIMER_LENGTH  20
 #define SCROLL_INITIAL_DELAY 100       /* must hold button this long before ... */
@@ -252,7 +253,7 @@ static gint gtk_vscrollbutton_button_press(GtkWidget *widget,
                                           GdkEventButton *event,
                                           GtkVScrollbutton *scrollbutton)
 {
-    if (!GTK_WIDGET_HAS_FOCUS(widget))
+    if (!gtkut_widget_has_focus(widget))
        gtk_widget_grab_focus(widget);
 
     if (scrollbutton->button == 0) {
@@ -274,7 +275,7 @@ static gint gtk_vscrollbutton_button_release(GtkWidget *widget,
                                             GdkEventButton *event,
                                             GtkVScrollbutton *scrollbutton)
 {
-    if (!GTK_WIDGET_HAS_FOCUS(widget))
+    if (!gtkut_widget_has_focus(widget))
        gtk_widget_grab_focus(widget);
 
     if (scrollbutton->button == event->button) {
@@ -416,7 +417,7 @@ static gint gtk_real_vscrollbutton_timer(GtkVScrollbutton *scrollbutton)
 static void gtk_vscrollbutton_set_sensitivity   (GtkAdjustment    *adjustment,
                                                 GtkVScrollbutton *scrollbutton)
 {
-       if (!GTK_WIDGET_REALIZED(GTK_WIDGET(scrollbutton))) return;
+       if (!gtkut_widget_get_realized(GTK_WIDGET(scrollbutton))) return;
        if (scrollbutton->button != 0) return; /* not while something is pressed */
        
        gtk_widget_set_sensitive(scrollbutton->upbutton, 
index 952228a53717d56801a913098517187577d0611f..f6651aad858647d33d46d2f0add7b92466875579 100644 (file)
@@ -85,7 +85,7 @@ static void combo_activated   (GtkEditable    *editable);
 gchar *input_dialog(const gchar *title, const gchar *message,
                    const gchar *default_string)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);
@@ -111,7 +111,7 @@ gchar *input_dialog(const gchar *title, const gchar *message,
 gchar *input_dialog_with_invisible(const gchar *title, const gchar *message,
                                   const gchar *default_string)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(TRUE);
@@ -137,7 +137,7 @@ gchar *input_dialog_with_invisible_checkbtn(const gchar *title, const gchar *mes
                                   const gchar *default_string, const gchar *checkbtn_label,
                                   gboolean *checkbtn_state)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(TRUE);
@@ -178,7 +178,7 @@ gchar *input_dialog_combo_remember(const gchar *title, const gchar *message,
                          const gchar *default_string, GList *list,
                          gboolean *remember)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);
@@ -209,7 +209,7 @@ gchar *input_dialog_with_checkbtn(const gchar       *title,
                                   const gchar  *checkbtn_label,
                                   gboolean *checkbtn_state)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);
@@ -421,7 +421,7 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message,
 {
        gchar *str;
 
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);
index da62bb26ae4df9ef68b6a2ab2b13ed2034c823ed..1f3b746dee4bafa6aae5b4c1338d00e91ed4d532 100644 (file)
@@ -40,6 +40,7 @@
 #include "prefs_common.h"
 #include "codeconv.h"
 #include "defs.h"
+#include "gtkutils.h"
 
 static void claws_spell_entry_init             (ClawsSpellEntry *entry);
 static void claws_spell_entry_editable_init    (GtkEditableClass *iface);
@@ -427,7 +428,7 @@ void claws_spell_entry_recheck_all(ClawsSpellEntry *entry)
        layout = gtk_entry_get_layout(GTK_ENTRY(entry));
        pango_layout_set_attributes(layout, entry->priv->attr_list);
 
-       if (GTK_WIDGET_REALIZED(GTK_WIDGET(entry))) {
+       if (gtkut_widget_get_realized(GTK_WIDGET(entry))) {
                rect.x = 0; rect.y = 0;
                rect.width  = GTK_WIDGET(entry)->allocation.width;
                rect.height = GTK_WIDGET(entry)->allocation.height;
index 93b6c8a2feb3d424da447623b7b6175e7ab89ee1..d57f3a87a66478869ec678299c3de573055feb7e 100644 (file)
@@ -258,13 +258,13 @@ static gint headerview_show_xface(HeaderView *headerview, MsgInfo *msginfo)
            !msginfo->extradata->xface || 
            strlen(msginfo->extradata->xface) < 5) {
                if (headerview->image &&
-                   GTK_WIDGET_VISIBLE(headerview->image)) {
+                   gtkut_widget_get_visible(headerview->image)) {
                        gtk_widget_hide(headerview->image);
                        gtk_widget_queue_resize(hbox);
                }
                return -1;
        }
-       if (!GTK_WIDGET_VISIBLE(headerview->hbox)) return -1;
+       if (!gtkut_widget_get_visible(headerview->hbox)) return -1;
 
        if (headerview->image) {
                gtk_widget_destroy(headerview->image);
@@ -295,13 +295,13 @@ static gint headerview_show_face (HeaderView *headerview, MsgInfo *msginfo)
 
        if (!msginfo->extradata || !msginfo->extradata->face) {
                if (headerview->image &&
-                   GTK_WIDGET_VISIBLE(headerview->image)) {
+                   gtkut_widget_get_visible(headerview->image)) {
                        gtk_widget_hide(headerview->image);
                        gtk_widget_queue_resize(hbox);
                }
                return -1;
        }
-       if (!GTK_WIDGET_VISIBLE(headerview->hbox)) return -1;
+       if (!gtkut_widget_get_visible(headerview->hbox)) return -1;
 
        if (headerview->image) {
                gtk_widget_destroy(headerview->image);
@@ -331,7 +331,7 @@ static void headerview_save_contact_pic (HeaderView *headerview, MsgInfo *msginf
        GError *error = NULL;
        GdkPixbuf *picture = NULL;
 
-       if (!GTK_WIDGET_VISIBLE(headerview->hbox)) return;
+       if (!gtkut_widget_get_visible(headerview->hbox)) return;
 
        if (headerview->image) {
                picture = gtk_image_get_pixbuf(GTK_IMAGE(headerview->image));
@@ -360,7 +360,7 @@ static gint headerview_show_contact_pic (HeaderView *headerview, MsgInfo *msginf
        GdkPixbuf *picture = NULL;
        gint w, h;
 
-       if (!GTK_WIDGET_VISIBLE(headerview->hbox)) return -1;
+       if (!gtkut_widget_get_visible(headerview->hbox)) return -1;
 
        if (headerview->image) {
                gtk_widget_destroy(headerview->image);
@@ -425,7 +425,7 @@ void headerview_clear(HeaderView *headerview)
        gtk_widget_hide(headerview->tags_header_label);
        gtk_widget_hide(headerview->tags_body_label);
 
-       if (headerview->image && GTK_WIDGET_VISIBLE(headerview->image)) {
+       if (headerview->image && gtkut_widget_get_visible(headerview->image)) {
                gtk_widget_hide(headerview->image);
                gtk_widget_queue_resize(headerview->hbox);
        }
index 92afab8a18421ac525e88de4360d4ba0b126fb7e..7c99e2457b38add4f367fe87444b2f9b7a1c57d6 100644 (file)
@@ -3563,7 +3563,7 @@ void main_window_popup(MainWindow *mainwin)
 {
        static gboolean first_start = TRUE;
 
-       if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window)))
+       if (!gtkut_widget_get_visible(GTK_WIDGET(mainwin->window)))
                main_window_show(mainwin);
 
        if (prefs_common.mainwin_maximised)
@@ -4795,7 +4795,7 @@ static void allsel_cb(GtkAction *action, gpointer data)
        MessageView *msgview = mainwin->messageview;
 
        if (messageview_is_visible(msgview) &&
-                (GTK_WIDGET_HAS_FOCUS(msgview->mimeview->textview->text)))
+                (gtkut_widget_has_focus(msgview->mimeview->textview->text)))
                messageview_select_all(mainwin->messageview);
        else
                summary_select_all(mainwin->summaryview);
index b514356fc0bc17e775151e4843cca403bfa61560..66959276589098b3bc50da709377c947a88b6a40 100644 (file)
@@ -1221,7 +1221,7 @@ static void mimeview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *node, gint colu
        if (!partinfo) return;
 
        /* ungrab the mouse event */
-       if (GTK_WIDGET_HAS_GRAB(ctree)) {
+       if (gtkut_widget_has_grab(GTK_WIDGET(ctree))) {
                gtk_grab_remove(GTK_WIDGET(ctree));
                if (gdk_pointer_is_grabbed())
                        gdk_pointer_ungrab(GDK_CURRENT_TIME);
index d2bc0e37328ff8163f3323bc501b17a5db321ffd..60db1571a87f86bfcb64da2f5af76e94602afc54 100644 (file)
@@ -5,7 +5,8 @@ libeggtrayicon_la_SOURCES = \
 
 INCLUDES = \
         -I../../../ \
-       -I../../../common 
+       -I../../../common \
+       -I../../../gtk 
                        
 AM_CPPFLAGS = \
        $(GTK_CFLAGS)
index 01376fbd3aac17a670cc055d61eab54554a14f6a..1f7506982f9aaba7863d13874a01f34cdd8facfa 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <string.h>
 #include "eggtrayicon.h"
+#include "gtkutils.h"
 
 #include <gdk/gdkx.h>
 #include <X11/Xatom.h>
@@ -350,7 +351,7 @@ egg_tray_icon_update_manager_window (EggTrayIcon *icon, gboolean dock_if_realize
  
       gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon);
 
-      if (dock_if_realized && GTK_WIDGET_REALIZED (icon))
+      if (dock_if_realized && gtkut_widget_get_realized (GTK_WIDGET(icon)))
         egg_tray_icon_send_dock_request (icon);
 
       egg_tray_icon_get_orientation_property (icon);
@@ -375,7 +376,7 @@ make_transparent_again (GtkWidget *widget, GtkStyle *previous_style,
 static void
 make_transparent (GtkWidget *widget, gpointer user_data)
 {
-  if (GTK_WIDGET_NO_WINDOW (widget) || GTK_WIDGET_APP_PAINTABLE (widget))
+  if (!gtkut_widget_get_has_window (widget) || gtkut_widget_get_app_paintable (widget))
     return;
 
   gtk_widget_set_app_paintable (widget, TRUE);
index 3ec2af76f39edd2503cec5d288a751df1449a06f..39bcde43e2abc67a078f9ad2e98db76407b3cb99 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "xembed.h"
 #include "gtk2-funcs.h"
+#include "gtkutils.h"
 
 static void            gtk_plug_xembed_class_init            (GtkPlugXEmbedClass *klass);
 static void            gtk_plug_xembed_init                  (GtkPlugXEmbed      *plug);
@@ -195,7 +196,7 @@ gtk_plug_xembed_set_is_child (GtkPlugXEmbed  *plug,
        * here, but don't bother remapping -- we will get mapped
        * by gtk_widget_set_parent ().
        */
-      if (GTK_WIDGET_MAPPED (plug))
+      if (gtkut_widget_get_mapped (plug))
        gtk_widget_unmap (GTK_WIDGET (plug));
       
       GTK_WIDGET_UNSET_FLAGS (plug, GTK_TOPLEVEL);
@@ -244,7 +245,7 @@ _gtk_plug_xembed_add_to_socket (GtkPlugXEmbed   *plug,
   
   g_return_if_fail (GTK_IS_PLUG_XEMBED (plug));
   g_return_if_fail (GTK_IS_SOCKET (socket));
-  g_return_if_fail (GTK_WIDGET_REALIZED (socket));
+  g_return_if_fail (gtkut_widget_get_realized (socket));
 
   widget = GTK_WIDGET (plug);
 
@@ -255,7 +256,7 @@ _gtk_plug_xembed_add_to_socket (GtkPlugXEmbed   *plug,
 
   plug->socket_window = GTK_WIDGET (socket)->window;
 
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtkut_widget_get_realized (widget))
     {
       gdk_drawable_get_size (GDK_DRAWABLE (widget->window), &w, &h);
       gdk_window_reparent (widget->window, plug->socket_window, -w, -h);
@@ -286,14 +287,14 @@ _gtk_plug_xembed_remove_from_socket (GtkPlugXEmbed   *plug,
 
   g_return_if_fail (GTK_IS_PLUG_XEMBED (plug));
   g_return_if_fail (GTK_IS_SOCKET (socket));
-  g_return_if_fail (GTK_WIDGET_REALIZED (plug));
+  g_return_if_fail (gtkut_widget_get_realized (plug));
 
   widget = GTK_WIDGET (plug);
 
   g_object_ref (plug);
   g_object_ref (socket);
 
-  widget_was_visible = GTK_WIDGET_VISIBLE (plug);
+  widget_was_visible = gtkut_widget_get_visible (plug);
   
   gdk_window_hide (widget->window);
   gdk_window_reparent (widget->window, GDK_ROOT_PARENT (), 0, 0);
@@ -327,7 +328,7 @@ _gtk_plug_xembed_remove_from_socket (GtkPlugXEmbed   *plug,
   gdk_window_unref (event.any.window);
   g_object_unref (plug);
 
-  if (widget_was_visible && GTK_WIDGET_VISIBLE (socket))
+  if (widget_was_visible && gtkut_widget_get_visible (socket))
     gtk_widget_queue_resize (GTK_WIDGET (socket));
 
   g_object_unref (socket);
@@ -395,7 +396,7 @@ gtk_plug_xembed_get_id (GtkPlugXEmbed *plug)
 {
   g_return_val_if_fail (GTK_IS_PLUG_XEMBED (plug), 0);
 
-  if (!GTK_WIDGET_REALIZED (plug))
+  if (!gtkut_widget_get_realized (plug))
     gtk_widget_realize (GTK_WIDGET (plug));
 
   return GDK_WINDOW_XWINDOW (GTK_WIDGET (plug)->window);
@@ -547,8 +548,8 @@ gtk_plug_xembed_map (GtkWidget *widget)
          GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
          
          if (bin->child &&
-             GTK_WIDGET_VISIBLE (bin->child) &&
-             !GTK_WIDGET_MAPPED (bin->child))
+             gtkut_widget_get_visible (bin->child) &&
+             !gtkut_widget_get_mapped (bin->child))
                  gtk_widget_map (bin->child);
          xembed_set_info (widget->window, XEMBED_MAPPED);
          if (!GTK_WIDGET_NO_WINDOW (widget))
@@ -604,12 +605,12 @@ gtk_plug_xembed_size_allocate (GtkWidget     *widget,
 
       widget->allocation = *allocation;
 
-      if (GTK_WIDGET_REALIZED (widget))
+      if (gtkut_widget_get_realized (widget))
        gdk_window_move_resize (widget->window,
                                allocation->x, allocation->y,
                                allocation->width, allocation->height);
 
-      if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+      if (bin->child && gtkut_widget_get_visible (bin->child))
        {
          GtkAllocation child_allocation;
          
index a81f9de75037de848e187e08262d03023dd5b9a8..7847a56bee717dd616e187632cec2ca64e7d2ba3 100644 (file)
@@ -248,7 +248,7 @@ static gboolean trayicon_close_hook(gpointer source, gpointer data)
                        *close_allowed = FALSE;
                        focused_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window));
                        
-                       if (GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window)))
+                       if (gtkut_widget_get_visible(GTK_WIDGET(mainwin->window)))
                                main_window_hide(mainwin);
                }
        }
@@ -260,7 +260,7 @@ static gboolean trayicon_got_iconified_hook(gpointer source, gpointer data)
        MainWindow *mainwin = mainwindow_get_mainwindow();
 
        if (trayicon_prefs.hide_when_iconified
-                       && GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window))
+                       && gtkut_widget_get_visible(GTK_WIDGET(mainwin->window))
                        && !gtk_window_get_skip_taskbar_hint(GTK_WINDOW(mainwin->window))) {
                focused_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window));
                gtk_window_set_skip_taskbar_hint(GTK_WINDOW(mainwin->window), TRUE);
@@ -299,7 +299,7 @@ static gboolean click_cb(GtkWidget * widget,
 
        switch (event->button) {
        case 1:
-               if (GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window))) {
+               if (gtkut_widget_get_visible(GTK_WIDGET(mainwin->window))) {
                        if ((gdk_window_get_state(GTK_WIDGET(mainwin->window)->window)&GDK_WINDOW_STATE_ICONIFIED)
                                        || mainwindow_is_obscured()) {
                                gtk_window_deiconify(GTK_WINDOW(mainwin->window));
@@ -477,7 +477,7 @@ int plugin_init(gchar **error)
        if (trayicon_prefs.hide_at_startup && claws_is_starting()) {
                MainWindow *mainwin = mainwindow_get_mainwindow();
 
-               if (GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window)))
+               if (gtkut_widget_get_visible(GTK_WIDGET(mainwin->window)))
                        main_window_hide(mainwin);
                main_set_show_at_startup(FALSE);
        }
index 5d48bd216e54c6714ce429dd0bd7576d3b3a4af6..ac46fe3079d37239af5f583c6f19d3821e65c0ed 100644 (file)
@@ -4494,7 +4494,7 @@ static void prefs_account_nntpauth_toggled(GtkToggleButton *button,
 {
        gboolean auth;
 
-       if (!GTK_WIDGET_SENSITIVE (GTK_WIDGET (button)))
+       if (!gtkut_widget_get_sensitive (GTK_WIDGET (button)))
                return;
        auth = gtk_toggle_button_get_active (button);
        gtk_widget_set_sensitive(basic_page.uid_label,  auth);