aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/egg/egg-editable-toolbar.c68
-rw-r--r--lib/egg/egg-toolbar-editor.c9
-rw-r--r--lib/ephy-dialog.c6
-rw-r--r--lib/ephy-dnd.c4
-rw-r--r--lib/ephy-gui.c70
-rw-r--r--lib/ephy-state.c8
-rw-r--r--lib/widgets/ephy-location-entry.c22
-rw-r--r--lib/widgets/ephy-node-view.c17
-rw-r--r--lib/widgets/ephy-spinner.c26
9 files changed, 131 insertions, 99 deletions
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));
}