[pan2: 61/68] remove depricated function through gtk 2.18



commit 173f4b0ddaaa798f2eca8e0955cfab4828e8181f
Author: K. Haley <haleykd users sf net>
Date:   Fri Oct 22 16:18:48 2010 -0600

    remove depricated function through gtk 2.18

 pan/gui/body-pane.cc          |   51 ++++++++++++++++++++++++++++-------------
 pan/gui/dl-headers-ui.cc      |    2 +-
 pan/gui/dl-headers-ui.h       |    2 +-
 pan/gui/e-charset-combo-box.c |    7 +++++-
 pan/gui/e-charset-dialog.c    |    6 ++--
 pan/gui/group-pane.cc         |    9 ++++++-
 pan/gui/group-prefs-dialog.cc |   13 ++++++++--
 pan/gui/group-prefs-dialog.h  |    2 +-
 pan/gui/gui.cc                |   25 ++++++++++++--------
 pan/gui/gui.h                 |    6 +++++
 pan/gui/header-pane.cc        |   14 +++++++++-
 pan/gui/log-ui.cc             |    2 +-
 pan/gui/log-ui.h              |    2 +-
 pan/gui/pan-file-entry.h      |    2 +-
 pan/gui/post-ui.cc            |    5 ++-
 pan/gui/prefs-ui.cc           |    2 +-
 pan/gui/prefs.cc              |    4 +-
 pan/gui/profiles-dialog.cc    |    4 +-
 pan/gui/progress-view.h       |    2 +-
 pan/gui/save-ui.cc            |    2 +-
 pan/gui/save-ui.h             |    2 +-
 pan/gui/score-add-ui.cc       |    2 +-
 pan/gui/score-add-ui.h        |    3 +-
 pan/gui/score-view-ui.cc      |    2 +-
 pan/gui/server-ui.cc          |    4 +-
 pan/gui/server-ui.h           |    2 +-
 26 files changed, 118 insertions(+), 59 deletions(-)
---
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index 2b4b44d..42070a6 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -51,6 +51,13 @@ using namespace pan;
 **/
 namespace
 {
+#if !GTK_CHECK_VERSION(2,18,0)
+  void gtk_widget_get_allocation( GtkWidget *w, GtkAllocation *a)
+  {
+    *a = w->allocation;
+  }
+#endif
+
   class PixbufCache
   {
     private:
@@ -402,7 +409,9 @@ BodyPane :: mouse_button_pressed (GtkWidget *w, GdkEventButton *event)
         const int offset (gtk_text_iter_get_offset (&iter));
         GtkTextBuffer * buf (gtk_text_view_get_buffer (GTK_TEXT_VIEW(w)));
         const bool fullsize (toggle_fullsize_flag (buf));
-        resize_picture_at_iter (buf, &iter, fullsize, &w->allocation, pix_tag);
+        GtkAllocation aloc;
+        gtk_widget_get_allocation(w, &aloc);
+        resize_picture_at_iter (buf, &iter, fullsize, &aloc, pix_tag);
         gtk_text_iter_set_offset (&iter, offset);
         set_cursor_from_iter (event->window, w, &iter);
 
@@ -491,13 +500,13 @@ namespace
       gtk_text_view_place_cursor_onscreen (GTK_TEXT_VIEW(w));
       GtkAdjustment * adj = gtk_scrolled_window_get_vadjustment (
                                                       GTK_SCROLLED_WINDOW(scroll));
-      gdouble val = adj->value;
+      gdouble val = gtk_adjustment_get_value(adj);
       if (up)
-        val -= adj->step_increment;
+        val -= gtk_adjustment_get_step_increment(adj);
       else
-        val += adj->step_increment;
-      val = MAX(val, adj->lower);
-      val = MIN(val, adj->upper-adj->page_size);
+        val += gtk_adjustment_get_step_increment(adj);
+      val = MAX(val, gtk_adjustment_get_lower(adj) );
+      val = MIN(val, gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj) );
       gtk_adjustment_set_value (adj, val);
     }
 
