[Xfce4-commits] [xfce/exo] 01/21: Make it build with -DGSEAL_ENABLE
noreply at xfce.org
noreply at xfce.org
Tue Jul 12 04:07:53 CEST 2016
This is an automated email from the git hooks/post-receive script.
bluesabre pushed a commit to branch master
in repository xfce/exo.
commit 26bcf69fcc4893e18195fb88e57e615d30a9653a
Author: Jonas Kümmerlin <rgcjonas at gmail.com>
Date: Thu Aug 6 09:49:28 2015 +0200
Make it build with -DGSEAL_ENABLE
---
configure.ac.in | 5 +
exo-desktop-item-edit/exo-die-command-entry.c | 2 +-
exo-desktop-item-edit/exo-die-editor.c | 8 +-
exo-desktop-item-edit/main.c | 13 +-
exo-helper/exo-helper-chooser-dialog.c | 6 +-
exo-helper/exo-helper-chooser.c | 28 ++-
exo-helper/exo-helper-launcher-dialog.c | 2 +-
exo/exo-cell-renderer-ellipsized-text.c | 18 +-
exo/exo-cell-renderer-icon.c | 27 +-
exo/exo-icon-bar.c | 90 +++----
exo/exo-icon-chooser-dialog.c | 6 +-
exo/exo-icon-view-accessible.c | 39 +--
exo/exo-icon-view.c | 343 ++++++++++++++------------
exo/exo-thumbnail-preview.c | 4 +-
exo/exo-toolbars-editor-dialog.c | 6 +-
exo/exo-toolbars-editor.c | 2 +-
exo/exo-toolbars-private.c | 22 +-
exo/exo-toolbars-view.c | 21 +-
exo/exo-tree-view.c | 14 +-
exo/exo-wrap-table.c | 36 +--
20 files changed, 375 insertions(+), 317 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index d1b3ee7..1487b9e 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -239,6 +239,11 @@ dnl *************************************
XDT_SUPPORTED_FLAGS([GTK_DOC_EXTRA_CFLAGS], [-Wno-sign-compare])
AC_SUBST([GTK_DOC_EXTRA_CFLAGS])
+dnl *************************************
+dnl *** Use GSEAL if possible ***
+dnl *************************************
+XDT_SUPPORTED_FLAGS([CFLAGS], [-DGSEAL_ENABLE])
+
AC_OUTPUT([
Makefile
docs/Makefile
diff --git a/exo-desktop-item-edit/exo-die-command-entry.c b/exo-desktop-item-edit/exo-die-command-entry.c
index 41ddd44..3e2af71 100644
--- a/exo-desktop-item-edit/exo-die-command-entry.c
+++ b/exo-desktop-item-edit/exo-die-command-entry.c
@@ -248,7 +248,7 @@ exo_die_command_entry_button_clicked (GtkWidget *button,
/* determine the toplevel window */
toplevel = gtk_widget_get_toplevel (button);
- if (toplevel == NULL || !GTK_WIDGET_TOPLEVEL (toplevel))
+ if (toplevel == NULL || !gtk_widget_is_toplevel (toplevel))
return;
/* allocate the file chooser */
diff --git a/exo-desktop-item-edit/exo-die-editor.c b/exo-desktop-item-edit/exo-die-editor.c
index 33fd09d..07f5dd2 100644
--- a/exo-desktop-item-edit/exo-die-editor.c
+++ b/exo-desktop-item-edit/exo-die-editor.c
@@ -583,7 +583,7 @@ exo_die_editor_icon_clicked (GtkWidget *button,
/* determine the toplevel widget */
toplevel = gtk_widget_get_toplevel (button);
- if (toplevel == NULL || !GTK_WIDGET_TOPLEVEL (toplevel))
+ if (toplevel == NULL || !gtk_widget_is_toplevel (toplevel))
return;
/* allocate the icon chooser dialog */
@@ -630,7 +630,7 @@ exo_die_editor_path_clicked (GtkWidget *button,
/* determine the toplevel widget */
toplevel = gtk_widget_get_toplevel (button);
- if (toplevel == NULL || !GTK_WIDGET_TOPLEVEL (toplevel))
+ if (toplevel == NULL || !gtk_widget_is_toplevel (toplevel))
return;
/* allocate the file chooser dialog */
@@ -1188,8 +1188,8 @@ exo_die_editor_set_icon (ExoDieEditor *editor,
g_object_notify (G_OBJECT (editor), "icon");
/* drop the previous icon button child */
- if (GTK_BIN (editor->icon_button)->child != NULL)
- gtk_widget_destroy (GTK_BIN (editor->icon_button)->child);
+ if (gtk_bin_get_child (GTK_BIN (editor->icon_button)) != NULL)
+ gtk_widget_destroy (gtk_bin_get_child (GTK_BIN (editor->icon_button)));
/* check the icon depending on the type */
if (icon != NULL && g_path_is_absolute (icon))
diff --git a/exo-desktop-item-edit/main.c b/exo-desktop-item-edit/main.c
index 29d6b8f..c9671e0 100644
--- a/exo-desktop-item-edit/main.c
+++ b/exo-desktop-item-edit/main.c
@@ -339,7 +339,7 @@ main (int argc, char **argv)
/* add the "Create"/"Save" button (as default) */
button = gtk_button_new_from_stock (opt_create_new ? _("C_reate") : GTK_STOCK_SAVE);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_ACCEPT);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@@ -348,7 +348,7 @@ main (int argc, char **argv)
exo_die_editor_set_mode (EXO_DIE_EDITOR (editor), mode);
gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
exo_binding_new (G_OBJECT (editor), "complete", G_OBJECT (button), "sensitive");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), editor, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), editor, TRUE, TRUE, 0);
gtk_widget_show (editor);
/* setup the name */
@@ -427,11 +427,13 @@ main (int argc, char **argv)
xwindow = gdk_window_foreign_new ((GdkNativeWindow) opt_xid);
if (G_LIKELY (xwindow != NULL))
{
+ GtkAllocation allocation;
+
/* realize the dialog first... */
gtk_widget_realize (dialog);
/* ...and set the "transient for" relation */
- gdk_window_set_transient_for (dialog->window, xwindow);
+ gdk_window_set_transient_for (gtk_widget_get_window (dialog), xwindow);
gtk_window_set_screen (GTK_WINDOW (dialog),
gdk_drawable_get_screen (GDK_DRAWABLE (xwindow)));
@@ -439,8 +441,9 @@ main (int argc, char **argv)
gdk_window_get_root_origin (xwindow, &ox, &oy);
gdk_window_get_geometry (xwindow, NULL, NULL, &ow, &oh, NULL);
- ox += (ow - dialog->allocation.width) / 2;
- oy += (oh - dialog->allocation.height) / 2;
+ gtk_widget_get_allocation (dialog, &allocation);
+ ox += (ow - allocation.width) / 2;
+ oy += (oh - allocation.height) / 2;
gtk_window_move (GTK_WINDOW (dialog), MAX (ox, 0), MAX (oy, 0));
}
diff --git a/exo-helper/exo-helper-chooser-dialog.c b/exo-helper/exo-helper-chooser-dialog.c
index 3bd0156..0dbc723 100644
--- a/exo-helper/exo-helper-chooser-dialog.c
+++ b/exo-helper/exo-helper-chooser-dialog.c
@@ -105,12 +105,12 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
/* add the "Help" button */
button = gtk_button_new_from_stock (GTK_STOCK_HELP);
g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (exo_helper_chooser_dialog_show_help), chooser_dialog);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (chooser_dialog)->action_area), button, FALSE, TRUE, 0);
- gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (GTK_DIALOG (chooser_dialog)->action_area), button, TRUE);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (chooser_dialog))), button, FALSE, TRUE, 0);
+ gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (gtk_dialog_get_action_area (GTK_DIALOG (chooser_dialog))), button, TRUE);
gtk_widget_show (button);
topcontainer = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (chooser_dialog)->vbox), topcontainer, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (chooser_dialog))), topcontainer, TRUE, TRUE, 0);
gtk_widget_show (topcontainer);
chooser_dialog->plug_child = topcontainer;
diff --git a/exo-helper/exo-helper-chooser.c b/exo-helper/exo-helper-chooser.c
index 8b6a9e3..1232788 100644
--- a/exo-helper/exo-helper-chooser.c
+++ b/exo-helper/exo-helper-chooser.c
@@ -381,7 +381,7 @@ browse_clicked (GtkWidget *button,
/* determine the toplevel window */
toplevel = gtk_widget_get_toplevel (entry);
- if (toplevel == NULL || !GTK_WIDGET_TOPLEVEL (toplevel))
+ if (toplevel == NULL || !gtk_widget_is_toplevel (toplevel))
return;
/* allocate the chooser */
@@ -540,13 +540,13 @@ menu_activate_other (GtkWidget *item,
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 6);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 6);
+ gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 5);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 6);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
hbox = g_object_new (GTK_TYPE_HBOX, "border-width", 5, "spacing", 12, NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
image = gtk_image_new_from_icon_name ("preferences-desktop-default-applications", GTK_ICON_SIZE_DIALOG);
@@ -639,7 +639,7 @@ menu_position (GtkMenu *menu,
gtk_widget_size_request (GTK_WIDGET (chooser), &chooser_request);
gtk_widget_size_request (GTK_WIDGET (menu), &menu_request);
- gdk_window_get_position (GTK_WIDGET (chooser)->window, x, y);
+ gdk_window_get_position (gtk_widget_get_window (GTK_WIDGET (chooser)), x, y);
*y += y0;
*x += x0;
@@ -674,19 +674,21 @@ exo_helper_chooser_pressed (ExoHelperChooser *chooser,
GdkPixbuf *icon;
GtkWidget *image;
GtkWidget *menu;
+ GtkAllocation menu_allocation;
GtkWidget *item;
GList *helpers;
GList *lp;
gint icon_size;
+ GtkAllocation chooser_allocation;
g_return_if_fail (EXO_IS_HELPER_CHOOSER (chooser));
g_return_if_fail (GTK_IS_BUTTON (button));
/* set a watch cursor while loading the menu */
- if (G_LIKELY (button->window != NULL))
+ if (G_LIKELY (gtk_widget_get_window (button) != NULL))
{
cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (button->window, cursor);
+ gdk_window_set_cursor (gtk_widget_get_window (button), cursor);
gdk_cursor_unref (cursor);
gdk_flush ();
}
@@ -766,12 +768,14 @@ exo_helper_chooser_pressed (ExoHelperChooser *chooser,
gtk_widget_show (item);
/* make sure the menu has atleast the same width as the chooser */
- if (menu->allocation.width < GTK_WIDGET (chooser)->allocation.width)
- gtk_widget_set_size_request (menu, GTK_WIDGET (chooser)->allocation.width, -1);
+ gtk_widget_get_allocation (menu, &menu_allocation);
+ gtk_widget_get_allocation (GTK_WIDGET (chooser), &chooser_allocation);
+ if (menu_allocation.width < chooser_allocation.width)
+ gtk_widget_set_size_request (menu, chooser_allocation.width, -1);
/* reset the watch cursor on the chooser */
- if (G_LIKELY (button->window != NULL))
- gdk_window_set_cursor (button->window, NULL);
+ if (G_LIKELY (gtk_widget_get_window (button) != NULL))
+ gdk_window_set_cursor (gtk_widget_get_window (button), NULL);
/* allocate a new main loop */
loop = g_main_loop_new (NULL, FALSE);
diff --git a/exo-helper/exo-helper-launcher-dialog.c b/exo-helper/exo-helper-launcher-dialog.c
index 6dba99a..e84ff44 100644
--- a/exo-helper/exo-helper-launcher-dialog.c
+++ b/exo-helper/exo-helper-launcher-dialog.c
@@ -114,7 +114,7 @@ exo_helper_launcher_dialog_init (ExoHelperLauncherDialog *launcher_dialog)
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (launcher_dialog)->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (launcher_dialog))), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
image = gtk_image_new_from_icon_name ("preferences-desktop-default-applications", GTK_ICON_SIZE_DIALOG);
diff --git a/exo/exo-cell-renderer-ellipsized-text.c b/exo/exo-cell-renderer-ellipsized-text.c
index 5836221..5c6e14c 100644
--- a/exo/exo-cell-renderer-ellipsized-text.c
+++ b/exo/exo-cell-renderer-ellipsized-text.c
@@ -201,6 +201,10 @@ exo_cell_renderer_ellipsized_text_get_size (GtkCellRenderer *renderer,
gint focus_padding;
gint text_height;
gint text_width;
+ gfloat renderer_xalign;
+ gfloat renderer_yalign;
+
+ gtk_cell_renderer_get_alignment (renderer, &renderer_xalign, &renderer_yalign);
/* determine the dimensions of the text from the GtkCellRendererText */
(*GTK_CELL_RENDERER_CLASS (exo_cell_renderer_ellipsized_text_parent_class)->get_size) (renderer, widget, NULL, NULL, NULL, &text_width, &text_height);
@@ -229,14 +233,14 @@ exo_cell_renderer_ellipsized_text_get_size (GtkCellRenderer *renderer,
{
if (G_LIKELY (x_offset != NULL))
{
- *x_offset = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? (1.0 - renderer->xalign) : renderer->xalign)
+ *x_offset = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? (1.0 - renderer_xalign) : renderer_xalign)
* (cell_area->width - text_width);
*x_offset = MAX (*x_offset, 0);
}
if (G_LIKELY (y_offset != NULL))
{
- *y_offset = renderer->yalign * (cell_area->height - text_height);
+ *y_offset = renderer_yalign * (cell_area->height - text_height);
*y_offset = MAX (*y_offset, 0);
}
}
@@ -275,19 +279,19 @@ exo_cell_renderer_ellipsized_text_render (GtkCellRenderer *renderer,
/* determine the widget state */
if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)
{
- if (GTK_WIDGET_HAS_FOCUS (widget))
+ if (gtk_widget_has_focus (widget))
state = GTK_STATE_SELECTED;
else
state = GTK_STATE_ACTIVE;
}
else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT
- && GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT)
+ && gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
{
state = GTK_STATE_PRELIGHT;
}
else
{
- if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
+ if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
else
state = GTK_STATE_NORMAL;
@@ -333,7 +337,7 @@ exo_cell_renderer_ellipsized_text_render (GtkCellRenderer *renderer,
cairo_curve_to (cr, x0 + 5, y1, x0, y1, x0, y1 - 5);
cairo_line_to (cr, x0, y0 + 5);
cairo_curve_to (cr, x0, y0 + 5, x0, y0, x0 + 5, y0);
- gdk_cairo_set_source_color (cr, &widget->style->base[state]);
+ gdk_cairo_set_source_color (cr, >k_widget_get_style (widget)->base[state]);
cairo_fill (cr);
cairo_destroy (cr);
}
@@ -341,7 +345,7 @@ exo_cell_renderer_ellipsized_text_render (GtkCellRenderer *renderer,
/* draw the focus indicator */
if ((flags & GTK_CELL_RENDERER_FOCUSED) != 0)
{
- gtk_paint_focus (widget->style, window, GTK_WIDGET_STATE (widget), NULL, widget, "icon_view", x0, y0, text_width, text_height);
+ gtk_paint_focus (gtk_widget_get_style (widget), window, gtk_widget_get_state (widget), NULL, widget, "icon_view", x0, y0, text_width, text_height);
flags &= ~GTK_CELL_RENDERER_FOCUSED;
}
}
diff --git a/exo/exo-cell-renderer-icon.c b/exo/exo-cell-renderer-icon.c
index 0e6ead7..db8884a 100644
--- a/exo/exo-cell-renderer-icon.c
+++ b/exo/exo-cell-renderer-icon.c
@@ -325,20 +325,25 @@ exo_cell_renderer_icon_get_size (GtkCellRenderer *renderer,
gint *height)
{
const ExoCellRendererIconPrivate *priv = EXO_CELL_RENDERER_ICON_GET_PRIVATE (renderer);
+ gfloat xalign, yalign;
+ gint xpad, ypad;
+
+ gtk_cell_renderer_get_alignment (renderer, &xalign, &yalign);
+ gtk_cell_renderer_get_padding (renderer, &xpad, &ypad);
if (cell_area != NULL)
{
if (x_offset != NULL)
{
- *x_offset = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? 1.0 - renderer->xalign : renderer->xalign)
+ *x_offset = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? 1.0 - xalign : xalign)
* (cell_area->width - priv->size);
- *x_offset = MAX (*x_offset, 0) + renderer->xpad;
+ *x_offset = MAX (*x_offset, 0) + xpad;
}
if (y_offset != NULL)
{
- *y_offset = renderer->yalign * (cell_area->height - priv->size);
- *y_offset = MAX (*y_offset, 0) + renderer->ypad;
+ *y_offset = yalign * (cell_area->height - priv->size);
+ *y_offset = MAX (*y_offset, 0) + ypad;
}
}
else
@@ -351,10 +356,10 @@ exo_cell_renderer_icon_get_size (GtkCellRenderer *renderer,
}
if (G_LIKELY (width != NULL))
- *width = (gint) renderer->xpad * 2 + priv->size;
+ *width = (gint) xpad * 2 + priv->size;
if (G_LIKELY (height != NULL))
- *height = (gint) renderer->ypad * 2 + priv->size;
+ *height = (gint) ypad * 2 + priv->size;
}
@@ -501,8 +506,8 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
{
if ((flags & GTK_CELL_RENDERER_SELECTED) != 0)
{
- state = GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE;
- temp = exo_gdk_pixbuf_colorize (icon, &widget->style->base[state]);
+ state = gtk_widget_has_focus (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE;
+ temp = exo_gdk_pixbuf_colorize (icon, >k_widget_get_style (widget)->base[state]);
g_object_unref (G_OBJECT (icon));
icon = temp;
}
@@ -516,7 +521,7 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
}
/* check if we should render an insensitive icon */
- if (G_UNLIKELY (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE || !renderer->sensitive))
+ if (G_UNLIKELY (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !gtk_cell_renderer_get_sensitive (renderer)))
{
/* allocate an icon source */
icon_source = gtk_icon_source_new ();
@@ -525,7 +530,7 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
gtk_icon_source_set_size (icon_source, GTK_ICON_SIZE_SMALL_TOOLBAR);
/* render the insensitive icon */
- temp = gtk_style_render_icon (widget->style, icon_source, gtk_widget_get_direction (widget),
+ temp = gtk_style_render_icon (gtk_widget_get_style (widget), icon_source, gtk_widget_get_direction (widget),
GTK_STATE_INSENSITIVE, -1, widget, "gtkcellrendererpixbuf");
g_object_unref (G_OBJECT (icon));
icon = temp;
@@ -535,7 +540,7 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
}
/* render the invalid parts of the icon */
- gdk_draw_pixbuf (window, widget->style->black_gc, icon,
+ gdk_draw_pixbuf (window, gtk_widget_get_style (widget)->black_gc, icon,
draw_area.x - icon_area.x, draw_area.y - icon_area.y,
draw_area.x, draw_area.y, draw_area.width, draw_area.height,
GDK_RGB_DITHER_NORMAL, 0, 0);
diff --git a/exo/exo-icon-bar.c b/exo/exo-icon-bar.c
index c48034b..de56df0 100644
--- a/exo/exo-icon-bar.c
+++ b/exo/exo-icon-bar.c
@@ -434,7 +434,7 @@ exo_icon_bar_init (ExoIconBar *icon_bar)
icon_bar->priv->layout = gtk_widget_create_pango_layout (GTK_WIDGET (icon_bar), NULL);
pango_layout_set_width (icon_bar->priv->layout, -1);
- GTK_WIDGET_UNSET_FLAGS (icon_bar, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (GTK_WIDGET (icon_bar), FALSE);
exo_icon_bar_set_adjustments (icon_bar, NULL, NULL);
}
@@ -549,10 +549,10 @@ exo_icon_bar_style_set (GtkWidget *widget,
(*GTK_WIDGET_CLASS (exo_icon_bar_parent_class)->style_set) (widget, previous_style);
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (icon_bar->priv->bin_window,
- &widget->style->base[widget->state]);
+ >k_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
}
}
@@ -564,28 +564,30 @@ exo_icon_bar_realize (GtkWidget *widget)
GdkWindowAttr attributes;
ExoIconBar *icon_bar = EXO_ICON_BAR (widget);
gint attributes_mask;
+ GtkAllocation allocation;
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
+ gtk_widget_get_allocation (widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ attributes.x = allocation.x;
+ attributes.y = allocation.y;
+ attributes.width = allocation.width;
+ attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes, attributes_mask);
- gdk_window_set_user_data (widget->window, widget);
+ gtk_widget_set_window (widget, gdk_window_new (gtk_widget_get_parent_window (widget),
+ &attributes, attributes_mask));
+ gdk_window_set_user_data (gtk_widget_get_window (widget), widget);
attributes.x = 0;
attributes.y = 0;
- attributes.width = MAX (icon_bar->priv->width, widget->allocation.width);
- attributes.height = MAX (icon_bar->priv->height, widget->allocation.height);
+ attributes.width = MAX (icon_bar->priv->width, allocation.width);
+ attributes.height = MAX (icon_bar->priv->height, allocation.height);
attributes.event_mask = (GDK_SCROLL_MASK
| GDK_EXPOSURE_MASK
| GDK_LEAVE_NOTIFY_MASK
@@ -597,13 +599,13 @@ exo_icon_bar_realize (GtkWidget *widget)
| gtk_widget_get_events (widget);
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- icon_bar->priv->bin_window = gdk_window_new (widget->window,
+ icon_bar->priv->bin_window = gdk_window_new (gtk_widget_get_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (icon_bar->priv->bin_window, widget);
- widget->style = gtk_style_attach (widget->style, widget->window);
- gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
- gdk_window_set_background (icon_bar->priv->bin_window, &widget->style->base[widget->state]);
+ gtk_widget_set_style (widget, gtk_style_attach (gtk_widget_get_style (widget), gtk_widget_get_window (widget)));
+ gdk_window_set_background (gtk_widget_get_window (widget), >k_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
+ gdk_window_set_background (icon_bar->priv->bin_window, >k_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
gdk_window_show (icon_bar->priv->bin_window);
}
@@ -678,11 +680,11 @@ exo_icon_bar_size_allocate (GtkWidget *widget,
{
ExoIconBar *icon_bar = EXO_ICON_BAR (widget);
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
- gdk_window_move_resize (widget->window,
+ gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x,
allocation->y,
allocation->width,
@@ -692,18 +694,18 @@ exo_icon_bar_size_allocate (GtkWidget *widget,
MAX (icon_bar->priv->height, allocation->height));
}
- icon_bar->priv->hadjustment->page_size = allocation->width;
- icon_bar->priv->hadjustment->page_increment = allocation->width * 0.9;
- icon_bar->priv->hadjustment->step_increment = allocation->width * 0.1;
- icon_bar->priv->hadjustment->lower = 0;
- icon_bar->priv->hadjustment->upper = MAX (allocation->width, icon_bar->priv->width);
+ gtk_adjustment_set_page_size (icon_bar->priv->hadjustment, allocation->width);
+ gtk_adjustment_set_page_increment (icon_bar->priv->hadjustment, allocation->width * 0.9);
+ gtk_adjustment_set_step_increment (icon_bar->priv->hadjustment, allocation->width * 0.1);
+ gtk_adjustment_set_lower (icon_bar->priv->hadjustment, 0);
+ gtk_adjustment_set_upper (icon_bar->priv->hadjustment, MAX (allocation->width, icon_bar->priv->width));
gtk_adjustment_changed (icon_bar->priv->hadjustment);
- icon_bar->priv->vadjustment->page_size = allocation->height;
- icon_bar->priv->vadjustment->page_increment = allocation->height * 0.9;
- icon_bar->priv->vadjustment->step_increment = allocation->height * 0.1;
- icon_bar->priv->vadjustment->lower = 0;
- icon_bar->priv->vadjustment->upper = MAX (allocation->height, icon_bar->priv->height);
+ gtk_adjustment_set_page_size (icon_bar->priv->vadjustment, allocation->height);
+ gtk_adjustment_set_page_increment (icon_bar->priv->vadjustment, allocation->height * 0.9);
+ gtk_adjustment_set_step_increment (icon_bar->priv->vadjustment, allocation->height * 0.1);
+ gtk_adjustment_set_lower (icon_bar->priv->vadjustment, 0);
+ gtk_adjustment_set_upper (icon_bar->priv->vadjustment, MAX (allocation->height, icon_bar->priv->height));
gtk_adjustment_changed (icon_bar->priv->vadjustment);
if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
@@ -810,7 +812,7 @@ exo_icon_bar_button_press (GtkWidget *widget,
ExoIconBarItem *item;
ExoIconBar *icon_bar = EXO_ICON_BAR (widget);
- if (!GTK_WIDGET_HAS_FOCUS (widget))
+ if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
@@ -888,11 +890,11 @@ static void
exo_icon_bar_adjustment_changed (GtkAdjustment *adjustment,
ExoIconBar *icon_bar)
{
- if (GTK_WIDGET_REALIZED (icon_bar))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_bar)))
{
gdk_window_move (icon_bar->priv->bin_window,
- - icon_bar->priv->hadjustment->value,
- - icon_bar->priv->vadjustment->value);
+ - gtk_adjustment_get_value (icon_bar->priv->hadjustment),
+ - gtk_adjustment_get_value (icon_bar->priv->vadjustment));
gdk_window_process_updates (icon_bar->priv->bin_window, TRUE);
}
@@ -935,7 +937,7 @@ exo_icon_bar_queue_draw_item (ExoIconBar *icon_bar,
{
GdkRectangle area;
- if (GTK_WIDGET_REALIZED (icon_bar))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_bar)))
{
if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
{
@@ -1015,13 +1017,13 @@ exo_icon_bar_paint_item (ExoIconBar *icon_bar,
if (fill_color == NULL)
{
- fill_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ fill_color = gdk_color_copy (>k_widget_get_style (GTK_WIDGET (icon_bar))->base[GTK_STATE_SELECTED]);
gdk_color_parse ("#c1d2ee", fill_color);
}
if (border_color == NULL)
{
- border_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ border_color = gdk_color_copy (>k_widget_get_style (GTK_WIDGET (icon_bar))->base[GTK_STATE_SELECTED]);
gdk_color_parse ("#316ac5", border_color);
}
@@ -1053,13 +1055,13 @@ exo_icon_bar_paint_item (ExoIconBar *icon_bar,
if (fill_color == NULL)
{
- fill_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ fill_color = gdk_color_copy (>k_widget_get_style (GTK_WIDGET (icon_bar))->base[GTK_STATE_SELECTED]);
gdk_color_parse ("#e0e8f6", fill_color);
}
if (border_color == NULL)
{
- border_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ border_color = gdk_color_copy (>k_widget_get_style (GTK_WIDGET (icon_bar))->base[GTK_STATE_SELECTED]);
gdk_color_parse ("#98b4e2", border_color);
}
@@ -1108,12 +1110,12 @@ exo_icon_bar_paint_item (ExoIconBar *icon_bar,
if (text_color == NULL)
{
- text_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ text_color = gdk_color_copy (>k_widget_get_style (GTK_WIDGET (icon_bar))->base[GTK_STATE_SELECTED]);
gdk_color_parse ("#000000", text_color);
}
gc = gdk_gc_new (GDK_DRAWABLE (icon_bar->priv->bin_window));
- gdk_gc_copy (gc, GTK_WIDGET (icon_bar)->style->text_gc[GTK_STATE_SELECTED]);
+ gdk_gc_copy (gc, gtk_widget_get_style (GTK_WIDGET (icon_bar))->text_gc[GTK_STATE_SELECTED]);
gdk_gc_set_clip_rectangle (gc, area);
gdk_gc_set_rgb_fg_color (gc, text_color);
gdk_draw_layout (icon_bar->priv->bin_window, gc, lx, ly, icon_bar->priv->layout);
@@ -1128,12 +1130,12 @@ exo_icon_bar_paint_item (ExoIconBar *icon_bar,
if (text_color == NULL)
{
- text_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ text_color = gdk_color_copy (>k_widget_get_style (GTK_WIDGET (icon_bar))->base[GTK_STATE_SELECTED]);
gdk_color_parse ("#000000", text_color);
}
gc = gdk_gc_new (GDK_DRAWABLE (icon_bar->priv->bin_window));
- gdk_gc_copy (gc, GTK_WIDGET (icon_bar)->style->text_gc[GTK_STATE_SELECTED]);
+ gdk_gc_copy (gc, gtk_widget_get_style (GTK_WIDGET (icon_bar))->text_gc[GTK_STATE_SELECTED]);
gdk_gc_set_clip_rectangle (gc, area);
gdk_gc_set_rgb_fg_color (gc, text_color);
gdk_draw_layout (icon_bar->priv->bin_window, gc, lx, ly, icon_bar->priv->layout);
@@ -1142,7 +1144,7 @@ exo_icon_bar_paint_item (ExoIconBar *icon_bar,
}
else
{
- gtk_paint_layout (GTK_WIDGET (icon_bar)->style,
+ gtk_paint_layout (gtk_widget_get_style (GTK_WIDGET (icon_bar)),
icon_bar->priv->bin_window,
GTK_STATE_NORMAL, TRUE, area,
GTK_WIDGET (icon_bar), "icon_bar",
diff --git a/exo/exo-icon-chooser-dialog.c b/exo/exo-icon-chooser-dialog.c
index 025400a..8cbb417 100644
--- a/exo/exo-icon-chooser-dialog.c
+++ b/exo/exo-icon-chooser-dialog.c
@@ -196,7 +196,7 @@ exo_icon_chooser_dialog_init (ExoIconChooserDialog *icon_chooser_dialog)
/* add the main box */
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (icon_chooser_dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (icon_chooser_dialog))), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
/* add the header table */
@@ -344,11 +344,11 @@ exo_icon_chooser_dialog_close (GtkDialog *dialog)
GdkEvent *event;
/* verify that the dialog is realized */
- if (G_LIKELY (GTK_WIDGET_REALIZED (dialog)))
+ if (G_LIKELY (gtk_widget_get_realized (GTK_WIDGET (dialog))))
{
/* send a delete event to the dialog */
event = gdk_event_new (GDK_DELETE);
- event->any.window = g_object_ref (GTK_WIDGET (dialog)->window);
+ event->any.window = g_object_ref (gtk_widget_get_window (GTK_WIDGET (dialog)));
event->any.send_event = TRUE;
gtk_main_do_event (event);
gdk_event_free (event);
diff --git a/exo/exo-icon-view-accessible.c b/exo/exo-icon-view-accessible.c
index 91c3980..7481a78 100644
--- a/exo/exo-icon-view-accessible.c
+++ b/exo/exo-icon-view-accessible.c
@@ -854,6 +854,7 @@ exo_icon_view_item_accessible_is_showing (ExoIconViewItemAccessible *item)
ExoIconView *icon_view;
GdkRectangle visible_rect;
gboolean is_showing;
+ GtkAllocation allocation;
/*
* An item is considered "SHOWING" if any part of the item is in the
@@ -869,12 +870,14 @@ exo_icon_view_item_accessible_is_showing (ExoIconViewItemAccessible *item)
icon_view = EXO_ICON_VIEW (item->widget);
visible_rect.x = 0;
if (icon_view->priv->hadjustment)
- visible_rect.x += icon_view->priv->hadjustment->value;
+ visible_rect.x += gtk_adjustment_get_value (icon_view->priv->hadjustment);
visible_rect.y = 0;
if (icon_view->priv->vadjustment)
- visible_rect.y += icon_view->priv->vadjustment->value;
- visible_rect.width = item->widget->allocation.width;
- visible_rect.height = item->widget->allocation.height;
+ visible_rect.y += gtk_adjustment_get_value (icon_view->priv->vadjustment);
+
+ gtk_widget_get_allocation (item->widget, &allocation);
+ visible_rect.width = allocation.width;
+ visible_rect.height = allocation.height;
if (((item->item->area.x + item->item->area.width) < visible_rect.x) ||
((item->item->area.y + item->item->area.height) < (visible_rect.y)) ||
@@ -1149,7 +1152,7 @@ exo_icon_view_accessible_get_n_children (AtkObject *accessible)
ExoIconView *icon_view;
GtkWidget *widget;
- widget = GTK_ACCESSIBLE (accessible)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
if (!widget)
return 0;
@@ -1189,7 +1192,7 @@ exo_icon_view_accessible_ref_child (AtkObject *accessible,
AtkObject *obj;
ExoIconViewItemAccessible *a11y_item;
- widget = GTK_ACCESSIBLE (accessible)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
if (!widget)
return NULL;
@@ -1248,7 +1251,7 @@ exo_icon_view_accessible_traverse_items (ExoIconViewAccessible *view,
GtkWidget *widget;
gboolean act_on_item;
- widget = GTK_ACCESSIBLE (view)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (view));
if (widget == NULL)
return;
@@ -1368,7 +1371,7 @@ exo_icon_view_accessible_model_row_changed (GtkTreeModel *tree_model,
if (a11y_item)
{
- widget = GTK_ACCESSIBLE (atk_obj)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_obj));
icon_view = EXO_ICON_VIEW (widget);
item = a11y_item->item;
@@ -1727,9 +1730,9 @@ exo_icon_view_accessible_destroyed (GtkWidget *widget,
static void
exo_icon_view_accessible_connect_widget_destroyed (GtkAccessible *accessible)
{
- if (accessible->widget)
+ if (gtk_accessible_get_widget (accessible))
{
- g_signal_connect_after (accessible->widget,
+ g_signal_connect_after (gtk_accessible_get_widget (accessible),
"destroy",
G_CALLBACK (exo_icon_view_accessible_destroyed),
accessible);
@@ -1771,7 +1774,7 @@ exo_icon_view_accessible_ref_accessible_at_point (AtkComponent *component,
gint x_pos, y_pos;
gint idx;
- widget = GTK_ACCESSIBLE (component)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
if (widget == NULL)
/* State is defunct */
return NULL;
@@ -1800,7 +1803,7 @@ exo_icon_view_accessible_add_selection (AtkSelection *selection,
ExoIconView *icon_view;
ExoIconViewItem *item;
- widget = GTK_ACCESSIBLE (selection)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (widget == NULL)
return FALSE;
@@ -1822,7 +1825,7 @@ exo_icon_view_accessible_clear_selection (AtkSelection *selection)
GtkWidget *widget;
ExoIconView *icon_view;
- widget = GTK_ACCESSIBLE (selection)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (widget == NULL)
return FALSE;
@@ -1842,7 +1845,7 @@ exo_icon_view_accessible_ref_selection (AtkSelection *selection,
ExoIconViewItem *item;
gint idx;
- widget = GTK_ACCESSIBLE (selection)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (widget == NULL)
return NULL;
@@ -1876,7 +1879,7 @@ exo_icon_view_accessible_get_selection_count (AtkSelection *selection)
GList *l;
gint count;
- widget = GTK_ACCESSIBLE (selection)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (widget == NULL)
return 0;
@@ -1905,7 +1908,7 @@ exo_icon_view_accessible_is_child_selected (AtkSelection *selection,
ExoIconView *icon_view;
ExoIconViewItem *item;
- widget = GTK_ACCESSIBLE (selection)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (widget == NULL)
return FALSE;
@@ -1928,7 +1931,7 @@ exo_icon_view_accessible_remove_selection (AtkSelection *selection,
GList *l;
gint count;
- widget = GTK_ACCESSIBLE (selection)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (widget == NULL)
return FALSE;
@@ -1959,7 +1962,7 @@ exo_icon_view_accessible_select_all_selection (AtkSelection *selection)
GtkWidget *widget;
ExoIconView *icon_view;
- widget = GTK_ACCESSIBLE (selection)->widget;
+ widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (widget == NULL)
return FALSE;
diff --git a/exo/exo-icon-view.c b/exo/exo-icon-view.c
index c4e61ef..6ef50e0 100644
--- a/exo/exo-icon-view.c
+++ b/exo/exo-icon-view.c
@@ -374,7 +374,7 @@ static gboolean exo_icon_view_search_iter (ExoIconView *icon_vi
static void exo_icon_view_search_move (GtkWidget *widget,
ExoIconView *icon_view,
gboolean move_up);
-static void exo_icon_view_search_preedit_changed (GtkIMContext *im_context,
+static void exo_icon_view_search_preedit_changed (GtkEntry *entry,
ExoIconView *icon_view);
static gboolean exo_icon_view_search_start (ExoIconView *icon_view,
gboolean keybinding);
@@ -1186,7 +1186,7 @@ exo_icon_view_init (ExoIconView *icon_view)
icon_view->priv->text_cell = -1;
icon_view->priv->pixbuf_cell = -1;
- GTK_WIDGET_SET_FLAGS (icon_view, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (GTK_WIDGET (icon_view), TRUE);
exo_icon_view_set_adjustments (icon_view, NULL, NULL);
@@ -1462,28 +1462,30 @@ exo_icon_view_realize (GtkWidget *widget)
ExoIconViewPrivate *priv = EXO_ICON_VIEW (widget)->priv;
GdkWindowAttr attributes;
gint attributes_mask;
+ GtkAllocation allocation;
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
+ gtk_widget_get_allocation (widget, &allocation);
/* Allocate the clipping window */
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ attributes.x = allocation.x;
+ attributes.y = allocation.y;
+ attributes.width = allocation.width;
+ attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
- gdk_window_set_user_data (widget->window, widget);
+ gtk_widget_set_window (widget, gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask));
+ gdk_window_set_user_data (gtk_widget_get_window (widget), widget);
/* Allocate the icons window */
attributes.x = 0;
attributes.y = 0;
- attributes.width = MAX (priv->width, widget->allocation.width);
- attributes.height = MAX (priv->height, widget->allocation.height);
+ attributes.width = MAX (priv->width, allocation.width);
+ attributes.height = MAX (priv->height, allocation.height);
attributes.event_mask = GDK_EXPOSURE_MASK
| GDK_SCROLL_MASK
| GDK_POINTER_MOTION_MASK
@@ -1492,13 +1494,13 @@ exo_icon_view_realize (GtkWidget *widget)
| GDK_KEY_PRESS_MASK
| GDK_KEY_RELEASE_MASK
| gtk_widget_get_events (widget);
- priv->bin_window = gdk_window_new (widget->window, &attributes, attributes_mask);
+ priv->bin_window = gdk_window_new (gtk_widget_get_window (widget), &attributes, attributes_mask);
gdk_window_set_user_data (priv->bin_window, widget);
/* Attach style/background */
- widget->style = gtk_style_attach (widget->style, widget->window);
- gdk_window_set_background (priv->bin_window, &widget->style->base[widget->state]);
- gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
+ gtk_widget_set_style (widget, gtk_style_attach (gtk_widget_get_style (widget), gtk_widget_get_window (widget)));
+ gdk_window_set_background (priv->bin_window, >k_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
+ gdk_window_set_background (gtk_widget_get_window (widget), >k_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
/* map the icons window */
gdk_window_show (priv->bin_window);
@@ -1540,7 +1542,7 @@ exo_icon_view_size_request (GtkWidget *widget,
for (lp = priv->children; lp != NULL; lp = lp->next)
{
child = lp->data;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
gtk_widget_size_request (child->widget, &child_requisition);
}
}
@@ -1590,13 +1592,13 @@ exo_icon_view_size_allocate (GtkWidget *widget,
ExoIconView *icon_view = EXO_ICON_VIEW (widget);
/* apply the new size allocation */
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
/* move/resize the clipping window, the icons window
* will be handled by exo_icon_view_layout().
*/
- if (GTK_WIDGET_REALIZED (widget))
- gdk_window_move_resize (widget->window, allocation->x, allocation->y, allocation->width, allocation->height);
+ if (gtk_widget_get_realized (widget))
+ gdk_window_move_resize (gtk_widget_get_window (widget), allocation->x, allocation->y, allocation->width, allocation->height);
/* layout the items */
exo_icon_view_layout (icon_view);
@@ -1606,23 +1608,23 @@ exo_icon_view_size_allocate (GtkWidget *widget,
/* update the horizontal scroll adjustment accordingly */
hadjustment = icon_view->priv->hadjustment;
- hadjustment->page_size = allocation->width;
- hadjustment->page_increment = allocation->width * 0.9;
- hadjustment->step_increment = allocation->width * 0.1;
- hadjustment->lower = 0;
- hadjustment->upper = MAX (allocation->width, icon_view->priv->width);
- if (hadjustment->value > hadjustment->upper - hadjustment->page_size)
- gtk_adjustment_set_value (hadjustment, MAX (0, hadjustment->upper - hadjustment->page_size));
+ gtk_adjustment_set_page_size (hadjustment, allocation->width);
+ gtk_adjustment_set_page_increment (hadjustment, allocation->width * 0.9);
+ gtk_adjustment_set_step_increment (hadjustment, allocation->width * 0.1);
+ gtk_adjustment_set_lower (hadjustment, 0);
+ gtk_adjustment_set_upper (hadjustment, MAX (allocation->width, icon_view->priv->width));
+ if (gtk_adjustment_get_value (hadjustment) > gtk_adjustment_get_upper (hadjustment) - gtk_adjustment_get_lower (hadjustment))
+ gtk_adjustment_set_value (hadjustment, MAX (0, gtk_adjustment_get_upper (hadjustment) - gtk_adjustment_get_page_size (hadjustment)));
/* update the vertical scroll adjustment accordingly */
vadjustment = icon_view->priv->vadjustment;
- vadjustment->page_size = allocation->height;
- vadjustment->page_increment = allocation->height * 0.9;
- vadjustment->step_increment = allocation->height * 0.1;
- vadjustment->lower = 0;
- vadjustment->upper = MAX (allocation->height, icon_view->priv->height);
- if (vadjustment->value > vadjustment->upper - vadjustment->page_size)
- gtk_adjustment_set_value (vadjustment, MAX (0, vadjustment->upper - vadjustment->page_size));
+ gtk_adjustment_set_page_size (vadjustment, allocation->height);
+ gtk_adjustment_set_page_increment (vadjustment, allocation->height * 0.9);
+ gtk_adjustment_set_step_increment (vadjustment, allocation->height * 0.1);
+ gtk_adjustment_set_lower (vadjustment, 0);
+ gtk_adjustment_set_upper (vadjustment, MAX (allocation->height, icon_view->priv->height));
+ if (gtk_adjustment_get_value (vadjustment) > gtk_adjustment_get_upper (vadjustment) - gtk_adjustment_get_page_size (vadjustment))
+ gtk_adjustment_set_value (vadjustment, MAX (0, gtk_adjustment_get_upper (vadjustment) - gtk_adjustment_get_page_size (vadjustment)));
/* we need to emit "changed" ourselves */
gtk_adjustment_changed (hadjustment);
@@ -1641,8 +1643,8 @@ exo_icon_view_style_set (GtkWidget *widget,
(*GTK_WIDGET_CLASS (exo_icon_view_parent_class)->style_set) (widget, previous_style);
/* apply the new style for the bin_window if we're realized */
- if (GTK_WIDGET_REALIZED (widget))
- gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
+ if (gtk_widget_get_realized (widget))
+ gdk_window_set_background (icon_view->priv->bin_window, >k_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
}
@@ -1748,40 +1750,40 @@ exo_icon_view_expose_event (GtkWidget *widget,
switch (dest_pos)
{
case EXO_ICON_VIEW_DROP_INTO:
- gtk_paint_focus (widget->style, priv->bin_window,
- GTK_WIDGET_STATE (widget), NULL, widget,
+ gtk_paint_focus (gtk_widget_get_style (widget), priv->bin_window,
+ gtk_widget_get_state (widget), NULL, widget,
"iconview-drop-indicator",
dest_item->area.x, dest_item->area.y,
dest_item->area.width, dest_item->area.height);
break;
case EXO_ICON_VIEW_DROP_ABOVE:
- gtk_paint_focus (widget->style, priv->bin_window,
- GTK_WIDGET_STATE (widget), NULL, widget,
+ gtk_paint_focus (gtk_widget_get_style (widget), priv->bin_window,
+ gtk_widget_get_state (widget), NULL, widget,
"iconview-drop-indicator",
dest_item->area.x, dest_item->area.y - 1,
dest_item->area.width, 2);
break;
case EXO_ICON_VIEW_DROP_LEFT:
- gtk_paint_focus (widget->style, priv->bin_window,
- GTK_WIDGET_STATE (widget), NULL, widget,
+ gtk_paint_focus (gtk_widget_get_style (widget), priv->bin_window,
+ gtk_widget_get_state (widget), NULL, widget,
"iconview-drop-indicator",
dest_item->area.x - 1, dest_item->area.y,
2, dest_item->area.height);
break;
case EXO_ICON_VIEW_DROP_BELOW:
- gtk_paint_focus (widget->style, priv->bin_window,
- GTK_WIDGET_STATE (widget), NULL, widget,
+ gtk_paint_focus (gtk_widget_get_style (widget), priv->bin_window,
+ gtk_widget_get_state (widget), NULL, widget,
"iconview-drop-indicator",
dest_item->area.x, dest_item->area.y + dest_item->area.height - 1,
dest_item->area.width, 2);
break;
case EXO_ICON_VIEW_DROP_RIGHT:
- gtk_paint_focus (widget->style, priv->bin_window,
- GTK_WIDGET_STATE (widget), NULL, widget,
+ gtk_paint_focus (gtk_widget_get_style (widget), priv->bin_window,
+ gtk_widget_get_state (widget), NULL, widget,
"iconview-drop-indicator",
dest_item->area.x + dest_item->area.width - 1, dest_item->area.y,
2, dest_item->area.height);
@@ -1855,7 +1857,7 @@ rubberband_scroll_timeout (gpointer user_data)
: icon_view->priv->hadjustment;
/* determine the new scroll value */
- value = MIN (adjustment->value + icon_view->priv->scroll_value_diff, adjustment->upper - adjustment->page_size);
+ value = MIN (gtk_adjustment_get_value (adjustment) + icon_view->priv->scroll_value_diff, gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_page_size (adjustment));
/* apply the new value */
gtk_adjustment_set_value (adjustment, value);
@@ -1878,8 +1880,10 @@ exo_icon_view_motion_notify_event (GtkWidget *widget,
GdkCursor *cursor;
gint size;
gint abso;
+ GtkAllocation allocation;
exo_icon_view_maybe_begin_drag (icon_view, event);
+ gtk_widget_get_allocation (widget, &allocation);
if (icon_view->priv->doing_rubberband)
{
@@ -1888,20 +1892,20 @@ exo_icon_view_motion_notify_event (GtkWidget *widget,
if (icon_view->priv->layout_mode == EXO_ICON_VIEW_LAYOUT_ROWS)
{
abso = event->y - icon_view->priv->height *
- (icon_view->priv->vadjustment->value /
- (icon_view->priv->vadjustment->upper -
- icon_view->priv->vadjustment->lower));
+ (gtk_adjustment_get_value (icon_view->priv->vadjustment) /
+ (gtk_adjustment_get_upper (icon_view->priv->vadjustment) -
+ gtk_adjustment_get_lower (icon_view->priv->vadjustment)));
- size = widget->allocation.height;
+ size = allocation.height;
}
else
{
abso = event->x - icon_view->priv->width *
- (icon_view->priv->hadjustment->value /
- (icon_view->priv->hadjustment->upper -
- icon_view->priv->hadjustment->lower));
+ (gtk_adjustment_get_value (icon_view->priv->hadjustment) /
+ (gtk_adjustment_get_upper (icon_view->priv->hadjustment) -
+ gtk_adjustment_get_lower (icon_view->priv->hadjustment)));
- size = widget->allocation.width;
+ size = allocation.width;
}
if (abso < 0 || abso > size)
@@ -2062,7 +2066,7 @@ exo_icon_view_put (ExoIconView *icon_view,
icon_view->priv->children = g_list_append (icon_view->priv->children, child);
/* setup the parent for the child */
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gtk_widget_set_parent_window (child->widget, icon_view->priv->bin_window);
gtk_widget_set_parent (widget, GTK_WIDGET (icon_view));
}
@@ -2085,7 +2089,7 @@ exo_icon_view_remove_widget (GtkCellEditable *editable,
for (lp = icon_view->priv->cell_list; lp != NULL; lp = lp->next)
((ExoIconViewCellInfo *) lp->data)->editing = FALSE;
- if (GTK_WIDGET_HAS_FOCUS (editable))
+ if (gtk_widget_has_focus (GTK_WIDGET (editable)))
gtk_widget_grab_focus (GTK_WIDGET (icon_view));
g_signal_handlers_disconnect_by_func (editable, exo_icon_view_remove_widget, icon_view);
@@ -2221,7 +2225,7 @@ exo_icon_view_button_press_event (GtkWidget *widget,
if (G_UNLIKELY (icon_view->priv->single_click_timeout_id != 0))
g_source_remove (icon_view->priv->single_click_timeout_id);
- if (G_UNLIKELY (!GTK_WIDGET_HAS_FOCUS (widget)))
+ if (G_UNLIKELY (!gtk_widget_has_focus (widget)))
gtk_widget_grab_focus (widget);
if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
@@ -2346,7 +2350,7 @@ exo_icon_view_button_press_event (GtkWidget *widget,
/* grab focus and stop drawing the keyboard focus indicator on single clicks */
if (G_LIKELY (event->type != GDK_2BUTTON_PRESS && event->type != GDK_3BUTTON_PRESS))
{
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
gtk_widget_grab_focus (GTK_WIDGET (icon_view));
EXO_ICON_VIEW_UNSET_FLAG (icon_view, EXO_ICON_VIEW_DRAW_KEYFOCUS);
}
@@ -2424,11 +2428,11 @@ exo_icon_view_scroll_event (GtkWidget *widget,
adjustment = icon_view->priv->hadjustment;
/* determine the scroll delta */
- delta = pow (adjustment->page_size, 2.0 / 3.0);
+ delta = pow (gtk_adjustment_get_page_size (adjustment), 2.0 / 3.0);
delta = (event->direction == GDK_SCROLL_UP) ? -delta : delta;
/* apply the new adjustment value */
- value = CLAMP (adjustment->value + delta, adjustment->lower, adjustment->upper - adjustment->page_size);
+ value = CLAMP (gtk_adjustment_get_value (adjustment) + delta, gtk_adjustment_get_lower (adjustment), gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_page_size (adjustment));
gtk_adjustment_set_value (adjustment, value);
return TRUE;
@@ -2477,7 +2481,7 @@ exo_icon_view_key_press_event (GtkWidget *widget,
/* allocate a new event to forward */
new_event = gdk_event_copy ((GdkEvent *) event);
g_object_unref (G_OBJECT (new_event->key.window));
- new_event->key.window = g_object_ref (G_OBJECT (icon_view->priv->search_entry->window));
+ new_event->key.window = g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry)));
/* send the event to the search entry. If the "preedit-changed" signal is
* emitted during this event, priv->search_imcontext_changed will be set.
@@ -2551,8 +2555,8 @@ exo_icon_view_leave_notify_event (GtkWidget *widget,
GdkEventCrossing *event)
{
/* reset cursor to default */
- if (GTK_WIDGET_REALIZED (widget))
- gdk_window_set_cursor (widget->window, NULL);
+ if (gtk_widget_get_realized (widget))
+ gdk_window_set_cursor (gtk_widget_get_window (widget), NULL);
/* call the parent's leave_notify_event (if any) */
if (GTK_WIDGET_CLASS (exo_icon_view_parent_class)->leave_notify_event != NULL)
@@ -2748,7 +2752,7 @@ exo_icon_view_item_hit_test (ExoIconView *icon_view,
{
info = l->data;
- if (!info->cell->visible
+ if (!gtk_cell_renderer_get_visible (info->cell)
|| item->box == NULL)
continue;
@@ -2966,9 +2970,9 @@ static void
exo_icon_view_adjustment_changed (GtkAdjustment *adjustment,
ExoIconView *icon_view)
{
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
{
- gdk_window_move (icon_view->priv->bin_window, -icon_view->priv->hadjustment->value, -icon_view->priv->vadjustment->value);
+ gdk_window_move (icon_view->priv->bin_window, -gtk_adjustment_get_value (icon_view->priv->hadjustment), -gtk_adjustment_get_value (icon_view->priv->vadjustment));
if (G_UNLIKELY (icon_view->priv->doing_rubberband))
exo_icon_view_update_rubberband (GTK_WIDGET (icon_view));
@@ -3001,8 +3005,10 @@ exo_icon_view_layout_single_row (ExoIconView *icon_view,
gint col = 0;
gint x;
gint i;
+ GtkAllocation allocation;
rtl = (gtk_widget_get_direction (GTK_WIDGET (icon_view)) == GTK_TEXT_DIR_RTL);
+ gtk_widget_get_allocation (GTK_WIDGET (icon_view), &allocation);
max_width = g_newa (gint, priv->n_cells);
max_height = g_newa (gint, priv->n_cells);
@@ -3032,14 +3038,14 @@ exo_icon_view_layout_single_row (ExoIconView *icon_view,
if (G_LIKELY (items != first_item))
{
- if ((priv->columns <= 0 && current_width > GTK_WIDGET (icon_view)->allocation.width) ||
+ if ((priv->columns <= 0 && current_width > allocation.width) ||
(priv->columns > 0 && col >= priv->columns) ||
(max_cols > 0 && col >= max_cols))
break;
}
item->area.y = *y + focus_width;
- item->area.x = rtl ? GTK_WIDGET (icon_view)->allocation.width - item->area.width - x : x;
+ item->area.x = rtl ? allocation.width - item->area.width - x : x;
x = current_width - (priv->margin + focus_width);
@@ -3101,6 +3107,7 @@ exo_icon_view_layout_single_col (ExoIconView *icon_view,
gint row = 0;
gint y;
gint i;
+ GtkAllocation allocation;
max_width = g_newa (gint, priv->n_cells);
max_height = g_newa (gint, priv->n_cells);
@@ -3113,6 +3120,7 @@ exo_icon_view_layout_single_col (ExoIconView *icon_view,
gtk_widget_style_get (GTK_WIDGET (icon_view),
"focus-line-width", &focus_width,
NULL);
+ gtk_widget_get_allocation (GTK_WIDGET (icon_view), &allocation);
y = priv->margin + focus_width;
current_height = 2 * (priv->margin + focus_width);
@@ -3131,7 +3139,7 @@ exo_icon_view_layout_single_col (ExoIconView *icon_view,
if (G_LIKELY (items != first_item))
{
- if (current_height >= GTK_WIDGET (icon_view)->allocation.height ||
+ if (current_height >= allocation.height ||
(max_rows > 0 && row >= max_rows))
break;
}
@@ -3179,16 +3187,16 @@ static void
exo_icon_view_set_adjustment_upper (GtkAdjustment *adj,
gdouble upper)
{
- if (upper != adj->upper)
+ if (upper != gtk_adjustment_get_upper (adj))
{
- gdouble min = MAX (0.0, upper - adj->page_size);
+ gdouble min = MAX (0.0, upper - gtk_adjustment_get_page_size (adj));
gboolean value_changed = FALSE;
- adj->upper = upper;
+ gtk_adjustment_set_upper (adj, upper);
- if (adj->value > min)
+ if (gtk_adjustment_get_value (adj) > min)
{
- adj->value = min;
+ gtk_adjustment_set_value (adj, min);
value_changed = TRUE;
}
@@ -3291,11 +3299,16 @@ exo_icon_view_layout (ExoIconView *icon_view)
gint item_width;
gint rows, cols;
gint x, y;
+ GtkAllocation allocation;
+ GtkRequisition requisition;
/* verify that we still have a valid model */
if (G_UNLIKELY (priv->model == NULL))
return;
+ gtk_widget_get_allocation (GTK_WIDGET (icon_view), &allocation);
+ gtk_widget_get_requisition (GTK_WIDGET (icon_view), &requisition);
+
/* determine the layout mode */
if (G_LIKELY (priv->layout_mode == EXO_ICON_VIEW_LAYOUT_ROWS))
{
@@ -3317,8 +3330,8 @@ exo_icon_view_layout (ExoIconView *icon_view)
* vertical scrollbar to appear that would prevent the last column from being able to fit,
* we need to relayout the icons with one less column.
*/
- if (cols == priv->cols + 1 && y > GTK_WIDGET (icon_view)->allocation.height &&
- priv->height <= GTK_WIDGET (icon_view)->allocation.height)
+ if (cols == priv->cols + 1 && y > allocation.height &&
+ priv->height <= allocation.height)
{
cols = exo_icon_view_layout_rows (icon_view, item_width, &y, &maximum_width, priv->cols);
}
@@ -3343,8 +3356,8 @@ exo_icon_view_layout (ExoIconView *icon_view)
* horizontal scrollbar to appear that would prevent the last row from being able to fit,
* we need to relayout the icons with one less row.
*/
- if (rows == priv->rows + 1 && x > GTK_WIDGET (icon_view)->allocation.width &&
- priv->width <= GTK_WIDGET (icon_view)->allocation.width)
+ if (rows == priv->rows + 1 && x > allocation.width &&
+ priv->width <= allocation.width)
{
rows = exo_icon_view_layout_cols (icon_view, item_height, &x, &maximum_height, priv->rows);
}
@@ -3357,15 +3370,15 @@ exo_icon_view_layout (ExoIconView *icon_view)
exo_icon_view_set_adjustment_upper (priv->hadjustment, priv->width);
exo_icon_view_set_adjustment_upper (priv->vadjustment, priv->height);
- if (priv->width != GTK_WIDGET (icon_view)->requisition.width
- || priv->height != GTK_WIDGET (icon_view)->requisition.height)
+ if (priv->width != requisition.width
+ || priv->height != requisition.height)
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (icon_view));
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
{
gdk_window_resize (priv->bin_window,
- MAX (priv->width, GTK_WIDGET (icon_view)->allocation.width),
- MAX (priv->height, GTK_WIDGET (icon_view)->allocation.height));
+ MAX (priv->width, allocation.width),
+ MAX (priv->height, allocation.height));
}
/* drop any pending layout idle source */
@@ -3436,7 +3449,7 @@ exo_icon_view_calculate_item_size (ExoIconView *icon_view,
for (lp = icon_view->priv->cell_list; lp != NULL; lp = lp->next)
{
info = EXO_ICON_VIEW_CELL_INFO (lp->data);
- if (G_UNLIKELY (!info->cell->visible))
+ if (G_UNLIKELY (!gtk_cell_renderer_get_visible (info->cell)))
continue;
gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view),
@@ -3472,6 +3485,8 @@ exo_icon_view_calculate_item_size2 (ExoIconView *icon_view,
GList *lp;
gint spacing;
gint i, k;
+ gfloat cell_xalign, cell_yalign;
+ gint cell_xpad, cell_ypad;
rtl = (gtk_widget_get_direction (GTK_WIDGET (icon_view)) == GTK_TEXT_DIR_RTL);
@@ -3508,9 +3523,12 @@ exo_icon_view_calculate_item_size2 (ExoIconView *icon_view,
for (lp = icon_view->priv->cell_list, i = 0; lp != NULL; lp = lp->next, ++i)
{
info = EXO_ICON_VIEW_CELL_INFO (lp->data);
- if (G_UNLIKELY (!info->cell->visible || info->pack == (k ? GTK_PACK_START : GTK_PACK_END)))
+ if (G_UNLIKELY (!gtk_cell_renderer_get_visible (info->cell) || info->pack == (k ? GTK_PACK_START : GTK_PACK_END)))
continue;
+ gtk_cell_renderer_get_alignment (info->cell, &cell_xalign, &cell_yalign);
+ gtk_cell_renderer_get_padding (info->cell, &cell_xpad, &cell_ypad);
+
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
cell_area.width = item->box[info->position].width;
@@ -3523,9 +3541,9 @@ exo_icon_view_calculate_item_size2 (ExoIconView *icon_view,
}
box = item->box + info->position;
- box->x = cell_area.x + (rtl ? (1.0 - info->cell->xalign) : info->cell->xalign) * (cell_area.width - box->width - (2 * info->cell->xpad));
+ box->x = cell_area.x + (rtl ? (1.0 - cell_xalign) : cell_xalign) * (cell_area.width - box->width - (2 * cell_xpad));
box->x = MAX (box->x, 0);
- box->y = cell_area.y + info->cell->yalign * (cell_area.height - box->height - (2 * info->cell->ypad));
+ box->y = cell_area.y + cell_yalign * (cell_area.height - box->height - (2 * cell_ypad));
box->y = MAX (box->y, 0);
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -3597,7 +3615,7 @@ exo_icon_view_paint_item (ExoIconView *icon_view,
if (item->selected)
{
flags = GTK_CELL_RENDERER_SELECTED;
- state = GTK_WIDGET_HAS_FOCUS (icon_view) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE;
+ state = gtk_widget_has_focus (GTK_WIDGET (icon_view)) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE;
/* FIXME We hardwire background drawing behind text cell renderers
* here. This is ugly, but it's done to be consistent with GtkIconView.
@@ -3610,7 +3628,7 @@ exo_icon_view_paint_item (ExoIconView *icon_view,
{
info = EXO_ICON_VIEW_CELL_INFO (lp->data);
- if (G_UNLIKELY (!info->cell->visible))
+ if (G_UNLIKELY (!gtk_cell_renderer_get_visible (info->cell)))
continue;
if (info->is_text)
@@ -3632,7 +3650,7 @@ exo_icon_view_paint_item (ExoIconView *icon_view,
cairo_line_to (cr, x_0, y_0 + 5);
cairo_curve_to (cr, x_0, y_0 + 5, x_0, y_0, x_0 + 5, y_0);
- gdk_cairo_set_source_color (cr, >K_WIDGET (icon_view)->style->base[state]);
+ gdk_cairo_set_source_color (cr, >k_widget_get_style (GTK_WIDGET (icon_view))->base[state]);
cairo_fill (cr);
}
@@ -3665,7 +3683,7 @@ exo_icon_view_paint_item (ExoIconView *icon_view,
{
info = EXO_ICON_VIEW_CELL_INFO (lp->data);
- if (G_UNLIKELY (!info->cell->visible))
+ if (G_UNLIKELY (!gtk_cell_renderer_get_visible (info->cell)))
continue;
exo_icon_view_get_cell_area (icon_view, item, info, &cell_area);
@@ -3800,7 +3818,7 @@ exo_icon_view_get_item_at_coords (const ExoIconView *icon_view,
{
/* check if the cell is visible */
info = (ExoIconViewCellInfo *) lp->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
box = item->box[info->position];
@@ -3952,7 +3970,7 @@ exo_icon_view_row_deleted (GtkTreeModel *model,
g_source_remove (icon_view->priv->single_click_timeout_id);
/* in single click mode, we also reset the cursor when realized */
- if (G_UNLIKELY (icon_view->priv->single_click && GTK_WIDGET_REALIZED (icon_view)))
+ if (G_UNLIKELY (icon_view->priv->single_click && gtk_widget_get_realized (GTK_WIDGET (icon_view))))
gdk_window_set_cursor (icon_view->priv->bin_window, NULL);
}
@@ -4069,7 +4087,7 @@ exo_icon_view_real_move_cursor (ExoIconView *icon_view,
step == GTK_MOVEMENT_PAGES ||
step == GTK_MOVEMENT_BUFFER_ENDS, FALSE);
- if (!GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (icon_view)))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return FALSE;
exo_icon_view_stop_editing (icon_view, FALSE);
@@ -4126,6 +4144,7 @@ find_cell (ExoIconView *icon_view,
gint current;
gint i, k;
GList *l;
+ GtkCellRendererMode mode;
if (icon_view->priv->orientation != orientation)
return cell;
@@ -4145,13 +4164,14 @@ find_cell (ExoIconView *icon_view,
if (info->pack == (k ? GTK_PACK_START : GTK_PACK_END))
continue;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
if (GTK_IS_CELL_RENDERER_TEXT (info->cell))
first_text = i;
- if (info->cell->mode != GTK_CELL_RENDERER_MODE_INERT)
+ g_object_get (info->cell, "mode", &mode, NULL);
+ if (mode != GTK_CELL_RENDERER_MODE_INERT)
{
if (cell == i)
current = n_focusable;
@@ -4201,7 +4221,7 @@ find_item_page_up_down (ExoIconView *icon_view,
GList *item = g_list_find (icon_view->priv->items, current);
GList *next;
gint col = current->col;
- gint y = current->area.y + count * icon_view->priv->vadjustment->page_size;
+ gint y = current->area.y + count * gtk_adjustment_get_page_size (icon_view->priv->vadjustment);
if (count > 0)
{
@@ -4290,7 +4310,7 @@ exo_icon_view_move_cursor_up_down (ExoIconView *icon_view,
GtkDirectionType direction;
GtkWidget *toplevel;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
direction = count < 0 ? GTK_DIR_UP : GTK_DIR_DOWN;
@@ -4399,7 +4419,7 @@ exo_icon_view_move_cursor_page_up_down (ExoIconView *icon_view,
ExoIconViewItem *item;
gboolean dirty = FALSE;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
if (!icon_view->priv->cursor_item)
@@ -4458,7 +4478,7 @@ exo_icon_view_move_cursor_left_right (ExoIconView *icon_view,
GtkDirectionType direction;
GtkWidget *toplevel;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
if (gtk_widget_get_direction (GTK_WIDGET (icon_view)) == GTK_TEXT_DIR_RTL)
@@ -4575,7 +4595,7 @@ exo_icon_view_move_cursor_start_end (ExoIconView *icon_view,
gboolean dirty = FALSE;
GList *lp;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
lp = (count < 0) ? icon_view->priv->items : g_list_last (icon_view->priv->items);
@@ -4626,7 +4646,7 @@ exo_icon_view_get_item_needed_size (ExoIconView *icon_view,
for (lp = icon_view->priv->cell_list; lp != NULL; lp = lp->next)
{
info = EXO_ICON_VIEW_CELL_INFO (lp->data);
- if (G_UNLIKELY (!info->cell->visible))
+ if (G_UNLIKELY (!gtk_cell_renderer_get_visible (info->cell)))
continue;
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -4653,6 +4673,7 @@ exo_icon_view_scroll_to_item (ExoIconView *icon_view,
gint x, y, width, height;
gint focus_width;
gint item_width, item_height;
+ GtkAllocation allocation;
gtk_widget_style_get (GTK_WIDGET (icon_view),
"focus-line-width", &focus_width,
@@ -4662,6 +4683,7 @@ exo_icon_view_scroll_to_item (ExoIconView *icon_view,
&width, &height);
gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
exo_icon_view_get_item_needed_size (icon_view, item, &item_width, &item_height);
+ gtk_widget_get_allocation (GTK_WIDGET (icon_view), &allocation);
/*
* If an item reaches beyond the edges of the view, we scroll just enough
@@ -4676,29 +4698,29 @@ exo_icon_view_scroll_to_item (ExoIconView *icon_view,
if (y + item->area.y - focus_width < 0)
{
gtk_adjustment_set_value (icon_view->priv->vadjustment,
- icon_view->priv->vadjustment->value + y + item->area.y - focus_width);
+ gtk_adjustment_get_value (icon_view->priv->vadjustment) + y + item->area.y - focus_width);
}
- else if (y + item->area.y + item_height + focus_width > GTK_WIDGET (icon_view)->allocation.height
+ else if (y + item->area.y + item_height + focus_width > allocation.height
&& y + item->area.y - focus_width > 0)
{
gtk_adjustment_set_value (icon_view->priv->vadjustment,
- icon_view->priv->vadjustment->value
+ gtk_adjustment_get_value (icon_view->priv->vadjustment)
+ MIN (y + item->area.y - focus_width,
- y + item->area.y + item_height + focus_width - GTK_WIDGET (icon_view)->allocation.height));
+ y + item->area.y + item_height + focus_width - allocation.height));
}
if (x + item->area.x - focus_width < 0)
{
gtk_adjustment_set_value (icon_view->priv->hadjustment,
- icon_view->priv->hadjustment->value+ x + item->area.x - focus_width);
+ gtk_adjustment_get_value (icon_view->priv->hadjustment) + x + item->area.x - focus_width);
}
- else if (x + item->area.x + item_width + focus_width > GTK_WIDGET (icon_view)->allocation.width
+ else if (x + item->area.x + item_width + focus_width > allocation.width
&& x + item->area.x - focus_width > 0)
{
gtk_adjustment_set_value (icon_view->priv->hadjustment,
- icon_view->priv->hadjustment->value
+ gtk_adjustment_get_value (icon_view->priv->hadjustment)
+ MIN (x + item->area.x - focus_width,
- x + item->area.x + item_width + focus_width - GTK_WIDGET (icon_view)->allocation.width));
+ x + item->area.x + item_width + focus_width - allocation.width));
}
gtk_adjustment_changed (icon_view->priv->hadjustment);
@@ -5013,9 +5035,9 @@ exo_icon_view_widget_to_icon_coords (const ExoIconView *icon_view,
g_return_if_fail (EXO_IS_ICON_VIEW (icon_view));
if (G_LIKELY (ix != NULL))
- *ix = wx + icon_view->priv->hadjustment->value;
+ *ix = wx + gtk_adjustment_get_value (icon_view->priv->hadjustment);
if (G_LIKELY (iy != NULL))
- *iy = wy + icon_view->priv->vadjustment->value;
+ *iy = wy + gtk_adjustment_get_value (icon_view->priv->vadjustment);
}
@@ -5041,9 +5063,9 @@ exo_icon_view_icon_to_widget_coords (const ExoIconView *icon_view,
g_return_if_fail (EXO_IS_ICON_VIEW (icon_view));
if (G_LIKELY (wx != NULL))
- *wx = ix - icon_view->priv->hadjustment->value;
+ *wx = ix - gtk_adjustment_get_value (icon_view->priv->hadjustment);
if (G_LIKELY (wy != NULL))
- *wy = iy - icon_view->priv->vadjustment->value;
+ *wy = iy - gtk_adjustment_get_value (icon_view->priv->vadjustment);
}
@@ -5071,8 +5093,8 @@ exo_icon_view_get_path_at_pos (const ExoIconView *icon_view,
g_return_val_if_fail (EXO_IS_ICON_VIEW (icon_view), NULL);
/* translate the widget coordinates to icon window coordinates */
- x += icon_view->priv->hadjustment->value;
- y += icon_view->priv->vadjustment->value;
+ x += gtk_adjustment_get_value (icon_view->priv->hadjustment);
+ y += gtk_adjustment_get_value (icon_view->priv->vadjustment);
item = exo_icon_view_get_item_at_coords (icon_view, x, y, TRUE, NULL);
@@ -5162,10 +5184,10 @@ exo_icon_view_get_visible_range (const ExoIconView *icon_view,
for (i = 0, lp = priv->items; lp != NULL; ++i, lp = lp->next)
{
item = (const ExoIconViewItem *) lp->data;
- if ((item->area.x + item->area.width >= (gint) priv->hadjustment->value) &&
- (item->area.y + item->area.height >= (gint) priv->vadjustment->value) &&
- (item->area.x <= (gint) (priv->hadjustment->value + priv->hadjustment->page_size)) &&
- (item->area.y <= (gint) (priv->vadjustment->value + priv->vadjustment->page_size)))
+ if ((item->area.x + item->area.width >= (gint) gtk_adjustment_get_value (priv->hadjustment)) &&
+ (item->area.y + item->area.height >= (gint) gtk_adjustment_get_value (priv->vadjustment)) &&
+ (item->area.x <= (gint) (gtk_adjustment_get_value (priv->hadjustment) + gtk_adjustment_get_page_size (priv->hadjustment))) &&
+ (item->area.y <= (gint) (gtk_adjustment_get_value (priv->vadjustment) + gtk_adjustment_get_page_size (priv->vadjustment))))
{
if (start_index == -1)
start_index = i;
@@ -5411,7 +5433,7 @@ exo_icon_view_set_model (ExoIconView *icon_view,
g_source_remove (icon_view->priv->single_click_timeout_id);
/* reset cursor when in single click mode and realized */
- if (G_UNLIKELY (icon_view->priv->single_click && GTK_WIDGET_REALIZED (icon_view)))
+ if (G_UNLIKELY (icon_view->priv->single_click && gtk_widget_get_realized (GTK_WIDGET (icon_view))))
gdk_window_set_cursor (icon_view->priv->bin_window, NULL);
}
@@ -5483,7 +5505,7 @@ exo_icon_view_set_model (ExoIconView *icon_view,
/* notify listeners */
g_object_notify (G_OBJECT (icon_view), "model");
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
}
@@ -6043,14 +6065,17 @@ exo_icon_view_scroll_to_path (ExoIconView *icon_view,
gfloat col_align)
{
ExoIconViewItem *item;
+ GtkAllocation allocation;
g_return_if_fail (EXO_IS_ICON_VIEW (icon_view));
g_return_if_fail (gtk_tree_path_get_depth (path) > 0);
g_return_if_fail (row_align >= 0.0 && row_align <= 1.0);
g_return_if_fail (col_align >= 0.0 && col_align <= 1.0);
+ gtk_widget_get_allocation (GTK_WIDGET (icon_view), &allocation);
+
/* Delay scrolling if either not realized or pending layout() */
- if (!GTK_WIDGET_REALIZED (icon_view) || icon_view->priv->layout_idle_id != 0)
+ if (!gtk_widget_get_realized (GTK_WIDGET (icon_view)) || icon_view->priv->layout_idle_id != 0)
{
/* release the previous scroll_to_path reference */
if (G_UNLIKELY (icon_view->priv->scroll_to_path != NULL))
@@ -6081,17 +6106,17 @@ exo_icon_view_scroll_to_path (ExoIconView *icon_view,
gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
offset = y + item->area.y - focus_width -
- row_align * (GTK_WIDGET (icon_view)->allocation.height - item->area.height);
- value = CLAMP (icon_view->priv->vadjustment->value + offset,
- icon_view->priv->vadjustment->lower,
- icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size);
+ row_align * (allocation.height - item->area.height);
+ value = CLAMP (gtk_adjustment_get_value (icon_view->priv->vadjustment) + offset,
+ gtk_adjustment_get_lower (icon_view->priv->vadjustment),
+ gtk_adjustment_get_upper (icon_view->priv->vadjustment) - gtk_adjustment_get_page_size (icon_view->priv->vadjustment));
gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
offset = x + item->area.x - focus_width -
- col_align * (GTK_WIDGET (icon_view)->allocation.width - item->area.width);
- value = CLAMP (icon_view->priv->hadjustment->value + offset,
- icon_view->priv->hadjustment->lower,
- icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size);
+ col_align * (allocation.width - item->area.width);
+ value = CLAMP (gtk_adjustment_get_value (icon_view->priv->hadjustment) + offset,
+ gtk_adjustment_get_lower (icon_view->priv->hadjustment),
+ gtk_adjustment_get_upper (icon_view->priv->hadjustment) - gtk_adjustment_get_page_size (icon_view->priv->hadjustment));
gtk_adjustment_set_value (icon_view->priv->hadjustment, value);
gtk_adjustment_changed (icon_view->priv->hadjustment);
@@ -6649,8 +6674,8 @@ exo_icon_view_autoscroll (ExoIconView *icon_view)
gint hoffset, voffset;
gfloat value;
- gdk_window_get_pointer (GTK_WIDGET (icon_view)->window, &px, &py, NULL);
- gdk_window_get_geometry (GTK_WIDGET (icon_view)->window, &x, &y, &width, &height, NULL);
+ gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (icon_view)), &px, &py, NULL);
+ gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (icon_view)), &x, &y, &width, &height, NULL);
/* see if we are near the edge. */
voffset = py - (y + 2 * SCROLL_EDGE_SIZE);
@@ -6663,16 +6688,16 @@ exo_icon_view_autoscroll (ExoIconView *icon_view)
if (voffset != 0)
{
- value = CLAMP (icon_view->priv->vadjustment->value + voffset,
- icon_view->priv->vadjustment->lower,
- icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size);
+ value = CLAMP (gtk_adjustment_get_value (icon_view->priv->vadjustment) + voffset,
+ gtk_adjustment_get_lower (icon_view->priv->vadjustment),
+ gtk_adjustment_get_upper (icon_view->priv->vadjustment) - gtk_adjustment_get_page_size (icon_view->priv->vadjustment));
gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
}
if (hoffset != 0)
{
- value = CLAMP (icon_view->priv->hadjustment->value + hoffset,
- icon_view->priv->hadjustment->lower,
- icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size);
+ value = CLAMP (gtk_adjustment_get_value (icon_view->priv->hadjustment) + hoffset,
+ gtk_adjustment_get_lower (icon_view->priv->hadjustment),
+ gtk_adjustment_get_upper (icon_view->priv->hadjustment) - gtk_adjustment_get_page_size (icon_view->priv->hadjustment));
gtk_adjustment_set_value (icon_view->priv->hadjustment, value);
}
}
@@ -6781,7 +6806,7 @@ out:
{
GtkWidget *source_widget;
- *suggested_action = context->suggested_action;
+ *suggested_action = gdk_drag_context_get_suggested_action (context);
source_widget = gtk_drag_get_source_widget (context);
if (source_widget == widget)
@@ -6789,7 +6814,7 @@ out:
/* Default to MOVE, unless the user has
* pressed ctrl or shift to affect available actions
*/
- if ((context->actions & GDK_ACTION_MOVE) != 0)
+ if ((gdk_drag_context_get_actions (context) & GDK_ACTION_MOVE) != 0)
*suggested_action = GDK_ACTION_MOVE;
}
@@ -6994,7 +7019,7 @@ exo_icon_view_drag_data_get (GtkWidget *widget,
goto done;
/* If drag_data_get does nothing, try providing row data. */
- if (selection_data->target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
+ if (gtk_selection_data_get_target (selection_data) == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
gtk_tree_set_row_drag_data (selection_data,
model,
source_row);
@@ -7226,7 +7251,7 @@ exo_icon_view_drag_data_received (GtkWidget *widget,
if (dest_row == NULL)
return;
- if (selection_data->length >= 0)
+ if (gtk_selection_data_get_length (selection_data) >= 0)
{
if (gtk_tree_drag_dest_drag_data_received (GTK_TREE_DRAG_DEST (model),
dest_row,
@@ -7236,7 +7261,7 @@ exo_icon_view_drag_data_received (GtkWidget *widget,
gtk_drag_finish (context,
accepted,
- (context->action == GDK_ACTION_MOVE),
+ (gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE),
drag_time);
gtk_tree_path_free (dest_row);
@@ -7562,7 +7587,7 @@ exo_icon_view_create_drag_icon (ExoIconView *icon_view,
g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, NULL);
/* verify that the widget is realized */
- if (G_UNLIKELY (!GTK_WIDGET_REALIZED (icon_view)))
+ if (G_UNLIKELY (!gtk_widget_get_realized (GTK_WIDGET (icon_view))))
return NULL;
idx = gtk_tree_path_get_indices (path)[0];
@@ -7578,7 +7603,7 @@ exo_icon_view_create_drag_icon (ExoIconView *icon_view,
-1);
gc = gdk_gc_new (drawable);
- gdk_gc_set_rgb_fg_color (gc, &widget->style->base[GTK_WIDGET_STATE (widget)]);
+ gdk_gc_set_rgb_fg_color (gc, >k_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
gdk_draw_rectangle (drawable, gc, TRUE, 0, 0, item->area.width + 2, item->area.height + 2);
area.x = 0;
@@ -7588,7 +7613,7 @@ exo_icon_view_create_drag_icon (ExoIconView *icon_view,
exo_icon_view_paint_item (icon_view, item, &area, drawable, 1, 1, FALSE);
- gdk_gc_set_rgb_fg_color (gc, &widget->style->black);
+ gdk_gc_set_rgb_fg_color (gc, >k_widget_get_style (widget)->black);
gdk_draw_rectangle (drawable, gc, FALSE, 1, 1, item->area.width + 1, item->area.height + 1);
g_object_unref (G_OBJECT (gc));
@@ -7842,7 +7867,7 @@ exo_icon_view_single_click_timeout (gpointer user_data)
GDK_THREADS_ENTER ();
/* verify that we are in single-click mode, have focus and a prelit item */
- if (GTK_WIDGET_HAS_FOCUS (icon_view) && icon_view->priv->single_click && icon_view->priv->prelit_item != NULL)
+ if (gtk_widget_has_focus (GTK_WIDGET (icon_view)) && icon_view->priv->single_click && icon_view->priv->prelit_item != NULL)
{
/* work on the prelit item */
item = icon_view->priv->prelit_item;
@@ -8196,17 +8221,17 @@ exo_icon_view_search_ensure_directory (ExoIconView *icon_view)
/* check if we already have a search window */
if (G_LIKELY (icon_view->priv->search_window != NULL))
{
- if (GTK_WINDOW (toplevel)->group != NULL)
- gtk_window_group_add_window (GTK_WINDOW (toplevel)->group, GTK_WINDOW (icon_view->priv->search_window));
- else if (GTK_WINDOW (icon_view->priv->search_window)->group != NULL)
- gtk_window_group_remove_window (GTK_WINDOW (icon_view->priv->search_window)->group, GTK_WINDOW (icon_view->priv->search_window));
+ if (gtk_window_get_group (GTK_WINDOW (toplevel)) != NULL)
+ gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)), GTK_WINDOW (icon_view->priv->search_window));
+ else if (gtk_window_get_group (GTK_WINDOW (icon_view->priv->search_window)) != NULL)
+ gtk_window_group_remove_window (gtk_window_get_group (GTK_WINDOW (icon_view->priv->search_window)), GTK_WINDOW (icon_view->priv->search_window));
return;
}
/* allocate a new search window */
icon_view->priv->search_window = gtk_window_new (GTK_WINDOW_POPUP);
- if (GTK_WINDOW (toplevel)->group != NULL)
- gtk_window_group_add_window (GTK_WINDOW (toplevel)->group, GTK_WINDOW (icon_view->priv->search_window));
+ if (gtk_window_get_group (GTK_WINDOW (toplevel)) != NULL)
+ gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)), GTK_WINDOW (icon_view->priv->search_window));
gtk_window_set_modal (GTK_WINDOW (icon_view->priv->search_window), TRUE);
gtk_window_set_screen (GTK_WINDOW (icon_view->priv->search_window), gtk_widget_get_screen (GTK_WIDGET (icon_view)));
@@ -8229,7 +8254,7 @@ exo_icon_view_search_ensure_directory (ExoIconView *icon_view)
/* allocate the search entry widget */
icon_view->priv->search_entry = gtk_entry_new ();
g_signal_connect (G_OBJECT (icon_view->priv->search_entry), "activate", G_CALLBACK (exo_icon_view_search_activate), icon_view);
- g_signal_connect (G_OBJECT (GTK_ENTRY (icon_view->priv->search_entry)->im_context), "preedit-changed",
+ g_signal_connect (G_OBJECT (icon_view->priv->search_entry), "preedit-changed",
G_CALLBACK (exo_icon_view_search_preedit_changed), icon_view);
gtk_box_pack_start (GTK_BOX (vbox), icon_view->priv->search_entry, TRUE, TRUE, 0);
gtk_widget_realize (icon_view->priv->search_entry);
@@ -8395,7 +8420,7 @@ exo_icon_view_search_move (GtkWidget *widget,
static void
-exo_icon_view_search_preedit_changed (GtkIMContext *im_context,
+exo_icon_view_search_preedit_changed (GtkEntry *entry,
ExoIconView *icon_view)
{
icon_view->priv->search_imcontext_changed = TRUE;
@@ -8423,14 +8448,14 @@ exo_icon_view_search_start (ExoIconView *icon_view,
return FALSE;
/* check if we already display the search window */
- if (icon_view->priv->search_window != NULL && GTK_WIDGET_VISIBLE (icon_view->priv->search_window))
+ if (icon_view->priv->search_window != NULL && gtk_widget_get_visible (icon_view->priv->search_window))
return TRUE;
/* we only start interactive search if we have focus,
* we don't want to start interactive search if one of
* our children has the focus.
*/
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return FALSE;
/* verify that we have a search column */
@@ -8549,7 +8574,7 @@ exo_icon_view_search_position_func (ExoIconView *icon_view,
{
GtkRequisition requisition;
GdkRectangle monitor;
- GdkWindow *view_window = GTK_WIDGET (icon_view)->window;
+ GdkWindow *view_window = gtk_widget_get_window (GTK_WIDGET (icon_view));
GdkScreen *screen = gdk_drawable_get_screen (view_window);
gint view_width, view_height;
gint view_x, view_y;
diff --git a/exo/exo-thumbnail-preview.c b/exo/exo-thumbnail-preview.c
index 79a899b..c6439c1 100644
--- a/exo/exo-thumbnail-preview.c
+++ b/exo/exo-thumbnail-preview.c
@@ -148,11 +148,11 @@ exo_thumbnail_preview_style_set (GtkWidget *ebox,
_exo_return_if_fail (GTK_IS_EVENT_BOX (ebox));
/* check if the ebox is already realized */
- if (GTK_WIDGET_REALIZED (ebox))
+ if (gtk_widget_get_realized (ebox))
{
/* set background color (using the base color) */
g_signal_handlers_block_by_func (G_OBJECT (ebox), exo_thumbnail_preview_style_set, thumbnail_preview);
- gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, &ebox->style->base[GTK_STATE_NORMAL]);
+ gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, >k_widget_get_style (ebox)->base[GTK_STATE_NORMAL]);
g_signal_handlers_unblock_by_func (G_OBJECT (ebox), exo_thumbnail_preview_style_set, thumbnail_preview);
}
}
diff --git a/exo/exo-toolbars-editor-dialog.c b/exo/exo-toolbars-editor-dialog.c
index 95b4568..f4bc6fb 100644
--- a/exo/exo-toolbars-editor-dialog.c
+++ b/exo/exo-toolbars-editor-dialog.c
@@ -94,13 +94,13 @@ exo_toolbars_editor_dialog_init (ExoToolbarsEditorDialog *dialog)
gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 300);
dialog->priv->editor = g_object_new (EXO_TYPE_TOOLBARS_EDITOR, NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->priv->editor, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->priv->editor, TRUE, TRUE, 0);
gtk_widget_show (dialog->priv->editor);
button = gtk_button_new ();
g_signal_connect_swapped (G_OBJECT (button), "clicked",
G_CALLBACK (exo_toolbars_editor_dialog_add_toolbar), dialog);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), button, FALSE, TRUE, 0);
gtk_widget_show (button);
align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
@@ -122,7 +122,7 @@ exo_toolbars_editor_dialog_init (ExoToolbarsEditorDialog *dialog)
button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
g_signal_connect_swapped (G_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), dialog);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), button, FALSE, TRUE, 0);
gtk_widget_show (button);
}
diff --git a/exo/exo-toolbars-editor.c b/exo/exo-toolbars-editor.c
index 1d86ccd..62656d6 100644
--- a/exo/exo-toolbars-editor.c
+++ b/exo/exo-toolbars-editor.c
@@ -310,7 +310,7 @@ exo_toolbars_editor_drag_data_get (GtkWidget *item,
action = g_object_get_data (G_OBJECT (item), I_("gtk-action"));
target = (action != NULL) ? gtk_action_get_name (action) : "separator";
- gtk_selection_data_set (selection_data, selection_data->target,
+ gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
8, (const guchar *) target, strlen (target));
}
diff --git a/exo/exo-toolbars-private.c b/exo/exo-toolbars-private.c
index bffcaba..0904b00 100644
--- a/exo/exo-toolbars-private.c
+++ b/exo/exo-toolbars-private.c
@@ -39,14 +39,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);
}
@@ -99,13 +99,13 @@ new_pixbuf_from_widget (GtkWidget *widget)
gtk_widget_size_request (window, &requisition);
/* Create a pixmap */
- pixmap = gdk_pixmap_new (GDK_DRAWABLE (window->window), icon_width, icon_height, -1);
+ pixmap = gdk_pixmap_new (gtk_widget_get_window (window), icon_width, icon_height, -1);
gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), gtk_widget_get_colormap (window));
/* Draw the window */
gtk_widget_ensure_style (window);
- g_assert (window->style);
- g_assert (window->style->font_desc);
+ g_assert (gtk_widget_get_style (window));
+ g_assert (gtk_widget_get_style (window)->font_desc);
fake_expose_widget (window, pixmap);
fake_expose_widget (widget, pixmap);
@@ -341,12 +341,12 @@ _exo_toolbars_set_drag_cursor (GtkWidget *widget)
GdkCursor *cursor;
GdkPixbuf *pixbuf;
- if (G_LIKELY (widget->window != NULL))
+ if (G_LIKELY (gtk_widget_get_window (widget) != NULL))
{
pixbuf = gdk_pixbuf_new_from_inline (-1, drag_cursor_data, FALSE, NULL);
cursor = gdk_cursor_new_from_pixbuf (gtk_widget_get_display (widget),
pixbuf, 12, 12);
- gdk_window_set_cursor (widget->window, cursor);
+ gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
g_object_unref (G_OBJECT (pixbuf));
gdk_cursor_unref (cursor);
}
@@ -361,8 +361,8 @@ _exo_toolbars_set_drag_cursor (GtkWidget *widget)
void
_exo_toolbars_unset_drag_cursor (GtkWidget *widget)
{
- if (G_LIKELY (widget->window != NULL))
- gdk_window_set_cursor (widget->window, NULL);
+ if (G_LIKELY (gtk_widget_get_window (widget) != NULL))
+ gdk_window_set_cursor (gtk_widget_get_window (widget), NULL);
}
diff --git a/exo/exo-toolbars-view.c b/exo/exo-toolbars-view.c
index aeb5c2d..269a314 100644
--- a/exo/exo-toolbars-view.c
+++ b/exo/exo-toolbars-view.c
@@ -382,7 +382,7 @@ exo_toolbars_view_get_toolbar_position (ExoToolbarsView *view,
gint position;
children = gtk_container_get_children (GTK_CONTAINER (view));
- position = g_list_index (children, toolbar->parent);
+ position = g_list_index (children, gtk_widget_get_parent (toolbar));
g_list_free (children);
return position;
@@ -454,9 +454,9 @@ exo_toolbars_view_drag_data_delete (GtkWidget *item,
gint toolbar_position;
gint item_position;
- item_position = gtk_toolbar_get_item_index (GTK_TOOLBAR (item->parent),
+ item_position = gtk_toolbar_get_item_index (GTK_TOOLBAR (gtk_widget_get_parent (item)),
GTK_TOOL_ITEM (item));
- toolbar_position = exo_toolbars_view_get_toolbar_position (view, item->parent);
+ toolbar_position = exo_toolbars_view_get_toolbar_position (view, gtk_widget_get_parent (item));
exo_toolbars_model_remove_item (view->priv->model, toolbar_position, item_position);
}
@@ -482,7 +482,7 @@ exo_toolbars_view_drag_data_get (GtkWidget *item,
else
target = exo_toolbars_model_get_item_data (view->priv->model, type, id);
- gtk_selection_data_set (selection_data, selection_data->target,
+ gtk_selection_data_set (selection_data, gtk_selection_data_get_target(selection_data),
8, (guchar *) target, strlen (target));
g_free (target);
@@ -647,7 +647,7 @@ exo_toolbars_view_drag_data_received (GtkWidget *toolbar,
target = gtk_drag_dest_find_target (toolbar, context, NULL);
type = exo_toolbars_model_get_item_type (view->priv->model, target);
- id = exo_toolbars_model_get_item_id (view->priv->model, type, (const gchar *) selection_data->data);
+ id = exo_toolbars_model_get_item_id (view->priv->model, type, (const gchar *) gtk_selection_data_get_data (selection_data));
if (G_UNLIKELY (id == NULL))
{
@@ -670,12 +670,12 @@ exo_toolbars_view_drag_data_received (GtkWidget *toolbar,
item_position = gtk_toolbar_get_drop_index (GTK_TOOLBAR (toolbar), x, y);
toolbar_position = exo_toolbars_view_get_toolbar_position (view, toolbar);
- if (data_is_separator ((const gchar *) selection_data->data))
+ if (data_is_separator ((const gchar *) gtk_selection_data_get_data (selection_data)))
exo_toolbars_model_add_separator (view->priv->model, toolbar_position, item_position);
else
exo_toolbars_model_add_item (view->priv->model, toolbar_position, item_position, id, type);
- gtk_drag_finish (context, TRUE, context->action == GDK_ACTION_MOVE, drag_time);
+ gtk_drag_finish (context, TRUE, gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE, drag_time);
}
g_free (type);
@@ -882,8 +882,10 @@ exo_toolbars_view_drag_motion (GtkWidget *toolbar,
GdkAtom target;
gint toolbar_position;
gint idx;
+ GdkDragAction suggested_action;
source = gtk_drag_get_source_widget (context);
+ suggested_action = gdk_drag_context_get_suggested_action (context);
if (G_LIKELY (source != NULL))
{
toolbar_position = exo_toolbars_view_get_toolbar_position (view, toolbar);
@@ -899,8 +901,9 @@ exo_toolbars_view_drag_motion (GtkWidget *toolbar,
return FALSE;
}
+ /* FIXME how to set the suggested action on the context? */
if (gtk_widget_is_ancestor (source, toolbar))
- context->suggested_action = GDK_ACTION_MOVE;
+ suggested_action = GDK_ACTION_MOVE;
}
target = gtk_drag_dest_find_target (toolbar, context, NULL);
@@ -933,7 +936,7 @@ exo_toolbars_view_drag_motion (GtkWidget *toolbar,
idx);
}
- gdk_drag_status (context, context->suggested_action, drag_time);
+ gdk_drag_status (context, suggested_action, drag_time);
return TRUE;
}
diff --git a/exo/exo-tree-view.c b/exo/exo-tree-view.c
index 96b26e4..ae87663 100644
--- a/exo/exo-tree-view.c
+++ b/exo/exo-tree-view.c
@@ -316,7 +316,7 @@ exo_tree_view_button_press_event (GtkWidget *widget,
/* if no custom select function is set, we simply use exo_noop_false here,
* to tell the tree view that it may not alter the selection.
*/
- if (G_LIKELY (selection->user_func == NULL))
+ if (G_LIKELY (gtk_tree_selection_get_select_function (selection) == NULL))
gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) exo_noop_false, NULL, NULL);
else
selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
@@ -365,7 +365,7 @@ exo_tree_view_button_press_event (GtkWidget *widget,
&& path != NULL && gtk_tree_selection_path_is_selected (selection, path))
{
/* check if we have to restore paths */
- if (G_LIKELY (selection->user_func != (GtkTreeSelectionFunc) exo_noop_false))
+ if (G_LIKELY (gtk_tree_selection_get_select_function (selection) != (GtkTreeSelectionFunc) exo_noop_false))
{
/* select all previously selected paths */
for (lp = selected_paths; lp != NULL; lp = lp->next)
@@ -374,12 +374,12 @@ exo_tree_view_button_press_event (GtkWidget *widget,
}
/* see bug http://bugzilla.xfce.org/show_bug.cgi?id=6230 for more information */
- if (G_LIKELY (selection->user_func == (GtkTreeSelectionFunc) exo_noop_false))
+ if (G_LIKELY (gtk_tree_selection_get_select_function (selection) == (GtkTreeSelectionFunc) exo_noop_false))
{
/* just reset the select function (previously set to exo_noop_false),
* there's no clean way to do this, so what the heck.
*/
- selection->user_func = NULL;
+ gtk_tree_selection_set_select_function (selection, NULL, NULL, NULL);
}
/* release the path (if any) */
@@ -575,7 +575,7 @@ exo_tree_view_leave_notify_event (GtkWidget *widget,
}
/* reset the cursor for the tree view internal window */
- if (GTK_WIDGET_REALIZED (tree_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
gdk_window_set_cursor (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (tree_view)), NULL);
/* the next button-release-event should not activate */
@@ -621,7 +621,7 @@ exo_tree_view_move_cursor (GtkTreeView *view,
}
/* reset the cursor for the tree view internal window */
- if (GTK_WIDGET_REALIZED (tree_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
gdk_window_set_cursor (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (tree_view)), NULL);
/* call the parent's handler */
@@ -646,7 +646,7 @@ exo_tree_view_single_click_timeout (gpointer user_data)
GDK_THREADS_ENTER ();
/* verify that we are in single-click mode, have focus and a hover path */
- if (GTK_WIDGET_HAS_FOCUS (tree_view) && tree_view->priv->single_click && tree_view->priv->hover_path != NULL)
+ if (gtk_widget_has_focus (GTK_WIDGET (tree_view)) && tree_view->priv->single_click && tree_view->priv->hover_path != NULL)
{
/* transform the hover_path to a tree iterator */
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
diff --git a/exo/exo-wrap-table.c b/exo/exo-wrap-table.c
index 2b2ed24..e79a3fd 100644
--- a/exo/exo-wrap-table.c
+++ b/exo/exo-wrap-table.c
@@ -190,7 +190,7 @@ exo_wrap_table_init (ExoWrapTable *table)
table->priv = EXO_WRAP_TABLE_GET_PRIVATE (table);
/* we don't provide our own window */
- GTK_WIDGET_SET_FLAGS (table, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (table), FALSE);
}
@@ -265,15 +265,17 @@ exo_wrap_table_size_request (GtkWidget *widget,
gint num_children;
gint num_cols;
gint num_rows = 0;
+ GtkAllocation allocation;
/* determine the max size request */
num_children = exo_wrap_table_get_max_child_size (table, &max_width, &max_height);
+ gtk_widget_get_allocation (widget, &allocation);
/* check if we have any visible children */
if (G_LIKELY (num_children > 0))
{
- num_cols = exo_wrap_table_get_num_fitting (widget->allocation.width
- - GTK_CONTAINER (widget)->border_width * 2,
+ num_cols = exo_wrap_table_get_num_fitting (allocation.width
+ - gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2,
table->priv->col_spacing, max_width);
if (G_LIKELY (num_cols > 0))
num_rows = num_children / num_cols;
@@ -285,7 +287,7 @@ exo_wrap_table_size_request (GtkWidget *widget,
requisition->width = -1;
requisition->height = (num_rows * max_height)
+ (num_rows - 1) * table->priv->col_spacing
- + GTK_CONTAINER (widget)->border_width * 2;
+ + gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
}
else
{
@@ -303,7 +305,7 @@ exo_wrap_table_size_allocate (GtkWidget *widget,
ExoWrapTable *table = EXO_WRAP_TABLE (widget);
/* setup the new allocation */
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
/* layout the children */
exo_wrap_table_layout (table);
@@ -324,13 +326,13 @@ exo_wrap_table_add (GtkContainer *container,
table->priv->children = g_list_append (table->priv->children, widget);
/* realize the widget if required */
- if (GTK_WIDGET_REALIZED (container))
+ if (gtk_widget_get_realized (GTK_WIDGET (container)))
gtk_widget_realize (widget);
/* map the widget if required */
- if (GTK_WIDGET_VISIBLE (container) && GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (GTK_WIDGET (container)) && gtk_widget_get_visible (widget))
{
- if (GTK_WIDGET_MAPPED (container))
+ if (gtk_widget_get_mapped (GTK_WIDGET (container)))
gtk_widget_map (widget);
}
@@ -348,7 +350,7 @@ exo_wrap_table_remove (GtkContainer *container,
gboolean widget_was_visible;
/* check if the widget was visible */
- widget_was_visible = GTK_WIDGET_VISIBLE (widget);
+ widget_was_visible = gtk_widget_get_visible (widget);
/* unparent and remove the widget */
gtk_widget_unparent (widget);
@@ -398,6 +400,7 @@ exo_wrap_table_layout (ExoWrapTable *table)
gint num_cols;
gint max_height;
gint max_width;
+ GtkAllocation allocation;
/* determine the number of visible children and the max size */
num_children = exo_wrap_table_get_max_child_size (table, &max_width, &max_height);
@@ -405,8 +408,8 @@ exo_wrap_table_layout (ExoWrapTable *table)
return;
/* determine the number of columns */
- num_cols = exo_wrap_table_get_num_fitting (GTK_WIDGET (table)->allocation.width
- - GTK_CONTAINER (table)->border_width * 2,
+ num_cols = exo_wrap_table_get_num_fitting (allocation.width
+ - gtk_container_get_border_width (GTK_CONTAINER (table)) * 2,
table->priv->col_spacing, max_width);
/* verify that the number of columns match */
@@ -418,19 +421,20 @@ exo_wrap_table_layout (ExoWrapTable *table)
}
/* determine the horizontal bounds */
- x0 = GTK_WIDGET (table)->allocation.x + GTK_CONTAINER (table)->border_width;
- x1 = x0 + GTK_WIDGET (table)->allocation.width - GTK_CONTAINER (table)->border_width;
+ gtk_widget_get_allocation (GTK_WIDGET (table), &allocation);
+ x0 = allocation.x + gtk_container_get_border_width (GTK_CONTAINER (table));
+ x1 = x0 + allocation.width - gtk_container_get_border_width (GTK_CONTAINER (table));
/* initialize the position */
x = x0;
- y = GTK_WIDGET (table)->allocation.y + GTK_CONTAINER (table)->border_width;
+ y = allocation.y + gtk_container_get_border_width (GTK_CONTAINER (table));
/* allocate space to all visible children */
for (lp = table->priv->children; lp != NULL; lp = lp->next)
{
/* allocate space only for visible children */
child = GTK_WIDGET (lp->data);
- if (G_UNLIKELY (!GTK_WIDGET_VISIBLE (child)))
+ if (G_UNLIKELY (!gtk_widget_get_visible (child)))
continue;
/* initialize the child position */
@@ -501,7 +505,7 @@ exo_wrap_table_get_max_child_size (const ExoWrapTable *table,
for (lp = table->priv->children; lp != NULL; lp = lp->next)
{
child = GTK_WIDGET (lp->data);
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
gtk_widget_size_request (child, &child_requisition);
if (child_requisition.width > max_width)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list