diff options
author | Javier Jardón <javierjc1982@gmail.com> | 2009-09-22 17:27:30 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-09-22 17:33:15 +0800 |
commit | 0eadd147c38a58cd235571d228e393216416cd3e (patch) | |
tree | 943359c4cb4d5ac6dcf797684322d5926f4c5c6a | |
parent | f279bbf2de2896f39ef08e52961e8638b9f1a29b (diff) | |
download | gsoc2013-epiphany-0eadd147c38a58cd235571d228e393216416cd3e.tar.gz gsoc2013-epiphany-0eadd147c38a58cd235571d228e393216416cd3e.tar.zst gsoc2013-epiphany-0eadd147c38a58cd235571d228e393216416cd3e.zip |
GTK+ 2.17.11 is now the required version
I've used all the GTK+ 2.17.11 api available, still missing:
GTK_WIDGET_REALIZED (GTK_WIDGET ())
GTK_WIDGET_MAPPED (GTK_WIDGET ())
GTK_ENTRY->im_context
GTK_STATUSBAR->frame
GTK_STATUSBAR->label
GTK_MESSAGE_DIALOG->label
https://bugzilla.gnome.org/show_bug.cgi?id=595791
Signed-off-by: Xan Lopez <xan@gnome.org>
33 files changed, 252 insertions, 177 deletions
diff --git a/configure.ac b/configure.ac index 91da95078..00c2a8922 100644 --- a/configure.ac +++ b/configure.ac @@ -94,7 +94,7 @@ if test "$enable_maintainer_mode" = "yes"; then fi GLIB_REQUIRED=2.19.7 -GTK_REQUIRED=2.16.0 +GTK_REQUIRED=2.17.11 LIBXML_REQUIRED=2.6.12 LIBXSLT_REQUIRED=1.1.7 LIBSTARTUP_NOTIFICATION_REQUIRED=0.5 diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index c1b4e3369..5f338c5ad 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -437,7 +437,7 @@ request_destination_uri (WebKitWebView *web_view, * 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"), @@ -647,7 +647,7 @@ confirm_action_from_mime (WebKitWebView *web_view, int default_response; parent_window = gtk_widget_get_toplevel (GTK_WIDGET(web_view)); - if (!GTK_WIDGET_TOPLEVEL (parent_window)) + if (!gtk_widget_is_toplevel (parent_window)) parent_window = NULL; /* FIXME: we still have no way of getting the content type from diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 4e93733ab..bb5ce6bb3 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -163,6 +163,7 @@ popups_manager_new_window_info (EphyEmbedContainer *container) { EphyEmbed *embed; EphyWebViewChrome chrome; + GtkAllocation allocation; gboolean is_popup; char *features; @@ -172,10 +173,12 @@ popups_manager_new_window_info (EphyEmbedContainer *container) embed = ephy_embed_container_get_active_child (container); g_return_val_if_fail (embed != NULL, g_strdup ("")); + gtk_widget_get_allocation (GTK_WIDGET (embed), &allocation); + features = g_strdup_printf ("width=%d,height=%d,menubar=%d,status=%d,toolbar=%d", - GTK_WIDGET (embed)->allocation.width, - GTK_WIDGET (embed)->allocation.height, + allocation.width, + allocation.height, (chrome & EPHY_WEB_VIEW_CHROME_MENUBAR) > 0, (chrome & EPHY_WEB_VIEW_CHROME_STATUSBAR) > 0, (chrome & EPHY_WEB_VIEW_CHROME_TOOLBAR) > 0); @@ -970,7 +973,7 @@ ge_new_window_cb (EphyWebView *view, g_return_if_fail (new_view != NULL); container = EPHY_EMBED_CONTAINER (gtk_widget_get_toplevel (GTK_WIDGET (new_view))); - g_return_if_fail (container != NULL || !GTK_WIDGET_TOPLEVEL (container)); + g_return_if_fail (container != NULL || !gtk_widget_is_toplevel (GTK_WIDGET (container))); popups_manager_add_window (view, container); } diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index ba1a80756..10906c349 100644 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -100,7 +100,7 @@ get_dock_position (EggEditableToolbar *etoolbar, static int get_toolbar_position (EggEditableToolbar *etoolbar, GtkWidget *toolbar) { - return get_dock_position (etoolbar, toolbar->parent); + return get_dock_position (etoolbar, gtk_widget_get_parent (toolbar)); } static int @@ -176,15 +176,17 @@ drag_data_delete_cb (GtkWidget *widget, GdkDragContext *context, EggEditableToolbar *etoolbar) { + GtkWidget *parent; int pos, toolbar_pos; widget = gtk_widget_get_ancestor (widget, GTK_TYPE_TOOL_ITEM); g_return_if_fail (widget != NULL); g_return_if_fail (EGG_IS_EDITABLE_TOOLBAR (etoolbar)); - pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (widget->parent), + parent = gtk_widget_get_parent (widget); + pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (parent), GTK_TOOL_ITEM (widget)); - toolbar_pos = get_toolbar_position (etoolbar, widget->parent); + toolbar_pos = get_toolbar_position (etoolbar, parent); egg_toolbars_model_remove_item (etoolbar->priv->model, toolbar_pos, pos); @@ -260,6 +262,7 @@ drag_data_get_cb (GtkWidget *widget, EggEditableToolbar *etoolbar) { EggToolbarsModel *model; + GdkAtom target; const char *name; char *data; @@ -272,11 +275,12 @@ drag_data_get_cb (GtkWidget *widget, name = g_object_get_data (G_OBJECT (gtk_widget_get_parent (widget)), EGG_ITEM_NAME); g_return_if_fail (name != NULL); } - - data = egg_toolbars_model_get_data (model, selection_data->target, name); + + target = gtk_selection_data_get_target (selection_data); + data = egg_toolbars_model_get_data (model, target, name); if (data != NULL) { - gtk_selection_data_set (selection_data, selection_data->target, 8, (unsigned char *)data, strlen (data)); + gtk_selection_data_set (selection_data, target, 8, (unsigned char *)data, strlen (data)); g_free (data); } } @@ -308,10 +312,12 @@ remove_item_cb (GtkAction *action, EggEditableToolbar *etoolbar) { GtkWidget *toolitem = gtk_widget_get_ancestor (egg_editable_toolbar_get_selected (etoolbar), GTK_TYPE_TOOL_ITEM); + GtkWidget *parent; int pos, toolbar_pos; - - toolbar_pos = get_toolbar_position (etoolbar, toolitem->parent); - pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (toolitem->parent), + + parent = gtk_widget_get_parent (toolitem); + toolbar_pos = get_toolbar_position (etoolbar, parent); + pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (parent), GTK_TOOL_ITEM (toolitem)); egg_toolbars_model_remove_item (etoolbar->priv->model, @@ -419,8 +425,10 @@ configure_item_cursor (GtkToolItem *item, { EggEditableToolbarPrivate *priv = etoolbar->priv; GtkWidget *widget = GTK_WIDGET (item); + GdkWindow *window; - if (widget->window != NULL) + window = gtk_widget_get_window (widget); + if (window != NULL) { if (priv->edit_mode > 0) { @@ -432,7 +440,7 @@ configure_item_cursor (GtkToolItem *item, cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen), GDK_HAND2); - gdk_window_set_cursor (widget->window, cursor); + gdk_window_set_cursor (window, cursor); gdk_cursor_unref (cursor); gtk_drag_source_set (widget, GDK_BUTTON1_MASK, dest_drag_types, @@ -498,7 +506,7 @@ configure_item_cursor (GtkToolItem *item, } else { - gdk_window_set_cursor (GTK_WIDGET(item)->window, NULL); + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET(item)), NULL); } } } @@ -642,15 +650,17 @@ toolbar_drag_data_received_cb (GtkToolbar *toolbar, * actually add a new item to the toolbar. */ - GdkAtom type = selection_data->type; - const char *data = (char *)selection_data->data; + GdkAtom type = gtk_selection_data_get_data_type (selection_data); + const char *data = (char *) gtk_selection_data_get_data (selection_data); int ipos = -1; + gint selection_data_length; char *name = NULL; gboolean used = FALSE; - + + selection_data_length = gtk_selection_data_get_length (selection_data); /* Find out where the drop is occuring, and the name of what is being dropped. */ - if (selection_data->length >= 0) + if (selection_data_length >= 0) { ipos = gtk_toolbar_get_drop_index (toolbar, x, y); name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, FALSE); @@ -679,7 +689,7 @@ toolbar_drag_data_received_cb (GtkToolbar *toolbar, etoolbar->priv->dnd_toolitem = NULL; /* If we don't have a name to use yet, try to create one. */ - if (name == NULL && selection_data->length >= 0) + if (name == NULL && selection_data_length >= 0) { name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, TRUE); } @@ -872,7 +882,7 @@ toolbar_visibility_refresh (EggEditableToolbar *etoolbar) priv->visibility_id = gtk_ui_manager_new_merge_id (priv->manager); - showing = GTK_WIDGET_VISIBLE (etoolbar); + showing = gtk_widget_get_visible (GTK_WIDGET (etoolbar)); n_toolbars = egg_toolbars_model_n_toolbars (priv->model); for (i = 0; i < n_toolbars; i++) @@ -954,8 +964,8 @@ toolbar_visibility_refresh (EggEditableToolbar *etoolbar) 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 - (get_dock_nth (etoolbar, i))); + 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)) { @@ -1078,7 +1088,7 @@ unparent_fixed (EggEditableToolbar *etoolbar) toolbar = etoolbar->priv->fixed_toolbar; dock = get_dock_nth (etoolbar, 0); - if (dock && toolbar->parent != NULL) + if (dock && (gtk_widget_get_parent (toolbar) != NULL)) { gtk_container_remove (GTK_CONTAINER (dock), toolbar); } @@ -1093,7 +1103,7 @@ update_fixed (EggEditableToolbar *etoolbar) toolbar = etoolbar->priv->fixed_toolbar; dock = get_dock_nth (etoolbar, 0); - if (dock && toolbar && toolbar->parent == NULL) + if (dock && toolbar && (gtk_widget_get_parent (toolbar) == NULL)) { gtk_box_pack_end (GTK_BOX (dock), toolbar, FALSE, TRUE, 0); @@ -1737,14 +1747,14 @@ fake_expose_widget (GtkWidget *widget, event.type = GDK_EXPOSE; event.window = pixmap; event.send_event = FALSE; - event.area = widget->allocation; + gtk_widget_get_allocation (widget, &event.area); event.region = NULL; event.count = 0; - tmp_window = widget->window; - widget->window = pixmap; + tmp_window = gtk_widget_get_window (widget); + gtk_widget_set_window (widget, pixmap); gtk_widget_send_expose (widget, (GdkEvent *) &event); - widget->window = tmp_window; + gtk_widget_set_window (widget, tmp_window); } /* We should probably experiment some more with this. @@ -1759,6 +1769,7 @@ new_pixbuf_from_widget (GtkWidget *widget) GdkPixbuf *pixbuf; GtkRequisition requisition; GtkAllocation allocation; + GtkStyle *style; GdkPixmap *pixmap; GdkVisual *visual; gint icon_width; @@ -1808,8 +1819,9 @@ new_pixbuf_from_widget (GtkWidget *widget) /* Draw the window */ gtk_widget_ensure_style (window); - g_assert (window->style); - g_assert (window->style->font_desc); + style = gtk_widget_get_style (window); + g_assert (style); + g_assert (style->font_desc); fake_expose_widget (window, pixmap); fake_expose_widget (widget, pixmap); diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index 39c007103..04810d7ad 100644 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -322,7 +322,8 @@ drag_data_get_cb (GtkWidget *widget, target = g_object_get_data (G_OBJECT (widget), "egg-item-name"); g_return_if_fail (target != NULL); - gtk_selection_data_set (selection_data, selection_data->target, 8, + gtk_selection_data_set (selection_data, + gtk_selection_data_get_target (selection_data), 8, (const guchar *) target, strlen (target)); } @@ -362,7 +363,7 @@ set_drag_cursor (GtkWidget *widget) cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen), GDK_HAND2); - gdk_window_set_cursor (widget->window, cursor); + gdk_window_set_cursor (gtk_widget_get_window (widget), cursor); gdk_cursor_unref (cursor); } @@ -631,11 +632,11 @@ update_editor_sheet (EggToolbarEditor *editor) g_ptr_array_free (items, TRUE); /* Delete old table. */ - viewport = GTK_BIN (editor->priv->scrolled_window)->child; + viewport = gtk_bin_get_child (GTK_BIN (editor->priv->scrolled_window)); if (viewport) { gtk_container_remove (GTK_CONTAINER (viewport), - GTK_BIN (viewport)->child); + gtk_bin_get_child (GTK_BIN (viewport))); } /* Add table to window. */ diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index 88f3ed6ba..3d2226d70 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -146,18 +146,18 @@ set_sensitivity (PropertyInfo *info, gboolean sensitive) for (l = list; l != NULL; l = l->next) { - sensitive = GTK_WIDGET_IS_SENSITIVE (GTK_WIDGET (l->data)) && sensitive; + sensitive = gtk_widget_is_sensitive (GTK_WIDGET (l->data)) && sensitive; gtk_widget_set_sensitive (GTK_WIDGET (l->data), sensitive); } } else if (info->widget_type == PT_EDITABLE) { - sensitive = GTK_WIDGET_IS_SENSITIVE (info->widget) && sensitive; + sensitive = gtk_widget_is_sensitive (info->widget) && sensitive; gtk_editable_set_editable (GTK_EDITABLE (info->widget), sensitive); } else { - sensitive = GTK_WIDGET_IS_SENSITIVE (info->widget) && sensitive; + sensitive = gtk_widget_is_sensitive (info->widget) && sensitive; gtk_widget_set_sensitive (info->widget, sensitive); } } diff --git a/lib/ephy-dnd.c b/lib/ephy-dnd.c index 64082dad3..79fa7a834 100644 --- a/lib/ephy-dnd.c +++ b/lib/ephy-dnd.c @@ -81,7 +81,7 @@ ephy_dnd_drag_data_get (GtkWidget *widget, GString *result = NULL; GdkAtom target; - target = selection_data->target; + target = gtk_selection_data_get_target (selection_data); if (target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE) || target == gdk_atom_intern (EPHY_DND_TEXT_TYPE, FALSE)) @@ -106,7 +106,7 @@ ephy_dnd_drag_data_get (GtkWidget *widget, } gtk_selection_data_set (selection_data, - selection_data->target, + target, 8, (const guchar *) result->str, result->len); g_string_free (result, TRUE); diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c index 1f9b94644..d16eac8fc 100644 --- a/lib/ephy-gui.c +++ b/lib/ephy-gui.c @@ -69,16 +69,18 @@ ephy_gui_menu_position_tree_selection (GtkMenu *menu, GtkTreeView *tree_view = GTK_TREE_VIEW (user_data); GtkWidget *widget = GTK_WIDGET (user_data); GtkRequisition req; + GtkAllocation allocation; GdkRectangle visible; gtk_widget_size_request (GTK_WIDGET (menu), &req); - gdk_window_get_origin (widget->window, x, y); + gdk_window_get_origin (gtk_widget_get_window (widget), x, y); + gtk_widget_get_allocation (widget, &allocation); - *x += (widget->allocation.width - req.width) / 2; + *x += (allocation.width - req.width) / 2; /* Add on height for the treeview title */ gtk_tree_view_get_visible_rect (tree_view, &visible); - *y += widget->allocation.height - visible.height; + *y += allocation.height - visible.height; selection = gtk_tree_view_get_selection (tree_view); selected_rows = gtk_tree_selection_get_selected_rows (selection, &model); @@ -121,7 +123,9 @@ ephy_gui_menu_position_under_widget (GtkMenu *menu, GtkWidget *container; GtkRequisition req; GtkRequisition menu_req; + GtkAllocation allocation; GdkRectangle monitor; + GdkWindow *window; int monitor_num; GdkScreen *screen; @@ -134,29 +138,31 @@ ephy_gui_menu_position_under_widget (GtkMenu *menu, gtk_widget_size_request (GTK_WIDGET (menu), &menu_req); screen = gtk_widget_get_screen (GTK_WIDGET (menu)); - monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window); + window = gtk_widget_get_window (widget); + monitor_num = gdk_screen_get_monitor_at_window (screen, window); if (monitor_num < 0) monitor_num = 0; gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); - gdk_window_get_origin (widget->window, x, y); - if (GTK_WIDGET_NO_WINDOW (widget)) + gtk_widget_get_allocation (widget, &allocation); + gdk_window_get_origin (window, x, y); + if (!gtk_widget_get_has_window (widget)) { - *x += widget->allocation.x; - *y += widget->allocation.y; + *x += allocation.x; + *y += allocation.y; } if (gtk_widget_get_direction (container) == GTK_TEXT_DIR_LTR) - *x += widget->allocation.width - req.width; + *x += allocation.width - req.width; else *x += req.width - menu_req.width; - if ((*y + widget->allocation.height + menu_req.height) <= monitor.y + monitor.height) - *y += widget->allocation.height; + if ((*y + allocation.height + menu_req.height) <= monitor.y + monitor.height) + *y += allocation.height; else if ((*y - menu_req.height) >= monitor.y) *y -= menu_req.height; - else if (monitor.y + monitor.height - (*y + widget->allocation.height) > *y) - *y += widget->allocation.height; + else if (monitor.y + monitor.height - (*y + allocation.height) > *y) + *y += allocation.height; else *y -= menu_req.height; @@ -186,6 +192,8 @@ ephy_gui_menu_position_on_toolbar (GtkMenu *menu, GtkToolbar *toolbar; GtkRequisition req; GtkRequisition menu_req; + GtkAllocation allocation; + GdkWindow *window; GdkRectangle monitor; int monitor_num; GdkScreen *screen; @@ -199,44 +207,46 @@ ephy_gui_menu_position_on_toolbar (GtkMenu *menu, gtk_widget_size_request (GTK_WIDGET (menu), &menu_req); screen = gtk_widget_get_screen (GTK_WIDGET (menu)); - monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window); + window = gtk_widget_get_window (widget); + monitor_num = gdk_screen_get_monitor_at_window (screen, window); if (monitor_num < 0) monitor_num = 0; gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); - gdk_window_get_origin (widget->window, x, y); - if (GTK_WIDGET_NO_WINDOW (widget)) + gtk_widget_get_allocation (widget, &allocation); + gdk_window_get_origin (window, x, y); + if (!gtk_widget_get_has_window (widget)) { - *x += widget->allocation.x; - *y += widget->allocation.y; + *x += allocation.x; + *y += allocation.y; } - if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL) + if (gtk_orientable_get_orientation (GTK_ORIENTABLE (toolbar)) == GTK_ORIENTATION_HORIZONTAL) { if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_LTR) - *x += widget->allocation.width - req.width; + *x += allocation.width - req.width; else *x += req.width - menu_req.width; - if ((*y + widget->allocation.height + menu_req.height) <= monitor.y + monitor.height) - *y += widget->allocation.height; + if ((*y + allocation.height + menu_req.height) <= monitor.y + monitor.height) + *y += allocation.height; else if ((*y - menu_req.height) >= monitor.y) *y -= menu_req.height; - else if (monitor.y + monitor.height - (*y + widget->allocation.height) > *y) - *y += widget->allocation.height; + else if (monitor.y + monitor.height - (*y + allocation.height) > *y) + *y += allocation.height; else *y -= menu_req.height; } else { if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_LTR) - *x += widget->allocation.width; + *x += allocation.width; else *x -= menu_req.width; if (*y + menu_req.height > monitor.y + monitor.height && - *y + widget->allocation.height - monitor.y > monitor.y + monitor.height - *y) - *y += widget->allocation.height - menu_req.height; + *y + allocation.height - monitor.y > monitor.y + monitor.height - *y) + *y += allocation.height - menu_req.height; } *push_in = FALSE; @@ -247,7 +257,7 @@ ephy_gui_ensure_window_group (GtkWindow *window) { GtkWindowGroup *group; - group = window->group; + group = gtk_window_get_group (window); if (group == NULL) { group = gtk_window_group_new (); @@ -498,7 +508,7 @@ ephy_gui_window_update_user_time (GtkWidget *window, if (user_time != 0) { gtk_widget_realize (window); - gdk_x11_window_set_user_time (window->window, + gdk_x11_window_set_user_time (gtk_widget_get_window (window), user_time); } @@ -512,7 +522,7 @@ ephy_gui_message_dialog_get_content_box (GtkWidget *dialog) GList *children; /* Get the hbox which is the first child of the main vbox */ - children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox)); + children = gtk_container_get_children (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog)))); g_return_val_if_fail (children != NULL, NULL); container = GTK_WIDGET (children->data); diff --git a/lib/ephy-state.c b/lib/ephy-state.c index c59b42d5e..0a347c979 100644 --- a/lib/ephy-state.c +++ b/lib/ephy-state.c @@ -166,7 +166,7 @@ ephy_state_window_set_position (GtkWidget *window, EphyNode *node) 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); @@ -219,7 +219,7 @@ ephy_state_window_save_size (GtkWidget *window, EphyNode *node) gboolean maximize; GdkWindowState state; - state = gdk_window_get_state (GTK_WIDGET (window)->window); + state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window))); maximize = ((state & GDK_WINDOW_STATE_MAXIMIZED) > 0); gtk_window_get_size (GTK_WINDOW(window), @@ -242,7 +242,7 @@ ephy_state_window_save_position (GtkWidget *window, EphyNode *node) gboolean maximize; GdkWindowState state; - state = gdk_window_get_state (GTK_WIDGET (window)->window); + state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window))); maximize = ((state & GDK_WINDOW_STATE_MAXIMIZED) > 0); /* Don't save the position if maximized */ @@ -278,7 +278,7 @@ window_configure_event_cb (GtkWidget *widget, { GdkWindowState state; - state = gdk_window_get_state (widget->window); + state = gdk_window_get_state (gtk_widget_get_window (widget)); if (!(state & GDK_WINDOW_STATE_FULLSCREEN)) { diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index cbe3d065d..77826374e 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -128,7 +128,7 @@ ephy_location_entry_style_set (GtkWidget *widget, GTK_WIDGET_CLASS (ephy_location_entry_parent_class)->style_set (widget, previous_style); } - title_fg_colour = widget->style->text[GTK_STATE_INSENSITIVE]; + title_fg_colour = gtk_widget_get_style (widget)->text[GTK_STATE_INSENSITIVE]; settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget)); g_object_get (settings, "gtk-theme-name", &theme, NULL); @@ -458,7 +458,7 @@ entry_key_press_after_cb (GtkEntry *entry, (state == GDK_CONTROL_MASK || state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))) { - gtk_im_context_reset (entry->im_context); + //gtk_im_context_reset (entry->im_context); priv->needs_reset = TRUE; g_signal_emit_by_name (entry, "activate"); @@ -519,7 +519,7 @@ match_selected_cb (GtkEntryCompletion *completion, state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)); ephy_location_entry_set_location (entry, item, NULL); - gtk_im_context_reset (GTK_ENTRY (entry->priv->entry)->im_context); + //gtk_im_context_reset (GTK_ENTRY (entry->priv->entry)->im_context); g_signal_emit_by_name (priv->entry, "activate"); g_free (item); @@ -647,7 +647,7 @@ entry_populate_popup_cb (GtkEntry *entry, * menu, and insert this menu item before it. * It's a bit of a hack, but there seems to be no better way to do it :/ */ - children = GTK_MENU_SHELL (menu)->children; + children = gtk_container_get_children (GTK_CONTAINER (menu)); for (item = children; item != NULL && sep < 2; item = item->next, pos++) { if (GTK_IS_SEPARATOR_MENU_ITEM (item->data)) sep++; @@ -703,6 +703,7 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, EphyLocationEntryPrivate *priv = entry->priv; char *title = NULL, *address = NULL; GString *text; + GtkStyle *style; GdkDrawable *drawable; PangoContext *context; PangoLayout *layout; @@ -743,8 +744,9 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, layout = pango_layout_new (context); context = gtk_widget_get_pango_context (widget); + style = gtk_widget_get_style (widget); metrics = pango_context_get_metrics (context, - widget->style->font_desc, + style->font_desc, pango_context_get_language (context)); char_width = pango_font_metrics_get_approximate_digit_width (metrics); @@ -769,13 +771,13 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, pixmap_height = layout_height / PANGO_SCALE + DRAG_ICON_LAYOUT_BORDER * 2; } - drawable = gdk_pixmap_new (widget->window, + drawable = gdk_pixmap_new (gtk_widget_get_window (widget), pixmap_width + 2, pixmap_height + 2, -1); gdk_draw_rectangle (drawable, - widget->style->base_gc [GTK_WIDGET_STATE (widget)], + style->base_gc [gtk_widget_get_state (widget)], TRUE, 0, 0, pixmap_width + 1, @@ -785,7 +787,7 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, if (priv->favicon != NULL) { gdk_draw_pixbuf (drawable, - widget->style->fg_gc[GTK_WIDGET_STATE (widget)], + style->fg_gc[gtk_widget_get_state (widget)], priv->favicon, 0, 0, 1 + DRAG_ICON_LAYOUT_BORDER + DRAG_ICON_ICON_SPACING, @@ -795,13 +797,13 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, } gdk_draw_layout (drawable, - widget->style->text_gc [GTK_WIDGET_STATE (widget)], + style->text_gc [gtk_widget_get_state (widget)], 1 + DRAG_ICON_LAYOUT_BORDER + offset_x, 1 + DRAG_ICON_LAYOUT_BORDER, layout); gdk_draw_rectangle (drawable, - widget->style->black_gc, + style->black_gc, FALSE, 0, 0, pixmap_width + 1, diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index fcad5568e..d2ce5f351 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -187,7 +187,7 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) gdk_window_get_pointer (window, NULL, &y, NULL); - y += vadjustment->value; + y += gtk_adjustment_get_value (vadjustment); gtk_tree_view_get_visible_rect (tree_view, &visible_rect); @@ -201,8 +201,8 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) } } - value = CLAMP (vadjustment->value + offset, 0.0, - vadjustment->upper - vadjustment->page_size); + value = CLAMP (gtk_adjustment_get_value (vadjustment) + offset, 0.0, + gtk_adjustment_get_upper (vadjustment) - gtk_adjustment_get_page_size (vadjustment)); gtk_adjustment_set_value (vadjustment, value); } @@ -371,7 +371,8 @@ drag_data_received_cb (GtkWidget *widget, /* x and y here are valid only on drop ! */ - if (selection_data->length <= 0 || selection_data->data == NULL) + if ((gtk_selection_data_get_length (selection_data) <= 0) || + (gtk_selection_data_get_data (selection_data) == NULL)) { return; } @@ -474,23 +475,25 @@ filter_changed_cb (EphyNodeFilter *filter, EphyNodeView *view) { GtkWidget *window; + GdkWindow *gdk_window; g_return_if_fail (EPHY_IS_NODE_VIEW (view)); window = gtk_widget_get_toplevel (GTK_WIDGET (view)); + gdk_window = gtk_widget_get_window (window); - if (window != NULL && window->window != NULL) + if (window != NULL && gdk_window != NULL) { /* nice busy cursor */ GdkCursor *cursor; cursor = gdk_cursor_new (GDK_WATCH); - gdk_window_set_cursor (window->window, cursor); + gdk_window_set_cursor (gdk_window, cursor); gdk_cursor_unref (cursor); gdk_flush (); - gdk_window_set_cursor (window->window, NULL); + gdk_window_set_cursor (gdk_window, NULL); /* no flush: this will cause the cursor to be reset * only when the UI is free again */ diff --git a/lib/widgets/ephy-spinner.c b/lib/widgets/ephy-spinner.c index a210a156b..068a36a8e 100644 --- a/lib/widgets/ephy-spinner.c +++ b/lib/widgets/ephy-spinner.c @@ -598,7 +598,7 @@ ephy_spinner_init (EphySpinner *spinner) details = spinner->details = EPHY_SPINNER_GET_PRIVATE (spinner); - GTK_WIDGET_SET_FLAGS (GTK_WIDGET (spinner), GTK_NO_WINDOW); + gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE); details->cache = ephy_spinner_cache_ref (); details->size = GTK_ICON_SIZE_DIALOG; @@ -614,12 +614,14 @@ ephy_spinner_expose (GtkWidget *widget, EphySpinner *spinner = EPHY_SPINNER (widget); EphySpinnerDetails *details = spinner->details; EphySpinnerImages *images; + GtkAllocation allocation; GdkPixbuf *pixbuf; + GdkWindow *window; GdkGC *gc; int x_offset, y_offset, width, height; GdkRectangle pix_area, dest; - if (!GTK_WIDGET_DRAWABLE (spinner)) + if (!gtk_widget_is_drawable (GTK_WIDGET (spinner))) { return FALSE; } @@ -650,11 +652,12 @@ ephy_spinner_expose (GtkWidget *widget, height = gdk_pixbuf_get_height (pixbuf); /* Compute the offsets for the image centered on our allocation */ - x_offset = (widget->allocation.width - width) / 2; - y_offset = (widget->allocation.height - height) / 2; + gtk_widget_get_allocation (widget, &allocation); + x_offset = (allocation.width - width) / 2; + y_offset = (allocation.height - height) / 2; - pix_area.x = x_offset + widget->allocation.x; - pix_area.y = y_offset + widget->allocation.y; + pix_area.x = x_offset + allocation.x; + pix_area.y = y_offset + allocation.y; pix_area.width = width; pix_area.height = height; @@ -663,10 +666,11 @@ ephy_spinner_expose (GtkWidget *widget, return FALSE; } - gc = gdk_gc_new (widget->window); - gdk_draw_pixbuf (widget->window, gc, pixbuf, - dest.x - x_offset - widget->allocation.x, - dest.y - y_offset - widget->allocation.y, + window = gtk_widget_get_window (widget); + gc = gdk_gc_new (window); + gdk_draw_pixbuf (window, gc, pixbuf, + dest.x - x_offset - allocation.x, + dest.y - y_offset - allocation.y, dest.x, dest.y, dest.width, dest.height, GDK_RGB_DITHER_MAX, 0, 0); @@ -924,7 +928,7 @@ ephy_spinner_stop (EphySpinner *spinner) { ephy_spinner_remove_update_callback (spinner); - if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner))) + //if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner))) { gtk_widget_queue_draw (GTK_WIDGET (spinner)); } diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index fd70b2904..90af3b1fd 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -463,7 +463,8 @@ drag_data_get_cb (GtkWidget *widget, g_return_if_fail (location != NULL); - gtk_selection_data_set (selection_data, selection_data->target, 8, (unsigned char *)location, strlen (location)); + gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data), + 8, (unsigned char *)location, strlen (location)); } static void @@ -593,7 +594,7 @@ connect_proxy (GtkAction *action, { GtkLabel *label; - label = (GtkLabel *) ((GtkBin *) proxy)->child; + label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (proxy))); gtk_label_set_use_underline (label, FALSE); gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); diff --git a/src/bookmarks/ephy-bookmark-factory-action.c b/src/bookmarks/ephy-bookmark-factory-action.c index 51c165f57..4a17cf5df 100644 --- a/src/bookmarks/ephy-bookmark-factory-action.c +++ b/src/bookmarks/ephy-bookmark-factory-action.c @@ -57,7 +57,7 @@ activate_item_cb (GtkWidget *menuitem, GtkWidget *placeholder) g_return_if_fail (model); children = gtk_container_get_children (GTK_CONTAINER (etoolbar)); - pos = g_list_index (children, toolbar->parent); + pos = g_list_index (children, gtk_widget_get_parent (toolbar)); index = gtk_toolbar_get_item_index (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (item)); g_list_free (children); @@ -186,7 +186,7 @@ remove_placeholder_cb (GtkMenuShell *menushell, g_object_set_data (G_OBJECT (model), EGG_TOOLBARS_MODEL_DATA, NULL); children = gtk_container_get_children (GTK_CONTAINER (etoolbar)); - pos = g_list_index (children, toolbar->parent); + pos = g_list_index (children, gtk_widget_get_parent (toolbar)); index = gtk_toolbar_get_item_index (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (item)); g_list_free (children); diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c index 83174506f..ed8f9b2cd 100644 --- a/src/bookmarks/ephy-bookmark-properties.c +++ b/src/bookmarks/ephy-bookmark-properties.c @@ -489,6 +489,7 @@ ephy_bookmark_properties_constructor (GType type, EphyBookmarkProperties *properties; EphyBookmarkPropertiesPrivate *priv; GtkWidget *widget, *table, *label, *entry, *container; + GtkWidget *content_area, *action_area; GtkWindow *window; GtkDialog *dialog; gboolean lockdown; @@ -526,10 +527,11 @@ ephy_bookmark_properties_constructor (GType type, lockdown = eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING); update_window_title (properties); + content_area = gtk_dialog_get_content_area (dialog); gtk_dialog_set_has_separator (dialog, FALSE); gtk_container_set_border_width (GTK_CONTAINER (properties), 5); - gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); + gtk_box_set_spacing (GTK_BOX (content_area), 2); table = gtk_table_new (4, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); @@ -604,7 +606,7 @@ ephy_bookmark_properties_constructor (GType type, gtk_widget_show (widget); gtk_table_attach (GTK_TABLE (table), widget, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); - gtk_box_pack_start (GTK_BOX (dialog->vbox), table, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), table, TRUE, TRUE, 0); priv->warning = gtk_toggle_button_new (); gtk_button_set_focus_on_click (GTK_BUTTON (priv->warning), FALSE); @@ -627,11 +629,13 @@ ephy_bookmark_properties_constructor (GType type, gtk_dialog_add_button (dialog, GTK_STOCK_HELP, GTK_RESPONSE_HELP); + + action_area = gtk_dialog_get_action_area (dialog); - gtk_box_pack_end (GTK_BOX (dialog->action_area), + gtk_box_pack_end (GTK_BOX (action_area), priv->warning, FALSE, TRUE, 0); - gtk_button_box_set_child_secondary - (GTK_BUTTON_BOX (dialog->action_area), priv->warning, TRUE); + gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (action_area), + priv->warning, TRUE); if (priv->creating) { diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 0feceed09..ea5c37f7a 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -402,7 +402,8 @@ delete_topic_dialog_construct (GtkWindow *parent, gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Delete Topic"), GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); - gtk_window_group_add_window (GTK_WINDOW (parent)->group, GTK_WINDOW (dialog)); + gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (parent)), + GTK_WINDOW (dialog)); return dialog; } @@ -685,7 +686,7 @@ import_bookmarks (EphyBookmarksEditor *editor, "unsupported type."), basename); - gtk_window_group_add_window (GTK_WINDOW (editor)->group, + gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (editor)), GTK_WINDOW (dialog)); gtk_dialog_run (GTK_DIALOG (dialog)); @@ -922,7 +923,8 @@ cmd_bookmarks_export (GtkAction *action, gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), hbox); - gtk_window_group_add_window (GTK_WINDOW (editor)->group, GTK_WINDOW (dialog)); + gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (editor)), + GTK_WINDOW (dialog)); g_signal_connect (dialog, "response", G_CALLBACK (export_dialog_response_cb), editor); @@ -934,6 +936,7 @@ cmd_bookmarks_import (GtkAction *action, EphyBookmarksEditor *editor) { GtkWidget *dialog; + GtkWidget *content_area; GtkWidget *label; GtkWidget *vbox; GtkWidget *combo; @@ -952,15 +955,17 @@ cmd_bookmarks_import (GtkAction *action, _("I_mport"), GTK_RESPONSE_OK, NULL); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); - gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); + gtk_box_set_spacing (GTK_BOX (content_area), 2); vbox = gtk_vbox_new (FALSE, 6); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_widget_show (vbox); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, + gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); label = gtk_label_new (_("Import bookmarks from:")); diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index d0c3fbfd7..32d922f14 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -79,7 +79,7 @@ drag_data_received_cb (GtkWidget *widget, topic = ephy_topic_action_get_topic (EPHY_TOPIC_ACTION (action)); - data = (char *)selection_data->data; + data = (char *) gtk_selection_data_get_data (selection_data); bookmarks = ephy_shell_get_bookmarks (ephy_shell); netscape_url = g_strsplit (data, "\n", 2); @@ -165,7 +165,7 @@ ephy_topic_action_sync_label (GtkAction *action, } else if (GTK_IS_MENU_ITEM (proxy)) { - label = GTK_BIN (proxy)->child; + label = gtk_bin_get_child (GTK_BIN (proxy)); } else { diff --git a/src/bookmarks/ephy-topic-factory-action.c b/src/bookmarks/ephy-topic-factory-action.c index 6c164807e..e8b8e583c 100644 --- a/src/bookmarks/ephy-topic-factory-action.c +++ b/src/bookmarks/ephy-topic-factory-action.c @@ -99,7 +99,7 @@ activate_item_cb (GtkWidget *menuitem, GtkWidget *placeholder) g_return_if_fail (model); children = gtk_container_get_children (GTK_CONTAINER (etoolbar)); - pos = g_list_index (children, toolbar->parent); + pos = g_list_index (children, gtk_widget_get_parent (toolbar)); index = gtk_toolbar_get_item_index (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (item)); g_list_free (children); @@ -185,7 +185,7 @@ remove_placeholder_cb (GtkMenuShell *menushell, GtkWidget *placeholder) g_object_set_data (G_OBJECT (model), EGG_TOOLBARS_MODEL_DATA, NULL); children = gtk_container_get_children (GTK_CONTAINER (etoolbar)); - pos = g_list_index (children, toolbar->parent); + pos = g_list_index (children, gtk_widget_get_parent (toolbar)); index = gtk_toolbar_get_item_index (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (item)); g_list_free (children); diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c index 822937cf4..00953ba6b 100644 --- a/src/ephy-encoding-dialog.c +++ b/src/ephy-encoding-dialog.c @@ -291,7 +291,7 @@ automatic_toggled_cb (GtkToggleButton *button, EphyEncodingDialog *dialog) static void ephy_encoding_dialog_init (EphyEncodingDialog *dialog) { - GtkWidget *treeview, *scroller, *button, *window; + GtkWidget *treeview, *scroller, *button, *window, *child; GtkTreeSelection *selection; EphyNode *node; @@ -345,13 +345,15 @@ ephy_encoding_dialog_init (EphyEncodingDialog *dialog) (EPHY_DIALOG (dialog), properties[SCROLLED_WINDOW_PROP].id); gtk_container_add (GTK_CONTAINER (scroller), treeview); + child = gtk_bin_get_child (GTK_BIN (button)); + button = ephy_dialog_get_control (EPHY_DIALOG (dialog), properties[AUTOMATIC_PROP].id); - gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (button)->child), TRUE); + gtk_label_set_use_markup (GTK_LABEL (child), TRUE); g_signal_connect (button, "toggled", G_CALLBACK (automatic_toggled_cb), dialog); button = ephy_dialog_get_control (EPHY_DIALOG (dialog), properties[MANUAL_PROP].id); - gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (button)->child), TRUE); + gtk_label_set_use_markup (GTK_LABEL (child), TRUE); dialog->priv->enc_view = treeview; diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c index bc8a46563..71f255258 100644 --- a/src/ephy-find-toolbar.c +++ b/src/ephy-find-toolbar.c @@ -92,7 +92,7 @@ scroll_lines (WebKitWebView *web_view, scrolled_window = GTK_SCROLLED_WINDOW (gtk_widget_get_parent (GTK_WIDGET (web_view))); vadj = gtk_scrolled_window_get_vadjustment (scrolled_window); - value = vadj->value + (num_lines * vadj->step_increment); + value = gtk_adjustment_get_value (vadj) + (num_lines * gtk_adjustment_get_step_increment (vadj)); gtk_adjustment_set_value (vadj, value); } @@ -107,7 +107,7 @@ scroll_pages (WebKitWebView *web_view, scrolled_window = GTK_SCROLLED_WINDOW (gtk_widget_get_parent (GTK_WIDGET (web_view))); vadj = gtk_scrolled_window_get_vadjustment (scrolled_window); - value = vadj->value + (num_pages * vadj->page_increment); + value = gtk_adjustment_get_value (vadj) + (num_pages * gtk_adjustment_get_page_increment (vadj)); gtk_adjustment_set_value (vadj, value); } @@ -195,7 +195,7 @@ tab_search_key_press_cb (EphyEmbed *embed, 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) { @@ -454,7 +454,7 @@ set_focus_cb (EphyWindow *window, while (widget != NULL && widget != wtoolbar) { - widget = widget->parent; + widget = gtk_widget_get_parent (widget); } /* if widget == toolbar, the new focus widget is in the toolbar */ @@ -481,7 +481,8 @@ ephy_find_toolbar_parent_set (GtkWidget *widget, EphyFindToolbarPrivate *priv = toolbar->priv; GtkWidget *toplevel; - if (widget->parent != NULL && priv->set_focus_handler == 0) + if (gtk_widget_get_parent (widget) != NULL && + priv->set_focus_handler == 0) { toplevel = gtk_widget_get_toplevel (widget); priv->set_focus_handler = @@ -795,7 +796,7 @@ ephy_find_toolbar_find_next (EphyFindToolbar *toolbar) 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); } @@ -824,7 +825,7 @@ ephy_find_toolbar_find_previous (EphyFindToolbar *toolbar) 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); } @@ -884,7 +885,7 @@ ephy_find_toolbar_close (EphyFindToolbar *toolbar) 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); } diff --git a/src/ephy-fullscreen-popup.c b/src/ephy-fullscreen-popup.c index cad0c7b47..88d530d5f 100644 --- a/src/ephy-fullscreen-popup.c +++ b/src/ephy-fullscreen-popup.c @@ -102,7 +102,7 @@ ephy_fullscreen_popup_update_spinner (EphyFullscreenPopup *popup) { EphyFullscreenPopupPrivate *priv = popup->priv; - if (priv->spinning && GTK_WIDGET_VISIBLE (popup)) + if (priv->spinning && gtk_widget_get_visible (GTK_WIDGET (popup))) { ephy_spinner_start (priv->spinner); } @@ -116,16 +116,19 @@ static void ephy_fullscreen_popup_update_position (EphyFullscreenPopup *popup) { GtkWidget *widget = GTK_WIDGET (popup); + GtkRequisition requisition; GdkScreen *screen; GdkRectangle screen_rect; int popup_width; - popup_width = widget->requisition.width; + gtk_widget_size_request (widget, &requisition); + popup_width = requisition.width; screen = gtk_widget_get_screen (widget); gdk_screen_get_monitor_geometry (screen, - gdk_screen_get_monitor_at_window (screen, widget->window), + gdk_screen_get_monitor_at_window (screen, + gtk_widget_get_window (widget)), &screen_rect); if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) diff --git a/src/ephy-go-action.c b/src/ephy-go-action.c index 7373df52d..5c5b52e62 100644 --- a/src/ephy-go-action.c +++ b/src/ephy-go-action.c @@ -67,9 +67,8 @@ connect_proxy (GtkAction *action, if (GTK_IS_TOOL_ITEM (proxy)) { - g_signal_connect (GTK_BIN (proxy)->child, "button-release-event", - G_CALLBACK (button_clicked_cb), action - ); + g_signal_connect (gtk_bin_get_child (GTK_BIN (proxy)), "button-release-event", + G_CALLBACK (button_clicked_cb), action); } } diff --git a/src/ephy-home-action.c b/src/ephy-home-action.c index 196078f96..7dc7cf8f2 100644 --- a/src/ephy-home-action.c +++ b/src/ephy-home-action.c @@ -179,19 +179,26 @@ home_action_drag_data_received_cb (GtkWidget* widget, guint time, EphyHomeAction *action) { - gchar *action_name; + GdkAtom target; + gchar *action_name; + const guchar *data; + gint length; g_object_get (action, "name", &action_name, NULL); g_signal_stop_emission_by_name (widget, "drag_data_received"); - if (selection_data->length <= 0 || selection_data->data == NULL) return; + length = gtk_selection_data_get_length (selection_data); + data = gtk_selection_data_get_data (selection_data); + target = gtk_selection_data_get_target (selection_data); - if (selection_data->target == gdk_atom_intern (EPHY_DND_URL_TYPE, FALSE)) + if (length <= 0 || data == NULL) return; + + if (target == gdk_atom_intern (EPHY_DND_URL_TYPE, FALSE)) { char **split; - split = g_strsplit ((const gchar *)selection_data->data, "\n", 2); + split = g_strsplit ((const gchar *) data, "\n", 2); if (split != NULL && split[0] != NULL && split[0][0] != '\0') { action_name_association (GTK_ACTION (action), @@ -199,7 +206,7 @@ home_action_drag_data_received_cb (GtkWidget* widget, } g_strfreev (split); } - else if (selection_data->target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE)) + else if (target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE)) { char **uris; int i; @@ -231,7 +238,8 @@ home_action_drag_data_received_cb (GtkWidget* widget, static void connect_proxy (GtkAction *action, GtkWidget *proxy) -{ +{ + GtkWidget *child; const gchar *action_name; GTK_ACTION_CLASS (ephy_home_action_parent_class)->connect_proxy (action, proxy); @@ -240,13 +248,14 @@ connect_proxy (GtkAction *action, if (GTK_IS_TOOL_ITEM (proxy) && (strcmp (action_name, "GoHome") != 0)) { - g_signal_connect (GTK_BIN (proxy)->child, "drag-data-received", + child = gtk_bin_get_child (GTK_BIN (proxy)); + g_signal_connect (child, "drag-data-received", G_CALLBACK (home_action_drag_data_received_cb), action); - gtk_drag_dest_set (GTK_BIN (proxy)->child, + gtk_drag_dest_set (child, GTK_DEST_DEFAULT_ALL, url_drag_types, G_N_ELEMENTS (url_drag_types), GDK_ACTION_MOVE | GDK_ACTION_COPY); - gtk_drag_dest_add_text_targets (GTK_BIN (proxy)->child); + gtk_drag_dest_add_text_targets (child); } } diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c index 972f86d30..d81c2c7df 100644 --- a/src/ephy-navigation-action.c +++ b/src/ephy-navigation-action.c @@ -88,7 +88,7 @@ new_history_menu_item (const char *origtext, item = gtk_image_menu_item_new_with_label (origtext); - label = GTK_LABEL (GTK_BIN (item)->child); + label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))); gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); gtk_label_set_max_width_chars (label, MAX_LABEL_LENGTH); diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 9121452b9..253e3a0d9 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -260,6 +260,7 @@ find_tab_num_at_pos (EphyNotebook *notebook, gint abs_x, gint abs_y) while ((page = gtk_notebook_get_nth_page (nb, page_num))) { GtkWidget *tab; + GtkAllocation allocation; gint max_x, max_y; gint x_root, y_root; @@ -272,11 +273,12 @@ find_tab_num_at_pos (EphyNotebook *notebook, gint abs_x, gint abs_y) continue; } - gdk_window_get_origin (GDK_WINDOW (tab->window), + gdk_window_get_origin (gtk_widget_get_window (tab), &x_root, &y_root); - max_x = x_root + tab->allocation.x + tab->allocation.width; - max_y = y_root + tab->allocation.y + tab->allocation.height; + gtk_widget_get_allocation (tab, &allocation); + max_x = x_root + allocation.x + allocation.width; + max_y = y_root + allocation.y + allocation.height; if (((tab_pos == GTK_POS_TOP) || (tab_pos == GTK_POS_BOTTOM)) @@ -359,25 +361,29 @@ notebook_drag_data_received_cb (GtkWidget* widget, { EphyWindow *window; GtkWidget *notebook; + GdkAtom target; + const guchar *data; - if (selection_data->target == gdk_atom_intern_static_string ("GTK_NOTEBOOK_TAB")) + target = gtk_selection_data_get_target (selection_data); + if (target == gdk_atom_intern_static_string ("GTK_NOTEBOOK_TAB")) return; g_signal_stop_emission_by_name (widget, "drag_data_received"); if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_ARBITRARY_URL)) return; - if (selection_data->length <= 0 || selection_data->data == NULL) return; + data = gtk_selection_data_get_data (selection_data); + if (gtk_selection_data_get_length (selection_data) <= 0 || data == NULL) return; window = EPHY_WINDOW (gtk_widget_get_toplevel (widget)); notebook = ephy_window_get_notebook (window); - if (selection_data->target == gdk_atom_intern (EPHY_DND_URL_TYPE, FALSE)) + if (target == gdk_atom_intern (EPHY_DND_URL_TYPE, FALSE)) { char **split; /* URL_TYPE has format: url \n title */ - split = g_strsplit ((const gchar *)selection_data->data, "\n", 2); + split = g_strsplit ((const gchar *) data, "\n", 2); if (split != NULL && split[0] != NULL && split[0][0] != '\0') { ephy_link_open (EPHY_LINK (notebook), split[0], embed, @@ -385,7 +391,7 @@ notebook_drag_data_received_cb (GtkWidget* widget, } g_strfreev (split); } - else if (selection_data->target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE)) + else if (target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE)) { char **uris; int i; @@ -538,7 +544,8 @@ sync_label (EphyWebView *view, GParamSpec *pspec, GtkWidget *label) /* Set the tooltip on the label's parent (the tab label hbox), * so it covers all of the tab label. */ - gtk_widget_set_tooltip_text (label->parent, title); + gtk_widget_set_tooltip_text (gtk_widget_get_parent (label), + title); } static void @@ -562,7 +569,7 @@ tab_label_style_set_cb (GtkWidget *hbox, context = gtk_widget_get_pango_context (hbox); metrics = pango_context_get_metrics (context, - hbox->style->font_desc, + gtk_widget_get_style (hbox)->font_desc, pango_context_get_language (context)); char_width = pango_font_metrics_get_approximate_digit_width (metrics); diff --git a/src/ephy-nss-glue.c b/src/ephy-nss-glue.c index d60326cdb..e1c65b6c0 100644 --- a/src/ephy-nss-glue.c +++ b/src/ephy-nss-glue.c @@ -64,7 +64,8 @@ ask_for_nss_password (PK11SlotInfo *slot, _("The passwords from the previous version (Gecko) are locked with a master password. If you want Epiphany to import them, please enter your master password below.")); entry = gtk_entry_new (); gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), entry); + gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), + entry); gtk_widget_show (entry); result = gtk_dialog_run (GTK_DIALOG (dialog)); diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c index 0a6854a63..a30d57f39 100644 --- a/src/ephy-statusbar.c +++ b/src/ephy-statusbar.c @@ -265,7 +265,7 @@ sync_visibility (GtkWidget *widget, GParamSpec *pspec, GtkWidget *separator) { - if (GTK_WIDGET_VISIBLE (widget)) + if (gtk_widget_get_visible (widget)) { gtk_widget_show (separator); } diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c index 7618b006d..7754794d4 100644 --- a/src/ephy-tabs-menu.c +++ b/src/ephy-tabs-menu.c @@ -277,7 +277,7 @@ connect_proxy_cb (GtkActionGroup *action_group, { GtkLabel *label; - label = GTK_LABEL (GTK_BIN (proxy)->child); + label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (proxy))); gtk_label_set_use_underline (label, FALSE); gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); diff --git a/src/ephy-toolbar-editor.c b/src/ephy-toolbar-editor.c index f77ef9fc5..8400a4d0c 100644 --- a/src/ephy-toolbar-editor.c +++ b/src/ephy-toolbar-editor.c @@ -178,9 +178,9 @@ ephy_toolbar_editor_constructor (GType type, toolbar = ephy_window_get_toolbar (priv->window); - vbox = GTK_DIALOG (dialog)->vbox; + vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)), 5); - gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2); gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); gtk_window_set_title (GTK_WINDOW (dialog), _("Toolbar Editor")); gtk_window_set_icon_name (GTK_WINDOW (dialog), EPHY_STOCK_EPHY); diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c index 61a34fccc..7442bc225 100644 --- a/src/ephy-toolbar.c +++ b/src/ephy-toolbar.c @@ -149,7 +149,7 @@ maybe_finish_activation_cb (EphyWindow *window, while (widget != NULL && widget != wtoolbar) { - widget = widget->parent; + widget = gtk_widget_get_parent (widget); } /* if widget == toolbar, the new focus widget is in the toolbar, so we diff --git a/src/ephy-window.c b/src/ephy-window.c index 360eaf110..80a37fe60 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -534,7 +534,8 @@ construct_confirm_close_dialog (EphyWindow *window) /* FIXME gtk_window_set_title (GTK_WINDOW (dialog), _("Close Document?")); */ gtk_window_set_icon_name (GTK_WINDOW (dialog), EPHY_STOCK_EPHY); - gtk_window_group_add_window (GTK_WINDOW (window)->group, GTK_WINDOW (dialog)); + gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (window)), + GTK_WINDOW (dialog)); return dialog; } @@ -989,7 +990,7 @@ ephy_window_key_press_event (GtkWidget *widget, 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); @@ -2594,6 +2595,9 @@ ephy_window_link_message_cb (EphyWebView *web_view, GParamSpec *spec, EphyWindow char *script; GdkColor bg, fg; GtkWidget *widget; + GtkAllocation allocation; + GtkStyle *style; + GtkStateType state; PangoLayout *layout; PangoLayoutLine *line; PangoLayoutRun *run; @@ -2603,7 +2607,8 @@ ephy_window_link_message_cb (EphyWebView *web_view, GParamSpec *spec, EphyWindow widget = GTK_WIDGET (view); layout = gtk_widget_create_pango_layout (widget, link_message); - pango_layout_set_width (layout, PANGO_SCALE * (widget->allocation.width * 0.9)); + gtk_widget_get_allocation (widget, &allocation); + pango_layout_set_width (layout, PANGO_SCALE * (allocation.width * 0.9)); pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); line = pango_layout_get_line_readonly (layout, 0); @@ -2620,8 +2625,10 @@ ephy_window_link_message_cb (EphyWebView *web_view, GParamSpec *spec, EphyWindow } g_utf8_strncpy ((gchar *)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)]; + style = gtk_widget_get_style (widget); + state = gtk_widget_get_state (widget); + bg = style->bg[state]; + fg = style->fg[state]; script = g_strdup_printf(add_node_string, (int) (bg.red / 65535. * 255), diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index fddf21f66..1c1bac06c 100644 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -460,7 +460,7 @@ pdm_dialog_show_clear_all_dialog (EphyDialog *edialog, _("<small><i><b>Note:</b> You cannot undo this action. " "The data you are choosing to clear " "will be deleted forever.</i></small>")); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), label, FALSE, FALSE, 0); /* Need to do this or the label will wrap too early */ gtk_widget_set_size_request (label, 330, -1); @@ -642,7 +642,7 @@ show_cookies_properties (PdmDialog *dialog, GtkWidget *table; GtkWidget *label; GtkWidget *parent; - GtkWidget *dialog_vbox; + GtkWidget *content_area; char *str; parent = ephy_dialog_get_control (EPHY_DIALOG(dialog), @@ -658,7 +658,8 @@ show_cookies_properties (PdmDialog *dialog, EPHY_STATE_WINDOW_SAVE_SIZE | EPHY_STATE_WINDOW_SAVE_POSITION); gtk_dialog_set_has_separator (GTK_DIALOG(gdialog), FALSE); gtk_container_set_border_width (GTK_CONTAINER (gdialog), 5); - gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (gdialog)->vbox), 14); /* 24 = 2 * 5 + 14 */ + content_area = gtk_dialog_get_content_area (GTK_DIALOG (gdialog)); + gtk_box_set_spacing (GTK_BOX (content_area), 14); /* 24 = 2 * 5 + 14 */ table = gtk_table_new (2, 4, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 5); @@ -740,8 +741,7 @@ show_cookies_properties (PdmDialog *dialog, gtk_widget_show (label); gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 3, 4); - dialog_vbox = GTK_DIALOG(gdialog)->vbox; - gtk_box_pack_start (GTK_BOX(dialog_vbox), + gtk_box_pack_start (GTK_BOX (content_area), table, FALSE, FALSE, 0); diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 0e409051c..b9e895654 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -616,7 +616,8 @@ setup_add_language_dialog (PrefsDialog *pd) add_lang_props[LANGUAGE_DIALOG].id, &window, NULL); - gtk_window_group_add_window (GTK_WINDOW (parent)->group, GTK_WINDOW (window)); + gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (parent)), + GTK_WINDOW (window)); gtk_window_set_modal (GTK_WINDOW (window), TRUE); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (treeview), FALSE); |