@@ -960,7 +969,9 @@ BodyPane :: foreach_part_cb (GMimeObject* /*parent*/, GMimeObject* o, gpointer s
 {
   BodyPane * pane = static_cast<BodyPane*>(self);
   GtkWidget * w (pane->_text);
-  pane->append_part (o, &w->allocation);
+  GtkAllocation aloc;
+  gtk_widget_get_allocation(w, &aloc);
+  pane->append_part (o, &aloc);
 }
 
 
@@ -1226,9 +1237,9 @@ BodyPane :: refresh_scroll_visible_state ()
 {
   GtkScrolledWindow * w (GTK_SCROLLED_WINDOW (_scroll));
   GtkAdjustment * adj = gtk_scrolled_window_get_hadjustment (w);
-  _hscroll_visible = adj->page_size < adj->upper;
+  _hscroll_visible = gtk_adjustment_get_page_size(adj) < gtk_adjustment_get_upper(adj);
   adj = gtk_scrolled_window_get_vadjustment (w);
-  _vscroll_visible = adj->page_size < adj->upper;
+  _vscroll_visible = gtk_adjustment_get_page_size(adj) < gtk_adjustment_get_upper(adj);
 }
 
 // show*_cb exist to ensure that _hscroll_visible and _vscroll_visible
@@ -1279,9 +1290,13 @@ BodyPane :: text_size_allocated_idle ()
 
   // walk through the buffer looking for pictures to resize
   GtkTextTag * tag (get_named_tag_from_view (_text, "pixbuf"));
+  GtkAllocation aloc;
   for (;;) {
     if (gtk_text_iter_begins_tag (&iter, tag))
-      resize_picture_at_iter (buf, &iter, fullsize, &_text->allocation, tag);
+    {
+      gtk_widget_get_allocation(_text, &aloc);
+      resize_picture_at_iter (buf, &iter, fullsize, &aloc, tag);
+    }
     if (!gtk_text_iter_forward_char (&iter))
       break;
     if (!gtk_text_iter_forward_to_tag_toggle (&iter, tag))
@@ -1467,18 +1482,22 @@ BodyPane :: read_more_or_less (bool more)
   GtkAdjustment * v = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(parent));
 
   // figure out how far we scroll
+  const double v_value = gtk_adjustment_get_value(v);
+  const double v_upper = gtk_adjustment_get_upper(v);
+  const double v_lower = gtk_adjustment_get_lower(v);
+  const double v_page_size = gtk_adjustment_get_page_size(v);
   const int arbitrary_font_height_pixels_hack (18);
-  const float inc (v->page_size - arbitrary_font_height_pixels_hack);
-  const gfloat val (CLAMP (v->value + (more ? inc : -inc),
-                           v->lower,
-                           MAX(v->upper,v->page_size)-MIN(v->upper,v->page_size)));
+  const float inc (v_page_size - arbitrary_font_height_pixels_hack);
+  const gfloat val (CLAMP (v_value + (more ? inc : -inc),
+                           v_lower,
+                           MAX(v_upper,v_page_size)-MIN(v_upper,v_page_size)));
 
   // if we can scroll, do so.
   bool handled (false);
-  if (v->upper>=v->page_size && val!=v->value)
+  if (v_upper>=v_page_size && val!=v_value)
   {
     if (_prefs.get_flag ("smooth-scrolling", true))
-      sylpheed_textview_smooth_scroll_do (v, v->value, val, smooth_scrolling_speed);
+      sylpheed_textview_smooth_scroll_do (v, v_value, val, smooth_scrolling_speed);
     else
       gtk_adjustment_set_value (v, val);
 
diff --git a/pan/gui/dl-headers-ui.cc b/pan/gui/dl-headers-ui.cc
index 69c3906..383a863 100644
--- a/pan/gui/dl-headers-ui.cc
+++ b/pan/gui/dl-headers-ui.cc
@@ -156,7 +156,7 @@ pan :: headers_dialog (Data& data, Prefs& prefs, Queue& queue,
     g_signal_connect (x, "focus_in_event", G_CALLBACK(spin_tickled_cb), state->n_headers_rb);
     gtk_table_attach_defaults (GTK_TABLE(t), x, 1, 2, row, row+1);
 
-    gtk_container_add (GTK_CONTAINER(GTK_DIALOG(state->dialog)->vbox), t);
+    gtk_container_add ( GTK_CONTAINER( gtk_dialog_get_content_area( GTK_DIALOG(state->dialog))), t);
     g_signal_connect (state->dialog, "response", G_CALLBACK(response_cb), state);
     g_object_set_data_full (G_OBJECT(state->dialog), "state", state, delete_state);
     gtk_widget_show_all (state->dialog);
diff --git a/pan/gui/dl-headers-ui.h b/pan/gui/dl-headers-ui.h
index 2b14e81..19c2b88 100644
--- a/pan/gui/dl-headers-ui.h
+++ b/pan/gui/dl-headers-ui.h
@@ -19,7 +19,7 @@
 #ifndef DOWNLOAD_HEADERS_UI_H
 #define DOWNLOAD_HEADERS_UI_H
 
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
 #include <pan/general/quark.h>
 #include "prefs.h"
 
diff --git a/pan/gui/e-charset-combo-box.c b/pan/gui/e-charset-combo-box.c
index cbdb6e6..9dabe50 100644
--- a/pan/gui/e-charset-combo-box.c
+++ b/pan/gui/e-charset-combo-box.c
@@ -83,7 +83,12 @@ charset_combo_box_run_dialog (ECharsetComboBox *combo_box)
 	 *       finally resolved. */
 
 	parent = gtk_widget_get_toplevel (GTK_WIDGET (combo_box));
-	parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
+#ifndef GTK_WIDGET_TOPLEVEL
+#define TOPLEVEL gtk_widget_is_toplevel
+#else
+#define TOPLEVEL GTK_WIDGET_TOPLEVEL
+#endif
+	parent = TOPLEVEL (parent) ? parent : NULL;
 
 	object = G_OBJECT (combo_box->priv->other_action);
 	charset = g_object_get_data (object, "charset");
diff --git a/pan/gui/e-charset-dialog.c b/pan/gui/e-charset-dialog.c
index 3e09b94..6a27024 100644
--- a/pan/gui/e-charset-dialog.c
+++ b/pan/gui/e-charset-dialog.c
@@ -55,7 +55,7 @@ e_charset_dialog (const char *title, const char *prompt,
 
 	vbox = gtk_vbox_new (FALSE, 6);
 	gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
-	gtk_box_pack_start (GTK_BOX (dialog->vbox), vbox, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(dialog)), vbox, FALSE, FALSE, 0);
 	gtk_widget_show (vbox);
 
 	label = gtk_label_new (prompt);
@@ -78,8 +78,8 @@ e_charset_dialog (const char *title, const char *prompt,
 	gtk_box_pack_start (GTK_BOX (hbox), picker, TRUE, TRUE, 0);
 	gtk_widget_show (picker);
 
-	gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 0);
-	gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 12);
+	gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_content_area(dialog)), 0);
+	gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area(dialog)), 12);
 
 	gtk_widget_show_all (GTK_WIDGET (dialog));
 
