summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-icon-container.c46
-rw-r--r--libnautilus-private/nautilus-icon-dnd.c36
-rw-r--r--libnautilus-private/nautilus-tree-view-drag-dest.c2
3 files changed, 46 insertions, 38 deletions
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index e9ba67573..db52e96c1 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -558,8 +558,8 @@ nautilus_icon_container_scroll (NautilusIconContainer *container,
GtkAdjustment *hadj, *vadj;
int old_h_value, old_v_value;
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
/* Store the old ajustment values so we can tell if we
* ended up actually scrolling. We may not have in a case
@@ -712,8 +712,8 @@ reveal_icon (NautilusIconContainer *container,
details = container->details;
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
if (nautilus_icon_container_is_auto_layout (container)) {
/* ensure that we reveal the entire row/column */
@@ -1008,8 +1008,8 @@ canvas_set_scroll_region_include_visible_area (EelCanvas *canvas,
width = (allocation.width) / canvas->pixels_per_unit;
height = (allocation.height) / canvas->pixels_per_unit;
- old_scroll_x = gtk_adjustment_get_value (GTK_ADJUSTMENT (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))));
- old_scroll_y = gtk_adjustment_get_value (GTK_ADJUSTMENT (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))));
+ old_scroll_x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)));
+ old_scroll_y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)));
x1 = MIN (x1, old_x1 + old_scroll_x);
y1 = MIN (y1, old_y1 + old_scroll_y);
@@ -1116,8 +1116,8 @@ nautilus_icon_container_update_scroll_region (NautilusIconContainer *container)
x1, y1, x2, y2);
}
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
/* Scroll by 1/4 icon each time you click. */
step_increment = nautilus_get_icon_size_for_zoom_level
@@ -2547,13 +2547,13 @@ rubberband_timeout_callback (gpointer data)
adj_changed = FALSE;
gtk_widget_get_allocation (widget, &allocation);
- adj_x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
+ adj_x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
if (adj_x != band_info->last_adj_x) {
band_info->last_adj_x = adj_x;
adj_changed = TRUE;
}
- adj_y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
+ adj_y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
if (adj_y != band_info->last_adj_y) {
band_info->last_adj_y = adj_y;
adj_changed = TRUE;
@@ -2590,8 +2590,8 @@ rubberband_timeout_callback (gpointer data)
/* Remember to convert from widget to scrolled window coords */
eel_canvas_window_to_world (EEL_CANVAS (container),
- x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))),
- y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))),
+ x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))),
+ y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))),
&world_x, &world_y);
if (world_x < band_info->start_x) {
@@ -2704,8 +2704,8 @@ start_rubberbanding (NautilusIconContainer *container,
atk_object_set_name (accessible, "selection");
atk_object_set_description (accessible, _("The selection rectangle"));
- band_info->prev_x = event->x - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
- band_info->prev_y = event->y - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
+ band_info->prev_x = event->x - gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
+ band_info->prev_y = event->y - gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
band_info->active = TRUE;
@@ -4186,11 +4186,11 @@ realize (GtkWidget *widget)
setup_background (container);
setup_label_gcs (container);
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (widget));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget));
g_signal_connect (hadj, "value_changed",
G_CALLBACK (handle_hadjustment_changed), widget);
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (widget));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget));
g_signal_connect (vadj, "value_changed",
G_CALLBACK (handle_vadjustment_changed), widget);
@@ -6582,9 +6582,9 @@ nautilus_icon_container_get_first_visible_icon (NautilusIconContainer *container
gboolean better_icon;
gboolean compare_lt;
- hadj_v = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
- vadj_v = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
- h_page_size = gtk_adjustment_get_page_size (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
+ hadj_v = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
+ vadj_v = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
+ h_page_size = gtk_adjustment_get_page_size (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
if (nautilus_icon_container_is_layout_rtl (container)) {
x = hadj_v + h_page_size - ICON_PAD_LEFT - 1;
@@ -6655,8 +6655,8 @@ nautilus_icon_container_scroll_to_icon (NautilusIconContainer *container,
EelIRect bounds;
GtkAllocation allocation;
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
/* We need to force a relayout now if there are updates queued
@@ -6957,8 +6957,8 @@ nautilus_icon_container_update_visible_icons (NautilusIconContainer *container)
gboolean visible;
GtkAllocation allocation;
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
min_x = gtk_adjustment_get_value (hadj);
diff --git a/libnautilus-private/nautilus-icon-dnd.c b/libnautilus-private/nautilus-icon-dnd.c
index aeb10e983..78fc18251 100644
--- a/libnautilus-private/nautilus-icon-dnd.c
+++ b/libnautilus-private/nautilus-icon-dnd.c
@@ -186,6 +186,10 @@ canvas_rect_world_to_widget (EelCanvas *canvas,
EelIRect *widget_rect)
{
EelDRect window_rect;
+ GtkAdjustment *hadj, *vadj;
+
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
eel_canvas_world_to_window (canvas,
world_rect->x0, world_rect->y0,
@@ -193,10 +197,10 @@ canvas_rect_world_to_widget (EelCanvas *canvas,
eel_canvas_world_to_window (canvas,
world_rect->x1, world_rect->y1,
&window_rect.x1, &window_rect.y1);
- widget_rect->x0 = (int) window_rect.x0 - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas)));
- widget_rect->y0 = (int) window_rect.y0 - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas)));
- widget_rect->x1 = (int) window_rect.x1 - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas)));
- widget_rect->y1 = (int) window_rect.y1 - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas)));
+ widget_rect->x0 = (int) window_rect.x0 - gtk_adjustment_get_value (hadj);
+ widget_rect->y0 = (int) window_rect.y0 - gtk_adjustment_get_value (vadj);
+ widget_rect->x1 = (int) window_rect.x1 - gtk_adjustment_get_value (hadj);
+ widget_rect->y1 = (int) window_rect.y1 - gtk_adjustment_get_value (vadj);
}
static void
@@ -205,8 +209,8 @@ canvas_widget_to_world (EelCanvas *canvas,
double *world_x, double *world_y)
{
eel_canvas_window_to_world (canvas,
- widget_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))),
- widget_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))),
+ widget_x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas))),
+ widget_y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas))),
world_x, world_y);
}
@@ -1082,8 +1086,8 @@ nautilus_icon_container_receive_dropped_icons (NautilusIconContainer *container,
if (real_action > 0) {
eel_canvas_window_to_world (EEL_CANVAS (container),
- x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))),
- y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))),
+ x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))),
+ y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))),
&world_x, &world_y);
drop_target = nautilus_icon_container_find_drop_target (container,
@@ -1293,8 +1297,10 @@ drag_begin_callback (GtkWidget *widget,
container = NAUTILUS_ICON_CONTAINER (widget);
- start_x = container->details->dnd_info->drag_info.start_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
- start_y = container->details->dnd_info->drag_info.start_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
+ start_x = container->details->dnd_info->drag_info.start_x +
+ gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
+ start_y = container->details->dnd_info->drag_info.start_y +
+ gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
/* create a pixmap and mask to drag with */
surface = nautilus_icon_canvas_item_get_drag_surface (container->details->drag_icon->item);
@@ -1332,8 +1338,10 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
/* Notice that the event is in bin_window coordinates, because of
the way the canvas handles events.
*/
- dnd_info->drag_info.start_x = start_x - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
- dnd_info->drag_info.start_y = start_y - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
+ dnd_info->drag_info.start_x = start_x -
+ gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
+ dnd_info->drag_info.start_y = start_y -
+ gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
/* start the drag */
context = gtk_drag_begin (GTK_WIDGET (container),
@@ -1351,8 +1359,8 @@ drag_highlight_draw (GtkWidget *widget,
gint x, y, width, height;
GdkWindow *window;
- x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget)));
- y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget)));
+ x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget)));
+ y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget)));
window = gtk_widget_get_window (widget);
width = gdk_window_get_width (window);
diff --git a/libnautilus-private/nautilus-tree-view-drag-dest.c b/libnautilus-private/nautilus-tree-view-drag-dest.c
index 96962ce0e..f11d07594 100644
--- a/libnautilus-private/nautilus-tree-view-drag-dest.c
+++ b/libnautilus-private/nautilus-tree-view-drag-dest.c
@@ -104,7 +104,7 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
float value;
window = gtk_tree_view_get_bin_window (tree_view);
- vadjustment = gtk_tree_view_get_vadjustment (tree_view);
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (tree_view));
gdk_window_get_pointer (window, NULL, &y, NULL);