[PATCH] Enable compilation on GTK 2.20 and above



This patch adds support for compilation on GTK version 2.20 and above,
by getting rid of the deprecated/unsupported APIs

Compile tested on Ubuntu 10.04

Signed-off-by: Ashutosh Naik <ashutosh naik gmail com>
Index: src/ephy-fullscreen-popup.c
===================================================================
--- src/ephy-fullscreen-popup.c	(revision 8959)
+++ src/ephy-fullscreen-popup.c	(working copy)
@@ -102,7 +102,7 @@
 {
 	EphyFullscreenPopupPrivate *priv = popup->priv;
 
-	if (priv->spinning && GTK_WIDGET_VISIBLE (popup))
+	if (priv->spinning && gtk_widget_get_visible (popup))
 	{
 		ephy_spinner_start (priv->spinner);
 	}
@@ -345,7 +345,7 @@
 
 	GTK_WIDGET_CLASS (ephy_fullscreen_popup_parent_class)->size_request (widget, requisition);
 
-	if (GTK_WIDGET_REALIZED (widget))
+	if (gtk_widget_get_realized (widget))
 	{
 		ephy_fullscreen_popup_update_position (popup);
 	}
Index: src/ephy-statusbar.c
===================================================================
--- src/ephy-statusbar.c	(revision 8959)
+++ src/ephy-statusbar.c	(working copy)
@@ -265,7 +265,7 @@
 		 GParamSpec *pspec,
 		 GtkWidget *separator)
 {
-	if (GTK_WIDGET_VISIBLE (widget))
+	if (gtk_widget_get_visible (widget))
 	{
 		gtk_widget_show (separator);
 	}
Index: src/ephy-notebook.c
===================================================================
--- src/ephy-notebook.c	(revision 8959)
+++ src/ephy-notebook.c	(working copy)
@@ -270,7 +270,7 @@
 		tab = gtk_notebook_get_tab_label (nb, page);
 		g_return_val_if_fail (tab != NULL, -1);
 
-		if (!GTK_WIDGET_MAPPED (GTK_WIDGET (tab)))
+		if (!gtk_widget_get_mapped (GTK_WIDGET (tab)))
 		{
 			page_num++;
 			continue;
Index: src/ephy-find-toolbar.c
===================================================================
--- src/ephy-find-toolbar.c	(revision 8959)
+++ src/ephy-find-toolbar.c	(working copy)
@@ -196,7 +196,7 @@
 	if (ephy_window_get_is_print_preview (priv->window)) return FALSE;
 
 	/* check for / and ' which open the find toolbar in text resp. link mode */
-	if (GTK_WIDGET_VISIBLE (widget) == FALSE)
+	if (gtk_widget_get_visible (widget) == FALSE)
 	{
 		if (event->keyval == GDK_slash)
 		{
@@ -808,7 +808,7 @@
 	EphyFindToolbarPrivate *priv = toolbar->priv;
 	FindAgainCBStruct *data;
 
-	if (!GTK_WIDGET_VISIBLE (widget)) {
+	if (!gtk_widget_get_visible (widget)) {
 		gtk_widget_show (widget);
 		gtk_widget_grab_focus (widget);
 	}
@@ -837,7 +837,7 @@
 	EphyFindToolbarPrivate *priv = toolbar->priv;
 	FindAgainCBStruct *data;
 
-	if (!GTK_WIDGET_VISIBLE (widget)) {
+	if (!gtk_widget_get_visible (widget)) {
 		gtk_widget_show (widget);
 		gtk_widget_grab_focus (widget);
 	}
@@ -897,7 +897,7 @@
 void
 ephy_find_toolbar_request_close (EphyFindToolbar *toolbar)
 {
-	if (GTK_WIDGET_VISIBLE (GTK_WIDGET (toolbar)))
+	if (gtk_widget_get_visible (GTK_WIDGET (toolbar)))
 	{
 		g_signal_emit (toolbar, signals[CLOSE], 0);
 	}
Index: src/ephy-window.c
===================================================================
--- src/ephy-window.c	(revision 8959)
+++ src/ephy-window.c	(working copy)
@@ -994,7 +994,7 @@
 		menubar = gtk_ui_manager_get_widget (window->priv->manager, "/menubar");
 		g_return_val_if_fail (menubar != NULL , FALSE);
 
-		if (!GTK_WIDGET_VISIBLE (menubar))
+		if (!gtk_widget_get_visible (menubar))
 		{
 			g_signal_connect (menubar, "deactivate",
 					  G_CALLBACK (menubar_deactivate_cb), window);
@@ -2642,8 +2642,8 @@
 		}
 			
 		g_utf8_strncpy (text, pango_layout_get_text (layout), item->num_chars);
-		bg = widget->style->bg[GTK_WIDGET_STATE(widget)];
-		fg = widget->style->fg[GTK_WIDGET_STATE(widget)];
+		bg = widget->style->bg[gtk_widget_get_state(widget)];
+		fg = widget->style->fg[gtk_widget_get_state(widget)];
 
 		script = g_strdup_printf(add_node_string,
 					 (int) (bg.red / 65535. * 255),
Index: lib/egg/egg-editable-toolbar.c
===================================================================
--- lib/egg/egg-editable-toolbar.c	(revision 8959)
+++ lib/egg/egg-editable-toolbar.c	(working copy)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- *  $Id: egg-editable-toolbar.c 925 2009-01-23 17:58:16Z xan $
+ *  $Id$
  */
 
 #include "config.h"
@@ -856,7 +856,7 @@
   
   priv->visibility_id = gtk_ui_manager_new_merge_id (priv->manager);
   
-  showing = GTK_WIDGET_VISIBLE (etoolbar);
+  showing = gtk_widget_get_visible (etoolbar);
   
   n_toolbars = egg_toolbars_model_n_toolbars (priv->model);
   for (i = 0; i < n_toolbars; i++)
@@ -938,7 +938,7 @@
       gtk_action_set_visible (GTK_ACTION (action), (egg_toolbars_model_get_flags (priv->model, i) 
 						    & EGG_TB_MODEL_NOT_REMOVABLE) == 0);
       gtk_action_set_sensitive (GTK_ACTION (action), showing);
-      gtk_toggle_action_set_active (action, GTK_WIDGET_VISIBLE
+      gtk_toggle_action_set_active (action, gtk_widget_get_visible
 				    (get_dock_nth (etoolbar, i)));
       
       for (list = priv->visibility_paths; list != NULL; list = g_list_next (list))
Index: lib/ephy-state.c
===================================================================
--- lib/ephy-state.c	(revision 8959)
+++ lib/ephy-state.c	(working copy)
@@ -166,7 +166,7 @@
 	g_return_if_fail (GTK_IS_WINDOW (window));
 
 	/* Setting the default size doesn't work when the window is already showing. */
-	g_return_if_fail (!GTK_WIDGET_VISIBLE (window));
+	g_return_if_fail (!gtk_widget_get_visible (window));
 
 	maximize = ephy_node_get_property_boolean (node, EPHY_NODE_STATE_PROP_MAXIMIZE);
 	size = ephy_node_get_property_boolean (node, EPHY_NODE_STATE_PROP_POSITION);
Index: lib/ephy-gui.c
===================================================================
--- lib/ephy-gui.c	(revision 8959)
+++ lib/ephy-gui.c	(working copy)
@@ -140,7 +140,7 @@
 	gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
 
 	gdk_window_get_origin (widget->window, x, y);
-	if (GTK_WIDGET_NO_WINDOW (widget))
+	if (gtk_widget_get_has_window (widget))
 	{
 		*x += widget->allocation.x;
 		*y += widget->allocation.y;
@@ -205,7 +205,7 @@
 	gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
 
 	gdk_window_get_origin (widget->window, x, y);
-	if (GTK_WIDGET_NO_WINDOW (widget))
+	if (gtk_widget_get_has_window (widget))
 	{
 		*x += widget->allocation.x;
 		*y += widget->allocation.y;
Index: lib/widgets/ephy-location-entry.c
===================================================================
--- lib/widgets/ephy-location-entry.c	(revision 8959)
+++ lib/widgets/ephy-location-entry.c	(working copy)
@@ -775,7 +775,7 @@
 				   -1);
 
 	gdk_draw_rectangle (drawable,
-			    widget->style->base_gc [GTK_WIDGET_STATE (widget)],
+			    widget->style->base_gc [gtk_widget_get_state (widget)],
 			    TRUE,
 			    0, 0,
 			    pixmap_width + 1,
@@ -785,7 +785,7 @@
 	if (priv->favicon != NULL)
 	{
 		gdk_draw_pixbuf (drawable,
-				 widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+				 widget->style->fg_gc[gtk_widget_get_state (widget)],
 				 priv->favicon,
 				 0, 0, 
 				 1 + DRAG_ICON_LAYOUT_BORDER + DRAG_ICON_ICON_SPACING,
@@ -795,7 +795,7 @@
 	}
 
 	gdk_draw_layout (drawable,
-			 widget->style->text_gc [GTK_WIDGET_STATE (widget)],
+			 widget->style->text_gc [gtk_widget_get_state (widget)],
 			 1 + DRAG_ICON_LAYOUT_BORDER + offset_x,
 			 1 + DRAG_ICON_LAYOUT_BORDER,
 			 layout);
@@ -1276,7 +1276,7 @@
 	 * bug #155824. So we save the selection iff the clipboard was owned by
 	 * the location entry.
 	 */
-	if (GTK_WIDGET_REALIZED (GTK_WIDGET (priv->entry)))
+	if (gtk_widget_get_realized (GTK_WIDGET (priv->entry)))
 	{
 		clipboard = gtk_widget_get_clipboard (priv->entry,
 						      GDK_SELECTION_PRIMARY);
Index: lib/widgets/ephy-spinner.c
===================================================================
--- lib/widgets/ephy-spinner.c	(revision 8959)
+++ lib/widgets/ephy-spinner.c	(working copy)
@@ -619,7 +619,7 @@
 	int x_offset, y_offset, width, height;
 	GdkRectangle pix_area, dest;
 
-	if (!GTK_WIDGET_DRAWABLE (spinner))
+	if (!gtk_widget_is_drawable (spinner))
 	{
 		return FALSE;
 	}
@@ -889,7 +889,7 @@
 
 	details->spinning = TRUE;
 
-	if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)) &&
+	if (gtk_widget_get_mapped (GTK_WIDGET (spinner)) &&
 	    details->timer_task == 0 &&
 	    ephy_spinner_load_images (spinner))
 	{
@@ -924,7 +924,7 @@
 	{
 		ephy_spinner_remove_update_callback (spinner);
 
-		if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)))
+		if (gtk_widget_get_mapped (GTK_WIDGET (spinner)))
 		{
 			gtk_widget_queue_draw (GTK_WIDGET (spinner));
 		}
Index: embed/webkit/webkit-embed.c
===================================================================
--- embed/webkit/webkit-embed.c	(revision 8959)
+++ embed/webkit/webkit-embed.c	(working copy)
@@ -449,7 +449,7 @@
    * WebView or other widget as a parent window.
    */
   window = gtk_widget_get_toplevel (GTK_WIDGET(web_view));
-  if (!GTK_WIDGET_TOPLEVEL (window))
+  if (!gtk_widget_is_toplevel (window))
     window = NULL;
 
   dialog = ephy_file_chooser_new (_("Save"),
Index: embed/ephy-base-embed.c
===================================================================
--- embed/ephy-base-embed.c	(revision 8959)
+++ embed/ephy-base-embed.c	(working copy)
@@ -129,7 +129,7 @@
 
   child = GTK_BIN (widget)->child;
 
-  if (child && GTK_WIDGET_VISIBLE (child)) {
+  if (child && gtk_widget_get_visible (child)) {
     GtkRequisition child_requisition;
     gtk_widget_size_request (GTK_WIDGET (child), &child_requisition);
   }
@@ -792,7 +792,7 @@
   g_return_if_fail (new_embed != NULL);
 
   container = EPHY_EMBED_CONTAINER (gtk_widget_get_toplevel (GTK_WIDGET (new_embed)));
-  g_return_if_fail (container != NULL || !GTK_WIDGET_TOPLEVEL (container));
+  g_return_if_fail (container != NULL || !gtk_widget_is_toplevel (container));
 
   popups_manager_add_window (bembed, container);
 }


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