diff --git a/pan/gui/group-pane.cc b/pan/gui/group-pane.cc
index 0edb243..e0a5df0 100644
--- a/pan/gui/group-pane.cc
+++ b/pan/gui/group-pane.cc
@@ -571,9 +571,16 @@ namespace
     return false;
   }
 
+#if !GTK_CHECK_VERSION(2,18,0)
+  bool gtk_widget_has_focus( GtkWidget *w)
+  {
+    return GTK_WIDGET_HAS_FOCUS(w);
+  }
+#endif
+
   void refresh_search_entry (GtkWidget * w)
   {
-    if (search_text.empty() && !GTK_WIDGET_HAS_FOCUS(w))
+    if (search_text.empty() && !gtk_widget_has_focus(w))
     {
       GdkColor c;
       c.pixel = 0;
diff --git a/pan/gui/group-prefs-dialog.cc b/pan/gui/group-prefs-dialog.cc
index 444beca..70fd3f5 100644
--- a/pan/gui/group-prefs-dialog.cc
+++ b/pan/gui/group-prefs-dialog.cc
@@ -39,6 +39,13 @@ namespace
   {
     delete static_cast<GroupPrefsDialog*>(castme);
   }
+
+#if !GTK_CHECK_VERSION(2,18,0)
+  bool gtk_widget_get_sensitive( GtkWidget *w)
+  {
+    return GTK_WIDGET_SENSITIVE(w);
+  }
+#endif
 }
 
 void
@@ -50,7 +57,7 @@ GroupPrefsDialog :: save_from_gui ()
 
   // posting profile...
   std::string profile;
-  if (GTK_WIDGET_SENSITIVE (_profile)) {
+  if (gtk_widget_get_sensitive (_profile)) {
     char * pch (gtk_combo_box_get_active_text (GTK_COMBO_BOX(_profile)));
     _group_prefs.set_string (_group, "posting-profile", pch);
     g_free (pch);
@@ -141,9 +148,9 @@ GroupPrefsDialog :: GroupPrefsDialog (Data         & data,
     HIG :: workarea_add_row (t, &row, _("Directory for _saving attachments:"), w);
     w = _profile = create_profiles_combo_box (data, group, group_prefs);
     l = HIG :: workarea_add_row (t, &row, _("Posting _profile:"), w);
-    gtk_widget_set_sensitive (l, GTK_WIDGET_SENSITIVE(w));
+    gtk_widget_set_sensitive (l, gtk_widget_get_sensitive(w));
 
   gtk_widget_show_all (t);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), t, true, true, 0);
+  gtk_box_pack_start ( GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG( dialog))), t, true, true, 0);
   _root = dialog;
 }
