[yelp] Use accessor functions instead direct access.



commit 5c43a73ccaeca8ec6c8a7187c279f1e0501168c9
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Dec 9 05:14:34 2009 +0100

    Use accessor functions instead direct access.
    
    Also, bump GTK+ version to 2.18
    
    https://bugzilla.gnome.org/show_bug.cgi?id=585115

 configure.in         |    2 +-
 src/gtkentryaction.c |    8 ++++----
 src/yelp-base.c      |    5 +++--
 src/yelp-print.c     |    2 +-
 src/yelp-window.c    |   15 +++++++++------
 5 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/configure.in b/configure.in
index e796e01..b70d9d7 100644
--- a/configure.in
+++ b/configure.in
@@ -71,7 +71,7 @@ PKG_CHECK_MODULES(YELP,
 	gconf-2.0
 	gnome-doc-utils >= 0.17.2
 	gtk+-unix-print-2.0
-	gtk+-2.0 >= 2.10.0
+	gtk+-2.0 >= 2.18.0
 	libxml-2.0 >= 2.6.5
 	libxslt >= 1.1.4
 	libexslt >= 0.8.1
diff --git a/src/gtkentryaction.c b/src/gtkentryaction.c
index 2537876..a8b2bf6 100644
--- a/src/gtkentryaction.c
+++ b/src/gtkentryaction.c
@@ -160,9 +160,10 @@ static void
 changed_cb (GtkEntry *entry, GtkEntryAction *action)
 {
   const char *text;
-  GtkWidget *proxy = GTK_WIDGET (entry)->parent;
+  GtkWidget *proxy;
 
   text = gtk_entry_get_text (entry);
+  proxy = gtk_widget_get_parent (GTK_WIDGET (entry));
 
   g_signal_handlers_block_by_func (action, G_CALLBACK (sync_text), proxy);
   gtk_entry_action_set_text (action, text);
@@ -351,7 +352,6 @@ gboolean
 gtk_entry_action_has_focus (GtkEntryAction *action)
 {
   g_return_val_if_fail (GTK_IS_ENTRY_ACTION (action), FALSE);
-  
-  return (GTK_WIDGET_HAS_FOCUS (action->priv->entry_widget));
-  
+
+  return (gtk_widget_has_focus (action->priv->entry_widget));
 }
diff --git a/src/yelp-base.c b/src/yelp-base.c
index c702a99..05334dd 100644
--- a/src/yelp-base.c
+++ b/src/yelp-base.c
@@ -243,13 +243,14 @@ yelp_base_new_window (YelpBase *base, const gchar *uri, const gchar *startup_id)
 		if (strncmp (sn_launchee_context_get_startup_id (context), 
 			     "_TIME", 5) != 0)
 			sn_launchee_context_setup_window (context,
-					 GDK_WINDOW_XWINDOW (window->window));
+					 GDK_WINDOW_XWINDOW (gtk_widget_get_window (window)));
 
 		if (sn_launchee_context_get_id_has_timestamp (context)) {
 			gulong time;
 
 			time = sn_launchee_context_get_timestamp (context);
-			gdk_x11_window_set_user_time (window->window, time);
+			gdk_x11_window_set_user_time (gtk_widget_get_window (window),
+						      time);
 		}		
 	}
 	        
diff --git a/src/yelp-print.c b/src/yelp-print.c
index 5bceef7..1f194c0 100644
--- a/src/yelp-print.c
+++ b/src/yelp-print.c
@@ -365,7 +365,7 @@ yelp_print_present_status_dialog (YelpWindow *window, YelpPrintInfo *info)
     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (info->dialog),
 					      _("Waiting to print"));
     info->progress = gtk_progress_bar_new ();
-    gtk_container_add (GTK_CONTAINER (GTK_DIALOG(info->dialog)->vbox),
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (info->dialog))),
 		       info->progress);
 
     gtk_widget_show (info->progress);
diff --git a/src/yelp-window.c b/src/yelp-window.c
index 58afc0a..98b42f2 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -919,8 +919,8 @@ page_request_cb (YelpDocument       *document,
 
 	window->priv->current_request = -1;
 	yelp_page_free ((YelpPage *) func_data);
-	gdk_window_set_cursor (GTK_WIDGET (window)->window, NULL);
-
+	gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)),
+	                       NULL);
 	g_free (data);
 	break;
     case YELP_DOCUMENT_SIGNAL_TITLE:
@@ -934,7 +934,8 @@ page_request_cb (YelpDocument       *document,
 	window_error (window, (gchar *) yelp_error_get_title (error),
 		      (gchar *) yelp_error_get_message (error), FALSE);
 	yelp_error_free (error);
-	gdk_window_set_cursor (GTK_WIDGET (window)->window, NULL);
+	gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)),
+			       NULL);
 	break;
     default:
 	g_assert_not_reached();
@@ -1500,7 +1501,7 @@ window_key_event_cb (GtkWidget *widget, GdkEventKey *event,
 {
     if ((window->priv->search_action &&
 	 gtk_entry_action_has_focus ((GtkEntryAction *) window->priv->search_action)) ||
-	GTK_WIDGET_HAS_FOCUS (window->priv->find_entry))
+	gtk_widget_has_focus (window->priv->find_entry))
 	return FALSE;
 
     if (event->keyval == GDK_slash) {
@@ -1771,7 +1772,8 @@ window_do_load_html (YelpWindow    *window,
         g_object_unref (stream);
 
     g_free (real_uri);
-    gdk_window_set_cursor (GTK_WIDGET (window)->window, NULL);
+    gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)),
+                           NULL);
 
     return handled;
 }
@@ -1789,7 +1791,8 @@ window_set_loading (YelpWindow *window)
     priv = window->priv;
 
     cursor = gdk_cursor_new (GDK_WATCH);
-    gdk_window_set_cursor (GTK_WIDGET (window)->window, cursor);
+    gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)),
+                           cursor);
     gdk_cursor_unref (cursor);
 
     action = gtk_action_group_get_action (priv->action_group, "GoPrevious");



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