2011-10-07 [colin] 3.7.10cvs19
authorColin Leroy <colin@colino.net>
Fri, 7 Oct 2011 09:08:57 +0000 (09:08 +0000)
committerColin Leroy <colin@colino.net>
Fri, 7 Oct 2011 09:08:57 +0000 (09:08 +0000)
* AUTHORS
* src/account.c
* src/action.c
* src/addr_compl.c
* src/addressbook.c
* src/alertpanel.c
* src/compose.c
* src/edittags.c
* src/folderview.c
* src/grouplistdialog.c
* src/image_viewer.c
* src/mainwindow.c
* src/mimeview.c
* src/noticeview.c
* src/prefs_filtering_action.c
* src/prefs_folder_column.c
* src/prefs_msg_colors.c
* src/prefs_summary_column.c
* src/prefs_toolbar.c
* src/printing.c
* src/stock_pixmap.c
* src/summaryview.c
* src/textview.c
* src/undo.c
* src/wizard.c
* src/gtk/about.c
* src/gtk/authors.h
* src/gtk/colorlabel.c
* src/gtk/colorsel.c
* src/gtk/gtkcmclist.c
* src/gtk/gtkcmctree.c
* src/gtk/gtkcmoptionmenu.c
* src/gtk/gtksctree.c
* src/gtk/gtkutils.c
* src/gtk/gtkvscrollbutton.c
* src/gtk/inputdialog.c
* src/gtk/logwindow.c
* src/gtk/menu.c
* src/gtk/prefswindow.c
* src/gtk/progressdialog.c
* src/plugins/pgpcore/passphrase.c
* src/plugins/trayicon/trayicon.c
Bug #2371, "Port to GTK+ 3.0": Use accessor functions.
Patch by Hanno Thurow-Meyer, many thanks to him !

45 files changed:
AUTHORS
ChangeLog
PATCHSETS
configure.ac
src/account.c
src/action.c
src/addr_compl.c
src/addressbook.c
src/alertpanel.c
src/compose.c
src/edittags.c
src/folderview.c
src/grouplistdialog.c
src/gtk/about.c
src/gtk/authors.h
src/gtk/colorlabel.c
src/gtk/colorsel.c
src/gtk/gtkcmclist.c
src/gtk/gtkcmctree.c
src/gtk/gtkcmoptionmenu.c
src/gtk/gtksctree.c
src/gtk/gtkutils.c
src/gtk/gtkvscrollbutton.c
src/gtk/inputdialog.c
src/gtk/logwindow.c
src/gtk/menu.c
src/gtk/prefswindow.c
src/gtk/progressdialog.c
src/image_viewer.c
src/mainwindow.c
src/mimeview.c
src/noticeview.c
src/plugins/pgpcore/passphrase.c
src/plugins/trayicon/trayicon.c
src/prefs_filtering_action.c
src/prefs_folder_column.c
src/prefs_msg_colors.c
src/prefs_summary_column.c
src/prefs_toolbar.c
src/printing.c
src/stock_pixmap.c
src/summaryview.c
src/textview.c
src/undo.c
src/wizard.c

diff --git a/AUTHORS b/AUTHORS
index bb9df0e..183877a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -285,3 +285,4 @@ contributors (in addition to the above; based on Changelog)
        Sebastien Bigaret
        Mikhail Efremov
        Steve Rader
+       Hanno Meyer-Thurow
index 3be82c1..cfa8681 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,50 @@
+2011-10-07 [colin]     3.7.10cvs19
+
+       * AUTHORS
+       * src/account.c
+       * src/action.c
+       * src/addr_compl.c
+       * src/addressbook.c
+       * src/alertpanel.c
+       * src/compose.c
+       * src/edittags.c
+       * src/folderview.c
+       * src/grouplistdialog.c
+       * src/image_viewer.c
+       * src/mainwindow.c
+       * src/mimeview.c
+       * src/noticeview.c
+       * src/prefs_filtering_action.c
+       * src/prefs_folder_column.c
+       * src/prefs_msg_colors.c
+       * src/prefs_summary_column.c
+       * src/prefs_toolbar.c
+       * src/printing.c
+       * src/stock_pixmap.c
+       * src/summaryview.c
+       * src/textview.c
+       * src/undo.c
+       * src/wizard.c
+       * src/gtk/about.c
+       * src/gtk/authors.h
+       * src/gtk/colorlabel.c
+       * src/gtk/colorsel.c
+       * src/gtk/gtkcmclist.c
+       * src/gtk/gtkcmctree.c
+       * src/gtk/gtkcmoptionmenu.c
+       * src/gtk/gtksctree.c
+       * src/gtk/gtkutils.c
+       * src/gtk/gtkvscrollbutton.c
+       * src/gtk/inputdialog.c
+       * src/gtk/logwindow.c
+       * src/gtk/menu.c
+       * src/gtk/prefswindow.c
+       * src/gtk/progressdialog.c
+       * src/plugins/pgpcore/passphrase.c
+       * src/plugins/trayicon/trayicon.c
+               Bug #2371, "Port to GTK+ 3.0": Use accessor functions.
+               Patch by Hanno Thurow-Meyer, many thanks to him !
+
 2011-09-20 [colin]     3.7.10cvs18
 
        * src/common/ssl.c
index cdf74c2..85fd914 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.9.2.48 -r 1.9.2.49 src/common/ssl.c;  ) > 3.7.10cvs16.patchset
 ( cvs diff -u -r 1.101.2.67 -r 1.101.2.68 src/news.c;  ) > 3.7.10cvs17.patchset
 ( cvs diff -u -r 1.9.2.49 -r 1.9.2.50 src/common/ssl.c;  ) > 3.7.10cvs18.patchset
+( cvs diff -u -r 1.100.2.79 -r 1.100.2.80 AUTHORS;  cvs diff -u -r 1.61.2.98 -r 1.61.2.99 src/account.c;  cvs diff -u -r 1.12.2.66 -r 1.12.2.67 src/action.c;  cvs diff -u -r 1.27.2.53 -r 1.27.2.54 src/addr_compl.c;  cvs diff -u -r 1.60.2.143 -r 1.60.2.144 src/addressbook.c;  cvs diff -u -r 1.17.2.43 -r 1.17.2.44 src/alertpanel.c;  cvs diff -u -r 1.382.2.580 -r 1.382.2.581 src/compose.c;  cvs diff -u -r 1.1.2.24 -r 1.1.2.25 src/edittags.c;  cvs diff -u -r 1.207.2.220 -r 1.207.2.221 src/folderview.c;  cvs diff -u -r 1.14.2.28 -r 1.14.2.29 src/grouplistdialog.c;  cvs diff -u -r 1.1.2.30 -r 1.1.2.31 src/image_viewer.c;  cvs diff -u -r 1.274.2.328 -r 1.274.2.329 src/mainwindow.c;  cvs diff -u -r 1.83.2.170 -r 1.83.2.171 src/mimeview.c;  cvs diff -u -r 1.5.2.25 -r 1.5.2.26 src/noticeview.c;  cvs diff -u -r 1.1.4.69 -r 1.1.4.70 src/prefs_filtering_action.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/prefs_folder_column.c;  cvs diff -u -r 1.1.2.42 -r 1.1.2.43 src/prefs_msg_colors.c;  cvs diff -u -r 1.10.2.27 -r 1.10.2.28 src/prefs_summary_column.c;  cvs diff -u -r 1.30.2.67 -r 1.30.2.68 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.31 -r 1.1.2.32 src/printing.c;  cvs diff -u -r 1.25.2.68 -r 1.25.2.69 src/stock_pixmap.c;  cvs diff -u -r 1.395.2.430 -r 1.395.2.431 src/summaryview.c;  cvs diff -u -r 1.96.2.232 -r 1.96.2.233 src/textview.c;  cvs diff -u -r 1.13.2.22 -r 1.13.2.23 src/undo.c;  cvs diff -u -r 1.1.2.84 -r 1.1.2.85 src/wizard.c;  cvs diff -u -r 1.4.2.79 -r 1.4.2.80 src/gtk/about.c;  cvs diff -u -r 1.1.2.73 -r 1.1.2.74 src/gtk/authors.h;  cvs diff -u -r 1.2.2.33 -r 1.2.2.34 src/gtk/colorlabel.c;  cvs diff -u -r 1.1.4.15 -r 1.1.4.16 src/gtk/colorsel.c;  cvs diff -u -r 1.1.2.15 -r 1.1.2.16 src/gtk/gtkcmclist.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/gtk/gtkcmoptionmenu.c;  cvs diff -u -r 1.1.4.60 -r 1.1.4.61 src/gtk/gtksctree.c;  cvs diff -u -r 1.5.2.95 -r 1.5.2.96 src/gtk/gtkutils.c;  cvs diff -u -r 1.5.2.21 -r 1.5.2.22 src/gtk/gtkvscrollbutton.c;  cvs diff -u -r 1.2.2.42 -r 1.2.2.43 src/gtk/inputdialog.c;  cvs diff -u -r 1.1.4.37 -r 1.1.4.38 src/gtk/logwindow.c;  cvs diff -u -r 1.5.2.42 -r 1.5.2.43 src/gtk/menu.c;  cvs diff -u -r 1.12.2.56 -r 1.12.2.57 src/gtk/prefswindow.c;  cvs diff -u -r 1.1.4.27 -r 1.1.4.28 src/gtk/progressdialog.c;  cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/plugins/pgpcore/passphrase.c;  cvs diff -u -r 1.14.2.77 -r 1.14.2.78 src/plugins/trayicon/trayicon.c;  ) > 3.7.10cvs19.patchset
index 9348f89..dde22b5 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=18
+EXTRA_VERSION=19
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a3ce627..05859db 100644 (file)
@@ -1531,7 +1531,7 @@ static void account_create_list_view_columns(GtkWidget *list_view)
                 NULL);
        gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);          
        gtk_tree_view_column_set_alignment (column, 0.5);
-       CLAWS_SET_TIP(column->button,
+       CLAWS_SET_TIP(gtk_tree_view_column_get_widget(column),
                        _("'Get Mail' retrieves mail from the checked accounts"));
        g_signal_connect(G_OBJECT(renderer), "toggled",                      
                         G_CALLBACK(account_get_all_toggled),
index 3e6de2c..d5b5e68 100644 (file)
@@ -476,15 +476,22 @@ void action_update_compose_menu(GtkUIManager *ui_manager,
 
 static GtkWidget *find_item_in_menu(GtkWidget *menu, gchar *name)
 {
-       GList *amenu = GTK_MENU_SHELL(menu)->children;
+       GList *children = gtk_container_get_children(GTK_CONTAINER(GTK_MENU_SHELL(menu)));
+       GList *amenu = children;
        const gchar *existing_name;
        while (amenu) {
                GtkWidget *item = GTK_WIDGET(amenu->data);
                if ((existing_name = g_object_get_data(G_OBJECT(item), "s_name")) != NULL &&
                    !strcmp2(name, existing_name))
+               {
+                       g_list_free(children);
                         return item;
+               }
                amenu = amenu->next;
        }
+
+       g_list_free(children);
+
        return NULL;
 }
 
@@ -1324,7 +1331,7 @@ static void create_io_dialog(Children *children)
 
        dialog = gtk_dialog_new();
        gtk_container_set_border_width
-               (GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5);
+               (GTK_CONTAINER(gtk_dialog_get_action_area(GTK_DIALOG(dialog))), 5);
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
        gtk_window_set_title(GTK_WINDOW(dialog), _("Action's input/output"));
        gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
@@ -1336,7 +1343,8 @@ static void create_io_dialog(Children *children)
                         children);
 
        vbox = gtk_vbox_new(FALSE, 8);
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), vbox);
+       gtk_container_add(GTK_CONTAINER(
+                               gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
        gtk_widget_show(vbox);
 
@@ -1435,7 +1443,8 @@ static void create_io_dialog(Children *children)
        if (children->nb)
                gtk_widget_set_sensitive(close_button, FALSE);
 
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), hbox);
+       gtk_container_add(GTK_CONTAINER(
+                       gtk_dialog_get_action_area(GTK_DIALOG(dialog))), hbox);
 
        children->dialog       = dialog;
        children->scrolledwin  = scrolledwin;
index d27fd0b..4620310 100644 (file)
 #endif
 #include "defs.h"
 
-/* We know this file uses some deprecated stuff. */
-#undef G_DISABLE_DEPRECATED
-#undef GTK_DISABLE_DEPRECATED
-#undef GDK_DISABLE_DEPRECATED
-
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
@@ -848,9 +843,9 @@ static void addrcompl_resize_window( CompletionWindow *cw ) {
        gint x, y, width, height, depth;
 
        /* Get current geometry of window */
-       gdk_window_get_geometry( cw->window->window, &x, &y, &width, &height, &depth );
+       gdk_window_get_geometry( gtk_widget_get_window( cw->window ), &x, &y, &width, &height, &depth );
 
-       gtk_widget_hide_all( cw->window );
+       gtk_widget_hide( cw->window );
        gtk_widget_show_all( cw->window );
        gtk_widget_size_request( cw->list_view, &r );
 
@@ -1107,7 +1102,7 @@ static void completion_window_apply_selection(GtkTreeView *list_view,
        g_free(text);
 
        /* Move focus to next widget */
-       parent = GTK_WIDGET(entry)->parent;
+       parent = gtk_widget_get_parent(GTK_WIDGET(entry));
        if( parent && move_focus) {
                gtk_widget_child_focus( parent, GTK_DIR_TAB_FORWARD );
        }
@@ -1317,6 +1312,7 @@ static void address_completion_create_completion_window( GtkEntry *entry_ )
        GtkRequisition r;
        GtkWidget *window;
        GtkWidget *entry = GTK_WIDGET(entry_);
+       GdkWindow *gdkwin;
 
        /* Create new window and list */
        window = gtk_window_new(GTK_WINDOW_POPUP);
@@ -1340,8 +1336,9 @@ static void address_completion_create_completion_window( GtkEntry *entry_ )
        gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll),
                GTK_SHADOW_OUT);
        /* Use entry widget to create initial window */
-       gdk_window_get_geometry(entry->window, &x, &y, &width, &height, &depth);
-       gdk_window_get_origin (entry->window, &x, &y);
+       gdkwin = gtk_widget_get_window(entry),
+       gdk_window_get_geometry(gdkwin, &x, &y, &width, &height, &depth);
+       gdk_window_get_origin (gdkwin, &x, &y);
        y += height;
        gtk_window_move(GTK_WINDOW(window), x, y);
 
@@ -1368,7 +1365,7 @@ static void address_completion_create_completion_window( GtkEntry *entry_ )
                         "key-press-event",
                         G_CALLBACK(completion_window_key_press),
                         _compWindow_ );
-       gdk_pointer_grab(window->window, TRUE,
+       gdk_pointer_grab(gtk_widget_get_window(window), TRUE,
                         GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
                         GDK_BUTTON_RELEASE_MASK,
                         NULL, NULL, GDK_CURRENT_TIME);
@@ -1414,7 +1411,7 @@ static gboolean completion_window_button_press(GtkWidget *widget,
                                restore = FALSE;
                                break;
                        }
-                       event_widget = event_widget->parent;
+                       event_widget = gtk_widget_get_parent(event_widget);
                }
        }
 