diff --git a/pan/gui/group-prefs-dialog.h b/pan/gui/group-prefs-dialog.h
index db73df0..3f5f9de 100644
--- a/pan/gui/group-prefs-dialog.h
+++ b/pan/gui/group-prefs-dialog.h
@@ -22,7 +22,7 @@
 
 #include <pan/general/quark.h>
 #include <pan/data/data.h>
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
 #include "group-prefs.h"
 
 namespace pan
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index ba51f9f..79843ff 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -106,7 +106,11 @@ namespace
 
   void toggle_visible (GtkWidget * w)
   {
+#if GTK_CHECK_VERSION(2,18,0)
+    set_visible (w, !gtk_widget_get_visible(w));
+#else
     set_visible (w, !GTK_WIDGET_VISIBLE(w));
+#endif
   }
 }
 
@@ -338,8 +342,8 @@ GUI :: ~GUI ()
   if (vpane)
     _prefs.set_int ("main-window-vpane-position", gtk_paned_get_position(GTK_PANED(vpane)));
 
-  const bool maximized = GTK_WIDGET(_root)->window
-                      && (gdk_window_get_state(_root->window) & GDK_WINDOW_STATE_MAXIMIZED);
+  const bool maximized = gtk_widget_get_window(_root)
+                      && (gdk_window_get_state( gtk_widget_get_window(_root)) & GDK_WINDOW_STATE_MAXIMIZED);
   _prefs.set_flag ("main-window-is-maximized", maximized);
 
   _prefs.remove_listener (this);