@@ -1466,7 +1463,7 @@ static gboolean completion_window_key_press(GtkWidget *widget,
        /* make tab move to next field */
        if( event->keyval == GDK_Tab ) {
                /* Reference to parent */
-               parent = GTK_WIDGET(entry)->parent;
+               parent = gtk_widget_get_parent(GTK_WIDGET(entry));
 
                /* Discard the window */
                clear_completion_cache();
@@ -1482,7 +1479,7 @@ static gboolean completion_window_key_press(GtkWidget *widget,
        /* make backtab move to previous field */
        if( event->keyval == GDK_ISO_Left_Tab ) {
                /* Reference to parent */
-               parent = GTK_WIDGET(entry)->parent;
+               parent = gtk_widget_get_parent(GTK_WIDGET(entry));
 
                /* Discard the window */
                clear_completion_cache();
@@ -1540,7 +1537,7 @@ static gboolean completion_window_key_press(GtkWidget *widget,
 
        /* make sure anything we typed comes in the edit box */
        tmp_event.type       = event->type;
-       tmp_event.window     = entry->window;
+       tmp_event.window     = gtk_widget_get_window(GTK_WIDGET(entry));
        tmp_event.send_event = TRUE;
        tmp_event.time       = event->time;
        tmp_event.state      = event->state;
index 07c99e7..e424e69 100644 (file)
@@ -5618,11 +5618,11 @@ static void addressbook_drag_data_get(GtkWidget        *widget,
        if (aio && aio->type == ADDR_ITEM_PERSON) {
                if( ds && ds->interface && ds->interface->readOnly)
                        gtk_selection_data_set(selection_data,
-                                      selection_data->target, 8,
+                                      gtk_selection_data_get_target(selection_data), 8,
                                       (const guchar *)"Dummy_addr_copy", 15);
                else
                        gtk_selection_data_set(selection_data,
-                                      selection_data->target, 8,
+                                      gtk_selection_data_get_target(selection_data), 8,
                                       (const guchar *)"Dummy_addr_move", 15);
        } 
 }
@@ -5634,14 +5634,18 @@ static gboolean addressbook_drag_motion_cb(GtkWidget      *widget,
                                          guint           time,
                                          void            *data)
 {
+       GtkAllocation allocation;
+       GtkRequisition requisition;
        gint row, column;
        GtkCMCTreeNode *node = NULL;
        gboolean acceptable = FALSE;
-       gint height = addrbook.ctree->allocation.height;
-       gint total_height = addrbook.ctree->requisition.height;
+       gtk_widget_get_allocation(GTK_WIDGET(addrbook.ctree), &allocation);
+       gint height = allocation.height;
+       gtk_widget_get_requisition(GTK_WIDGET(addrbook.ctree), &requisition);
+       gint total_height = requisition.height;
        GtkAdjustment *pos = gtk_scrolled_window_get_vadjustment(
                                GTK_SCROLLED_WINDOW(addrbook.ctree_swin));
-       gfloat vpos = pos->value;
+       gfloat vpos = gtk_adjustment_get_value(pos);
        
        if (gtk_cmclist_get_selection_info
                (GTK_CMCLIST(widget), x - 24, y - 24, &row, &column)) {
@@ -5683,7 +5687,7 @@ static gboolean addressbook_drag_motion_cb(GtkWidget      *widget,
                        (G_OBJECT(widget),
                         G_CALLBACK(addressbook_tree_selected), NULL);
                gdk_drag_status(context, 
-                                       (context->actions == GDK_ACTION_COPY ?
+                                       (gdk_drag_context_get_actions(context) == GDK_ACTION_COPY ?
                                        GDK_ACTION_COPY : GDK_ACTION_MOVE) , time);
        } else {
                gdk_drag_status(context, 0, time);
@@ -5721,7 +5725,7 @@ static void addressbook_drag_received_cb(GtkWidget        *widget,
        GtkCMCTreeNode *node;
        GtkCMCTreeNode *lastopened = addrbook.opened;
 
-       if (!strncmp(data->data, "Dummy_addr", 10)) {
+       if (!strncmp(gtk_selection_data_get_data(data), "Dummy_addr", 10)) {
                if (gtk_cmclist_get_selection_info
                        (GTK_CMCLIST(widget), x - 24, y - 24, &row, &column) == 0) {
                        return;
@@ -5732,8 +5736,8 @@ static void addressbook_drag_received_cb(GtkWidget        *widget,
                        return;
                
                gtk_cmclist_freeze(GTK_CMCLIST(addrbook.clist));
-               if (drag_context->action == GDK_ACTION_COPY || 
-                   !strcmp(data->data, "Dummy_addr_copy"))
+               if (gdk_drag_context_get_selected_action(drag_context) == GDK_ACTION_COPY || 
+                   !strcmp(gtk_selection_data_get_data(data), "Dummy_addr_copy"))
                        addressbook_clip_copy_cb(NULL, NULL);
                else
                        addressbook_clip_cut_cb(NULL, NULL);
index 55368f6..41b4a20 100644 (file)
@@ -268,7 +268,7 @@ static void alertpanel_create(const gchar *title,
        /* for title icon, label and message */
        hbox = gtk_hbox_new(FALSE, 12);
        gtk_container_set_border_width(GTK_CONTAINER(hbox), 12);
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
+       gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
                           hbox, FALSE, FALSE, 0);
 
        /* title icon */
@@ -308,7 +308,7 @@ static void alertpanel_create(const gchar *title,
                gint size;
 
                size = pango_font_description_get_size
-                       (label->style->font_desc);
+                       (gtk_widget_get_style(label)->font_desc);
                font_desc = pango_font_description_new();
                pango_font_description_set_weight
                        (font_desc, PANGO_WEIGHT_BOLD);
@@ -337,7 +337,8 @@ static void alertpanel_create(const gchar *title,
 
        if (can_disable) {
                hbox = gtk_hbox_new(FALSE, 0);
-               gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox,
+               gtk_box_pack_start(GTK_BOX(
+                       gtk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox,
                                   FALSE, FALSE, 0);
 
                disable_checkbtn = gtk_check_button_new_with_label
@@ -364,7 +365,7 @@ static void alertpanel_create(const gchar *title,
                                      button2_label ? &button2 : NULL, label2,
                                      button3_label ? &button3 : NULL, label3);
 
-       gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area),
+       gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(dialog))),
                         confirm_area, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(confirm_area), 5);
        gtk_widget_grab_default(button1);
index 96e492a..84ffd4d 100644 (file)
@@ -859,7 +859,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
        color[5] = quote_bgcolor3;
        color[6] = signature_color;
        color[7] = uri_color;
-       cmap = gdk_drawable_get_colormap(compose->window->window);
+       cmap = gdk_drawable_get_colormap(gtk_widget_get_window(compose->window));
        gdk_colormap_alloc_colors(cmap, color, 8, FALSE, TRUE, success);
 
        for (i = 0; i < 8; i++) {
@@ -6910,7 +6910,7 @@ static gboolean text_clicked(GtkWidget *text, GdkEventButton *event,
                                        Compose *compose)
 {
        gint prev_autowrap;
-       GtkTextBuffer *buffer = GTK_TEXT_VIEW(text)->buffer;
+       GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
 #if USE_ENCHANT
        if (event->button == 3) {
                GtkTextIter iter;
@@ -7867,7 +7867,7 @@ static void compose_set_privacy_system_cb(GtkWidget *widget, gpointer data)
 
        cm_return_if_fail(GTK_IS_CHECK_MENU_ITEM(widget));
 
-       if (!GTK_CHECK_MENU_ITEM(widget)->active)
+       if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)))
                return;
 
        systemid = g_object_get_data(G_OBJECT(widget), "privacy_system");
@@ -7890,7 +7890,7 @@ static void compose_update_privacy_system_menu_item(Compose * compose, gboolean
 {
        static gchar *branch_path = "/Menu/Options/PrivacySystem";
        GtkWidget *menuitem = NULL;
-       GList *amenu;
+       GList *children, *amenu;
        gboolean can_sign = FALSE, can_encrypt = FALSE;
        gboolean found = FALSE;
 
@@ -7900,11 +7900,10 @@ static void compose_update_privacy_system_menu_item(Compose * compose, gboolean
                                gtk_ui_manager_get_widget(compose->ui_manager, branch_path)));
                cm_return_if_fail(menuitem != NULL);
 
-               amenu = GTK_MENU_SHELL(menuitem)->children;
+               children = gtk_container_get_children(GTK_CONTAINER(GTK_MENU_SHELL(menuitem)));
+               amenu = children;
                menuitem = NULL;
                while (amenu != NULL) {
-                       GList *alist = amenu->next;
-
                        systemid = g_object_get_data(G_OBJECT(amenu->data), "privacy_system");
                        if (systemid != NULL) {
                                if (strcmp(systemid, compose->privacy_system) == 0 &&
@@ -7926,8 +7925,9 @@ static void compose_update_privacy_system_menu_item(Compose * compose, gboolean
                                        break;
                        }
 
-                       amenu = alist;
+                       amenu = amenu->next;
                }
+               g_list_free(children);
                if (menuitem != NULL)
                        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
                
@@ -8333,6 +8333,7 @@ static void compose_template_apply_fields(Compose *compose, Template *tmpl)
 
 static void compose_destroy(Compose *compose)
 {
+       GtkAllocation allocation;
        GtkTextBuffer *buffer;
        GtkClipboard *clipboard;
 
@@ -8398,8 +8399,9 @@ static void compose_destroy(Compose *compose)
 #endif
 
        if (!compose->batch) {
-               prefs_common.compose_width = compose->scrolledwin->allocation.width;
-               prefs_common.compose_height = compose->window->allocation.height;
+               gtk_widget_get_allocation(compose->scrolledwin, &allocation);
+               prefs_common.compose_width = allocation.width;
+               prefs_common.compose_height = allocation.height;
        }
 
        if (!gtk_widget_get_parent(compose->paned))
@@ -10406,6 +10408,8 @@ static void compose_advanced_action_cb(GtkAction *gaction, gpointer data)
 
 static void compose_grab_focus_cb(GtkWidget *widget, Compose *compose)
 {
+       GtkAllocation allocation;
+       GtkWidget *parent;
        gchar *str = NULL;
        
        if (GTK_IS_EDITABLE(widget)) {
@@ -10413,24 +10417,29 @@ static void compose_grab_focus_cb(GtkWidget *widget, Compose *compose)
                gtk_editable_set_position(GTK_EDITABLE(widget), 
                        strlen(str));
                g_free(str);
-               if (widget->parent && widget->parent->parent
-                && widget->parent->parent->parent) {
-                       if (GTK_IS_SCROLLED_WINDOW(widget->parent->parent->parent)) {
-                               gint y = widget->allocation.y;
-                               gint height = widget->allocation.height;
+               if ((parent = gtk_widget_get_parent(widget))
+                && (parent = gtk_widget_get_parent(parent))
+                && (parent = gtk_widget_get_parent(parent))) {
+                       if (GTK_IS_SCROLLED_WINDOW(parent)) {
+                               gtk_widget_get_allocation(widget, &allocation);
+                               gint y = allocation.y;
+                               gint height = allocation.height;
                                GtkAdjustment *shown = gtk_scrolled_window_get_vadjustment
-                                       (GTK_SCROLLED_WINDOW(widget->parent->parent->parent));
+                                       (GTK_SCROLLED_WINDOW(parent));
 
-                               if (y < (int)shown->value) {
-                                       gtk_adjustment_set_value(GTK_ADJUSTMENT(shown), y - 1);
+                               gfloat value = gtk_adjustment_get_value(shown);
+                               gfloat upper = gtk_adjustment_get_upper(shown);
+                               gfloat page_size = gtk_adjustment_get_page_size(shown);
+                               if (y < (int)value) {
+                                       gtk_adjustment_set_value(shown, y - 1);
                                }
-                               if (y + height > (int)shown->value + (int)shown->page_size) {
-                                       if (y - height - 1 < (int)shown->upper - (int)shown->page_size) {
-                                               gtk_adjustment_set_value(GTK_ADJUSTMENT(shown)
-                                                       y + height - (int)shown->page_size - 1);
+                               if ((y + height) > ((int)value + (int)page_size)) {
+                                       if ((y - height - 1) < ((int)upper - (int)page_size)) {
+                                               gtk_adjustment_set_value(shown
+                                                       y + height - (int)page_size - 1);
                                        } else {
-                                               gtk_adjustment_set_value(GTK_ADJUSTMENT(shown)
-                                                       (int)shown->upper - (int)shown->page_size - 1);
+                                               gtk_adjustment_set_value(shown
+                                                       (int)upper - (int)page_size - 1);
                                        }
                                }
                        }
@@ -10571,14 +10580,17 @@ static void compose_attach_drag_received_cb (GtkWidget                *widget,
 {
        Compose *compose = (Compose *)user_data;
        GList *list, *tmp;
+       GdkAtom type;
 
-       if (((gdk_atom_name(data->type) && !strcmp(gdk_atom_name(data->type), "text/uri-list"))
+       type = gtk_selection_data_get_data_type(data);
+       if (((gdk_atom_name(type) && !strcmp(gdk_atom_name(type), "text/uri-list"))
 #ifdef G_OS_WIN32
-        || (gdk_atom_name(data->type) && !strcmp(gdk_atom_name(data->type), "DROPFILES_DND"))
+        || (gdk_atom_name(type) && !strcmp(gdk_atom_name(type), "DROPFILES_DND"))
 #endif
           ) && gtk_drag_get_source_widget(context) != 
                summary_get_main_widget(mainwindow_get_mainwindow()->summaryview)) {
-               list = uri_list_extract_filenames((const gchar *)data->data);
+               list = uri_list_extract_filenames(
+                       (const gchar *)gtk_selection_data_get_data(data));
                for (tmp = list; tmp != NULL; tmp = tmp->next) {
                        gchar *utf8_filename = conv_filename_to_utf8((const gchar *)tmp->data);
                        compose_attach_append
@@ -10638,20 +10650,23 @@ static void compose_insert_drag_received_cb (GtkWidget                *widget,
 {
        Compose *compose = (Compose *)user_data;
        GList *list, *tmp;
+       GdkAtom type;
 
        /* strangely, testing data->type == gdk_atom_intern("text/uri-list", TRUE)
         * does not work */
+       type = gtk_selection_data_get_data_type(data);
 #ifndef G_OS_WIN32
-       if (gdk_atom_name(data->type) && !strcmp(gdk_atom_name(data->type), "text/uri-list")) {
+       if (gdk_atom_name(type) && !strcmp(gdk_atom_name(type), "text/uri-list")) {
 #else
-       if (gdk_atom_name(data->type) && !strcmp(gdk_atom_name(data->type), "DROPFILES_DND")) {
+       if (gdk_atom_name(type) && !strcmp(gdk_atom_name(type), "DROPFILES_DND")) {
 #endif
                AlertValue val = G_ALERTDEFAULT;
+               const gchar* ddata = (const gchar *)gtk_selection_data_get_data(data);
 
-               list = uri_list_extract_filenames((const gchar *)data->data);
-               if (list == NULL && strstr((gchar *)(data->data), "://")) {
+               list = uri_list_extract_filenames(ddata);
+               if (list == NULL && strstr(ddata, "://")) {
                        /* Assume a list of no files, and data has ://, is a remote link */
-                       gchar *tmpdata = g_strstrip(g_strdup((const gchar *)data->data));
+                       gchar *tmpdata = g_strstrip(g_strdup(ddata));
                        gchar *tmpfile = get_tmp_file();
                        str_write_to_file(tmpdata, tmpfile);
                        g_free(tmpdata);  
@@ -10725,7 +10740,7 @@ static void compose_header_drag_received_cb (GtkWidget          *widget,
                                             gpointer            user_data)
 {
        GtkEditable *entry = (GtkEditable *)user_data;
-       gchar *email = (gchar *)data->data;
+       const gchar *email = (const gchar *)gtk_selection_data_get_data(data);
 
        /* strangely, testing data->type == gdk_atom_intern("text/plain", TRUE)
         * does not work */
@@ -10734,8 +10749,7 @@ static void compose_header_drag_received_cb (GtkWidget          *widget,
                gchar *decoded=g_new(gchar, strlen(email));
                int start = 0;
 
-               email += strlen("mailto:");
-               decode_uri(decoded, email); /* will fit */
+               decode_uri(decoded, email + strlen("mailto:")); /* will fit */
                gtk_editable_delete_text(entry, 0, -1);
                gtk_editable_insert_text(entry, decoded, strlen(decoded), &start);
                gtk_drag_finish(drag_context, TRUE, FALSE, time);
@@ -10843,9 +10857,13 @@ static void compose_show_first_last_header(Compose *compose, gboolean show_first
        cm_return_if_fail(compose);
        cm_return_if_fail(!compose->batch);
        cm_return_if_fail(GTK_IS_WIDGET(compose->header_table));
-       cm_return_if_fail(GTK_IS_VIEWPORT(compose->header_table->parent));
-       vadj = gtk_viewport_get_vadjustment(GTK_VIEWPORT(compose->header_table->parent));
-       gtk_adjustment_set_value(vadj, (show_first ? vadj->lower : (vadj->upper - vadj->page_size)));
+       cm_return_if_fail(GTK_IS_VIEWPORT(gtk_widget_get_parent(compose->header_table)));
+       vadj = gtk_viewport_get_vadjustment(GTK_VIEWPORT(
+                               gtk_widget_get_parent(compose->header_table)));
+       gtk_adjustment_set_value(vadj, (show_first ?
+                               gtk_adjustment_get_lower(vadj) :
+                               (gtk_adjustment_get_upper(vadj) -
+                               gtk_adjustment_get_page_size(vadj))));
        gtk_adjustment_changed(vadj);
 }
 
index eef83a7..754ad4a 100644 (file)
@@ -90,12 +90,12 @@ static struct TagApplyWindow
 } applywindow;
 
 #define APPLYWINDOW_LOCK() {                                                           \
-       gdk_window_set_cursor(applywindow.window->window, applywindow.watch_cursor);    \
+       gdk_window_set_cursor(gtk_widget_get_window(applywindow.window), applywindow.watch_cursor);     \
        applywindow.busy = TRUE;                                                        \
 }
 
 #define APPLYWINDOW_UNLOCK() {                                                         \
-       gdk_window_set_cursor(applywindow.window->window, NULL);                        \
+       gdk_window_set_cursor(gtk_widget_get_window(applywindow.window), NULL);                 \
        applywindow.busy = FALSE;                                                       \
 }
 
index e06bf3d..c4c703a 100644 (file)
@@ -1080,7 +1080,7 @@ void folderview_rescan_tree(Folder *folder, gboolean rebuild)
        if (folderview) {
                pos = gtk_scrolled_window_get_vadjustment(
                                        GTK_SCROLLED_WINDOW(folderview->scrolledwin));
-               height = pos->value;
+               height = gtk_adjustment_get_value(pos);
        }
 
        folder_set_ui_func(folder, folderview_scan_tree_func, NULL);
@@ -1121,7 +1121,7 @@ void folderview_fast_rescan_tree(Folder *folder)
        if (folderview) {
                pos = gtk_scrolled_window_get_vadjustment(
                                        GTK_SCROLLED_WINDOW(folderview->scrolledwin));
-               height = pos->value;
+               height = gtk_adjustment_get_value(pos);
        }
 
        folder_set_ui_func(folder, folderview_scan_tree_func, NULL);
@@ -2647,7 +2647,7 @@ void folderview_reflect_prefs(void)
        FolderItem *item = folderview_get_selected_item(folderview);
        GtkAdjustment *pos = gtk_scrolled_window_get_vadjustment(
                                GTK_SCROLLED_WINDOW(folderview->scrolledwin));
-       gint height = pos->value;
+       gint height = gtk_adjustment_get_value(pos);
 
        if (!last_smallfont || strcmp(last_smallfont, SMALL_FONT) ||
                        !last_normalfont || strcmp(last_normalfont, NORMAL_FONT) ||
@@ -2770,7 +2770,7 @@ static void folderview_drag_data_get(GtkWidget        *widget,
                        if (item) {
                                source = g_strdup_printf ("FROM_OTHER_FOLDER%s", folder_item_get_identifier(item));
                                gtk_selection_data_set(selection_data,
-                                                      selection_data->target, 8,
+                                                      gtk_selection_data_get_target(selection_data), 8,
                                                       source, strlen(source));
                                break;
                        } else
@@ -2823,8 +2823,9 @@ static gboolean folderview_dnd_scroll_cb(gpointer data)
        FolderView *folderview = (FolderView *)data;
        GtkAdjustment *pos = gtk_scrolled_window_get_vadjustment(
                                GTK_SCROLLED_WINDOW(folderview->scrolledwin));
-       gint new_val = (int)pos->value + folderview->scroll_value;
-       gint max = (int)pos->upper - (int)pos->page_size;
+       gint new_val = (int)gtk_adjustment_get_value(pos) + folderview->scroll_value;
+       gint max = (int)gtk_adjustment_get_upper(pos) -
+               (int)gtk_adjustment_get_page_size(pos);
 
        if (folderview->scroll_value == 0) {
                folderview->scroll_timeout_id = -1;
@@ -2854,9 +2855,9 @@ static gboolean folderview_drag_motion_cb(GtkWidget      *widget,
        gboolean acceptable = FALSE;
        GtkAdjustment *pos = gtk_scrolled_window_get_vadjustment(
                                GTK_SCROLLED_WINDOW(folderview->scrolledwin));
-       int height = (int)pos->page_size;
-       int total_height = (int)pos->upper;
-       int vpos = (int) pos->value;
+       int height = (int)gtk_adjustment_get_page_size(pos);
+       int total_height = (int)gtk_adjustment_get_upper(pos);
+       int vpos = (int)gtk_adjustment_get_value(pos);
        int offset = prefs_common.show_col_headers ? 24:0;
        int dist;
 
@@ -2925,7 +2926,7 @@ static gboolean folderview_drag_motion_cb(GtkWidget      *widget,
                        (G_OBJECT(widget),
                         G_CALLBACK(folderview_selected), folderview);
                gdk_drag_status(context, 
-                                       (context->actions == GDK_ACTION_COPY ?
+                                       (gdk_drag_context_get_actions(context) == GDK_ACTION_COPY ?
                                        GDK_ACTION_COPY : GDK_ACTION_MOVE) , time);
        } else {
                if (folderview->opened)
@@ -3013,7 +3014,8 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
 
        if (info == TARGET_DUMMY) {
                drag_state_stop(folderview);
-               if ((void *)strstr(data->data, "FROM_OTHER_FOLDER") != (void *)data->data) {
+               const gchar *ddata = (const gchar *)gtk_selection_data_get_data(data);
+               if ((gchar *)strstr(ddata, "FROM_OTHER_FOLDER") != ddata) {
                        /* comes from summaryview */
                        if (gtk_cmclist_get_selection_info
                                (GTK_CMCLIST(widget), x - offset, y - offset, &row, &column) == 0)
@@ -3034,7 +3036,7 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                                return;
                        }
                        if (item && src_item) {
-                               switch (drag_context->action) {
+                               switch (gdk_drag_context_get_selected_action(drag_context)) {
                                case GDK_ACTION_COPY:
                                        summary_copy_selected_to(folderview->summaryview, item);
                                        gtk_drag_finish(drag_context, TRUE, FALSE, time);
@@ -3054,9 +3056,10 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                        /* comes from folderview */
                        char *source;
                        gboolean folder_is_normal = TRUE;
-                       gboolean copy = (drag_context->action == GDK_ACTION_COPY);
+                       gboolean copy = (GDK_ACTION_COPY ==
+                               gdk_drag_context_get_selected_action(drag_context));
 
-                       source = data->data + 17;
+                       source = (char *)gtk_selection_data_get_data(data) + 17;
                        if (gtk_cmclist_get_selection_info
                            (GTK_CMCLIST(widget), x - offset, y - offset, &row, &column) == 0
                            || *source == 0) {
@@ -3100,7 +3103,8 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                        debug_print("no item\n");
                        return;
                }
-               folderview_finish_dnd(data->data, drag_context, time, item);
+               folderview_finish_dnd(gtk_selection_data_get_data(data),
+                       drag_context, time, item);
        }
 }
 
index d00ba0d..2c243e3 100644 (file)
@@ -156,7 +156,7 @@ static void grouplist_dialog_create(void)
        dialog = gtk_dialog_new();
        gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
        gtk_container_set_border_width
-               (GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5);
+               (GTK_CONTAINER(gtk_dialog_get_action_area(GTK_DIALOG(dialog))), 5);
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
        gtk_window_set_title(GTK_WINDOW(dialog), _("Newsgroup subscription"));
        g_signal_connect(G_OBJECT(dialog), "delete_event",
@@ -168,7 +168,8 @@ static void grouplist_dialog_create(void)
        MANAGE_WINDOW_SIGNALS_CONNECT(dialog);
 
        vbox = gtk_vbox_new(FALSE, 8);
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), vbox);
+       gtk_container_add(GTK_CONTAINER(
+                               gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
 
        hbox = gtk_hbox_new(FALSE, 0);
@@ -235,7 +236,7 @@ static void grouplist_dialog_create(void)
                                      &refresh_button, GTK_STOCK_REFRESH,
                                      &cancel_button, GTK_STOCK_CANCEL,
                                      &ok_button, GTK_STOCK_OK);
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
+       gtk_container_add(GTK_CONTAINER(gtk_dialog_get_action_area(GTK_DIALOG(dialog))),
                          confirm_area);
        gtk_widget_grab_default(ok_button);
 
@@ -257,7 +258,7 @@ static void grouplist_dialog_create(void)
                                        prefs_common.news_subscribe_width,
                                        prefs_common.news_subscribe_height);
 
-       gtk_widget_show_all(GTK_DIALOG(dialog)->vbox);
+       gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
 }
 
 static GHashTable *branch_node_table;
@@ -401,6 +402,7 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
        GSList *cur;
        GtkCMCTreeNode *node;
        GPatternSpec *pspec;
+       GdkWindow *window;
 
        if (locked) return;
        locked = TRUE;
@@ -410,7 +412,8 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
 
        if (!watch_cursor)
                watch_cursor = gdk_cursor_new(GDK_WATCH);
-       gdk_window_set_cursor(dialog->window, watch_cursor);
+       window = gtk_widget_get_window(dialog);
+       gdk_window_set_cursor(window, watch_cursor);
        main_window_cursor_wait(mainwindow_get_mainwindow());
        GTK_EVENTS_FLUSH();
        
@@ -424,7 +427,7 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
                if (group_list == NULL && ack == TRUE) {
                        alertpanel_error(_("Can't retrieve newsgroup list."));
                        locked = FALSE;
-                       gdk_window_set_cursor(dialog->window, NULL);
+                       gdk_window_set_cursor(window, NULL);
                        main_window_cursor_normal(mainwindow_get_mainwindow());
                        return;
                }
@@ -461,7 +464,7 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
 
        gtk_label_set_text(GTK_LABEL(status_label), _("Done."));
 
-       gdk_window_set_cursor(dialog->window, NULL);
+       gdk_window_set_cursor(window, NULL);
        main_window_cursor_normal(mainwindow_get_mainwindow());
 
        locked = FALSE;
index 7f79a07..8d7c991 100644 (file)
@@ -847,7 +847,7 @@ static gboolean about_textview_motion_notify(GtkWidget *widget,
                                        GtkWidget *textview)
 {
        about_textview_uri_update(textview, event->x, event->y);
-       gdk_window_get_pointer(widget->window, NULL, NULL, NULL);
+       gdk_window_get_pointer(gtk_widget_get_window(widget), NULL, NULL, NULL);
 
        return FALSE;
 }
index cccdfbc..2a88b95 100644 (file)
@@ -184,6 +184,7 @@ static char *CONTRIBS_LIST[] = {
 "David Mehrmann",
 "Christian Mertes",
 "Bram Metsch",
+"Hanno Meyer-Thurow",
 "George Michaelson",
 "Florian Mickler",
 "Neill Miller",
index 22233c6..8fa7d12 100644 (file)
@@ -191,7 +191,8 @@ gchar *colorlabel_get_color_default_text(gint color_index)
 static gboolean colorlabel_drawing_area_expose_event_cb
        (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
 {
-       GdkDrawable *drawable = widget->window;
+       GdkDrawable *drawable = gtk_widget_get_window(widget);
+       GtkAllocation allocation;
        gulong c = (gulong) GPOINTER_TO_INT(data);
        GdkColor color;
        cairo_t *cr;
@@ -199,17 +200,18 @@ static gboolean colorlabel_drawing_area_expose_event_cb
        INTCOLOR_TO_GDKCOLOR(c, color)
 
        gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &color, FALSE, TRUE);
+       gtk_widget_get_allocation(widget, &allocation);
 
        cr = gdk_cairo_create(drawable);
        cairo_set_source_rgb(cr, 0., 0., 0.);
        cairo_rectangle(cr, 0, 0,
-           widget->allocation.width - 1,
-           widget->allocation.height - 1);
+           allocation.width - 1,
+           allocation.height - 1);
        cairo_stroke(cr);
        gdk_cairo_set_source_color(cr, &color);
        cairo_rectangle(cr, 1, 1,
-           widget->allocation.width - 2,
-           widget->allocation.height - 2);
+           allocation.width - 2,
+           allocation.height - 2);
        cairo_fill(cr);
        cairo_destroy(cr);
        
index 3b7a22f..83fe60c 100644 (file)
@@ -56,6 +56,7 @@ gint colorsel_select_color_rgb(gchar *title, gint rgbvalue)
 {
        GdkColor color;
        GtkColorSelectionDialog *color_dialog;
+       GtkWidget *ok_button, *cancel_button;
        gint result;
 
        color_dialog = GTK_COLOR_SELECTION_DIALOG(gtk_color_selection_dialog_new(title));
@@ -63,10 +64,15 @@ gint colorsel_select_color_rgb(gchar *title, gint rgbvalue)
        gtk_window_set_resizable(GTK_WINDOW(color_dialog), FALSE);
        manage_window_set_transient(GTK_WINDOW(color_dialog));
 
-       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
+       g_object_get(color_dialog,
+               "ok-button", &ok_button,
+               "cancel-button", &cancel_button,
+               NULL);
+
+       g_signal_connect(G_OBJECT(ok_button),
                         "clicked", 
                         G_CALLBACK(quote_colors_set_dialog_ok), &result);
-       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
+       g_signal_connect(G_OBJECT(cancel_button),
                         "clicked", 
                         G_CALLBACK(quote_colors_set_dialog_cancel), &result);
        g_signal_connect(G_OBJECT(color_dialog), "key_press_event",
@@ -74,14 +80,15 @@ gint colorsel_select_color_rgb(gchar *title, gint rgbvalue)
 
        /* preselect the previous color in the color selection dialog */
        gtkut_convert_int_to_gdk_color(rgbvalue, &color);
-       gtk_color_selection_set_current_color
-               (GTK_COLOR_SELECTION(color_dialog->colorsel), &color);
+       gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
+               gtk_color_selection_dialog_get_color_selection(color_dialog)), &color);
 
        gtk_widget_show(GTK_WIDGET(color_dialog));
        gtk_main();
 
        if (result == 0) {
-               gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(color_dialog->colorsel), &color);
+               gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(
+                       gtk_color_selection_dialog_get_color_selection(color_dialog)), &color);
                rgbvalue = gtkut_convert_gdk_color_to_int(&color);
        }
 
index 7e8ba9e..22d9a87 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-/* We know this file uses some deprecated stuff. */
-#undef G_DISABLE_DEPRECATED
-#undef GTK_DISABLE_DEPRECATED
-#undef GDK_DISABLE_DEPRECATED
-
 #include <gtk/gtk.h>
 #include "claws-marshal.h"
 #include "gtkcmclist.h"
@@ -1468,7 +1463,7 @@ void
 gtk_cmclist_column_title_passive (GtkCMCList *clist,
                                gint      column)
 {
-  GtkButton *button;
+  GtkToggleButton *button;
 
   cm_return_if_fail (GTK_IS_CMCLIST (clist));
 
@@ -1477,16 +1472,16 @@ gtk_cmclist_column_title_passive (GtkCMCList *clist,
   if (!clist->column[column].button || clist->column[column].button_passive)
     return;
 
-  button = GTK_BUTTON (clist->column[column].button);
+  button = GTK_TOGGLE_BUTTON (clist->column[column].button);
 
   clist->column[column].button_passive = TRUE;
 
-  if (button->button_down)
+  if (gtk_toggle_button_get_active(button))
        g_signal_connect(G_OBJECT (clist->column[column].button),
                         "button-release-event",
                         G_CALLBACK(column_title_passive_func),
                         NULL);
-  if (button->in_button)
+  if (gtk_widget_is_focus(gtk_bin_get_child(GTK_BIN(button))))
        g_signal_connect(G_OBJECT (clist->column[column].button),
                         "leave-notify-event",
                         G_CALLBACK(column_title_passive_func),
@@ -1548,7 +1543,7 @@ gtk_cmclist_set_column_title (GtkCMCList    *clist,
   column_title_new (clist, column, title);
 
   /* remove and destroy the old widget */
-  old_widget = GTK_BIN (clist->column[column].button)->child;
+  old_widget = gtk_bin_get_child (GTK_BIN (clist->column[column].button));
   if (old_widget)
     gtk_container_remove (GTK_CONTAINER (clist->column[column].button), old_widget);
 
@@ -1622,7 +1617,7 @@ gtk_cmclist_set_column_widget (GtkCMCList  *clist,
   column_title_new (clist, column, NULL);
 
   /* remove and destroy the old widget */
-  old_widget = GTK_BIN (clist->column[column].button)->child;
+  old_widget = gtk_bin_get_child (GTK_BIN (clist->column[column].button));
   if (old_widget)
     gtk_container_remove (GTK_CONTAINER (clist->column[column].button),
                          old_widget);
@@ -1650,7 +1645,7 @@ gtk_cmclist_get_column_widget (GtkCMCList *clist,
     return NULL;
 
   if (clist->column[column].button)
-    return GTK_BIN (clist->column[column].button)->child;
+       return gtk_bin_get_child (GTK_BIN (clist->column[column].button));
 
   return NULL;
 }
@@ -1673,7 +1668,7 @@ gtk_cmclist_set_column_justification (GtkCMCList         *clist,
    * custom widget */
   if (clist->column[column].title)
     {
-      alignment = GTK_BIN (clist->column[column].button)->child;
+      alignment = gtk_bin_get_child (GTK_BIN (clist->column[column].button));
 
       switch (clist->column[column].justification)
        {
@@ -1826,11 +1821,14 @@ gtk_cmclist_optimal_column_width (GtkCMCList *clist,
     return 0;
 
   if (GTK_CMCLIST_SHOW_TITLES(clist) && clist->column[column].button)
-    width = (clist->column[column].button->requisition.width)
+    {
+      gtk_widget_get_requisition (clist->column[column].button, &requisition);
+      width = requisition.width
 #if 0
             (CELL_SPACING + (2 * COLUMN_INSET)))
 #endif
                ;
+    }
   else
     width = 0;
 
@@ -1944,8 +1942,11 @@ column_auto_resize (GtkCMCList    *clist,
       /* run a "gtk_cmclist_optimal_column_width" but break, if
        * the column doesn't shrink */
       if (GTK_CMCLIST_SHOW_TITLES(clist) && clist->column[column].button)
-       new_width = (clist->column[column].button->requisition.width -
+    {
+       gtk_widget_get_requisition (clist->column[column].button, &requisition);
+       new_width = (requisition.width -
                     (CELL_SPACING + (2 * COLUMN_INSET)));
+    }
       else
        new_width = 0;
 
@@ -2096,6 +2097,7 @@ static void
 size_allocate_columns (GtkCMCList *clist,
                       gboolean  block_resize)
 {
+  GtkRequisition requisition;
   gint xoffset = CELL_SPACING + COLUMN_INSET;
   gint last_column;
   gint i;
@@ -2119,7 +2121,8 @@ size_allocate_columns (GtkCMCList *clist,
            {
              gint width;
 
-             width = (clist->column[i].button->requisition.width -
+             gtk_widget_get_requisition (clist->column[i].button, &requisition);
+             width = (requisition.width -
                       (CELL_SPACING + (2 * COLUMN_INSET)));
 
              if (width > clist->column[i].width)
@@ -2131,10 +2134,11 @@ size_allocate_columns (GtkCMCList *clist,
        }
       else if (GTK_CMCLIST_SHOW_TITLES(clist) && clist->column[i].button)
        {
+         gtk_widget_get_requisition (clist->column[i].button, &requisition);
          clist->column[i].area.width =
-           clist->column[i].button->requisition.width -
+           requisition.width -
            (CELL_SPACING + (2 * COLUMN_INSET));
-         xoffset += clist->column[i].button->requisition.width;
+         xoffset += requisition.width;
        }
     }
 
@@ -2145,6 +2149,7 @@ size_allocate_columns (GtkCMCList *clist,
 static gint
 list_requisition_width (GtkCMCList *clist) 
 {
+  GtkRequisition requisition;
   gint width = CELL_SPACING;
   gint i;
 
@@ -2156,7 +2161,10 @@ list_requisition_width (GtkCMCList *clist)
       if (clist->column[i].width_set)
        width += clist->column[i].width + CELL_SPACING + (2 * COLUMN_INSET);
       else if (GTK_CMCLIST_SHOW_TITLES(clist) && clist->column[i].button)
-       width += clist->column[i].button->requisition.width;
+    {
+       gtk_widget_get_requisition (clist->column[i].button, &requisition);
+       width += requisition.width;
+    }
     }
 
   return width;
@@ -2170,7 +2178,7 @@ new_column_width (GtkCMCList *clist,
                  gint      column,
                  gint     *x)
 {
-  gint xthickness = GTK_WIDGET (clist)->style->xthickness;
+  gint xthickness = gtk_widget_get_style (GTK_WIDGET (clist))->xthickness;
   gint width;
   gint cx;
   gint dx;
@@ -2922,6 +2930,7 @@ real_clear (GtkCMCList *clist)
 {
   GList *list;
   GList *free_list;
+  GtkRequisition requisition;
   gint i;
 
   cm_return_if_fail (GTK_IS_CMCLIST (clist));
@@ -2956,9 +2965,12 @@ real_clear (GtkCMCList *clist)
     if (clist->column[i].auto_resize)
       {
        if (GTK_CMCLIST_SHOW_TITLES(clist) && clist->column[i].button)
+    {
+       gtk_widget_get_requisition (clist->column[i].button, &requisition);
          gtk_cmclist_set_column_width
-           (clist, i, (clist->column[i].button->requisition.width -
+           (clist, i, (requisition.width -
                        (CELL_SPACING + (2 * COLUMN_INSET))));
+    }
        else
          gtk_cmclist_set_column_width (clist, i, 0);
       }
@@ -3094,12 +3106,15 @@ void
 gtk_cmclist_set_row_height (GtkCMCList *clist,
                          guint     height)
 {
+  GtkStyle *style;
   GtkWidget *widget;
 
   cm_return_if_fail (GTK_IS_CMCLIST (clist));
 
   widget = GTK_WIDGET (clist);
 
+  style = gtk_widget_get_style (widget);
+
   if (height > 0)
     {
       clist->row_height = height;
@@ -3111,13 +3126,13 @@ gtk_cmclist_set_row_height (GtkCMCList *clist,
       clist->row_height = 0;
     }
 
-  if (widget->style->font_desc)
+  if (style->font_desc)
     {
       PangoContext *context = gtk_widget_get_pango_context (widget);
       PangoFontMetrics *metrics;
 
       metrics = pango_context_get_metrics (context,
-                                          widget->style->font_desc,
+                                          style->font_desc,
                                           pango_context_get_language (context));
       
       if (!GTK_CMCLIST_ROW_HEIGHT_SET(clist))
@@ -4512,7 +4527,10 @@ gtk_cmclist_finalize (GObject *object)
 static void
 gtk_cmclist_realize (GtkWidget *widget)
 {
+  GtkAllocation allocation;
   GtkCMCList *clist;
+  GtkStyle *style;
+  GdkWindow *window;
   GdkWindowAttr attributes;
   GdkGCValues values;
   GtkCMCListRow *clist_row;
@@ -4528,13 +4546,15 @@ gtk_cmclist_realize (GtkWidget *widget)
 
   gtkut_widget_set_realized (widget, TRUE);
 
-  border_width = GTK_CONTAINER (widget)->border_width;
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
+  gtk_widget_get_allocation (widget, &allocation);
   
   attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.x = widget->allocation.x + border_width;
-  attributes.y = widget->allocation.y + border_width;
-  attributes.width = widget->allocation.width - border_width * 2;
-  attributes.height = widget->allocation.height - border_width * 2;
+  attributes.x = allocation.x + border_width;
+  attributes.y = allocation.y + border_width;
+  attributes.width = allocation.width - border_width * 2;
+  attributes.height = allocation.height - border_width * 2;
   attributes.wclass = GDK_INPUT_OUTPUT;
   attributes.visual = gtk_widget_get_visual (widget);
   attributes.colormap = gtk_widget_get_colormap (widget);
@@ -4546,13 +4566,17 @@ gtk_cmclist_realize (GtkWidget *widget)
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
 
   /* main window */
-  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
+  window = gtk_widget_get_window (widget);
+  window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                   &attributes, attributes_mask);
-  gdk_window_set_user_data (widget->window, clist);
+  gdk_window_set_user_data (window, clist);
+  gtk_widget_set_window (widget, window);
 
-  widget->style = gtk_style_attach (widget->style, widget->window);
+  style = gtk_widget_get_style (widget);
+  style = gtk_style_attach (style, window);
+  gtk_widget_set_style (widget, style);
 
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+  gtk_style_set_background (style, window, GTK_STATE_NORMAL);
 
   /* column-title window */
 
@@ -4561,11 +4585,11 @@ gtk_cmclist_realize (GtkWidget *widget)
   attributes.width = clist->column_title_area.width;
   attributes.height = clist->column_title_area.height;
   
-  clist->title_window = gdk_window_new (widget->window, &attributes,
+  clist->title_window = gdk_window_new (window, &attributes,
                                        attributes_mask);
   gdk_window_set_user_data (clist->title_window, clist);
 
-  gtk_style_set_background (widget->style, clist->title_window,
+  gtk_style_set_background (style, clist->title_window,
                            GTK_STATE_NORMAL);
   gdk_window_show (clist->title_window);
 
@@ -4577,19 +4601,19 @@ gtk_cmclist_realize (GtkWidget *widget)
 
   /* clist-window */
   attributes.x = (clist->internal_allocation.x +
-                 widget->style->xthickness);
+                 style->xthickness);
   attributes.y = (clist->internal_allocation.y +
-                 widget->style->ythickness +
+                 style->ythickness +
                  clist->column_title_area.height);
   attributes.width = clist->clist_window_width;
   attributes.height = clist->clist_window_height;
   
-  clist->clist_window = gdk_window_new (widget->window, &attributes,
+  clist->clist_window = gdk_window_new (window, &attributes,
                                        attributes_mask);
   gdk_window_set_user_data (clist->clist_window, clist);
 
   gdk_window_set_background (clist->clist_window,
-                            &widget->style->base[GTK_STATE_NORMAL]);
+                            &style->base[GTK_STATE_NORMAL]);
   gdk_window_show (clist->clist_window);
   gdk_drawable_get_size (clist->clist_window, &clist->clist_window_width,
                       &clist->clist_window_height);
@@ -4623,17 +4647,17 @@ gtk_cmclist_realize (GtkWidget *widget)
   size_allocate_title_buttons (clist);
 
   /* GCs */
-  clist->fg_gc = gdk_gc_new (widget->window);
-  clist->bg_gc = gdk_gc_new (widget->window);
+  clist->fg_gc = gdk_gc_new (window);
+  clist->bg_gc = gdk_gc_new (window);
   
   /* We'll use this gc to do scrolling as well */
   gdk_gc_set_exposures (clist->fg_gc, TRUE);
 
-  values.foreground = (widget->style->white.pixel==0 ?
-                      widget->style->black:widget->style->white);
+  values.foreground = (style->white.pixel==0 ?
+                      style->black:style->white);
   values.function = GDK_XOR;
   values.subwindow_mode = GDK_INCLUDE_INFERIORS;
-  clist->xor_gc = gdk_gc_new_with_values (widget->window,
+  clist->xor_gc = gdk_gc_new_with_values (window,
                                          &values,
                                          GDK_GC_FOREGROUND |
                                          GDK_GC_FUNCTION |
@@ -4773,7 +4797,7 @@ gtk_cmclist_map (GtkWidget *widget)
 
       gdk_window_show (clist->title_window);
       gdk_window_show (clist->clist_window);
-      gdk_window_show (widget->window);
+      gdk_window_show (gtk_widget_get_window (widget));
 
       /* unfreeze the list */
       clist->freeze_count = 0;
@@ -4823,7 +4847,7 @@ gtk_cmclist_unmap (GtkWidget *widget)
 
       gdk_window_hide (clist->clist_window);
       gdk_window_hide (clist->title_window);
-      gdk_window_hide (widget->window);
+      gdk_window_hide (gtk_widget_get_window (widget));
 
       /* unmap column buttons */
       for (i = 0; i < clist->columns; i++)
@@ -4840,25 +4864,30 @@ static gint
 gtk_cmclist_expose (GtkWidget      *widget,
                  GdkEventExpose *event)
 {
+  GdkWindow *window;
   GtkCMCList *clist;
+  GtkStyle *style;
 
   cm_return_val_if_fail (GTK_IS_CMCLIST (widget), FALSE);
   cm_return_val_if_fail (event != NULL, FALSE);
 
+  window = gtk_widget_get_window (widget);
+  style = gtk_widget_get_style (widget);
+
   if (gtkut_widget_is_drawable (widget))
     {
       clist = GTK_CMCLIST (widget);
 
       /* draw border */
-      if (event->window == widget->window)
-       gtk_paint_shadow (widget->style, widget->window,
+      if (event->window == window)
+       gtk_paint_shadow (style, window,
                         GTK_STATE_NORMAL, clist->shadow_type,
                         NULL, NULL, NULL,
                         0, 0,
                         clist->clist_window_width +
-                        (2 * widget->style->xthickness),
+                        (2 * style->xthickness),
                         clist->clist_window_height +
-                        (2 * widget->style->ythickness) +
+                        (2 * style->ythickness) +
                         clist->column_title_area.height);
 
       /* exposure events on the list */
@@ -4895,6 +4924,7 @@ gtk_cmclist_style_set (GtkWidget *widget,
                     GtkStyle  *previous_style)
 {
   GtkCMCList *clist;
+  GtkStyle *style;
 
   cm_return_if_fail (GTK_IS_CMCLIST (widget));
 
@@ -4905,9 +4935,11 @@ gtk_cmclist_style_set (GtkWidget *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);
-      gdk_window_set_background (clist->clist_window, &widget->style->base[GTK_STATE_NORMAL]);
+      style = gtk_widget_get_style (widget);
+      gtk_style_set_background (style, gtk_widget_get_window (widget),
+                               gtk_widget_get_state(widget));
+      gtk_style_set_background (style, clist->title_window, GTK_STATE_NORMAL);
+      gdk_window_set_background (clist->clist_window, &style->base[GTK_STATE_NORMAL]);
     }
 
   /* Fill in data after widget has correct style */
@@ -5257,6 +5289,7 @@ gtk_cmclist_motion (GtkWidget      *widget,
   gint row;
   gint new_width;
   gint button_actions = 0;
+  guint value;
 
   cm_return_val_if_fail (GTK_IS_CMCLIST (widget), FALSE);
 
@@ -5269,7 +5302,7 @@ gtk_cmclist_motion (GtkWidget      *widget,
 
   if (GTK_CMCLIST_IN_DRAG(clist))
     {
-      if (event->is_hint || event->window != widget->window)
+      if (event->is_hint || event->window != gtk_widget_get_window (widget))
        gtk_widget_get_pointer (widget, &x, NULL);
       else
        x = event->x;
@@ -5353,9 +5386,10 @@ gtk_cmclist_motion (GtkWidget      *widget,
       clist->htimer = g_timeout_add
        (SCROLL_TIME, (GSourceFunc) horizontal_timeout, clist);
 #endif
-      if (!((x < 0 && clist->hadjustment->value == 0) ||
+      value = gtk_adjustment_get_value (clist->hadjustment);
+      if (!((x < 0 && value == 0) ||
            (x >= clist->clist_window_width &&
-            clist->hadjustment->value ==
+            value ==
             LIST_WIDTH (clist) - clist->clist_window_width)))
        {
          if (x < 0)
@@ -5435,12 +5469,15 @@ gtk_cmclist_size_request (GtkWidget      *widget,
                        GtkRequisition *requisition)
 {
   GtkCMCList *clist;
+  GtkStyle *style;
   gint i;
   gint font_height = 0;
+  guint border_width;
   cm_return_if_fail (GTK_IS_CMCLIST (widget));
   cm_return_if_fail (requisition != NULL);
 
   clist = GTK_CMCLIST (widget);
+  style = gtk_widget_get_style (widget);
 
   requisition->width = 0;
   requisition->height = 0;
@@ -5448,7 +5485,7 @@ gtk_cmclist_size_request (GtkWidget      *widget,
   /* compute the size of the column title (title) area */
   clist->column_title_area.height = 0;
   if (GTK_CMCLIST_SHOW_TITLES(clist)) {
-    font_height = (pango_font_description_get_size((GTK_WIDGET(clist)->style)->font_desc)/PANGO_SCALE)*2+4;
+    font_height = (pango_font_description_get_size(style->font_desc)/PANGO_SCALE)*2+4;
     for (i = 0; i < clist->columns; i++)
       if (clist->column[i].button)
        {
@@ -5462,11 +5499,12 @@ gtk_cmclist_size_request (GtkWidget      *widget,
        }
     //clist->column_title_area.height = font_height;
   }
-  requisition->width += (widget->style->xthickness +
-                        GTK_CONTAINER (widget)->border_width) * 2;
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+  requisition->width += (style->xthickness +
+                        border_width) * 2;
   requisition->height += (clist->column_title_area.height +
-                         (widget->style->ythickness +
-                          GTK_CONTAINER (widget)->border_width) * 2);
+                         (style->ythickness +
+                          border_width) * 2);
 
   /* if (!clist->hadjustment) */
   requisition->width += list_requisition_width (clist);
@@ -5478,6 +5516,7 @@ static void
 gtk_cmclist_size_allocate (GtkWidget     *widget,
                         GtkAllocation *allocation)
 {
+  GtkStyle *style;
   GtkCMCList *clist;
   GtkAllocation clist_allocation;
   gint border_width;
@@ -5485,13 +5524,14 @@ gtk_cmclist_size_allocate (GtkWidget     *widget,
   cm_return_if_fail (GTK_IS_CMCLIST (widget));
   cm_return_if_fail (allocation != NULL);
 
+  style = gtk_widget_get_style (widget);
   clist = GTK_CMCLIST (widget);
-  widget->allocation = *allocation;
-  border_width = GTK_CONTAINER (widget)->border_width;
+  gtk_widget_set_allocation (widget, allocation);
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
   if (gtkut_widget_get_realized (widget))
     {
-      gdk_window_move_resize (widget->window,
+      gdk_window_move_resize (gtk_widget_get_window (widget),
                              allocation->x + border_width,
                              allocation->y + border_width,
                              allocation->width - border_width * 2,
@@ -5510,14 +5550,14 @@ gtk_cmclist_size_allocate (GtkWidget     *widget,
        
   /* allocate clist window assuming no scrollbars */
   clist_allocation.x = (clist->internal_allocation.x +
-                       widget->style->xthickness);
+                       style->xthickness);
   clist_allocation.y = (clist->internal_allocation.y +
-                       widget->style->ythickness +
+                       style->ythickness +
                        clist->column_title_area.height);
   clist_allocation.width = MAX (1, (gint)clist->internal_allocation.width - 
-                               (2 * (gint)widget->style->xthickness));
+                               (2 * (gint)style->xthickness));
   clist_allocation.height = MAX (1, (gint)clist->internal_allocation.height -
-                                (2 * (gint)widget->style->ythickness) -
+                                (2 * (gint)style->ythickness) -
                                 (gint)clist->column_title_area.height);
   
   clist->clist_window_width = clist_allocation.width;
@@ -5533,8 +5573,8 @@ gtk_cmclist_size_allocate (GtkWidget     *widget,
     }
   
   /* position the window which holds the column title buttons */
-  clist->column_title_area.x = widget->style->xthickness;
-  clist->column_title_area.y = widget->style->ythickness;
+  clist->column_title_area.x = style->xthickness;
+  clist->column_title_area.y = style->ythickness;
   clist->column_title_area.width = clist_allocation.width;
   
   if (gtkut_widget_get_realized (widget))
@@ -5596,10 +5636,11 @@ get_cell_style (GtkCMCList     *clist,
                GdkGC       **fg_gc,
                GdkGC       **bg_gc)
 {
+  GtkStyle *gtkstyle;
   gint fg_state;
 
   if ((state == GTK_STATE_NORMAL) &&
-      (GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE))
+      (gtk_widget_get_state (GTK_WIDGET (clist)) == GTK_STATE_INSENSITIVE))
     fg_state = GTK_STATE_INSENSITIVE;
   else
     fg_state = state;
@@ -5632,15 +5673,16 @@ get_cell_style (GtkCMCList     *clist,
     }
   else
     {
+      gtkstyle = gtk_widget_get_style (GTK_WIDGET (clist));
       if (style)
-       *style = GTK_WIDGET (clist)->style;
+       *style = gtkstyle;
       if (fg_gc)
-       *fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state];
+       *fg_gc = gtkstyle->fg_gc[fg_state];
       if (bg_gc) {
        if (state == GTK_STATE_SELECTED)
-         *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state];
+         *bg_gc = gtkstyle->bg_gc[state];
        else
-         *bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
+         *bg_gc = gtkstyle->base_gc[state];
       }
 
       if (state != GTK_STATE_SELECTED)
@@ -5698,6 +5740,7 @@ draw_row (GtkCMCList     *clist,
          gint          row,
          GtkCMCListRow  *clist_row)
 {
+  GtkStyle *style;
   GtkWidget *widget;
   GdkRectangle *rect;
   GdkRectangle row_rectangle;
@@ -5715,6 +5758,7 @@ draw_row (GtkCMCList     *clist,
     return;
 
   widget = GTK_WIDGET (clist);
+  style = gtk_widget_get_style (widget);
 
   /* if the function is passed the pointer to the row instead of null,
    * it avoids this expensive lookup */
@@ -5757,7 +5801,7 @@ draw_row (GtkCMCList     *clist,
       if (gdk_rectangle_intersect (area, &cell_rectangle,
                                   &intersect_rectangle))
        gdk_draw_rectangle (clist->clist_window,
-                           widget->style->base_gc[GTK_STATE_NORMAL],
+                           style->base_gc[GTK_STATE_NORMAL],
                            TRUE,
                            intersect_rectangle.x,
                            intersect_rectangle.y,
@@ -5772,7 +5816,7 @@ draw_row (GtkCMCList     *clist,
          if (gdk_rectangle_intersect (area, &cell_rectangle,
                                       &intersect_rectangle))
            gdk_draw_rectangle (clist->clist_window,
-                               widget->style->base_gc[GTK_STATE_NORMAL],
+                               style->base_gc[GTK_STATE_NORMAL],
                                TRUE,
                                intersect_rectangle.x,
                                intersect_rectangle.y,
@@ -5788,7 +5832,7 @@ draw_row (GtkCMCList     *clist,
     {
       rect = &clip_rectangle;
       gdk_draw_rectangle (clist->clist_window,
-                         widget->style->base_gc[GTK_STATE_NORMAL],
+                         style->base_gc[GTK_STATE_NORMAL],
                          TRUE,
                          cell_rectangle.x,
                          cell_rectangle.y,
@@ -5801,7 +5845,7 @@ draw_row (GtkCMCList     *clist,
          cell_rectangle.y += clist->row_height + CELL_SPACING;
 
          gdk_draw_rectangle (clist->clist_window,
-                             widget->style->base_gc[GTK_STATE_NORMAL],
+                             style->base_gc[GTK_STATE_NORMAL],
                              TRUE,
                              cell_rectangle.x,
                              cell_rectangle.y,
@@ -6028,9 +6072,9 @@ draw_xor_line (GtkCMCList *clist)
 
   widget = GTK_WIDGET (clist);
 
-  gdk_draw_line (widget->window, clist->xor_gc,
+  gdk_draw_line (gtk_widget_get_window (widget), clist->xor_gc,
                  clist->x_drag,
-                widget->style->ythickness,
+                gtk_widget_get_style (widget)->ythickness,
                  clist->x_drag,
                  clist->column_title_area.height +
                 clist->clist_window_height + 1);
@@ -6107,19 +6151,19 @@ adjust_adjustments (GtkCMCList *clist,
 {
   if (clist->vadjustment)
     {
-      clist->vadjustment->page_size = clist->clist_window_height;
-      clist->vadjustment->step_increment = clist->row_height;
-      clist->vadjustment->page_increment =
-       MAX (clist->vadjustment->page_size - clist->vadjustment->step_increment,
-            clist->vadjustment->page_size / 2);
-      clist->vadjustment->lower = 0;
-      clist->vadjustment->upper = LIST_HEIGHT (clist);
+      gtk_adjustment_set_page_size (clist->vadjustment, clist->clist_window_height);
+      gtk_adjustment_set_step_increment (clist->vadjustment, clist->row_height);
+      gtk_adjustment_set_page_increment (clist->vadjustment,
+       MAX (clist->clist_window_height - clist->row_height,
+            clist->clist_window_height / 2));
+      gtk_adjustment_set_lower (clist->vadjustment, 0);
+      gtk_adjustment_set_upper (clist->vadjustment, LIST_HEIGHT (clist));
 
-      if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist) ||
-         (clist->voffset + (gint)clist->vadjustment->value) != 0)
+      if ((clist->clist_window_height - clist->voffset) > LIST_HEIGHT (clist) ||
+         (clist->voffset + (gint)gtk_adjustment_get_value (clist->vadjustment)) != 0)
        {
-         clist->vadjustment->value = MAX (0, (LIST_HEIGHT (clist) -
-                                              clist->clist_window_height));
+         gtk_adjustment_set_value (clist->vadjustment,
+          MAX (0, (LIST_HEIGHT (clist) - clist->clist_window_height)));
          g_signal_emit_by_name (G_OBJECT (clist->vadjustment),
                                   "value_changed");
        }
@@ -6128,19 +6172,20 @@ adjust_adjustments (GtkCMCList *clist,
 
   if (clist->hadjustment)
     {
-      clist->hadjustment->page_size = clist->clist_window_width;
-      clist->hadjustment->step_increment = 10;
-      clist->hadjustment->page_increment =
-       MAX (clist->hadjustment->page_size - clist->hadjustment->step_increment,
-            clist->hadjustment->page_size / 2);
-      clist->hadjustment->lower = 0;
-      clist->hadjustment->upper = LIST_WIDTH (clist);
-
-      if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist) ||
-         (clist->hoffset + (gint)clist->hadjustment->value) != 0)
+      gtk_adjustment_set_page_size (clist->hadjustment, clist->clist_window_width);
+      gtk_adjustment_set_step_increment (clist->hadjustment, 10);
+      gtk_adjustment_set_page_increment (clist->hadjustment,
+       MAX (clist->clist_window_width -
+         gtk_adjustment_get_step_increment (clist->hadjustment),
+            clist->clist_window_width / 2));
+      gtk_adjustment_set_lower (clist->hadjustment, 0);
+      gtk_adjustment_set_upper (clist->hadjustment, LIST_WIDTH (clist));
+
+      if ((clist->clist_window_width - clist->hoffset) > LIST_WIDTH (clist) ||
+         (clist->hoffset + (gint)gtk_adjustment_get_value (clist->hadjustment)) != 0)
        {
-         clist->hadjustment->value = MAX (0, (LIST_WIDTH (clist) -
-                                              clist->clist_window_width));
+         gtk_adjustment_set_value (clist->hadjustment, MAX (0, (LIST_WIDTH (clist) -
+                                              clist->clist_window_width)));
          g_signal_emit_by_name (G_OBJECT (clist->hadjustment),
                                   "value_changed");
        }
@@ -6151,14 +6196,16 @@ adjust_adjustments (GtkCMCList *clist,
     {
       GtkWidget *widget;
       GtkRequisition requisition;
+      GtkAllocation allocation;
 
       widget = GTK_WIDGET (clist);
       gtk_widget_size_request (widget, &requisition);
+      gtk_widget_get_allocation (widget, &allocation);
 
       if ((!clist->hadjustment &&
-          requisition.width != widget->allocation.width) ||
+          requisition.width != allocation.width) ||
          (!clist->vadjustment &&
-          requisition.height != widget->allocation.height))
+          requisition.height != allocation.height))
        gtk_widget_queue_resize (widget);
     }
 }
@@ -6202,7 +6249,7 @@ vadjustment_value_changed (GtkAdjustment *adjustment,
   if (adjustment != clist->vadjustment)
     return;
 
-  value = -adjustment->value;
+  value = -gtk_adjustment_get_value (adjustment);
   dy = value - clist->voffset;
   clist->voffset = value;
 
@@ -6224,20 +6271,23 @@ typedef struct
 /* The window to which widget->window is relative */
 #define ALLOCATION_WINDOW(widget)              \
    (!gtkut_widget_get_has_window (widget) ?            \
-    (widget)->window :                          \
-     gdk_window_get_parent ((widget)->window))
+       gtk_widget_get_window (widget) :         \
+       gdk_window_get_parent (gtk_widget_get_window(widget)))
 
 static void
 adjust_allocation_recurse (GtkWidget *widget,
                           gpointer   data)
 {
+  GtkAllocation allocation;
   ScrollData *scroll_data = data;
+
+  gtk_widget_get_allocation (widget, &allocation);
   
   if (!gtkut_widget_get_realized (widget))
     {
       if (gtkut_widget_get_visible (widget))
        {
-         GdkRectangle tmp_rectangle = widget->allocation;
+         GdkRectangle tmp_rectangle = allocation;
          tmp_rectangle.x += scroll_data->dx;
       
          gtk_widget_size_allocate (widget, &tmp_rectangle);
@@ -6247,7 +6297,8 @@ adjust_allocation_recurse (GtkWidget *widget,
     {
       if (ALLOCATION_WINDOW (widget) == scroll_data->window)
        {
-         widget->allocation.x += scroll_data->dx;
+         allocation.x += scroll_data->dx;
+         gtk_widget_set_allocation (widget, &allocation);
 
          if (GTK_IS_CONTAINER (widget))
            gtk_container_forall (GTK_CONTAINER (widget),
@@ -6294,7 +6345,7 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
   if (adjustment != clist->hadjustment)
     return;
 
-  value = adjustment->value;
+  value = gtk_adjustment_get_value (adjustment);
 
   dx = -value - clist->hoffset;
 
@@ -6310,9 +6361,10 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
 
   if (gtkut_widget_is_drawable (GTK_WIDGET(clist)))
     {
+      GtkWidget *focus_child = gtk_container_get_focus_child (container);
       if (gtkut_widget_get_can_focus(GTK_WIDGET(clist)) && 
           gtkut_widget_has_focus(GTK_WIDGET(clist)) &&
-          !container->focus_child && GTK_CMCLIST_ADD_MODE(clist))
+          !focus_child && GTK_CMCLIST_ADD_MODE(clist))
         {
           y = ROW_TOP_YPIXEL (clist, clist->focus_row);
       
@@ -6326,7 +6378,7 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
 
       if (gtkut_widget_get_can_focus(GTK_WIDGET(clist)) && 
           gtkut_widget_has_focus(GTK_WIDGET(clist)) &&
-          !container->focus_child)
+          !focus_child)
         {
           if (GTK_CMCLIST_ADD_MODE(clist))
             {
@@ -6536,7 +6588,7 @@ gtk_cmclist_focus (GtkWidget        *widget,
   if (!gtkut_widget_is_sensitive (widget))
     return FALSE;
 
-  focus_child = GTK_CONTAINER (widget)->focus_child;
+  focus_child = gtk_container_get_focus_child (GTK_CONTAINER (widget));
   
   is_current_focus = gtk_widget_is_focus (GTK_WIDGET (clist));
                          
@@ -6754,7 +6806,7 @@ title_focus_move (GtkCMCList *clist,
   if (!GTK_CMCLIST_SHOW_TITLES(clist))
     return FALSE;
 
-  focus_child = GTK_CONTAINER (clist)->focus_child;
+  focus_child = gtk_container_get_focus_child (GTK_CONTAINER (clist));
   g_assert (focus_child);
 
   /* Movement direction within headers
@@ -7098,8 +7150,9 @@ move_horizontal (GtkCMCList *clist,
   if (!clist->hadjustment)
     return;
 
-  value = CLAMP (clist->hadjustment->value + diff, 0.0,
-                clist->hadjustment->upper - clist->hadjustment->page_size);
+  value = CLAMP (gtk_adjustment_get_value (clist->hadjustment) + diff, 0.0,
+                gtk_adjustment_get_upper (clist->hadjustment) -
+                gtk_adjustment_get_page_size (clist->hadjustment));
   gtk_adjustment_set_value (clist->hadjustment, value);
 }
 
@@ -7109,6 +7162,8 @@ move_vertical (GtkCMCList *clist,
               gfloat    align)
 {
   gdouble value;
+  gdouble upper;
+  gdouble page_size;
 
   if (!clist->vadjustment)
     return;
@@ -7117,8 +7172,10 @@ move_vertical (GtkCMCList *clist,
           align * (clist->clist_window_height - clist->row_height) +
           (2 * align - 1) * CELL_SPACING);
 
-  if (value + clist->vadjustment->page_size > clist->vadjustment->upper)
-    value = clist->vadjustment->upper - clist->vadjustment->page_size;
+  upper = gtk_adjustment_get_upper (clist->vadjustment);
+  page_size = gtk_adjustment_get_page_size (clist->vadjustment);
+  if ((value + page_size) > upper)
+       value = upper - page_size;
 
   gtk_adjustment_set_value (clist->vadjustment, value);
 }
@@ -7444,13 +7501,17 @@ drag_dest_cell (GtkCMCList         *clist,
                GtkCMCListDestInfo *dest_info)
 {
   GtkWidget *widget;
+  GtkStyle *style;
+  guint border_width;
 
   widget = GTK_WIDGET (clist);
+  style = gtk_widget_get_style (widget);
 
   dest_info->insert_pos = GTK_CMCLIST_DRAG_NONE;
 
-  y -= (GTK_CONTAINER (clist)->border_width +
-       widget->style->ythickness +
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+  y -= (border_width +
+       style->ythickness +
        clist->column_title_area.height);
 
   dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
@@ -7462,7 +7523,7 @@ drag_dest_cell (GtkCMCList         *clist,
   if (dest_info->cell.row < -1)
     dest_info->cell.row = -1;
   
-  x -= GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
+  x -= border_width + style->xthickness;
 
   dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
 
@@ -7580,23 +7641,17 @@ gtk_cmclist_drag_leave (GtkWidget      *widget,
          GTK_CMCLIST_REORDERABLE(clist) &&
          gtk_drag_get_source_widget (context) == widget)
        {
-         GList *list;
          GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
+         GdkAtom found = gtk_drag_dest_find_target(widget, context, NULL);
 
-         list = context->targets;
-         while (list)
-           {
-             if (atom == GDK_POINTER_TO_ATOM (list->data))
+             if (atom == found)
                {
                  GTK_CMCLIST_GET_CLASS (clist)->draw_drag_highlight
                    (clist,
                     g_list_nth (clist->row_list, dest_info->cell.row)->data,
                     dest_info->cell.row, dest_info->insert_pos);
                  clist->drag_highlight_row = -1;
-                 break;
                }
-             list = list->next;
-           }
        }
       g_dataset_remove_data (context, "gtk-clist-drag-dest");
     }
@@ -7635,18 +7690,10 @@ gtk_cmclist_drag_motion (GtkWidget      *widget,
 
   if (GTK_CMCLIST_REORDERABLE (clist))
     {
-      GList *list;
       GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
+      GdkAtom found = gtk_drag_dest_find_target(widget, context, NULL);
 
-      list = context->targets;
-      while (list)
-       {
-         if (atom == GDK_POINTER_TO_ATOM (list->data))
-           break;
-         list = list->next;
-       }
-
-      if (list)
+      if (atom == found)
        {
          if (gtk_drag_get_source_widget (context) != widget ||
              new_info.insert_pos == GTK_CMCLIST_DRAG_NONE ||
@@ -7686,7 +7733,8 @@ gtk_cmclist_drag_motion (GtkWidget      *widget,
              clist->drag_highlight_row = dest_info->cell.row;
              clist->drag_highlight_pos = dest_info->insert_pos;
 
-             gdk_drag_status (context, context->suggested_action, time);
+             gdk_drag_status (context,
+               gdk_drag_context_get_suggested_action(context), time);
            }
          return TRUE;
        }
@@ -7711,16 +7759,11 @@ gtk_cmclist_drag_drop (GtkWidget      *widget,
   if (GTK_CMCLIST_REORDERABLE (widget) &&
       gtk_drag_get_source_widget (context) == widget)
     {
-      GList *list;
       GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
+      GdkAtom found = gtk_drag_dest_find_target(widget, context, NULL);
 
-      list = context->targets;
-      while (list)
-       {
-         if (atom == GDK_POINTER_TO_ATOM (list->data))
+         if (atom == found)
            return TRUE;
-         list = list->next;
-       }
     }
   return FALSE;
 }
@@ -7744,14 +7787,14 @@ gtk_cmclist_drag_data_received (GtkWidget        *widget,
 
   if (GTK_CMCLIST_REORDERABLE (clist) &&
       gtk_drag_get_source_widget (context) == widget &&
-      selection_data->target ==
+      gtk_selection_data_get_target (selection_data) ==
       gdk_atom_intern_static_string ("gtk-clist-drag-reorder") &&
-      selection_data->format == 8 &&
-      selection_data->length == sizeof (GtkCMCListCellInfo))
+      gtk_selection_data_get_format (selection_data) == 8 &&
+      gtk_selection_data_get_length (selection_data) == sizeof (GtkCMCListCellInfo))
     {
       GtkCMCListCellInfo *source_info;
 
-      source_info = (GtkCMCListCellInfo *)(selection_data->data);
+      source_info = (GtkCMCListCellInfo *)(gtk_selection_data_get_data (selection_data));
       if (source_info)
        {
          GtkCMCListDestInfo dest_info;
@@ -7777,11 +7820,13 @@ gtk_cmclist_drag_data_get (GtkWidget        *widget,
                         guint             info,
                         guint             time)
 {
+  GdkAtom target;
   cm_return_if_fail (GTK_IS_CMCLIST (widget));
   cm_return_if_fail (context != NULL);
   cm_return_if_fail (selection_data != NULL);
 
-  if (selection_data->target == gdk_atom_intern_static_string ("gtk-clist-drag-reorder"))
+  target = gtk_selection_data_get_target (selection_data);
+  if (target == gdk_atom_intern_static_string ("gtk-clist-drag-reorder"))
     {
       GtkCMCListCellInfo *info;
 
@@ -7794,7 +7839,7 @@ gtk_cmclist_drag_data_get (GtkWidget        *widget,
          ret_info.row = info->row;
          ret_info.column = info->column;
 
-         gtk_selection_data_set (selection_data, selection_data->target,
+         gtk_selection_data_set (selection_data, target,
                                  8, (guchar *) &ret_info,
                                  sizeof (GtkCMCListCellInfo));
        }
index c984057..eb5fc96 100644 (file)
 #include <config.h>
 #include <stdlib.h>
 
-/* We know this file uses some deprecated stuff. */
-#undef G_DISABLE_DEPRECATED
-#undef GTK_DISABLE_DEPRECATED
-#undef GDK_DISABLE_DEPRECATED
-
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 #include "gtkcmctree.h"
@@ -847,6 +842,7 @@ gtk_cmctree_realize (GtkWidget *widget)
   GdkGCValues values;
   GtkCMCTreeNode *node;
   GtkCMCTreeNode *child;
+  GtkStyle *style;
   gint i;
 
   cm_return_if_fail (GTK_IS_CMCTREE (widget));
@@ -866,8 +862,10 @@ gtk_cmctree_realize (GtkWidget *widget)
       node = GTK_CMCTREE_NODE_NEXT (node);
     }
 
-  values.foreground = widget->style->fg[GTK_STATE_NORMAL];
-  values.background = widget->style->base[GTK_STATE_NORMAL];
+  style = gtk_widget_get_style(widget);
+
+  values.foreground = style->fg[GTK_STATE_NORMAL];
+  values.background = style->base[GTK_STATE_NORMAL];
   values.subwindow_mode = GDK_INCLUDE_INFERIORS;
   values.line_style = GDK_LINE_SOLID;
   ctree->lines_gc = gdk_gc_new_with_values (GTK_CMCLIST(widget)->clist_window, 
@@ -977,6 +975,7 @@ draw_drag_highlight (GtkCMCList        *clist,
                     gint             dest_row_number,
                     GtkCMCListDragPos  drag_pos)
 {
+  GtkAllocation allocation;
   GtkCMCTree *ctree;
   GdkPoint points[4];
   gint level;
@@ -986,6 +985,7 @@ draw_drag_highlight (GtkCMCList        *clist,
   cm_return_if_fail (GTK_IS_CMCTREE (clist));
 
   ctree = GTK_CMCTREE (clist);
+  gtk_widget_get_allocation(GTK_WIDGET(ctree), &allocation);
 
   level = ((GtkCMCTreeRow *)(dest_row))->level;
 
@@ -1016,7 +1016,7 @@ draw_drag_highlight (GtkCMCList        *clist,
                           COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) + 
                           ctree->tree_indent * level -
                           (ctree->tree_indent - PM_SIZE) / 2, y,
-                          GTK_WIDGET (ctree)->allocation.width, y);
+                          allocation.width, y);
            break;
          case GTK_JUSTIFY_RIGHT:
            if (ctree->tree_column < clist->columns - 1)
@@ -1172,10 +1172,12 @@ get_cell_style (GtkCMCList     *clist,
                GdkGC       **fg_gc,
                GdkGC       **bg_gc)
 {
+  GtkStyle *gtkstyle;
   gint fg_state;
 
+  gtkstyle = gtk_widget_get_style (GTK_WIDGET (clist));
   if ((state == GTK_STATE_NORMAL) &&
-      (GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE))
+      (gtk_widget_get_state(GTK_WIDGET (clist)) == GTK_STATE_INSENSITIVE))
     fg_state = GTK_STATE_INSENSITIVE;
   else
     fg_state = state;
@@ -1209,14 +1211,14 @@ get_cell_style (GtkCMCList     *clist,
   else
     {
       if (style)
-       *style = GTK_WIDGET (clist)->style;
+       *style = gtkstyle;
       if (fg_gc)
-       *fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state];
+       *fg_gc = gtkstyle->fg_gc[fg_state];
       if (bg_gc) {
        if (state == GTK_STATE_SELECTED)
-         *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state];
+         *bg_gc = gtkstyle->bg_gc[state];
        else
-         *bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
+         *bg_gc = gtkstyle->base_gc[state];
       }
 
       if (state != GTK_STATE_SELECTED)
@@ -1537,7 +1539,7 @@ gtk_cmctree_draw_lines (GtkCMCTree     *ctree,
                      else if (state == GTK_STATE_SELECTED)
                        bg_gc = style->base_gc[state];
                      else
-                       bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
+                       bg_gc = gtk_widget_get_style (GTK_WIDGET (clist))->base_gc[state];
 
                      if (!area)
                        gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
@@ -1601,8 +1603,8 @@ gtk_cmctree_draw_lines (GtkCMCTree     *ctree,
 
          if (!area)
            gdk_draw_rectangle (clist->clist_window,
-                               GTK_WIDGET
-                               (ctree)->style->base_gc[GTK_STATE_NORMAL],
+                               gtk_widget_get_style (GTK_WIDGET
+                               (ctree))->base_gc[GTK_STATE_NORMAL],
                                TRUE,
                                tree_rectangle.x,
                                tree_rectangle.y,
@@ -1611,8 +1613,8 @@ gtk_cmctree_draw_lines (GtkCMCTree     *ctree,
          else if (gdk_rectangle_intersect (area, &tree_rectangle,
                                            &tc_rectangle))
            gdk_draw_rectangle (clist->clist_window,
-                               GTK_WIDGET
-                               (ctree)->style->base_gc[GTK_STATE_NORMAL],
+                               gtk_widget_get_style (GTK_WIDGET
+                               (ctree))->base_gc[GTK_STATE_NORMAL],
                                TRUE,
                                tc_rectangle.x,
                                tc_rectangle.y,
@@ -1744,6 +1746,7 @@ draw_row (GtkCMCList     *clist,
          gint          row,
          GtkCMCListRow  *clist_row)
 {
+  GtkStyle *style;
   GtkWidget *widget;
   GtkCMCTree  *ctree;
   GdkRectangle *crect;
@@ -1801,8 +1804,9 @@ draw_row (GtkCMCList     *clist,
   
   state = clist_row->state;
 
+  style = gtk_widget_get_style (widget);
   gdk_gc_set_foreground (ctree->lines_gc,
-                        &widget->style->fg[clist_row->state]);
+                        &style->fg[clist_row->state]);
 
   /* draw the cell borders */
   if (area)
@@ -1811,7 +1815,7 @@ draw_row (GtkCMCList     *clist,
 
       if (gdk_rectangle_intersect (area, &cell_rectangle, crect))
        gdk_draw_rectangle (clist->clist_window,
-                           widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+                           style->base_gc[GTK_STATE_NORMAL], TRUE,
                            crect->x, crect->y, crect->width, crect->height);
     }
   else
@@ -1819,7 +1823,7 @@ draw_row (GtkCMCList     *clist,
       crect = &cell_rectangle;
 
       gdk_draw_rectangle (clist->clist_window,
-                         widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+                         style->base_gc[GTK_STATE_NORMAL], TRUE,
                          crect->x, crect->y, crect->width, crect->height);
     }
 
@@ -1866,7 +1870,7 @@ draw_row (GtkCMCList     *clist,
       if (!area || gdk_rectangle_intersect (area, &cell_rectangle, crect))
        {
          gdk_draw_rectangle (clist->clist_window,
-                             widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+                             gtk_widget_get_style (widget)->base_gc[GTK_STATE_NORMAL], TRUE,
                              crect->x, crect->y, crect->width, crect->height);
 
          /* horizontal black lines */
@@ -2883,8 +2887,12 @@ column_auto_resize (GtkCMCList    *clist,
       /* run a "gtk_cmclist_optimal_column_width" but break, if
        * the column doesn't shrink */
       if (GTK_CMCLIST_SHOW_TITLES (clist) && clist->column[column].button)
-       new_width = (clist->column[column].button->requisition.width -
+        {
+       GtkRequisition req;
+       gtk_widget_get_requisition (clist->column[column].button, &req);
+       new_width = (req.width -
                     (CELL_SPACING + (2 * COLUMN_INSET)));
+        }
       else
        new_width = 0;
 
@@ -5864,14 +5872,18 @@ drag_dest_cell (GtkCMCList         *clist,
                gint              y,
                GtkCMCListDestInfo *dest_info)
 {
+  GtkStyle *style;
   GtkWidget *widget;
+  guint border_width;
 
   widget = GTK_WIDGET (clist);
+  style = gtk_widget_get_style (widget);
 
   dest_info->insert_pos = GTK_CMCLIST_DRAG_NONE;
 
-  y -= (GTK_CONTAINER (widget)->border_width +
-       widget->style->ythickness + clist->column_title_area.height);
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+  y -= (border_width +
+       style->ythickness + clist->column_title_area.height);
   dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
 
   if (dest_info->cell.row >= clist->rows)
@@ -5882,7 +5894,7 @@ drag_dest_cell (GtkCMCList         *clist,
   if (dest_info->cell.row < -1)
     dest_info->cell.row = -1;
   
-  x -= GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
+  x -= border_width + style->xthickness;
 
   dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
 
@@ -5980,18 +5992,10 @@ gtk_cmctree_drag_motion (GtkWidget      *widget,
 
   if (GTK_CMCLIST_REORDERABLE (clist))
     {
-      GList *list;
       GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
+      GdkAtom found = gtk_drag_dest_find_target(widget, context, NULL);
 
-      list = context->targets;
-      while (list)
-       {
-         if (atom == GDK_POINTER_TO_ATOM (list->data))
-           break;
-         list = list->next;
-       }
-
-      if (list)
+      if (atom == found)
        {
          GtkCMCTreeNode *drag_source;
          GtkCMCTreeNode *drag_target;
@@ -6035,7 +6039,8 @@ gtk_cmctree_drag_motion (GtkWidget      *widget,
              clist->drag_highlight_row = dest_info->cell.row;
              clist->drag_highlight_pos = dest_info->insert_pos;
 
-             gdk_drag_status (context, context->suggested_action, time);
+             gdk_drag_status (context,
+               gdk_drag_context_get_suggested_action(context), time);
            }
          return TRUE;
        }
@@ -6068,14 +6073,14 @@ gtk_cmctree_drag_data_received (GtkWidget        *widget,
 
   if (GTK_CMCLIST_REORDERABLE (clist) &&
       gtk_drag_get_source_widget (context) == widget &&
-      selection_data->target ==
+      gtk_selection_data_get_target (selection_data) ==
       gdk_atom_intern_static_string ("gtk-clist-drag-reorder") &&
-      selection_data->format == 8 &&
-      selection_data->length == sizeof (GtkCMCListCellInfo))
+      gtk_selection_data_get_format (selection_data) == 8 &&
+      gtk_selection_data_get_length (selection_data) == sizeof (GtkCMCListCellInfo))
     {
       GtkCMCListCellInfo *source_info;
 
-      source_info = (GtkCMCListCellInfo *)(selection_data->data);
+      source_info = (GtkCMCListCellInfo *)(gtk_selection_data_get_data (selection_data));
       if (source_info)
        {
          GtkCMCListDestInfo dest_info;
index dd6d8e2..44409f3 100644 (file)
@@ -255,7 +255,7 @@ gtk_cmoption_menu_set_menu (GtkCMOptionMenu *option_menu,
                                G_CALLBACK (gtk_cmoption_menu_calc_size),
                                option_menu);
 
-      if (GTK_WIDGET (option_menu)->parent)
+      if (gtk_widget_get_parent (GTK_WIDGET (option_menu)))
        gtk_widget_queue_resize (GTK_WIDGET (option_menu));
 
       gtk_cmoption_menu_update_contents (option_menu);
@@ -271,7 +271,8 @@ gtk_cmoption_menu_remove_menu (GtkCMOptionMenu *option_menu)
 
   if (option_menu->menu)
     {
-      if (GTK_MENU_SHELL (option_menu->menu)->active)
+      if (option_menu->menu_item ==
+       gtk_menu_get_active (GTK_MENU (option_menu->menu)))
        gtk_menu_shell_cancel (GTK_MENU_SHELL (option_menu->menu));
       
       gtk_menu_detach (GTK_MENU (option_menu->menu));
@@ -310,6 +311,8 @@ gint
 gtk_cmoption_menu_get_history (GtkCMOptionMenu *option_menu)
 {
   GtkWidget *active_widget;
+  GList *list;
+  gint index;
   
   cm_return_val_if_fail (GTK_IS_CMOPTION_MENU (option_menu), -1);
 
@@ -318,8 +321,14 @@ gtk_cmoption_menu_get_history (GtkCMOptionMenu *option_menu)
       active_widget = gtk_menu_get_active (GTK_MENU (option_menu->menu));
 
       if (active_widget)
-       return g_list_index (GTK_MENU_SHELL (option_menu->menu)->children,
-                             active_widget);
+        {
+       list = gtk_container_get_children (GTK_CONTAINER
+               (GTK_MENU_SHELL (option_menu->menu)));
+       index = g_list_index (list, active_widget);
+       g_list_free (list);
+
+       return index;
+        }
       else
        return -1;
     }
@@ -419,26 +428,32 @@ gtk_cmoption_menu_size_request (GtkWidget      *widget,
   GtkCMOptionMenu *option_menu = GTK_CMOPTION_MENU (widget);
   GtkCMOptionMenuProps props;
   gint tmp;
+  GtkWidget *child;
   GtkRequisition child_requisition = { 0, 0 };
+  GtkStyle *style;
+  gint border_width;
       
   gtk_cmoption_menu_get_props (option_menu, &props);
  
-  if (GTK_BIN (option_menu)->child && gtkut_widget_get_visible (GTK_BIN (option_menu)->child))
+  child = gtk_bin_get_child (GTK_BIN (option_menu));
+  if (child && gtkut_widget_get_visible (child))
     {
-      gtk_widget_size_request (GTK_BIN (option_menu)->child, &child_requisition);
+      gtk_widget_size_request (child, &child_requisition);
 
       requisition->width += child_requisition.width;
       requisition->height += child_requisition.height;
     }
-  
-  requisition->width = ((GTK_CONTAINER (widget)->border_width +
-                        GTK_WIDGET (widget)->style->xthickness + props.focus_pad) * 2 +
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+  style = gtk_widget_get_style (widget);
+  requisition->width = ((border_width +
+                        style->xthickness + props.focus_pad) * 2 +
                        MAX (child_requisition.width, option_menu->width) +
                        props.indicator_size.width +
                        props.indicator_spacing.left + props.indicator_spacing.right +
                        CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING + props.focus_width * 2);
-  requisition->height = ((GTK_CONTAINER (widget)->border_width +
-                         GTK_WIDGET (widget)->style->ythickness + props.focus_pad) * 2 +
+  requisition->height = ((border_width +
+                         style->ythickness + props.focus_pad) * 2 +
                         MAX (child_requisition.height, option_menu->height) +
                         CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING + props.focus_width * 2);
 
@@ -452,28 +467,31 @@ gtk_cmoption_menu_size_allocate (GtkWidget     *widget,
                               GtkAllocation *allocation)
 {
   GtkWidget *child;
+  GtkStyle *style;
   GtkButton *button = GTK_BUTTON (widget);
-  GtkAllocation child_allocation;
+  GtkAllocation child_allocation, widget_allocation;
   GtkCMOptionMenuProps props;
   gint border_width;
     
   gtk_cmoption_menu_get_props (GTK_CMOPTION_MENU (widget), &props);
-  border_width = GTK_CONTAINER (widget)->border_width;
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-  widget->allocation = *allocation;
+  gtk_widget_set_allocation (widget, allocation);
   if (gtkut_widget_get_realized (widget))
-    gdk_window_move_resize (button->event_window,
+       gdk_window_move_resize (gtk_button_get_event_window (button),
                            allocation->x + border_width, allocation->y + border_width,
                            allocation->width - border_width * 2, allocation->height - border_width * 2);
 
-  child = GTK_BIN (widget)->child;
+  child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtkut_widget_get_visible (child))
     {
-      gint xthickness = GTK_WIDGET (widget)->style->xthickness;
-      gint ythickness = GTK_WIDGET (widget)->style->ythickness;
+      style = gtk_widget_get_style (widget);
+      gint xthickness = style->xthickness;
+      gint ythickness = style->ythickness;
       
-      child_allocation.x = widget->allocation.x + border_width + xthickness + props.focus_width + props.focus_pad + CHILD_LEFT_SPACING;
-      child_allocation.y = widget->allocation.y + border_width + ythickness + props.focus_width + props.focus_pad + CHILD_TOP_SPACING;
+      gtk_widget_get_allocation (widget, &widget_allocation);
+      child_allocation.x = widget_allocation.x + border_width + xthickness + props.focus_width + props.focus_pad + CHILD_LEFT_SPACING;
+      child_allocation.y = widget_allocation.y + border_width + ythickness + props.focus_width + props.focus_pad + CHILD_TOP_SPACING;
       child_allocation.width = MAX (1, allocation->width - (border_width + xthickness + props.focus_width + props.focus_pad) * 2 -
                                    props.indicator_size.width - props.indicator_spacing.left - props.indicator_spacing.right -
                                    CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING);
@@ -491,7 +509,10 @@ static void
 gtk_cmoption_menu_paint (GtkWidget    *widget,
                       GdkRectangle *area)
 {
+  GtkAllocation allocation;
+  GtkStyle *style;
   GdkRectangle button_area;
+  GdkWindow *window;
   GtkCMOptionMenuProps props;
   gint border_width;
   gint tab_x;
@@ -501,13 +522,14 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
 
   if (gtkut_widget_is_drawable (widget))
     {
-      border_width = GTK_CONTAINER (widget)->border_width;
+      gtk_widget_get_allocation (widget, &allocation);
+      border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
       gtk_cmoption_menu_get_props (GTK_CMOPTION_MENU (widget), &props);
 
-      button_area.x = widget->allocation.x + border_width;
-      button_area.y = widget->allocation.y + border_width;
-      button_area.width = widget->allocation.width - 2 * border_width;
-      button_area.height = widget->allocation.height - 2 * border_width;
+      button_area.x = allocation.x + border_width;
+      button_area.y = allocation.y + border_width;
+      button_area.width = allocation.width - 2 * border_width;
+      button_area.height = allocation.height - 2 * border_width;
 
       if (!props.interior_focus && gtkut_widget_has_focus (widget))
        {
@@ -517,7 +539,9 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
          button_area.height -= 2 * (props.focus_width + props.focus_pad);
        }
       
-      gtk_paint_box (widget->style, widget->window,
+      style = gtk_widget_get_style (widget);
+      window = gtk_widget_get_window (widget);
+      gtk_paint_box (style, window,
                     gtkut_widget_get_state (widget), GTK_SHADOW_OUT,
                     area, widget, "optionmenu",
                     button_area.x, button_area.y,
@@ -525,13 +549,13 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
       
       if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) 
        tab_x = button_area.x + props.indicator_spacing.right + 
-         widget->style->xthickness;
+         style->xthickness;
       else
        tab_x = button_area.x + button_area.width - 
          props.indicator_size.width - props.indicator_spacing.right -
-         widget->style->xthickness;
+         style->xthickness;
 
-      gtk_paint_tab (widget->style, widget->window,
+      gtk_paint_tab (style, window,
                     gtkut_widget_get_state (widget), GTK_SHADOW_OUT,
                     area, widget, "optionmenutab",
                     tab_x,
@@ -542,13 +566,13 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
        {
          if (props.interior_focus)
            {
-             button_area.x += widget->style->xthickness + props.focus_pad;
-             button_area.y += widget->style->ythickness + props.focus_pad;
-             button_area.width -= 2 * (widget->style->xthickness + props.focus_pad) +
+             button_area.x += style->xthickness + props.focus_pad;
+             button_area.y += style->ythickness + props.focus_pad;
+             button_area.width -= 2 * (style->xthickness + props.focus_pad) +
                      props.indicator_spacing.left +
                      props.indicator_spacing.right +
                      props.indicator_size.width;
-             button_area.height -= 2 * (widget->style->ythickness + props.focus_pad);
+             button_area.height -= 2 * (style->ythickness + props.focus_pad);
              if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) 
                button_area.x += props.indicator_spacing.left +
                  props.indicator_spacing.right +
@@ -562,7 +586,7 @@ gtk_cmoption_menu_paint (GtkWidget    *widget,
              button_area.height += 2 * (props.focus_width + props.focus_pad);
            }
            
-         gtk_paint_focus (widget->style, widget->window, gtkut_widget_get_state (widget),
+         gtk_paint_focus (style, window, gtkut_widget_get_state (widget),
                           area, widget, "button",
                           button_area.x, 
                           button_area.y, 
@@ -576,6 +600,7 @@ static gint
 gtk_cmoption_menu_expose (GtkWidget      *widget,
                        GdkEventExpose *event)
 {
+  GtkWidget *child;
   cm_return_val_if_fail (GTK_IS_CMOPTION_MENU (widget), FALSE);
   cm_return_val_if_fail (event != NULL, FALSE);
 
@@ -618,9 +643,10 @@ gtk_cmoption_menu_expose (GtkWidget      *widget,
       if (remove_child)
        gtk_cmoption_menu_remove_contents (GTK_CMOPTION_MENU (widget));
 #else
-      if (GTK_BIN (widget)->child)
+      child = gtk_bin_get_child (GTK_BIN (widget));
+      if (child)
        gtk_container_propagate_expose (GTK_CONTAINER (widget),
-                                       GTK_BIN (widget)->child,
+                                       child,
                                        event);
 #endif /* 0 */
     }
@@ -708,7 +734,7 @@ gtk_cmoption_menu_select_first_sensitive (GtkCMOptionMenu *option_menu)
 {
   if (option_menu->menu)
     {
-      GList *children = GTK_MENU_SHELL (option_menu->menu)->children;
+      GList *children = gtk_container_get_children (GTK_CONTAINER (GTK_MENU_SHELL (option_menu->menu)));
       gint index = 0;
 
       while (children)
@@ -722,6 +748,8 @@ gtk_cmoption_menu_select_first_sensitive (GtkCMOptionMenu *option_menu)
          children = children->next;
          index++;
        }
+
+       g_list_free (children);
     }
 }
 
@@ -730,7 +758,7 @@ gtk_cmoption_menu_item_state_changed_cb (GtkWidget      *widget,
                                       GtkStateType    previous_state,
                                       GtkCMOptionMenu  *option_menu)
 {
-  GtkWidget *child = GTK_BIN (option_menu)->child;
+  GtkWidget *child = gtk_bin_get_child (GTK_BIN (option_menu));
 
   if (child && gtkut_widget_get_sensitive (child) != gtkut_widget_is_sensitive (widget))
     gtk_widget_set_sensitive (child, gtkut_widget_is_sensitive (widget));
@@ -740,7 +768,7 @@ static void
 gtk_cmoption_menu_item_destroy_cb (GtkWidget     *widget,
                                 GtkCMOptionMenu *option_menu)
 {
-  GtkWidget *child = GTK_BIN (option_menu)->child;
+  GtkWidget *child = gtk_bin_get_child (GTK_BIN (option_menu));
 
   if (child)
     {
@@ -758,6 +786,7 @@ gtk_cmoption_menu_update_contents (GtkCMOptionMenu *option_menu)
 {
   GtkWidget *child;
   GtkRequisition child_requisition;
+  GtkAllocation allocation;
 
   cm_return_if_fail (GTK_IS_CMOPTION_MENU (option_menu));
 
@@ -771,7 +800,7 @@ gtk_cmoption_menu_update_contents (GtkCMOptionMenu *option_menu)
       if (option_menu->menu_item)
        {
          g_object_ref (option_menu->menu_item);
-         child = GTK_BIN (option_menu->menu_item)->child;
+         child = gtk_bin_get_child (GTK_BIN (option_menu->menu_item));
          if (child)
            {
              if (!gtkut_widget_is_sensitive (option_menu->menu_item))
@@ -785,8 +814,9 @@ gtk_cmoption_menu_update_contents (GtkCMOptionMenu *option_menu)
                            G_CALLBACK (gtk_cmoption_menu_item_destroy_cb), option_menu);
 
          gtk_widget_size_request (child, &child_requisition);
+         gtk_widget_get_allocation (GTK_WIDGET (option_menu), &allocation);
          gtk_widget_size_allocate (GTK_WIDGET (option_menu),
-                                   &(GTK_WIDGET (option_menu)->allocation));
+                                   &allocation);
 
          if (gtkut_widget_is_drawable (GTK_WIDGET(option_menu)))
            gtk_widget_queue_draw (GTK_WIDGET (option_menu));
@@ -806,7 +836,7 @@ gtk_cmoption_menu_remove_contents (GtkCMOptionMenu *option_menu)
 
   if (option_menu->menu_item)
     {
-      child = GTK_BIN (option_menu)->child;
+      child = gtk_bin_get_child (GTK_BIN (option_menu));
   
       if (child)
        {
@@ -843,7 +873,7 @@ gtk_cmoption_menu_calc_size (GtkCMOptionMenu *option_menu)
 
   if (option_menu->menu)
     {
-      children = GTK_MENU_SHELL (option_menu->menu)->children;
+      children = gtk_container_get_children (GTK_CONTAINER (GTK_MENU_SHELL (option_menu->menu)));
       while (children)
        {
          child = children->data;
@@ -851,7 +881,7 @@ gtk_cmoption_menu_calc_size (GtkCMOptionMenu *option_menu)
 
          if (gtkut_widget_get_visible (child))
            {
-             GtkWidget *inner = GTK_BIN (child)->child;
+             GtkWidget *inner = gtk_bin_get_child (GTK_BIN (child));
 
              if (inner)
                {
@@ -862,6 +892,8 @@ gtk_cmoption_menu_calc_size (GtkCMOptionMenu *option_menu)
                }
            }
        }
+
+       g_list_free(children);
     }
 
   if (old_width != option_menu->width || old_height != option_menu->height)
@@ -880,7 +912,8 @@ gtk_cmoption_menu_position (GtkMenu  *menu,
   GtkWidget *child;
   GtkWidget *widget;
   GtkRequisition requisition;
-  GList *children;
+  GtkAllocation allocation;
+  GList *children, *cur;
   gint screen_width;
   gint menu_xpos;
   gint menu_ypos;
@@ -895,10 +928,11 @@ gtk_cmoption_menu_position (GtkMenu  *menu,
   menu_width = requisition.width;
 
   active = gtk_menu_get_active (GTK_MENU (option_menu->menu));
-  gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
+  gdk_window_get_origin (gtk_widget_get_window (widget), &menu_xpos, &menu_ypos);
 
-  menu_xpos += widget->allocation.x;
-  menu_ypos += widget->allocation.y + widget->allocation.height / 2 - 2;
+  gtk_widget_get_allocation (widget, &allocation);
+  menu_xpos += allocation.x;
+  menu_ypos += allocation.y + allocation.height / 2 - 2;
 
   if (active != NULL)
     {
@@ -906,10 +940,10 @@ gtk_cmoption_menu_position (GtkMenu  *menu,
       menu_ypos -= requisition.height / 2;
     }
 
-  children = GTK_MENU_SHELL (option_menu->menu)->children;
-  while (children)
+  children = gtk_container_get_children (GTK_CONTAINER (GTK_MENU_SHELL (option_menu->menu)));
+  for (cur = children; cur && cur->data; cur = cur->next)
     {
-      child = children->data;
+      child = cur->data;
 
       if (active == child)
        break;
@@ -919,12 +953,12 @@ gtk_cmoption_menu_position (GtkMenu  *menu,
          gtk_widget_get_child_requisition (child, &requisition);
          menu_ypos -= requisition.height;
        }
-
-      children = children->next;
     }
 
+  g_list_free (children);
+
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
-    menu_xpos = menu_xpos + widget->allocation.width - menu_width;
+       menu_xpos = menu_xpos + allocation.width - menu_width;
 
   /* Clamp the position on screen */
   screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
@@ -968,7 +1002,7 @@ gtk_cmoption_menu_hide_all (GtkWidget *widget)
   container = GTK_CONTAINER (widget);
 
   gtk_widget_hide (widget);
-  gtk_container_foreach (container, (GtkCallback) gtk_widget_hide_all, NULL);
+  gtk_container_foreach (container, (GtkCallback) gtk_widget_hide, NULL);
 }
 
 static gboolean
@@ -987,14 +1021,15 @@ gtk_cmoption_menu_scroll_event (GtkWidget          *widget,
   gint index;
   gint n_children;
   gint index_dir;
-  GList *l;
+  GList *l, *children;
   GtkMenuItem *item;
     
   index = gtk_cmoption_menu_get_history (option_menu);
 
   if (index != -1)
     {
-      n_children = g_list_length (GTK_MENU_SHELL (option_menu->menu)->children);
+      children = gtk_container_get_children (GTK_CONTAINER (GTK_MENU_SHELL (option_menu->menu)));
+      n_children = g_list_length (children);
       
       if (event->direction == GDK_SCROLL_UP)
        index_dir = -1;
@@ -1011,7 +1046,7 @@ gtk_cmoption_menu_scroll_event (GtkWidget          *widget,
          if (index >= n_children)
            break;
 
-         l = g_list_nth (GTK_MENU_SHELL (option_menu->menu)->children, index);
+         l = g_list_nth (children, index);
          item = GTK_MENU_ITEM (l->data);
          if (gtkut_widget_get_visible (GTK_WIDGET(item)) && 
              gtkut_widget_is_sensitive (GTK_WIDGET(item)))
@@ -1022,6 +1057,8 @@ gtk_cmoption_menu_scroll_event (GtkWidget          *widget,
            }
              
        }
+      
+       g_list_free (children);
     }
 
   return TRUE;
index 1e7d166..7fa8c14 100644 (file)
 
 #include <stdlib.h>
 
-/* We know this file uses some deprecated stuff. */
-#undef G_DISABLE_DEPRECATED
-#undef GTK_DISABLE_DEPRECATED
-#undef GDK_DISABLE_DEPRECATED
-
 #include "gtksctree.h"
 #include "claws-marshal.h"
 #include "prefs_common.h"
@@ -207,10 +202,11 @@ gtk_sctree_get_cell_style (GtkCMCList     *clist,
                GdkGC       **fg_gc,
                GdkGC       **bg_gc)
 {
+  GtkStyle *gtkstyle;
   gint fg_state;
 
   if ((state == GTK_STATE_NORMAL) &&
-      (GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE))
+      (gtk_widget_get_state (GTK_WIDGET (clist)) == GTK_STATE_INSENSITIVE))
     fg_state = GTK_STATE_INSENSITIVE;
   else
     fg_state = state;
@@ -242,15 +238,16 @@ gtk_sctree_get_cell_style (GtkCMCList     *clist,
     }
   else
     {
+      gtkstyle = gtk_widget_get_style (GTK_WIDGET (clist));
       if (style)
-       *style = GTK_WIDGET (clist)->style;
+       *style = gtkstyle;
       if (fg_gc)
-       *fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state];
+       *fg_gc = gtkstyle->fg_gc[fg_state];
       if (bg_gc) {
        if (state == GTK_STATE_SELECTED)
-         *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state];
+         *bg_gc = gtkstyle->bg_gc[state];
        else
-         *bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
+         *bg_gc = gtkstyle->base_gc[state];
       }
 
       if (state != GTK_STATE_SELECTED)
@@ -574,7 +571,7 @@ gtk_sctree_draw_lines (GtkCMCTree     *ctree,
                      else if (state == GTK_STATE_SELECTED)
                        bg_gc = style->base_gc[state];
                      else
-                       bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
+                       bg_gc = gtk_widget_get_style (GTK_WIDGET (clist))->base_gc[state];
 
                      if (!area)
                        gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
@@ -638,8 +635,8 @@ gtk_sctree_draw_lines (GtkCMCTree     *ctree,
 
          if (!area)
            gdk_draw_rectangle (clist->clist_window,
-                               GTK_WIDGET
-                               (ctree)->style->base_gc[GTK_STATE_NORMAL],
+                               gtk_widget_get_style (GTK_WIDGET
+                               (ctree))->base_gc[GTK_STATE_NORMAL],
                                TRUE,
                                tree_rectangle.x,
                                tree_rectangle.y,
@@ -648,8 +645,8 @@ gtk_sctree_draw_lines (GtkCMCTree     *ctree,
          else if (gdk_rectangle_intersect (area, &tree_rectangle,
                                            &tc_rectangle))
            gdk_draw_rectangle (clist->clist_window,
-                               GTK_WIDGET
-                               (ctree)->style->base_gc[GTK_STATE_NORMAL],
+                               gtk_widget_get_style (GTK_WIDGET
+                               (ctree))->base_gc[GTK_STATE_NORMAL],
                                TRUE,
                                tc_rectangle.x,
                                tc_rectangle.y,
@@ -845,6 +842,7 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
          GtkCMCListRow  *clist_row)
 {
   GtkWidget *widget;
+  GtkStyle *style;
   GtkCMCTree  *ctree;
   GdkRectangle *rect;
   GdkRectangle *crect;
@@ -861,13 +859,17 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
   static GdkColor greybg={0, 0, 0, 0};
   static gboolean color_change = TRUE;
 
+  cm_return_if_fail (clist != NULL);
+  widget = GTK_WIDGET (clist);
+  style = gtk_widget_get_style (widget);
+
   if (greybg.pixel == 0 &&
       greybg.red == 0 &&
       greybg.green == 0 &&
       greybg.blue == 0) {
        GdkColor normalbg = {0, 0xffff, 0xffff, 0xffff};
-       if (GTK_WIDGET (clist)->style) {
-               normalbg = GTK_WIDGET (clist)->style->base[GTK_STATE_NORMAL];
+       if (style) {
+               normalbg = style->base[GTK_STATE_NORMAL];
        }
        if (normalbg.red > 0x8888 && normalbg.green > 0x8888 && normalbg.blue > 0x8888) {
                greybg.pixel = normalbg.pixel;
@@ -884,13 +886,10 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
        }
   }
 
-  cm_return_if_fail (clist != NULL);
-
   /* bail now if we arn't drawable yet */
   if (!gtkut_widget_is_drawable (GTK_WIDGET(clist)) || row < 0 || row >= clist->rows)
     return;
 
-  widget = GTK_WIDGET (clist);
   ctree  = GTK_CMCTREE  (clist);
 
   /* if the function is passed the pointer to the row instead of null,
@@ -935,7 +934,7 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
   state = clist_row->state;
 
   gdk_gc_set_foreground (ctree->lines_gc,
-                        &widget->style->fg[clist_row->state]);
+                        &style->fg[clist_row->state]);
 
   /* draw the cell borders */
   if (area)
@@ -945,7 +944,7 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
 
       if (gdk_rectangle_intersect (area, &cell_rectangle, crect))
        gdk_draw_rectangle (clist->clist_window,
-                           widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+                           style->base_gc[GTK_STATE_NORMAL], TRUE,
                            crect->x, crect->y, crect->width, crect->height);
     }
   else
@@ -954,7 +953,7 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
       crect = &cell_rectangle;
 
       gdk_draw_rectangle (clist->clist_window,
-                         widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+                         style->base_gc[GTK_STATE_NORMAL], TRUE,
                          crect->x, crect->y, crect->width, crect->height);
     }
 
@@ -1001,7 +1000,7 @@ gtk_sctree_draw_row (GtkCMCList     *clist,
       if (!area || gdk_rectangle_intersect (area, &cell_rectangle, crect))
        {
          gdk_draw_rectangle (clist->clist_window,
-                             widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+                             style->base_gc[GTK_STATE_NORMAL], TRUE,
                              crect->x, crect->y, crect->width, crect->height);
 
          /* horizontal black lines */
@@ -1953,13 +1952,17 @@ gtk_sctree_column_auto_resize (GtkCMCList    *clist,
           old_width == clist->column[column].width)
     {
       GList *list;
+      GtkRequisition button_req;
       gint new_width;
 
       /* run a "gtk_cmclist_optimal_column_width" but break, if
        * the column doesn't shrink */
       if (GTK_CMCLIST_SHOW_TITLES (clist) && clist->column[column].button)
-       new_width = (clist->column[column].button->requisition.width -
+        {
+       gtk_widget_get_requisition (clist->column[column].button, &button_req);
+       new_width = (button_req.width -
                     (CELL_SPACING + (2 * COLUMN_INSET)));
+        }
       else
        new_width = 0;
 
index 85de4be..ff5c62d 100644 (file)
@@ -84,7 +84,7 @@ void gtkut_widget_set_small_font_size(GtkWidget *widget)
        gint size;
 
        cm_return_if_fail(widget != NULL);
-       cm_return_if_fail(widget->style != NULL);
+       cm_return_if_fail(gtk_widget_get_style(widget) != NULL);
 
        if (prefs_common.derive_from_normal_font || !SMALL_FONT) {
                font_desc = pango_font_description_from_string(NORMAL_FONT);
@@ -605,19 +605,22 @@ gboolean gtkut_text_view_search_string_backward(GtkTextView *text, const gchar *
 
 void gtkut_window_popup(GtkWidget *window)
 {
+       GdkWindow *gdkwin;
        gint x, y, sx, sy, new_x, new_y;
 
+       gdkwin = gtk_widget_get_window(window);
+
        cm_return_if_fail(window != NULL);
-       cm_return_if_fail(window->window != NULL);
+       cm_return_if_fail(gdkwin != NULL);
 
        sx = gdk_screen_width();
        sy = gdk_screen_height();
 
-       gdk_window_get_origin(window->window, &x, &y);
+       gdk_window_get_origin(gdkwin, &x, &y);
        new_x = x % sx; if (new_x < 0) new_x = 0;
        new_y = y % sy; if (new_y < 0) new_y = 0;
        if (new_x != x || new_y != y)
-               gdk_window_move(window->window, new_x, new_y);
+               gdk_window_move(gdkwin, new_x, new_y);
 
        gtk_window_set_skip_taskbar_hint(GTK_WINDOW(window), FALSE);
        gtk_window_present_with_time(GTK_WINDOW(window), time(NULL));
@@ -625,17 +628,20 @@ void gtkut_window_popup(GtkWidget *window)
 
 void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py)
 {
+       GdkWindow *gdkwin;
        gint x, y;
        gint sx, sy;
 
+       gdkwin = gtk_widget_get_window(widget);
+
        cm_return_if_fail(widget != NULL);
-       cm_return_if_fail(widget->window != NULL);
+       cm_return_if_fail(gdkwin != NULL);
 
        sx = gdk_screen_width();
        sy = gdk_screen_height();
 
        /* gdk_window_get_root_origin ever return *rootwindow*'s position */
-       gdk_window_get_root_origin(widget->window, &x, &y);
+       gdk_window_get_root_origin(gdkwin, &x, &y);
 
        x %= sx; if (x < 0) x = 0;
        y %= sy; if (y < 0) y = 0;
@@ -646,7 +652,7 @@ void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py)
 void gtkut_widget_draw_now(GtkWidget *widget)
 {
        if (widget && gtkut_widget_get_visible(widget) && gtkut_widget_is_drawable(widget))
-               gdk_window_process_updates(widget->window, FALSE);
+               gdk_window_process_updates(gtk_widget_get_window(widget), FALSE);
 }
 
 static void gtkut_clist_bindings_add(GtkWidget *clist)
@@ -709,7 +715,7 @@ void gtkut_widget_set_app_icon(GtkWidget *widget)
        static GdkPixbuf *icon = NULL;
        
        cm_return_if_fail(widget != NULL);
-       cm_return_if_fail(widget->window != NULL);
+       cm_return_if_fail(gtk_widget_get_window(widget) != NULL);
        if (!icon) {
                stock_pixbuf_gdk(widget, STOCK_PIXMAP_CLAWS_MAIL_ICON, &icon);
        }               
@@ -722,7 +728,7 @@ void gtkut_widget_set_composer_icon(GtkWidget *widget)
        static GdkPixbuf *icon = NULL;
        
        cm_return_if_fail(widget != NULL);
-       cm_return_if_fail(widget->window != NULL);
+       cm_return_if_fail(gtk_widget_get_window(widget) != NULL);
        if (!icon) {
                stock_pixbuf_gdk(widget, STOCK_PIXMAP_MAIL_COMPOSE, &icon);
        }               
@@ -1148,12 +1154,15 @@ static GdkCursor *hand_cursor = NULL;
 
 static void link_btn_enter(GtkButton *button, gpointer data)
 {
+       GdkWindow *gdkwin;
        GtkWidget *window = (GtkWidget *)data;
 
+       gdkwin = gtk_widget_get_window(window);
+
        if (!hand_cursor)
                hand_cursor = gdk_cursor_new(GDK_HAND2);
-       if (window && window->window)
-               gdk_window_set_cursor(window->window, hand_cursor);
+       if (window && gdkwin)
+               gdk_window_set_cursor(gdkwin, hand_cursor);
 
        gtk_button_set_relief(button, GTK_RELIEF_NONE);
        gtk_widget_set_state(GTK_WIDGET(button), GTK_STATE_NORMAL);
@@ -1162,10 +1171,13 @@ static void link_btn_enter(GtkButton *button, gpointer data)
 
 static void link_btn_leave(GtkButton *button, gpointer data)
 {
+       GdkWindow *gdkwin;
        GtkWidget *window = (GtkWidget *)data;
 
-       if (window && window->window)
-               gdk_window_set_cursor(window->window, NULL);
+       gdkwin = gtk_widget_get_window(window);
+
+       if (window && gdkwin)
+               gdk_window_set_cursor(gdkwin, NULL);
 
        gtk_button_set_relief(button, GTK_RELIEF_NONE);
        gtk_widget_set_state(GTK_WIDGET(button), GTK_STATE_NORMAL);
@@ -1218,7 +1230,7 @@ GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar *
        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)));
-       cmap = gdk_drawable_get_colormap(window->window);
+       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) {
                GtkStyle *style;
@@ -1307,12 +1319,12 @@ static void gtkutils_smooth_scroll_do(GtkWidget *widget, GtkAdjustment *vadj,
        }
 
        for (i = step; i <= change_value; i += step) {
-               vadj->value = old_value + (up ? -i : i);
+               gtk_adjustment_set_value(vadj, old_value + (up ? -i : i));
                g_signal_emit_by_name(G_OBJECT(vadj),
                                      "value_changed", 0);
        }
 
-       vadj->value = last_value;
+       gtk_adjustment_set_value(vadj, last_value);
        g_signal_emit_by_name(G_OBJECT(vadj), "value_changed", 0);
 
        gtk_widget_queue_draw(widget);
@@ -1325,16 +1337,15 @@ static gboolean gtkutils_smooth_scroll_page(GtkWidget *widget, GtkAdjustment *va
        gfloat old_value;
        gfloat last_value;
 
+       page_incr = gtk_adjustment_get_page_increment(vadj);
        if (prefs_common.scroll_halfpage)
-               page_incr = vadj->page_increment / 2;
-       else
-               page_incr = vadj->page_increment;
+               page_incr /= 2;
 
+       old_value = gtk_adjustment_get_value(vadj);
        if (!up) {
-               upper = vadj->upper - vadj->page_size;
-               if (vadj->value < upper) {
-                       old_value = vadj->value;
-                       last_value = vadj->value + page_incr;
+               upper = gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj);
+               if (old_value < upper) {
+                       last_value = old_value + page_incr;
                        last_value = MIN(last_value, upper);
 
                        gtkutils_smooth_scroll_do(widget, vadj, old_value,
@@ -1343,9 +1354,8 @@ static gboolean gtkutils_smooth_scroll_page(GtkWidget *widget, GtkAdjustment *va
                } else
                        return FALSE;
        } else {
-               if (vadj->value > 0.0) {
-                       old_value = vadj->value;
-                       last_value = vadj->value - page_incr;
+               if (old_value > 0.0) {
+                       last_value = old_value - page_incr;
                        last_value = MAX(last_value, 0.0);
 
                        gtkutils_smooth_scroll_do(widget, vadj, old_value,
@@ -1362,28 +1372,31 @@ gboolean gtkutils_scroll_page(GtkWidget *widget, GtkAdjustment *vadj, gboolean u
 {
        gfloat upper;
        gfloat page_incr;
+       gfloat old_value;
 
        if (prefs_common.enable_smooth_scroll)
                return gtkutils_smooth_scroll_page(widget, vadj, up);
 
+       page_incr = gtk_adjustment_get_page_increment(vadj);
        if (prefs_common.scroll_halfpage)
-               page_incr = vadj->page_increment / 2;
-       else
-               page_incr = vadj->page_increment;
+               page_incr /= 2;
 
+       old_value = gtk_adjustment_get_value(vadj);
        if (!up) {
-               upper = vadj->upper - vadj->page_size;
-               if (vadj->value < upper) {
-                       vadj->value += page_incr;
-                       vadj->value = MIN(vadj->value, upper);
+               upper = gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj);
+               if (old_value < upper) {
+                       old_value += page_incr;
+                       old_value = MIN(old_value, upper);
+                       gtk_adjustment_set_value(vadj, old_value);
                        g_signal_emit_by_name(G_OBJECT(vadj),
                                              "value_changed", 0);
                } else
                        return FALSE;
        } else {
-               if (vadj->value > 0.0) {
-                       vadj->value -= page_incr;
-                       vadj->value = MAX(vadj->value, 0.0);
+               if (old_value > 0.0) {
+                       old_value -= page_incr;
+                       old_value = MAX(old_value, 0.0);
+                       gtk_adjustment_set_value(vadj, old_value);
                        g_signal_emit_by_name(G_OBJECT(vadj),
                                              "value_changed", 0);
                } else
@@ -1398,11 +1411,11 @@ static void gtkutils_smooth_scroll_one_line(GtkWidget *widget, GtkAdjustment *va
        gfloat old_value;
        gfloat last_value;
 
+       old_value = gtk_adjustment_get_value(vadj);
        if (!up) {
-               upper = vadj->upper - vadj->page_size;
-               if (vadj->value < upper) {
-                       old_value = vadj->value;
-                       last_value = vadj->value + vadj->step_increment;
+               upper = gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj);
+               if (old_value < upper) {
+                       last_value = old_value + gtk_adjustment_get_step_increment(vadj);
                        last_value = MIN(last_value, upper);
 
                        gtkutils_smooth_scroll_do(widget, vadj, old_value,
@@ -1410,9 +1423,8 @@ static void gtkutils_smooth_scroll_one_line(GtkWidget *widget, GtkAdjustment *va
                                                  prefs_common.scroll_step);
                }
        } else {
-               if (vadj->value > 0.0) {
-                       old_value = vadj->value;
-                       last_value = vadj->value - vadj->step_increment;
+               if (old_value > 0.0) {
+                       last_value = old_value - gtk_adjustment_get_step_increment(vadj);
                        last_value = MAX(last_value, 0.0);
 
                        gtkutils_smooth_scroll_do(widget, vadj, old_value,
@@ -1425,24 +1437,28 @@ static void gtkutils_smooth_scroll_one_line(GtkWidget *widget, GtkAdjustment *va
 void gtkutils_scroll_one_line(GtkWidget *widget, GtkAdjustment *vadj, gboolean up)
 {
        gfloat upper;
+       gfloat old_value;
 
        if (prefs_common.enable_smooth_scroll) {
                gtkutils_smooth_scroll_one_line(widget, vadj, up);
                return;
        }
 
+       old_value = gtk_adjustment_get_value(vadj);
        if (!up) {
-               upper = vadj->upper - vadj->page_size;
-               if (vadj->value < upper) {
-                       vadj->value += vadj->step_increment;
-                       vadj->value = MIN(vadj->value, upper);
+               upper = gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj);
+               if (old_value < upper) {
+                       old_value += gtk_adjustment_get_step_increment(vadj);
+                       old_value = MIN(old_value, upper);
+                       gtk_adjustment_set_value(vadj, old_value);
                        g_signal_emit_by_name(G_OBJECT(vadj),
                                              "value_changed", 0);
                }
        } else {
-               if (vadj->value > 0.0) {
-                       vadj->value -= vadj->step_increment;
-                       vadj->value = MAX(vadj->value, 0.0);
+               if (old_value > 0.0) {
+                       old_value -= gtk_adjustment_get_step_increment(vadj);
+                       old_value = MAX(old_value, 0.0);
+                       gtk_adjustment_set_value(vadj, old_value);
                        g_signal_emit_by_name(G_OBJECT(vadj),
                                              "value_changed", 0);
                }
index d810708..13c52ed 100644 (file)
@@ -119,7 +119,7 @@ static gboolean vscroll_visi_notify(GtkWidget *widget,
                                       GdkEventVisibility *event,
                                       gpointer data)
 {
-       gdk_window_set_cursor(widget->window, hand_cursor);
+       gdk_window_set_cursor(gtk_widget_get_window(widget), hand_cursor);
        return FALSE;
 }
 
@@ -127,7 +127,7 @@ static gboolean vscroll_leave_notify(GtkWidget *widget,
                                      GdkEventCrossing *event,
                                       gpointer data)
 {
-       gdk_window_set_cursor(widget->window, NULL);
+       gdk_window_set_cursor(gtk_widget_get_window(widget), NULL);
        return FALSE;
 }
 
@@ -135,7 +135,7 @@ static gboolean vscroll_enter_notify(GtkWidget *widget,
                                      GdkEventCrossing *event,
                                       gpointer data)
 {
-       gdk_window_set_cursor(widget->window, hand_cursor);
+       gdk_window_set_cursor(gtk_widget_get_window(widget), hand_cursor);
        return FALSE;
 }
 
@@ -290,34 +290,36 @@ static gint gtk_vscrollbutton_button_release(GtkWidget *widget,
 
 gboolean gtk_vscrollbutton_scroll(GtkVScrollbutton *scrollbutton)
 {
+    gfloat bound;
     gfloat new_value;
+    gfloat page_size;
+    gfloat value;
     gboolean return_val;
 
     cm_return_val_if_fail(scrollbutton != NULL, FALSE);
     cm_return_val_if_fail(GTK_IS_VSCROLLBUTTON(scrollbutton), FALSE);
 
-    new_value = scrollbutton->adjustment->value;
+    new_value = value = gtk_adjustment_get_value(scrollbutton->adjustment);
     return_val = TRUE;
 
     switch (scrollbutton->scroll_type) {
 
     case GTK_SCROLL_STEP_BACKWARD:
-       new_value -= scrollbutton->adjustment->step_increment;
-       if (new_value <= scrollbutton->adjustment->lower) {
-           new_value = scrollbutton->adjustment->lower;
+       new_value = value - gtk_adjustment_get_step_increment(scrollbutton->adjustment);
+       bound = gtk_adjustment_get_lower(scrollbutton->adjustment);
+       if (new_value <= bound) {
+           new_value = bound;
            return_val = FALSE;
            scrollbutton->timer = 0;
        }
        break;
 
     case GTK_SCROLL_STEP_FORWARD:
-       new_value += scrollbutton->adjustment->step_increment;
-       if (new_value >=
-           (scrollbutton->adjustment->upper -
-            scrollbutton->adjustment->page_size)) {
-           new_value =
-               scrollbutton->adjustment->upper -
-               scrollbutton->adjustment->page_size;
+       new_value = value + gtk_adjustment_get_step_increment(scrollbutton->adjustment);
+       bound = gtk_adjustment_get_upper(scrollbutton->adjustment);
+       page_size = gtk_adjustment_get_page_size(scrollbutton->adjustment);
+       if (new_value >= (bound - page_size)) {
+           new_value = bound - page_size;
            return_val = FALSE;
            scrollbutton->timer = 0;
        }
@@ -328,8 +330,8 @@ gboolean gtk_vscrollbutton_scroll(GtkVScrollbutton *scrollbutton)
     
     }
 
-    if (new_value != scrollbutton->adjustment->value) {
-       scrollbutton->adjustment->value = new_value;
+       if (new_value != value) {
+       gtk_adjustment_set_value(scrollbutton->adjustment, new_value);
        g_signal_emit_by_name(G_OBJECT
                                (scrollbutton->adjustment),
                                "value_changed");
@@ -417,11 +419,14 @@ static gboolean gtk_real_vscrollbutton_timer(GtkVScrollbutton *scrollbutton)
 static void gtk_vscrollbutton_set_sensitivity   (GtkAdjustment    *adjustment,
                                                 GtkVScrollbutton *scrollbutton)
 {
+       gfloat value;
        if (!gtkut_widget_get_realized(GTK_WIDGET(scrollbutton))) return;
        if (scrollbutton->button != 0) return; /* not while something is pressed */
        
+       value = gtk_adjustment_get_value(adjustment);
        gtk_widget_set_sensitive(scrollbutton->upbutton, 
-                                (adjustment->value > adjustment->lower));
+                                (value > gtk_adjustment_get_lower(adjustment)));
        gtk_widget_set_sensitive(scrollbutton->downbutton, 
-                                (adjustment->value <  (adjustment->upper - adjustment->page_size)));
+                                (value < (gtk_adjustment_get_upper(adjustment) -
+                           gtk_adjustment_get_page_size(adjustment))));
 }
index 4b0c463..344d9db 100644 (file)
@@ -320,11 +320,12 @@ static void input_dialog_create(gboolean is_password)
                         G_CALLBACK(key_pressed), NULL);
        MANAGE_WINDOW_SIGNALS_CONNECT(dialog);
 
-       gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
+       vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+       gtk_box_set_spacing (GTK_BOX (vbox), 14);
        hbox = gtk_hbox_new (FALSE, 12);
        gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
        gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+       gtk_box_pack_start (GTK_BOX (vbox), hbox,
                            FALSE, FALSE, 0);
 
        /* for title label */
@@ -353,7 +354,7 @@ static void input_dialog_create(gboolean is_password)
                gint size;
 
                size = pango_font_description_get_size
-                       (msg_title->style->font_desc);
+                       (gtk_widget_get_style(msg_title)->font_desc);
                font_desc = pango_font_description_new();
                pango_font_description_set_weight
                        (font_desc, PANGO_WEIGHT_BOLD);
@@ -389,11 +390,11 @@ static void input_dialog_create(gboolean is_password)
                                      &ok_button, GTK_STOCK_OK,
                                      NULL, NULL);
 
-       gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area),
+       gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(dialog))),
                         confirm_area, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(confirm_area), 5);
 
-       gtk_widget_show_all(GTK_DIALOG(dialog)->vbox);
+       gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
        
        gtk_widget_hide(remember_checkbtn);
 
index e3810fe..adb0b9f 100644 (file)
@@ -178,7 +178,7 @@ void log_window_init(LogWindow *logwin)
        logwin->status_nok_color = color[6];
        logwin->status_skip_color = color[7];
 
-       colormap = gdk_drawable_get_colormap(logwin->window->window);
+       colormap = gdk_drawable_get_colormap(gtk_widget_get_window(logwin->window));
        gdk_colormap_alloc_colors(colormap, color, LOG_COLORS, FALSE, TRUE, success);
 
        for (i = 0; i < LOG_COLORS; i++) {
@@ -364,10 +364,12 @@ static gboolean log_window_append(gpointer source, gpointer data)
               log_window_clip (logwindow, logwindow->clip_length);
 
        if (!logwindow->hidden) {
-               GtkAdjustment *vadj = text->vadjustment;
-               gfloat upper = vadj->upper - vadj->page_size;
-               if (vadj->value == upper || 
-                   (upper - vadj->value < 16 && vadj->value < 8))
+               GtkAdjustment *vadj = gtk_text_view_get_vadjustment(text);
+               gfloat upper = gtk_adjustment_get_upper(vadj) -
+                   gtk_adjustment_get_page_size(vadj);
+               gfloat value = gtk_adjustment_get_value(vadj);
+               if (value == upper || 
+                   (upper - value < 16 && value < 8))
                        gtk_text_view_scroll_mark_onscreen(text, logwindow->end_mark);
        }
 
index 29a9766..c38ee92 100644 (file)
@@ -123,10 +123,13 @@ void cm_toggle_menu_set_active_full(GtkUIManager *gui_manager, gchar *menu, gboo
 
 void menu_set_sensitive_all(GtkMenuShell *menu_shell, gboolean sensitive)
 {
+       GList *children = gtk_container_get_children(GTK_CONTAINER(menu_shell));
        GList *cur;
 
-       for (cur = menu_shell->children; cur != NULL; cur = cur->next)
+       for (cur = children; cur != NULL; cur = cur->next)
                gtk_widget_set_sensitive(GTK_WIDGET(cur->data), sensitive);
+
+       g_list_free(children);
 }
 
 void menu_button_position(GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
@@ -135,7 +138,8 @@ void menu_button_position(GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
         GtkWidget *widget;
         gint wheight;
         gint wx, wy;
-       GtkRequisition mreq;
+       GtkAllocation allocation;
+       GtkRequisition mreq, wreq;
        GdkScreen *screen;
        GdkRectangle monitor;
        gint monitor_num;
@@ -145,10 +149,12 @@ void menu_button_position(GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
 
        widget = GTK_WIDGET(user_data);
 
-        gdk_window_get_origin(widget->window, x, y);
-        wheight = widget->requisition.height;
-        wx = widget->allocation.x;
-        wy = widget->allocation.y;
+        gdk_window_get_origin(gtk_widget_get_window(widget), x, y);
+        gtk_widget_get_requisition(widget, &wreq);
+        wheight = wreq.height;
+        gtk_widget_get_allocation(widget, &allocation);
+        wx = allocation.x;
+        wy = allocation.y;
         
        gtk_widget_size_request(GTK_WIDGET(menu), &mreq);
        screen = gtk_widget_get_screen (widget);
@@ -169,12 +175,14 @@ gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
        GtkWidget *menu;
        GtkWidget *menuitem;
        gpointer menu_data;
+       GList *children;
        GList *cur;
        gint n;
 
        menu = gtk_cmoption_menu_get_menu(optmenu);
+       children = gtk_container_get_children(GTK_CONTAINER(GTK_MENU_SHELL(menu)));
 
-       for (cur = GTK_MENU_SHELL(menu)->children, n = 0;
+       for (cur = children, n = 0;
             cur != NULL; cur = cur->next, n++) {
                menuitem = GTK_WIDGET(cur->data);
                menu_data = g_object_get_data(G_OBJECT(menuitem),
@@ -186,5 +194,7 @@ gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
                        return n;
        }
 
+       g_list_free(children);
+
        return -1;
 }
index e739695..034a3a6 100644 (file)
@@ -600,7 +600,7 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
 #endif
        adj = gtk_scrolled_window_get_vadjustment(
                        GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow1));
-       gtk_adjustment_set_value(adj, adj->lower);
+       gtk_adjustment_set_value(adj, gtk_adjustment_get_lower(adj));
        gtk_adjustment_changed(adj);
 }
 
@@ -686,6 +686,7 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
        PrefsTreeNode *prefsnode;
        PrefsPage *page;
        PrefsWindow *prefswindow = (PrefsWindow *) data;
+       gfloat lower;
        gchar *labeltext;
        gint pagenum, i;
        GtkTreeIter iter;
@@ -730,11 +731,12 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
 
        adj = gtk_scrolled_window_get_vadjustment(
                        GTK_SCROLLED_WINDOW(page->widget));
-       gtk_adjustment_set_value(adj, adj->lower);
+       lower = gtk_adjustment_get_lower(adj);
+       gtk_adjustment_set_value(adj, lower);
        gtk_adjustment_changed(adj);
        adj = gtk_scrolled_window_get_hadjustment(
                        GTK_SCROLLED_WINDOW(page->widget));
-       gtk_adjustment_set_value(adj, adj->lower);
+       gtk_adjustment_set_value(adj, lower);
        gtk_adjustment_changed(adj);
 
 #ifdef GENERIC_UMPC
index ccd279a..2d97dce 100644 (file)
@@ -48,6 +48,7 @@ ProgressDialog *progress_dialog_create(void)
        ProgressDialog *progress;
        GtkWidget *dialog;
        GtkWidget *hbox;
+       GtkWidget *vbox;
        GtkWidget *label;
        GtkWidget *cancel_btn;
        GtkWidget *progressbar;
@@ -67,11 +68,12 @@ ProgressDialog *progress_dialog_create(void)
        gtk_widget_realize(dialog);
 
        gtk_container_set_border_width
-               (GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 0);
-       gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), 8);
+               (GTK_CONTAINER(gtk_dialog_get_action_area(GTK_DIALOG(dialog))), 0);
+       vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+       gtk_box_set_spacing(GTK_BOX(vbox), 8);
 
        hbox = gtk_hbox_new(FALSE, 0);
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox,
+       gtk_box_pack_start(GTK_BOX(vbox), hbox,
                           FALSE, FALSE, 8);
        gtk_widget_show(hbox);
 
@@ -86,13 +88,13 @@ ProgressDialog *progress_dialog_create(void)
        gtk_widget_grab_focus(cancel_btn);
 
        progressbar = gtk_progress_bar_new();
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), progressbar,
+       gtk_box_pack_start(GTK_BOX(vbox), progressbar,
                           FALSE, FALSE, 0);
        gtk_widget_show(progressbar);
 
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
        gtk_widget_show(scrolledwin);
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), scrolledwin,
+       gtk_box_pack_start(GTK_BOX(vbox), scrolledwin,
                           TRUE, TRUE, 0);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
                                       GTK_POLICY_AUTOMATIC,
index 8c51e84..123a8fc 100644 (file)
@@ -69,6 +69,7 @@ static GtkWidget *image_viewer_get_widget(MimeViewer *_mimeviewer)
 
 static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfile)
 {
+       GtkAllocation allocation;
        GdkPixbufAnimation *animation = NULL;
        GdkPixbuf *pixbuf = NULL;
        GError *error = NULL;
@@ -83,10 +84,13 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
                g_object_unref(animation);
                animation = NULL;
 
-               if (imageviewer->resize_img)
+               if (imageviewer->resize_img) {
+                       gtk_widget_get_allocation(
+                               gtk_widget_get_parent(imageviewer->notebook), &allocation);
                        pixbuf = claws_load_pixbuf_fitting(pixbuf,
-                               imageviewer->notebook->parent->allocation.width,
-                               imageviewer->notebook->parent->allocation.height);
+                               allocation.width,
+                               allocation.height);
+               }
                else
                        pixbuf = claws_load_pixbuf_fitting(pixbuf, -1, -1);
        }
index 0511d23..1ee266b 100644 (file)
@@ -892,7 +892,7 @@ static void mainwindow_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_i
        GtkMenuShell *menu;
        GtkCheckMenuItem **items;
        gint n;
-       GList *cur;
+       GList *children, *cur;
        GSList *sel;
 
        mainwin = (MainWindow *)data;
@@ -912,7 +912,8 @@ static void mainwindow_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_i
                          GINT_TO_POINTER(1));
 
        /* clear items. get item pointers. */
-       for (n = 0, cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (n = 0, cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
                        gtk_check_menu_item_set_active
                                (GTK_CHECK_MENU_ITEM(cur->data), FALSE);
@@ -921,6 +922,8 @@ static void mainwindow_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_i
                }
        }
 
+       g_list_free(children);
+
        if (n == (N_COLOR_LABELS + 1)) {
                /* iterate all messages and set the state of the appropriate
                 * items */
@@ -931,7 +934,7 @@ static void mainwindow_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_i
                        msginfo = (MsgInfo *)sel->data;
                        if (msginfo) {
                                clabel = MSG_GET_COLORLABEL_VALUE(msginfo->flags);
-                               if (!items[clabel]->active)
+                               if (!gtk_check_menu_item_get_active(items[clabel]))
                                        gtk_check_menu_item_set_active
                                                (items[clabel], TRUE);
                        }
@@ -967,7 +970,7 @@ static void mainwindow_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
 {
        MainWindow *mainwin;
        GtkMenuShell *menu;
-       GList *cur;
+       GList *children, *cur;
        GSList *sel;
        GHashTable *menu_table = g_hash_table_new_full(
                                        g_direct_hash,
@@ -993,7 +996,8 @@ static void mainwindow_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                          GINT_TO_POINTER(1));
 
        /* clear items. get item pointers. */
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
                        gint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cur->data),
                                "tag_id"));
@@ -1005,6 +1009,8 @@ static void mainwindow_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                }
        }
 
+       g_list_free(children);
+
        /* iterate all messages and set the state of the appropriate
         * items */
        sel_len = 0;
@@ -1024,7 +1030,7 @@ static void mainwindow_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                                gint num_checked = GPOINTER_TO_INT(g_hash_table_lookup(menu_allsel_table, tags->data));
                                id = GPOINTER_TO_INT(tags->data);
                                item = g_hash_table_lookup(menu_table, GINT_TO_POINTER(tags->data));
-                               if (item && !item->active) {
+                               if (item && !gtk_check_menu_item_get_active(item)) {
                                        gtk_check_menu_item_set_active
                                                (item, TRUE);
                                }
@@ -1034,7 +1040,8 @@ static void mainwindow_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                }
        }
 
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
                        gint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cur->data),
                                "tag_id"));
@@ -1045,6 +1052,7 @@ static void mainwindow_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                                gtk_check_menu_item_set_inconsistent(GTK_CHECK_MENU_ITEM(cur->data), FALSE);
                }
        }
+       g_list_free(children);
        g_slist_free(sel);
        g_hash_table_destroy(menu_table);
        g_hash_table_destroy(menu_allsel_table);
@@ -1281,7 +1289,7 @@ static gboolean warning_visi_notify(GtkWidget *widget,
                                       GdkEventVisibility *event,
                                       MainWindow *mainwindow)
 {
-       gdk_window_set_cursor(mainwindow->warning_btn->window, hand_cursor);
+       gdk_window_set_cursor(gtk_widget_get_window(mainwindow->warning_btn), hand_cursor);
        return FALSE;
 }
 
@@ -1289,7 +1297,7 @@ static gboolean warning_leave_notify(GtkWidget *widget,
                                      GdkEventCrossing *event,
                                      MainWindow *mainwindow)
 {
-       gdk_window_set_cursor(mainwindow->warning_btn->window, NULL);
+       gdk_window_set_cursor(gtk_widget_get_window(mainwindow->warning_btn), NULL);
        return FALSE;
 }
 
@@ -1297,7 +1305,7 @@ static gboolean warning_enter_notify(GtkWidget *widget,
                                      GdkEventCrossing *event,
                                      MainWindow *mainwindow)
 {
-       gdk_window_set_cursor(mainwindow->warning_btn->window, hand_cursor);
+       gdk_window_set_cursor(gtk_widget_get_window(mainwindow->warning_btn), hand_cursor);
        return FALSE;
 }
 #endif
@@ -2198,7 +2206,7 @@ MainWindow *main_window_create()
        color[2] = folderview->color_new;
        color[3] = folderview->color_op;
 
-       colormap = gdk_drawable_get_colormap(window->window);
+       colormap = gdk_drawable_get_colormap(gtk_widget_get_window(window));
        gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success);
        for (i = 0; i < 4; i++) {
                if (success[i] == FALSE)
@@ -2339,7 +2347,7 @@ void main_window_cursor_wait(MainWindow *mainwin)
 {
 
        if (mainwin->cursor_count == 0) {
-               gdk_window_set_cursor(mainwin->window->window, watch_cursor);
+               gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), watch_cursor);
                textview_cursor_wait(mainwin->messageview->mimeview->textview);
        }
        
@@ -2354,7 +2362,7 @@ void main_window_cursor_normal(MainWindow *mainwin)
                mainwin->cursor_count--;
 
        if (mainwin->cursor_count == 0) {
-               gdk_window_set_cursor(mainwin->window->window, NULL);
+               gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), NULL);
                textview_cursor_normal(mainwin->messageview->mimeview->textview);
        }
        gdk_flush();
@@ -2472,20 +2480,22 @@ void main_window_reflect_prefs_all_now(void)
 void main_window_reflect_prefs_custom_colors(MainWindow *mainwin)
 {
        GtkMenuShell *menu;
-       GList *cur;
+       GList *children, *cur;
 
        /* re-create colorlabel submenu */
        menu = GTK_MENU_SHELL(mainwin->colorlabel_menu);
        cm_return_if_fail(menu != NULL);
 
        /* clear items. get item pointers. */
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                g_signal_handlers_disconnect_matched
                         (gtk_ui_manager_get_accel_group(mainwin->ui_manager), 
                         G_SIGNAL_MATCH_DATA|G_SIGNAL_MATCH_FUNC,
                         0, 0, NULL, mainwin_accel_changed_cb, cur->data);
                gtk_menu_item_set_submenu(GTK_MENU_ITEM(cur->data), NULL);
        }
+       g_list_free(children);
        mainwindow_colorlabel_menu_create(mainwin, TRUE);
        summary_reflect_prefs_custom_colors(mainwin->summaryview);
        folderview_reinit_fonts(mainwin->folderview);
@@ -2495,7 +2505,7 @@ static gint tags_tag = 0;
 static gboolean main_window_reflect_tags_changes_real(gpointer data)
 {
        GtkMenuShell *menu;
-       GList *cur;
+       GList *children, *cur;
        MainWindow *mainwin = (MainWindow *)data;
 
        if (summary_is_locked(mainwin->summaryview)) {
@@ -2507,9 +2517,11 @@ static gboolean main_window_reflect_tags_changes_real(gpointer data)
        cm_return_val_if_fail(menu != NULL, FALSE);
 
        /* clear items. get item pointers. */
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                gtk_menu_item_set_submenu(GTK_MENU_ITEM(cur->data), NULL);
        }
+       g_list_free(children);
        mainwindow_tags_menu_create(mainwin, TRUE);
        summary_reflect_tags_changes(mainwin->summaryview);
        
@@ -2590,7 +2602,7 @@ static void main_window_set_account_selector_menu(MainWindow *mainwin,
 static void main_window_set_account_receive_menu(MainWindow *mainwin,
                                                 GList *account_list)
 {
-       GList *cur_ac, *cur_item;
+       GList *children, *child;
        GtkWidget *menu;
        GtkWidget *menuitem;
        PrefsAccount *ac_prefs;
@@ -2599,23 +2611,24 @@ static void main_window_set_account_receive_menu(MainWindow *mainwin,
                gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive")));
 
        /* search for separator */
-       for (cur_item = GTK_MENU_SHELL(menu)->children; cur_item != NULL;
-            cur_item = cur_item->next) {
-               if (cur_item->data == gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive/Separator1")) {
-                       cur_item = cur_item->next;
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (child = children; child != NULL; child = child->next) {
+               if (child->data == gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive/Separator1")) {
+                       child = child->next;
                        break;
                }
        }
 
        /* destroy all previous menu item */
-       while (cur_item != NULL) {
-               GList *next = cur_item->next;
-               gtk_widget_destroy(GTK_WIDGET(cur_item->data));
-               cur_item = next;
+       while (child != NULL) {
+               gtk_widget_destroy(GTK_WIDGET(child->data));
+               child = child->next;
        }
 
-       for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
-               ac_prefs = (PrefsAccount *)cur_ac->data;
+       g_list_free(children);
+
+       for (child = account_list; child != NULL; child = child->next) {
+               ac_prefs = (PrefsAccount *)child->data;
 
                if (ac_prefs->protocol == A_NONE)
                        continue;
@@ -2767,11 +2780,11 @@ static void main_window_separation_change(MainWindow *mainwin, LayoutType layout
        g_object_ref(summary_wid);
        g_object_ref(message_wid);
        gtkut_container_remove
-               (GTK_CONTAINER(folder_wid->parent), folder_wid);
+               (GTK_CONTAINER(gtk_widget_get_parent(folder_wid)), folder_wid);
        gtkut_container_remove
-               (GTK_CONTAINER(summary_wid->parent), summary_wid);
+               (GTK_CONTAINER(gtk_widget_get_parent(summary_wid)), summary_wid);
        gtkut_container_remove
-               (GTK_CONTAINER(message_wid->parent), message_wid);
+               (GTK_CONTAINER(gtk_widget_get_parent(message_wid)), message_wid);
 
        gtk_widget_hide(mainwin->window);
        main_window_set_widgets(mainwin, layout_mode);
@@ -2842,7 +2855,7 @@ void main_window_toggle_message_view(MainWindow *mainwin)
        case SMALL_LAYOUT:
                ppaned = mainwin->vpaned;
                container = mainwin->hpaned;
-               if (ppaned->parent != NULL) {
+               if (gtk_widget_get_parent(ppaned) != NULL) {
                        mainwin->messageview->visible = FALSE;
                        summaryview->displayed = NULL;
                        g_object_ref(ppaned);
@@ -2858,7 +2871,7 @@ void main_window_toggle_message_view(MainWindow *mainwin)
        case WIDE_LAYOUT:
                ppaned = mainwin->hpaned;
                container = mainwin->vpaned;
-               if (mainwin->messageview->vbox->parent != NULL) {
+               if (gtk_widget_get_parent(mainwin->messageview->vbox) != NULL) {
                        mainwin->messageview->visible = FALSE;
                        summaryview->displayed = NULL;
                        g_object_ref(mainwin->messageview->vbox);
@@ -2900,7 +2913,7 @@ void main_window_toggle_message_view(MainWindow *mainwin)
 
 void main_window_get_size(MainWindow *mainwin)
 {
-       GtkAllocation *allocation;
+       GtkAllocation allocation;
 
        if (mainwin_list == NULL || mainwin->messageview == NULL) {
                debug_print("called after messageview "
@@ -2908,41 +2921,41 @@ void main_window_get_size(MainWindow *mainwin)
                return;
        }
 
-       allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation);
-       
        if (prefs_common.mainwin_fullscreen) {
                debug_print("mainwin in full screen state. "
                            "Keeping original settings\n");
        }
-       if (allocation->width > 1 && allocation->height > 1 && !prefs_common.mainwin_fullscreen) {
-               prefs_common.summaryview_width = allocation->width;
+
+       gtk_widget_get_allocation(GTK_WIDGET_PTR(mainwin->summaryview), &allocation);
+       if (allocation.width > 1 && allocation.height > 1 && !prefs_common.mainwin_fullscreen) {
+               prefs_common.summaryview_width = allocation.width;
 
                if (messageview_is_visible(mainwin->messageview))
-                       prefs_common.summaryview_height = allocation->height;
+                       prefs_common.summaryview_height = allocation.height;
 
-               prefs_common.mainview_width = allocation->width;
+               prefs_common.mainview_width = allocation.width;
        }
 
-       allocation = &mainwin->window->allocation;
-       if (allocation->width > 1 && allocation->height > 1 &&
+       gtk_widget_get_allocation(mainwin->window, &allocation);
+       if (allocation.width > 1 && allocation.height > 1 &&
            !prefs_common.mainwin_maximised && !prefs_common.mainwin_fullscreen) {
-               prefs_common.mainview_height = allocation->height;
-               prefs_common.mainwin_width   = allocation->width;
-               prefs_common.mainwin_height  = allocation->height;
+               prefs_common.mainview_height = allocation.height;
+               prefs_common.mainwin_width   = allocation.width;
+               prefs_common.mainwin_height  = allocation.height;
        }
 
-       allocation = &(GTK_WIDGET_PTR(mainwin->folderview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1 &&
+       gtk_widget_get_allocation(GTK_WIDGET_PTR(mainwin->folderview), &allocation);
+       if (allocation.width > 1 && allocation.height > 1 &&
            !prefs_common.mainwin_fullscreen) {
-               prefs_common.folderview_width  = allocation->width;
-               prefs_common.folderview_height = allocation->height;
+               prefs_common.folderview_width  = allocation.width;
+               prefs_common.folderview_height = allocation.height;
        }
 
-       allocation = &(GTK_WIDGET_PTR(mainwin->messageview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1 &&
+       gtk_widget_get_allocation(GTK_WIDGET_PTR(mainwin->messageview), &allocation);
+       if (allocation.width > 1 && allocation.height > 1 &&
            !prefs_common.mainwin_fullscreen) {
-               prefs_common.msgview_width = allocation->width;
-               prefs_common.msgview_height = allocation->height;
+               prefs_common.msgview_width = allocation.width;
+               prefs_common.msgview_height = allocation.height;
        }
 
 /*     debug_print("summaryview size: %d x %d\n",
@@ -3182,7 +3195,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        SummaryView *summaryview;
        gchar *menu_path;
        GtkWidget *menu;
-       GList *cur_item;
+       GList *children, *cur_item;
        gint i;
 
        static const struct {
@@ -3288,8 +3301,8 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(
                gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive")));
 
-       for (cur_item = GTK_MENU_SHELL(menu)->children; cur_item != NULL;
-            cur_item = cur_item->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur_item = children; cur_item != NULL; cur_item = cur_item->next) {
                if (cur_item->data == gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive/Separator1")) {
                        cur_item = cur_item->next;
                        break;
@@ -3301,6 +3314,8 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                                         (M_UNLOCKED & state) != 0);
        }
 
+       g_list_free(children);
+
        main_window_menu_callback_block(mainwin);
 
        cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView",
@@ -3440,19 +3455,19 @@ static gint mailing_list_populate_submenu (GtkWidget *menuitem, const gchar * li
        GtkWidget *item, *menu;
        const gchar *url_pt ;
        gchar url_decoded[BUFFSIZE];
-       GList *amenu, *alist;
+       GList *children, *amenu;
        gint menu_nb = 0;
        
        menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(menuitem));
        
        /* First delete old submenu */
        /* FIXME: we can optimize this, and only change/add/delete necessary items */
-       for (amenu = (GTK_MENU_SHELL(menu)->children) ; amenu; ) {
-               alist = amenu->next;
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (amenu = children; amenu; amenu = amenu->next) {
                item = GTK_WIDGET (amenu->data);
                gtk_widget_destroy (item);
-               amenu = alist;
        }
+       g_list_free(children);
        if (list_header) {
                for (url_pt = list_header; url_pt && *url_pt;) {
                        get_url_part (&url_pt, url_decoded, BUFFSIZE);
@@ -3681,7 +3696,7 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
 #endif
        /* clean top-most container */
        if (mainwin->hpaned) {
-               if (mainwin->hpaned->parent == mainwin->vpaned)
+               if (gtk_widget_get_parent(mainwin->hpaned) == mainwin->vpaned)
                        gtk_widget_destroy(mainwin->vpaned);
                else
                        gtk_widget_destroy(mainwin->hpaned);
index 2f585c0..8948e1b 100644 (file)
@@ -216,7 +216,7 @@ static gboolean mimeview_visi_notify(GtkWidget *widget,
                                       GdkEventVisibility *event,
                                       MimeView *mimeview)
 {
-       gdk_window_set_cursor(widget->window, hand_cursor);
+       gdk_window_set_cursor(gtk_widget_get_window(widget), hand_cursor);
        return FALSE;
 }
 
@@ -224,7 +224,7 @@ static gboolean mimeview_leave_notify(GtkWidget *widget,
                                      GdkEventCrossing *event,
                                      MimeView *mimeview)
 {
-       gdk_window_set_cursor(widget->window, NULL);
+       gdk_window_set_cursor(gtk_widget_get_window(widget), NULL);
        return FALSE;
 }
 
@@ -232,7 +232,7 @@ static gboolean mimeview_enter_notify(GtkWidget *widget,
                                      GdkEventCrossing *event,
                                      MimeView *mimeview)
 {
-       gdk_window_set_cursor(widget->window, hand_cursor);
+       gdk_window_set_cursor(gtk_widget_get_window(widget), hand_cursor);
        return FALSE;
 }
 
@@ -1618,7 +1618,8 @@ check_new_file:
        uriname = g_strconcat(tmp, "\r\n", NULL);
        g_free(tmp);
 
-       gtk_selection_data_set(selection_data, selection_data->target, 8,
+       gtk_selection_data_set(selection_data, 
+                   gtk_selection_data_get_target(selection_data), 8,
                               (guchar *)uriname, strlen(uriname));
 
        g_free(uriname);
@@ -2455,7 +2456,7 @@ static void icon_list_clear (MimeView *mimeview)
        g_list_free(orig);
        mimeview->icon_count = 0;
        adj  = gtk_layout_get_vadjustment(GTK_LAYOUT(mimeview->icon_scroll));
-       gtk_adjustment_set_value(adj, adj->lower);
+       gtk_adjustment_set_value(adj, gtk_adjustment_get_lower(adj));
        gtk_adjustment_changed(adj);
 }
 
@@ -2467,26 +2468,28 @@ static void icon_list_clear (MimeView *mimeview)
 static void icon_scroll_size_allocate_cb(GtkWidget *widget, 
                                         GtkAllocation *size, MimeView *mimeview)
 {
-       GtkAllocation *mainbox_size;
-       GtkAllocation *vbox_size;
-       GtkAllocation *layout_size;
+       GtkAllocation vbox_size;
+       GtkAllocation layout_size;
        GtkAdjustment *adj;
+       guint width;
+       guint height;
 
        adj = gtk_layout_get_vadjustment(GTK_LAYOUT(mimeview->icon_scroll));
 
-       mainbox_size = &mimeview->icon_mainbox->allocation;
-       vbox_size = &mimeview->icon_vbox->allocation;
-       layout_size = &mimeview->icon_scroll->allocation;
+       gtk_widget_get_allocation(mimeview->icon_vbox, &vbox_size);
+       gtk_widget_get_allocation(mimeview->icon_scroll, &layout_size);
                
+       gtk_layout_get_size(GTK_LAYOUT(mimeview->icon_scroll), &width, &height);
        gtk_layout_set_size(GTK_LAYOUT(mimeview->icon_scroll), 
-                           GTK_LAYOUT(mimeview->icon_scroll)->width, 
-                           MAX(vbox_size->height, layout_size->height));
-       adj->step_increment = 10;
+                           width, 
+                           MAX(vbox_size.height, layout_size.height));
+       gtk_adjustment_set_step_increment(adj, 10);
 }
 
 static void icon_list_create(MimeView *mimeview, MimeInfo *mimeinfo)
 {
        GtkRequisition size;
+       GtkRequisition requisition;
 
        cm_return_if_fail(mimeinfo != NULL);
 
@@ -2501,7 +2504,8 @@ static void icon_list_create(MimeView *mimeview, MimeInfo *mimeinfo)
                         : NULL;
        }
        gtk_widget_size_request(mimeview->icon_vbox, &size);
-       if (size.width > mimeview->icon_mainbox->requisition.width) {
+       gtk_widget_get_requisition(mimeview->icon_mainbox, &requisition);
+       if (size.width > requisition.width) {
                gtk_widget_set_size_request(mimeview->icon_mainbox, 
                                            size.width, -1);
        }
@@ -2536,6 +2540,7 @@ static void icon_list_toggle_by_mime_info (MimeView       *mimeview,
 static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
                                    MimeView *mimeview)
 {
+       GtkAllocation allocation;
        g_object_ref(button); 
 
        mimeview_leave_notify(button, NULL, NULL);
@@ -2555,7 +2560,8 @@ static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
        } else {
                gtk_arrow_set(GTK_ARROW(gtk_bin_get_child(GTK_BIN((button)))), GTK_ARROW_LEFT, 
                              GTK_SHADOW_NONE);
-               mimeview->oldsize = mimeview->ctree_mainbox->allocation.height;
+               gtk_widget_get_allocation(mimeview->ctree_mainbox, &allocation);
+               mimeview->oldsize = allocation.height;
                gtk_widget_hide(mimeview->ctree_mainbox);
                gtk_widget_show(mimeview->icon_mainbox);
                gtk_paned_set_position(GTK_PANED(mimeview->paned), 0);
@@ -2564,7 +2570,7 @@ static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
                                        button);
                gtk_box_pack_start(GTK_BOX(mimeview->icon_mainbox), 
                                   button, FALSE, FALSE, 0);
-               gtk_box_reorder_child(GTK_BOX(button->parent), button, 0);
+               gtk_box_reorder_child(GTK_BOX(gtk_widget_get_parent(button)), button, 0);
                if (mimeview->opened)
                        icon_list_toggle_by_mime_info
                                (mimeview, gtk_cmctree_node_get_row_data(GTK_CMCTREE(mimeview->ctree), 
index 6d41a15..a6d0199 100644 (file)
@@ -217,7 +217,7 @@ static gboolean noticeview_visi_notify(GtkWidget *widget,
                                       NoticeView *noticeview)
 {
        if (noticeview->icon_clickable)
-               gdk_window_set_cursor(noticeview->evtbox->window, hand_cursor);
+               gdk_window_set_cursor(gtk_widget_get_window(noticeview->evtbox), hand_cursor);
        return FALSE;
 }
 
@@ -225,7 +225,7 @@ static gboolean noticeview_leave_notify(GtkWidget *widget,
                                      GdkEventCrossing *event,
                                      NoticeView *noticeview)
 {
-       gdk_window_set_cursor(noticeview->evtbox->window, NULL);
+       gdk_window_set_cursor(gtk_widget_get_window(noticeview->evtbox), NULL);
        return FALSE;
 }
 
@@ -234,7 +234,7 @@ static gboolean noticeview_enter_notify(GtkWidget *widget,
                                      NoticeView *noticeview)
 {
        if (noticeview->icon_clickable)
-               gdk_window_set_cursor(noticeview->evtbox->window, hand_cursor);
+               gdk_window_set_cursor(gtk_widget_get_window(noticeview->evtbox), hand_cursor);
        return FALSE;
 }
 
index 8fe6f09..d789585 100644 (file)
@@ -77,6 +77,7 @@ passphrase_mbox(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad, gi
     GtkWidget *pass_entry;
     GtkWidget *ok_button;
     GtkWidget *cancel_button;
+    GdkWindow *gdkwin;
 
     SummaryView *summaryview = mainwindow_get_mainwindow()->summaryview;
     
@@ -147,14 +148,15 @@ passphrase_mbox(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad, gi
         int err = 0, cnt = 0;
         /* make sure that window is viewable */
         gtk_widget_show_now(window);
-       gdk_window_process_updates(window->window, TRUE);
+       gdkwin = gtk_widget_get_window(window);
+       gdk_window_process_updates(gdkwin, TRUE);
        gdk_flush();
        while(gtk_events_pending()) {
                gtk_main_iteration();
        }
 try_again:
-        if ((err = gdk_pointer_grab(window->window, TRUE, 0,
-                             window->window, NULL, GDK_CURRENT_TIME))) {
+        if ((err = gdk_pointer_grab(gdkwin, TRUE, 0,
+                             gdkwin, NULL, GDK_CURRENT_TIME))) {
            if (err == GDK_GRAB_NOT_VIEWABLE && cnt < 10) {
                cnt++;
                g_warning("trying to grab mouse again\n");
@@ -166,7 +168,7 @@ try_again:
                 return NULL;
            }
         }
-        if (gdk_keyboard_grab(window->window, FALSE, GDK_CURRENT_TIME)) {
+        if (gdk_keyboard_grab(gdkwin, FALSE, GDK_CURRENT_TIME)) {
             gdk_display_pointer_ungrab(gdk_display_get_default(),
                                       GDK_CURRENT_TIME);
             g_warning("OOPS: Could not grab keyboard\n");
index 2068e25..10c4b5a 100644 (file)
@@ -284,7 +284,8 @@ static gboolean click_cb(GtkWidget * widget,
        switch (event->button) {
        case 1:
                if (gtkut_widget_get_visible(GTK_WIDGET(mainwin->window))) {
-                       if ((gdk_window_get_state(GTK_WIDGET(mainwin->window)->window)&GDK_WINDOW_STATE_ICONIFIED)
+                       if ((gdk_window_get_state(gtk_widget_get_window(
+                               GTK_WIDGET(mainwin->window)))&GDK_WINDOW_STATE_ICONIFIED)
                                        || mainwindow_is_obscured()) {
                                gtk_window_deiconify(GTK_WINDOW(mainwin->window));
                                gtk_window_set_skip_taskbar_hint(GTK_WINDOW(mainwin->window), FALSE);
index 000516e..e1944d2 100644 (file)
@@ -1264,7 +1264,7 @@ static void prefs_filtering_action_enable_widget(GtkWidget* widget, const gboole
 
        if(enable == TRUE)
        {
-               if(GTK_IS_COMBO_BOX(widget) || GTK_IS_COMBO_BOX_ENTRY(widget))
+               if(GTK_IS_COMBO_BOX(widget) && gtk_combo_box_get_has_entry(GTK_COMBO_BOX(widget)))
                        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);
index 43ab549..0d31c94 100644 (file)
@@ -791,7 +791,8 @@ static void drag_data_get(GtkTreeView *tree_view, GdkDragContext *context,
                           -1);
 
        /* send the type */
-       gtk_selection_data_set(data, data->target, 8, (gchar *) &type, sizeof type);
+       gtk_selection_data_set(data, gtk_selection_data_get_target(data), 8,
+               (gchar *) &type, sizeof type);
 }
 
 static void drag_data_received(GtkTreeView *tree_view, GdkDragContext *context,
@@ -861,7 +862,7 @@ static void drag_data_received(GtkTreeView *tree_view, GdkDragContext *context,
                gtk_tree_selection_get_selected(gtk_tree_view_get_selection(
                                                GTK_TREE_VIEW(source)),
                                                &sel_model, &isel);
-               type = *((gint *) data->data);
+               type = *((gint *) gtk_selection_data_get_data(data));
                name = gettext(col_name[type]);
                gtk_list_store_remove(GTK_LIST_STORE(sel_model), &isel);
 
index 8c008f7..864b06c 100644 (file)
@@ -579,6 +579,8 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
        GdkColor color;
        gint rgbvalue = 0;
        GtkColorSelectionDialog *dialog;
+       GtkWidget button_ok;
+       GtkWidget button_cancel;
        gint c;
 
        /* custom colors */
@@ -638,9 +640,13 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
        gtk_window_set_resizable(GTK_WINDOW(color_dialog), FALSE);
        manage_window_set_transient(GTK_WINDOW(color_dialog));
 
-       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
+       g_object_get(color_dialog, "ok-button", &button_ok,
+                               "cancel-button", &button_cancel,
+                               NULL);
+
+       g_signal_connect(G_OBJECT(&button_cancel),
                         "clicked", G_CALLBACK(quote_colors_set_dialog_cancel), data);
-       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
+       g_signal_connect(G_OBJECT(&button_ok),
                         "clicked", G_CALLBACK(quote_colors_set_dialog_ok), data);
        g_signal_connect(G_OBJECT(color_dialog), "key_press_event",
                         G_CALLBACK(quote_colors_set_dialog_key_pressed),data);
@@ -651,15 +657,16 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
 
        dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
        gtk_color_selection_set_current_color
-               (GTK_COLOR_SELECTION(dialog->colorsel), &color);
+               (GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(dialog)), &color);
 
        gtk_widget_show(color_dialog);
 }
 
 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
 {
-       GtkColorSelection *colorsel = (GtkColorSelection *)
-                                               ((GtkColorSelectionDialog *)color_dialog)->colorsel;
+       GtkColorSelection *colorsel = GTK_COLOR_SELECTION(
+               gtk_color_selection_dialog_get_color_selection
+                                               ((GtkColorSelectionDialog *)color_dialog));
        GdkColor color;
        gint rgbvalue;
        gchar *type = (gchar *)data;
@@ -727,23 +734,27 @@ static gboolean quote_colors_set_dialog_key_pressed(GtkWidget *widget,
                                                GdkEventKey *event,
                                                gpointer data)
 {
+       GtkColorSelectionDialog *dialog;
+       GtkWidget button_ok;
+       GtkWidget button_cancel;
+
+       dialog = GTK_COLOR_SELECTION_DIALOG(widget);
+       g_object_get(dialog, "ok-button", &button_ok,
+                         "cancel-button", &button_cancel,
+                          NULL);
+
        if (event) {
                switch (event->keyval) {
                        case GDK_Escape:
-                               gtk_button_clicked(GTK_BUTTON(GTK_COLOR_SELECTION_DIALOG
-                                                       (widget)->cancel_button));
+                               gtk_button_clicked(GTK_BUTTON(&button_cancel));
                                return TRUE;
                        case GDK_Return: 
                        case GDK_KP_Enter:
                                /* NOTE: changing focus makes widget accept all currently 
                                 * changed settings! */
-                               gtk_widget_grab_focus
-                                       (GTK_COLOR_SELECTION_DIALOG
-                                               (widget)->ok_button);
+                               gtk_widget_grab_focus(&button_ok);
                                /* call ok handler */                                           
-                               gtk_button_clicked(GTK_BUTTON
-                                       (GTK_COLOR_SELECTION_DIALOG
-                                               (widget)->ok_button));
+                               gtk_button_clicked(GTK_BUTTON(&button_ok));
                                return TRUE;
                        default:
                                break;
index 401cf58..01fce6c 100644 (file)
@@ -806,7 +806,8 @@ static void drag_data_get(GtkTreeView *tree_view, GdkDragContext *context,
                           -1);
 
        /* send the type */
-       gtk_selection_data_set(data, data->target, 8, (gchar *) &type, sizeof type);
+       gtk_selection_data_set(data, gtk_selection_data_get_target(data), 8,
+               (gchar *) &type, sizeof type);
 }
 
 static void drag_data_received(GtkTreeView *tree_view, GdkDragContext *context,
@@ -876,7 +877,7 @@ static void drag_data_received(GtkTreeView *tree_view, GdkDragContext *context,
                gtk_tree_selection_get_selected(gtk_tree_view_get_selection(
                                                GTK_TREE_VIEW(source)),
                                                &sel_model, &isel);
-               type = *((gint *) data->data);
+               type = *((gint *) gtk_selection_data_get_data(data));
                name = gettext(col_name[type]);
                gtk_list_store_remove(GTK_LIST_STORE(sel_model), &isel);
 
index ee4003e..57a34f2 100644 (file)
@@ -1597,7 +1597,7 @@ static gboolean icon_window_button_press(GtkWidget *widget,
                                restore = FALSE;
                                break;
                        }
-                       event_widget = event_widget->parent;
+                       event_widget = gtk_widget_get_parent(event_widget);
                }
        }
 
@@ -1616,6 +1616,7 @@ static void icon_chooser_activated(GtkTreeView *treeview, GtkTreePath *path,
 
 static void icon_chooser_create(GtkButton *button, ToolbarPage *prefs_toolbar)
 {
+       GtkAllocation allocation;
        GtkWidget *icon_chooser_win;
        GtkWidget *scrollwin;
        GtkWidget *icon_view;
@@ -1646,10 +1647,12 @@ static void icon_chooser_create(GtkButton *button, ToolbarPage *prefs_toolbar)
 #ifndef MAEMO
        gtk_window_set_decorated(GTK_WINDOW(icon_chooser_win), FALSE);
 #endif
-       gdk_window_get_origin(GTK_WIDGET(prefs_toolbar->icon_button)->window, 
+       gdk_window_get_origin(gtk_widget_get_window(
+                       GTK_WIDGET(prefs_toolbar->icon_button)), 
                        &x, &y);
-       x += GTK_WIDGET(prefs_toolbar->icon_button)->allocation.x;
-       y += GTK_WIDGET(prefs_toolbar->icon_button)->allocation.y;
+       gtk_widget_get_allocation(GTK_WIDGET(prefs_toolbar->icon_button), &allocation);
+       x += allocation.x;
+       y += allocation.y;
        y += 50;
        x -= 300-50;
        gtk_window_move(GTK_WINDOW(icon_chooser_win), x, y);
index 4d77ddd..8fe1b89 100644 (file)
@@ -537,7 +537,7 @@ static gboolean cb_preview(GtkPrintOperation        *operation,
        preview_data->area = da;
 
        /* cairo context */
-       cr = gdk_cairo_create(da->window);
+       cr = gdk_cairo_create(gtk_widget_get_window(da));
        gtk_print_context_set_cairo_context(context, cr, PREVIEW_SCALE, PREVIEW_SCALE);
        cairo_destroy(cr);
 
@@ -663,7 +663,7 @@ static gboolean cb_preview_expose(GtkWidget *widget, GdkEventExpose *event,
 
        debug_print("preview_expose (current %p)\n", preview_data->current_page);
 
-       cr = gdk_cairo_create(preview_data->area->window);
+       cr = gdk_cairo_create(gtk_widget_get_window(preview_data->area));
 
        /* background */
        cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
@@ -768,13 +768,15 @@ static void cb_preview_zoom_100(GtkButton *button, gpointer data)
 static void cb_preview_zoom_fit(GtkButton *button, gpointer data)
 {
        PreviewData *preview_data = (PreviewData*) data;
+       GtkAllocation allocation;
        gdouble zoom_w;
        gdouble zoom_h;
 
-       zoom_w = ((gdouble)preview_data->scrolled_window->allocation.width) /
+       gtk_widget_get_allocation(preview_data->scrolled_window, &allocation);
+       zoom_w = ((gdouble)allocation.width) /
                 ((gdouble)preview_data->page_width/preview_data->print_data->zoom +
                  PREVIEW_SHADOW_OFFSET);
-       zoom_h = ((gdouble)preview_data->scrolled_window->allocation.height) /
+       zoom_h = ((gdouble)allocation.height) /
                 ((gdouble)preview_data->page_height/preview_data->print_data->zoom +
                  PREVIEW_SHADOW_OFFSET);
 
index f12466a..f8e1c75 100644 (file)
@@ -593,7 +593,7 @@ StockPixmap stock_pixmap_get_icon (gchar *file)
 static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventExpose *expose,
                                                    OverlayData *data) 
 {
-       GdkDrawable *drawable = widget->window; 
+       GdkDrawable *drawable = gtk_widget_get_window(widget);  
        cairo_t *cr;
        gint left = 0;
        gint top = 0;
@@ -749,11 +749,13 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
        GdkPixbuf *stock_pixbuf = NULL;
        GtkWidget *widget = NULL;
        GtkWidget *stock_wid = NULL;
+       GtkRequisition requisition;
        OverlayData *data = NULL;
        
        data = g_new0(OverlayData, 1);
 
        stock_wid = stock_pixmap_widget(window, icon);
+       gtk_widget_get_requisition(stock_wid, &requisition);
 
        if (gtk_image_get_storage_type(GTK_IMAGE(stock_wid)) == GTK_IMAGE_PIXMAP)
                data->is_pixmap = TRUE;
@@ -766,8 +768,8 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                g_object_ref(stock_mask);
                data->base_pixmap = stock_pixmap;
                data->base_mask   = stock_mask;
-               data->base_height = stock_wid->requisition.height;
-               data->base_width  = stock_wid->requisition.width;
+               data->base_height = requisition.height;
+               data->base_width  = requisition.width;
                gtk_widget_destroy(stock_wid);
 
                if (pos == OVERLAY_NONE) {
@@ -780,8 +782,8 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                        g_object_ref(stock_mask);
                        data->overlay_pixmap = stock_pixmap;
                        data->overlay_mask   = stock_mask;
-                       data->overlay_height = stock_wid->requisition.height;
-                       data->overlay_width  = stock_wid->requisition.width;
+                       data->overlay_height = requisition.height;
+                       data->overlay_width  = requisition.width;
 
                        gtk_widget_destroy(stock_wid);
                }
@@ -790,8 +792,8 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                stock_pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(stock_wid));
                g_object_ref(stock_pixbuf);
                data->base_pixbuf = stock_pixbuf;
-               data->base_height = stock_wid->requisition.height;
-               data->base_width  = stock_wid->requisition.width;
+               data->base_height = requisition.height;
+               data->base_width  = requisition.width;
                gtk_widget_destroy(stock_wid);
                if (pos == OVERLAY_NONE) {
                        data->overlay_pixmap = NULL;
@@ -801,8 +803,8 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                        stock_pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(stock_wid));
                        g_object_ref(stock_pixbuf);
                        data->overlay_pixbuf = stock_pixbuf;
-                       data->overlay_height = stock_wid->requisition.height;
-                       data->overlay_width  = stock_wid->requisition.width;
+                       data->overlay_height = requisition.height;
+                       data->overlay_width  = requisition.width;
 
                        gtk_widget_destroy(stock_wid);
                }
index 3d2f5f8..eb55cc5 100644 (file)
@@ -791,8 +791,10 @@ void summary_relayout(SummaryView *summaryview)
        g_object_ref(summaryview->hbox_l);
        g_object_ref(summaryview->statlabel_msgs);
        
-       gtkut_container_remove(GTK_CONTAINER(summaryview->hbox_l->parent), summaryview->hbox_l);
-       gtkut_container_remove(GTK_CONTAINER(summaryview->statlabel_msgs->parent), summaryview->statlabel_msgs);
+       gtkut_container_remove(GTK_CONTAINER(
+               gtk_widget_get_parent(summaryview->hbox_l)), summaryview->hbox_l);
+       gtkut_container_remove(GTK_CONTAINER(
+               gtk_widget_get_parent(summaryview->statlabel_msgs)), summaryview->statlabel_msgs);
 
        switch (prefs_common.layout_mode) {
        case NORMAL_LAYOUT:
@@ -876,7 +878,7 @@ static void summary_set_fonts(SummaryView *summaryview)
        if (prefs_common.derive_from_normal_font || !SMALL_FONT) {
                font_desc = pango_font_description_new();
                size = pango_font_description_get_size
-                       (summaryview->ctree->style->font_desc);
+                       (gtk_widget_get_style(summaryview->ctree)->font_desc);
                pango_font_description_set_size(font_desc, size * PANGO_SCALE_SMALL);
        } else {
                font_desc = pango_font_description_from_string(SMALL_FONT);
@@ -2726,7 +2728,7 @@ static void summary_set_column_titles(SummaryView *summaryview)
 void summary_reflect_tags_changes(SummaryView *summaryview)
 {
        GtkMenuShell *menu;
-       GList *cur;
+       GList *children, *cur;
        GtkCMCTreeNode *node;
        GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
        gboolean froze = FALSE;
@@ -2737,9 +2739,11 @@ void summary_reflect_tags_changes(SummaryView *summaryview)
        cm_return_if_fail(menu != NULL);
 
        /* clear items. get item pointers. */
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                gtk_menu_item_set_submenu(GTK_MENU_ITEM(cur->data), NULL);
        }
+       g_list_free(children);
        summary_tags_menu_create(summaryview, TRUE);
 
        START_LONG_OPERATION(summaryview, TRUE);
@@ -5777,7 +5781,7 @@ static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item
        GtkMenuShell *menu;
        GtkCheckMenuItem **items;
        gint n;
-       GList *cur, *sel;
+       GList *children, *cur, *sel;
 
        summaryview = (SummaryView *)data;
        cm_return_if_fail(summaryview != NULL);
@@ -5797,7 +5801,8 @@ static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item
                          GINT_TO_POINTER(1));
 
        /* clear items. get item pointers. */
-       for (n = 0, cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (n = 0, cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
                        gtk_check_menu_item_set_active
                                (GTK_CHECK_MENU_ITEM(cur->data), FALSE);
@@ -5806,6 +5811,8 @@ static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item
                }
        }
 
+       g_list_free(children);
+
        if (n == (N_COLOR_LABELS + 1)) {
                /* iterate all messages and set the state of the appropriate
                 * items */
@@ -5818,7 +5825,7 @@ static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item
                                 GTK_CMCTREE_NODE(sel->data));
                        if (msginfo) {
                                clabel = MSG_GET_COLORLABEL_VALUE(msginfo->flags);
-                               if (!items[clabel]->active)
+                               if (!gtk_check_menu_item_get_active(items[clabel]))
                                        gtk_check_menu_item_set_active
                                                (items[clabel], TRUE);
                        }
@@ -5901,7 +5908,7 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                                                          gpointer data)
 {
        GtkMenuShell *menu;
-       GList *cur;
+       GList *children, *cur;
        GList *sel;
        GHashTable *menu_table = g_hash_table_new_full(
                                        g_direct_hash,
@@ -5927,7 +5934,8 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                          GINT_TO_POINTER(1));
 
        /* clear items. get item pointers. */
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
                        gint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cur->data),
                                "tag_id"));
@@ -5939,6 +5947,8 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                }
        }
 
+       g_list_free(children);
+
        /* iterate all messages and set the state of the appropriate
         * items */
        sel_len = 0;
@@ -5960,7 +5970,7 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                                gint num_checked = GPOINTER_TO_INT(g_hash_table_lookup(menu_allsel_table, tags->data));
                                id = GPOINTER_TO_INT(tags->data);
                                item = g_hash_table_lookup(menu_table, GINT_TO_POINTER(tags->data));
-                               if (item && !item->active) {
+                               if (item && !gtk_check_menu_item_get_active(item)) {
                                        gtk_check_menu_item_set_active
                                                (item, TRUE);
                                }
@@ -5970,7 +5980,8 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                }
        }
 
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
                        gint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cur->data),
                                "tag_id"));
@@ -5981,6 +5992,7 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
                                gtk_check_menu_item_set_inconsistent(GTK_CHECK_MENU_ITEM(cur->data), FALSE);
                }
        }
+       g_list_free(children);
        g_hash_table_destroy(menu_table);
        g_hash_table_destroy(menu_allsel_table);
        /* reset "dont_toggle" state */
@@ -6622,7 +6634,7 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        case GDK_Left:          /* Move focus */
                adj = gtk_scrolled_window_get_hadjustment
                        (GTK_SCROLLED_WINDOW(summaryview->scrolledwin));
-               if (adj->lower != adj->value)
+               if (gtk_adjustment_get_lower(adj) != gtk_adjustment_get_value(adj))
                        break;
                /* FALLTHROUGH */       
        case GDK_Escape:
@@ -7024,7 +7036,7 @@ static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
                                 GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_DEFAULT, button, event);
        gtk_drag_set_icon_default(context);
        if (prefs_common.layout_mode == SMALL_LAYOUT) {
-               GtkWidget *paned = GTK_WIDGET_PTR(summaryview)->parent;
+               GtkWidget *paned = gtk_widget_get_parent(GTK_WIDGET_PTR(summaryview));
                if (paned && GTK_IS_PANED(paned)) {
                        mainwindow_reset_paned(GTK_PANED(paned));
                }
@@ -7101,14 +7113,14 @@ static void summary_drag_data_get(GtkWidget        *widget,
 
                if (mail_list != NULL) {
                        gtk_selection_data_set(selection_data,
-                                              selection_data->target, 8,
+                                              gtk_selection_data_get_target(selection_data), 8,
                                               mail_list, strlen(mail_list));
                        g_free(mail_list);
                } 
        } else if (info == TARGET_DUMMY) {
                if (GTK_CMCLIST(summaryview->ctree)->selection)
                        gtk_selection_data_set(selection_data,
-                                              selection_data->target, 8,
+                                              gtk_selection_data_get_target(selection_data), 8,
                                               "Dummy-Summaryview", 
                                               strlen("Dummy-Summaryview")+1);
        } else if (info == TARGET_MAIL_CM_PATH_LIST) {
@@ -7140,7 +7152,7 @@ static void summary_drag_data_get(GtkWidget        *widget,
 
                if (path_list != NULL) {
                        gtk_selection_data_set(selection_data,
-                                              selection_data->target, 8,
+                                              gtk_selection_data_get_target(selection_data), 8,
                                               path_list, strlen(path_list));
                        g_free(path_list);
                }
@@ -7190,7 +7202,8 @@ static void summary_drag_data_received(GtkWidget        *widget,
                        gtk_drag_finish(drag_context, FALSE, FALSE, time);                      
                        return;
                } else {
-                       folderview_finish_dnd(data->data, drag_context, time, item);
+                       folderview_finish_dnd(gtk_selection_data_get_data(data),
+                               drag_context, time, item);
                }
        }
 }
@@ -7723,20 +7736,22 @@ void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
 void summary_reflect_prefs_custom_colors(SummaryView *summaryview)
 {
        GtkMenuShell *menu;
-       GList *cur;
+       GList *children, *cur;
 
        /* re-create colorlabel submenu */
        menu = GTK_MENU_SHELL(summaryview->colorlabel_menu);
        cm_return_if_fail(menu != NULL);
 
        /* clear items. get item pointers. */
-       for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
+       children = gtk_container_get_children(GTK_CONTAINER(menu));
+       for (cur = children; cur != NULL && cur->data != NULL; cur = cur->next) {
                g_signal_handlers_disconnect_matched
                         (gtk_ui_manager_get_accel_group(summaryview->mainwin->ui_manager), 
                         G_SIGNAL_MATCH_DATA|G_SIGNAL_MATCH_FUNC,
                         0, 0, NULL, mainwin_accel_changed_cb, cur->data);
                gtk_menu_item_set_submenu(GTK_MENU_ITEM(cur->data), NULL);
        }
+       g_list_free(children);
        summary_colorlabel_menu_create(summaryview, TRUE);
 }
 
index 66dcfc7..97d44ec 100644 (file)
@@ -233,8 +233,10 @@ static void scrolled_cb (GtkAdjustment *adj, TextView *textview)
 #  define HEIGHT 48
 #endif
        if (textview->image) {
+               GtkAllocation allocation;
                gint x, y, x1;
-               x1 = textview->text->allocation.width - WIDTH - 5;
+               gtk_widget_get_allocation(textview->text, &allocation);
+               x1 = allocation.width - WIDTH - 5;
                gtk_text_view_buffer_to_window_coords(
                        GTK_TEXT_VIEW(textview->text),
                        GTK_TEXT_WINDOW_TEXT, x1, 5, &x, &y);
@@ -603,6 +605,7 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
 
 static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
 {
+       GtkAllocation allocation;
        GtkTextView *text;
        GtkTextBuffer *buffer;
        GtkTextIter iter, start_iter;
@@ -710,9 +713,10 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
                                return;
                        }
 
+                       gtk_widget_get_allocation(textview->scrolledwin, &allocation);
                        pixbuf = claws_load_pixbuf_fitting(pixbuf,
-                                       textview->scrolledwin->allocation.width,
-                                       textview->scrolledwin->allocation.height);
+                                       allocation.width,
+                                       allocation.height);
 
                        if (textview->stop_loading) {
                                return;
@@ -1850,6 +1854,7 @@ static GPtrArray *textview_scan_header(TextView *textview, FILE *fp)
 
 static void textview_show_face(TextView *textview)
 {
+       GtkAllocation allocation;
        GtkTextView *text = GTK_TEXT_VIEW(textview->text);
        MsgInfo *msginfo = textview->messageview->msginfo;
        int x = 0;
@@ -1870,7 +1875,8 @@ static void textview_show_face(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);
@@ -1887,6 +1893,7 @@ bail:
 
 void textview_show_icon(TextView *textview, const gchar *stock_id)
 {
+       GtkAllocation allocation;
        GtkTextView *text = GTK_TEXT_VIEW(textview->text);
        int x = 0;
        
@@ -1898,7 +1905,8 @@ void textview_show_icon(TextView *textview, const gchar *stock_id)
 
        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);
@@ -1989,6 +1997,7 @@ static void textview_save_contact_pic(TextView *textview)
 
 static void textview_show_contact_pic(TextView *textview)
 {
+       GtkAllocation allocation;
        MsgInfo *msginfo = textview->messageview->msginfo;
        GtkTextView *text = GTK_TEXT_VIEW(textview->text);
        int x = 0;
@@ -2040,7 +2049,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);
@@ -2232,7 +2242,7 @@ gboolean textview_search_string_backward(TextView *textview, const gchar *str,
 void textview_scroll_one_line(TextView *textview, gboolean up)
 {
        GtkTextView *text = GTK_TEXT_VIEW(textview->text);
-       GtkAdjustment *vadj = text->vadjustment;
+       GtkAdjustment *vadj = gtk_text_view_get_vadjustment(text);
 
        gtkutils_scroll_one_line(GTK_WIDGET(text), vadj, up);
 }
@@ -2240,7 +2250,7 @@ void textview_scroll_one_line(TextView *textview, gboolean up)
 gboolean textview_scroll_page(TextView *textview, gboolean up)
 {
        GtkTextView *text = GTK_TEXT_VIEW(textview->text);
-       GtkAdjustment *vadj = text->vadjustment;
+       GtkAdjustment *vadj = gtk_text_view_get_vadjustment(text);
 
        return gtkutils_scroll_page(GTK_WIDGET(text), vadj, up);
 }
@@ -2252,6 +2262,7 @@ gboolean textview_scroll_page(TextView *textview, gboolean up)
 static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                 TextView *textview)
 {
+       GdkWindow *window;
        SummaryView *summaryview = NULL;
        MessageView *messageview = textview->messageview;
 
@@ -2308,11 +2319,12 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                }
                /* possible fall through */
        default:
+               window = gtk_widget_get_window(messageview->mainwin->window);
                if (summaryview &&
-                   event->window != messageview->mainwin->window->window) {
+                   event->window != window) {
                        GdkEventKey tmpev = *event;
 
-                       tmpev.window = messageview->mainwin->window->window;
+                       tmpev.window = window;
                        KEY_PRESS_EVENT_STOP();
                        gtk_widget_event(messageview->mainwin->window,
                                         (GdkEvent *)&tmpev);
@@ -2330,7 +2342,7 @@ static gboolean textview_motion_notify(GtkWidget *widget,
        if (textview->loading)
                return FALSE;
        textview_uri_update(textview, event->x, event->y);
-       gdk_window_get_pointer(widget->window, NULL, NULL, NULL);
+       gdk_window_get_pointer(gtk_widget_get_window(widget), NULL, NULL, NULL);
 
        return FALSE;
 }
@@ -2363,7 +2375,7 @@ static gboolean textview_visibility_notify(GtkWidget *widget,
        if (window != event->window)
                return FALSE;
        
-       gdk_window_get_pointer(widget->window, &wx, &wy, NULL);
+       gdk_window_get_pointer(gtk_widget_get_window(widget), &wx, &wy, NULL);
        textview_uri_update(textview, wx, wy);
 
        return FALSE;
index a0bffd4..fda7899 100644 (file)
@@ -311,9 +311,10 @@ static void undo_add(const gchar *text,
 
        undo_check_size(undostruct);
 
-       vadj = GTK_ADJUSTMENT(GTK_TEXT_VIEW(undostruct->textview)->vadjustment);
+       vadj = GTK_ADJUSTMENT(gtk_text_view_get_vadjustment(
+                               GTK_TEXT_VIEW(undostruct->textview)));
        undoinfo = undo_object_new(g_strdup(text), start_pos, end_pos, action,
-                                  vadj->value);
+                                  gtk_adjustment_get_value(vadj));
 
        if (end_pos - start_pos != 1 || text[0] == '\n')
                undoinfo->mergeable = FALSE;
@@ -366,7 +367,7 @@ void undo_undo(UndoMain *undostruct)
 
        /* Move the view (scrollbars) to the correct position */
        gtk_adjustment_set_value
-               (GTK_ADJUSTMENT(textview->vadjustment),
+               (GTK_ADJUSTMENT(gtk_text_view_get_vadjustment(textview)),
                 undoinfo->window_position);
        
        switch (undoinfo->action) {
@@ -449,7 +450,7 @@ void undo_redo(UndoMain *undostruct)
        gtk_text_buffer_place_cursor(buffer, &iter);
 
        /* Move the view to the right position. */
-       gtk_adjustment_set_value(textview->vadjustment
+       gtk_adjustment_set_value(gtk_text_view_get_vadjustment(textview)
                                 redoinfo->window_position);
 
        switch (redoinfo->action) {
index 409c500..c275e29 100644 (file)
@@ -450,7 +450,7 @@ static void initialize_fonts(WizardWindow *wizard)
 {
        GtkWidget *widget = wizard->email;
        gint size = pango_font_description_get_size(
-                       widget->style->font_desc)
+                       gtk_widget_get_style(widget)->font_desc)
                      /PANGO_SCALE;
        gchar *tmp, *new;
 #ifdef G_OS_WIN32
@@ -1848,7 +1848,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
        wizard->notebook = gtk_notebook_new();
        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(wizard->notebook), FALSE);
        gtk_notebook_set_show_border(GTK_NOTEBOOK(wizard->notebook), FALSE);
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(wizard->window)->vbox), 
+       gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(wizard->window))), 
                            wizard->notebook, TRUE, TRUE, 0);
        
        wizard->pages = NULL;