@@ -373,7 +377,7 @@ void
 GUI :: watch_cursor_on ()
 {
   GdkCursor * cursor = gdk_cursor_new (GDK_WATCH);
-  gdk_window_set_cursor (_root->window, cursor);
+  gdk_window_set_cursor ( gtk_widget_get_window(_root), cursor);
   gdk_cursor_unref (cursor);
   while (gtk_events_pending ())
     gtk_main_iteration ();
@@ -382,7 +386,7 @@ GUI :: watch_cursor_on ()
 void
 GUI :: watch_cursor_off ()
 {
-  gdk_window_set_cursor (_root->window, NULL);
+  gdk_window_set_cursor ( gtk_widget_get_window(_root), NULL);
 }
 
 /***
@@ -778,21 +782,21 @@ void GUI :: do_show_profiles_dialog ()
 void GUI :: do_jump_to_group_tab ()
 {
   toggle_action ("tabbed-layout", true);
-  GtkNotebook * n (GTK_NOTEBOOK (GTK_BIN (_workarea_bin)->child));
+  GtkNotebook * n (GTK_NOTEBOOK (gtk_bin_get_child( GTK_BIN (_workarea_bin))));
   gtk_notebook_set_current_page (n, 0);
 }
 
 void GUI :: do_jump_to_header_tab ()
 {
   toggle_action ("tabbed-layout", true);
-  GtkNotebook * n (GTK_NOTEBOOK (GTK_BIN (_workarea_bin)->child));
+  GtkNotebook * n (GTK_NOTEBOOK (gtk_bin_get_child( GTK_BIN (_workarea_bin))));
   gtk_notebook_set_current_page (n, 1);
 }
 
 void GUI :: do_jump_to_body_tab ()
 {
   toggle_action ("tabbed-layout", true);
-  GtkNotebook * n (GTK_NOTEBOOK (GTK_BIN (_workarea_bin)->child));
+  GtkNotebook * n (GTK_NOTEBOOK (gtk_bin_get_child( GTK_BIN (_workarea_bin))));
   gtk_notebook_set_current_page (n, 2);
 }
 
@@ -1264,8 +1268,9 @@ namespace
 {
   void remove_from_parent (GtkWidget * w)
   {
-    if (w->parent != 0)
-      gtk_container_remove (GTK_CONTAINER(w->parent), w);
+    GtkWidget *parent = gtk_widget_get_parent(w);
+    if (parent != 0)
+      gtk_container_remove (GTK_CONTAINER(parent), w);
   }
 
   enum { HORIZONTAL, VERTICAL };
@@ -1403,7 +1408,7 @@ void GUI :: do_tabbed_layout (bool tabbed)
   set_visible (body_w, is_action_active("show-body-pane"));
 
   if (tabbed)
-    gtk_notebook_set_current_page (GTK_NOTEBOOK(GTK_BIN(_workarea_bin)->child), 0);
+    gtk_notebook_set_current_page (GTK_NOTEBOOK( gtk_bin_get_child( GTK_BIN(_workarea_bin))), 0);
 }
 
 void GUI :: do_show_group_pane (bool b)
diff --git a/pan/gui/gui.h b/pan/gui/gui.h
index b8ec1a6..1cf817e 100644
--- a/pan/gui/gui.h
+++ b/pan/gui/gui.h
@@ -30,6 +30,12 @@
 #include <pan/gui/group-prefs.h>
 #include <pan/gui/wait.h>
 
+#ifdef GTK_DISABLE_DEPRECATED
+#if GTK_CHECK_VERSION(2,22,0)
+#define GtkNotebookPage void
+#endif
+#endif
+
 namespace pan
 {
   class GroupPane;
diff --git a/pan/gui/header-pane.cc b/pan/gui/header-pane.cc
index 960896f..f2fa81e 100644
--- a/pan/gui/header-pane.cc
+++ b/pan/gui/header-pane.cc
@@ -545,8 +545,11 @@ HeaderPane :: set_group (const Quark& new_group)
       _atree->add_listener (this);
 
       rebuild ();
-
+#ifndef GTK_WIDGET_REALIZED
+      if (gtk_widget_get_realized(_tree_view))
+#else
       if (GTK_WIDGET_REALIZED(_tree_view))
+#endif
         gtk_tree_view_scroll_to_point (GTK_TREE_VIEW(_tree_view), 0, 0);
     }
   }
@@ -1201,9 +1204,16 @@ namespace
     return false;
   }
 
+#if !GTK_CHECK_VERSION(2,18,0)
+  bool gtk_widget_has_focus( GtkWidget *w)
+  {
+    return GTK_WIDGET_HAS_FOCUS(w);
+  }
+#endif
+
   void refresh_search_entry (GtkWidget * w)
   {
-    if (search_text.empty() && !GTK_WIDGET_HAS_FOCUS(w))
+    if (search_text.empty() && !gtk_widget_has_focus(w))
     {
       GdkColor c;
       c.pixel = 0;
diff --git a/pan/gui/log-ui.cc b/pan/gui/log-ui.cc
index 5c863f0..05a4d72 100644
--- a/pan/gui/log-ui.cc
+++ b/pan/gui/log-ui.cc
@@ -222,7 +222,7 @@ pan :: log_dialog_new (Prefs& prefs, GtkWindow* window)
 
   gtk_widget_show (view);
   gtk_widget_show (scroll);
-  pan_box_pack_start_defaults (GTK_BOX(GTK_DIALOG(dialog)->vbox), scroll);
+  pan_box_pack_start_defaults (GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(dialog))), scroll);
 
   gtk_window_set_role (GTK_WINDOW(dialog), "pan-events-dialog");
   prefs.set_window ("events-window", GTK_WINDOW(dialog), 150, 150, 600, 300);
diff --git a/pan/gui/log-ui.h b/pan/gui/log-ui.h
index 33a0222..c337b25 100644
--- a/pan/gui/log-ui.h
+++ b/pan/gui/log-ui.h
@@ -19,7 +19,7 @@
 #ifndef LOG_UI_H
 #define LOG_UI_H
 
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
 #include "prefs.h"
 
 namespace pan
diff --git a/pan/gui/pan-file-entry.h b/pan/gui/pan-file-entry.h
index b791ce1..fed7359 100644
--- a/pan/gui/pan-file-entry.h
+++ b/pan/gui/pan-file-entry.h
@@ -20,7 +20,7 @@
 #ifndef __PanFileEntry_h__
 #define __PanFileEntry_h__
 
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
 
 namespace pan
 {
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 1d3b732..bd9622f 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -655,11 +655,12 @@ PostUI :: maybe_post_message (GMimeMessage * message)
   char buf[512];
   g_snprintf (buf, sizeof(buf), "<b>%s</b>", _("Posting..."));
   GtkWidget * w = GTK_WIDGET (g_object_new (GTK_TYPE_LABEL, "use-markup", TRUE, "label", buf, NULL));
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(d)->vbox), w, false, false, PAD_SMALL);
+  GtkWidget *content = gtk_dialog_get_content_area(GTK_DIALOG(d));
+  gtk_box_pack_start (GTK_BOX(content), w, false, false, PAD_SMALL);
   w = gtk_progress_bar_new ();
   gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR(w), 0.05);
   const guint tag = g_timeout_add (100, pulse_me, w);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(d)->vbox), w, false, false, PAD_SMALL);
+  gtk_box_pack_start (GTK_BOX(content), w, false, false, PAD_SMALL);
   g_object_set_data_full (G_OBJECT(d), "progressbar-timeout-tag", GUINT_TO_POINTER(tag), remove_progress_tag);
   _post_dialog = d;
   g_signal_connect (_post_dialog, "destroy", G_CALLBACK(gtk_widget_destroyed), &_post_dialog);
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index 0467273..1adf6ff 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -591,6 +591,6 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
   gtk_notebook_append_page (GTK_NOTEBOOK(notebook), t, gtk_label_new_with_mnemonic(_("A_pplications")));
 
   gtk_widget_show_all (notebook);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), notebook, true, true, 0);
+  gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(dialog))), notebook, true, true, 0);
   _root = dialog;
 }
diff --git a/pan/gui/prefs.cc b/pan/gui/prefs.cc
index 220c2e8..971a1dc 100644
--- a/pan/gui/prefs.cc
+++ b/pan/gui/prefs.cc
@@ -222,8 +222,8 @@ Prefs :: window_size_allocated_cb (GtkWidget      * widget,
 {
   const char * key ((const char*) g_object_get_data (G_OBJECT(widget), PREFS_WIDGET_KEY));
 
-  const bool maximized = GTK_WIDGET(widget)->window
-                      && (gdk_window_get_state(widget->window) & GDK_WINDOW_STATE_MAXIMIZED);
+  const bool maximized = gtk_widget_get_window(widget)
+                      && (gdk_window_get_state(gtk_widget_get_window(widget)) & GDK_WINDOW_STATE_MAXIMIZED);
   if (!maximized)
   {
     int x(0), y(0);
diff --git a/pan/gui/profiles-dialog.cc b/pan/gui/profiles-dialog.cc
index 08df307..0dc3e6f 100644
--- a/pan/gui/profiles-dialog.cc
+++ b/pan/gui/profiles-dialog.cc
@@ -205,7 +205,7 @@ ProfileDialog :: ProfileDialog (const Data         & data,
 
   on_sig_file_toggled (GTK_TOGGLE_BUTTON(_signature_file_check), _signature_file);
   on_sig_file_toggled (GTK_TOGGLE_BUTTON(_signature_file_check), _signature_file_combo);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(_root)->vbox), t, true, true, 0);
+  gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(_root))), t, true, true, 0);
   gtk_widget_show_all (t);
 
   if (parent != 0) {
@@ -447,7 +447,7 @@ ProfilesDialog :: ProfilesDialog (const Data& data, Profiles &profiles, GtkWindo
   // workarea
   GtkWidget * hbox = gtk_hbox_new (false, PAD);
   gtk_container_set_border_width (GTK_CONTAINER(hbox), PAD_BIG);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(_root)->vbox), hbox, true, true, 0);
+  gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(_root))), hbox, true, true, 0);
 
   // create the list
   GtkWidget * w = _view = gtk_tree_view_new ();
diff --git a/pan/gui/progress-view.h b/pan/gui/progress-view.h
index f5cdba3..de0d917 100644
--- a/pan/gui/progress-view.h
+++ b/pan/gui/progress-view.h
@@ -20,7 +20,7 @@
 #ifndef __Progress_View_h__
 #define __Progress_View_h__
 
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
 #include <pan/general/progress.h>
 
 namespace pan
diff --git a/pan/gui/save-ui.cc b/pan/gui/save-ui.cc
index db4ab82..a29ec8d 100644
--- a/pan/gui/save-ui.cc
+++ b/pan/gui/save-ui.cc
@@ -324,7 +324,7 @@ SaveDialog :: SaveDialog (Prefs                       & prefs,
   w = HIG :: workarea_add_row (t, &row, _("_Priority:"), w);
 
   gtk_widget_show_all (t);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), t, true, true, 0);
+  gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(dialog))), t, true, true, 0);
   gtk_widget_grab_focus (focus);
   _root = dialog;
 }
diff --git a/pan/gui/save-ui.h b/pan/gui/save-ui.h
index 2b5ad9c..0ac695e 100644
--- a/pan/gui/save-ui.h
+++ b/pan/gui/save-ui.h
@@ -26,7 +26,7 @@
 #include <pan/data/article.h>
 #include <pan/data/article-cache.h>
 #include <pan/data/data.h>
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
 #include "group-prefs.h"
 #include "prefs.h"
 
diff --git a/pan/gui/score-add-ui.cc b/pan/gui/score-add-ui.cc
index 35b89d2..ab8604f 100644
--- a/pan/gui/score-add-ui.cc
+++ b/pan/gui/score-add-ui.cc
@@ -619,7 +619,7 @@ ScoreAddDialog :: ScoreAddDialog (Data           & data,
 
   int row = 0;
   GtkWidget * t = HIG :: workarea_create ();
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(_root)->vbox), t, true, true, 0);
+  gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(_root))), t, true, true, 0);
   HIG::workarea_add_section_title (t, &row, _("New Scoring Rule"));
     HIG::workarea_add_section_spacer (t, row, 4);
 
diff --git a/pan/gui/score-add-ui.h b/pan/gui/score-add-ui.h
index 7c216b9..0b43d92 100644
--- a/pan/gui/score-add-ui.h
+++ b/pan/gui/score-add-ui.h
@@ -1,8 +1,7 @@
 #ifndef __SCORE_ADD_UI_H__
 #define __SCORE_ADD_UI_H__
 
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
 #include <pan/data/article.h>
 #include <pan/data/data.h>
 
diff --git a/pan/gui/score-view-ui.cc b/pan/gui/score-view-ui.cc
index edec714..e4ce49a 100644
--- a/pan/gui/score-view-ui.cc
+++ b/pan/gui/score-view-ui.cc
@@ -193,7 +193,7 @@ ScoreView :: ScoreView (Data& data, GtkWindow* parent,
   // workarea
   GtkWidget * hbox = gtk_hbox_new (FALSE, PAD);
   gtk_container_set_border_width (GTK_CONTAINER(hbox), 12);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(w)->vbox), hbox, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(w))), hbox, TRUE, TRUE, 0);
   gtk_widget_show (hbox);
 
   // create the list store & view
diff --git a/pan/gui/server-ui.cc b/pan/gui/server-ui.cc
index 5220ca3..15237a4 100644
--- a/pan/gui/server-ui.cc
+++ b/pan/gui/server-ui.cc
@@ -218,7 +218,7 @@ pan :: server_edit_dialog_new (Data& data, Queue& queue, GtkWindow * window, con
 
   int row (0);
   GtkWidget * t (HIG::workarea_create ());
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(d->dialog)->vbox), t, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(d->dialog))), t, TRUE, TRUE, 0);
   HIG::workarea_add_section_title (t, &row, _("Location"));
     HIG::workarea_add_section_spacer (t, row, 2);
 
@@ -501,7 +501,7 @@ pan :: server_list_dialog_new (Data& data, Queue& queue, GtkWindow* parent)
   // workarea
   GtkWidget * hbox = gtk_hbox_new (FALSE, PAD);
   gtk_container_set_border_width (GTK_CONTAINER(hbox), 12);
-  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(w)->vbox), hbox, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(w))), hbox, TRUE, TRUE, 0);
 
 
   // create the list
diff --git a/pan/gui/server-ui.h b/pan/gui/server-ui.h
index 1e3c62e..2201976 100644
--- a/pan/gui/server-ui.h
+++ b/pan/gui/server-ui.h
@@ -20,7 +20,7 @@
 #ifndef SERVER_UI_H
 #define SERVER_UI_H
 
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
 #include <pan/data/data.h>
 #include <pan/tasks/queue.h>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]