Commit b2351f8f authored by Timm Bäder's avatar Timm Bäder 👎

widget: Remove _gtk_widget_get_allocation

Getting the allocation is kind of discouraged until we have figured out
what exactly we need to expose, so stop having an internal function for
it. Most of the calls should be replaced by gtk_widget_compute_bounds.
parent c73e0709
......@@ -961,7 +961,7 @@ gtk_entry_accessible_get_character_extents (AtkText *text,
pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, &char_rect);
pango_extents_to_pixels (&char_rect, NULL);
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
surface = gtk_widget_get_surface (widget);
gdk_surface_get_origin (surface, &x_surface, &y_surface);
......
......@@ -13181,7 +13181,7 @@ gtk_widget_create_render_node (GtkWidget *widget,
snapshot = gtk_snapshot_new_with_parent (parent_snapshot);
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
gtk_snapshot_push_debug (snapshot,
"RenderNode for %s %p @ %d x %d",
G_OBJECT_TYPE_NAME (widget), widget,
......
......@@ -454,13 +454,6 @@ _gtk_widget_get_surface (GtkWidget *widget)
return widget->priv->surface;
}
static inline void
_gtk_widget_get_allocation (GtkWidget *widget,
GtkAllocation *allocation)
{
*allocation = widget->priv->allocation;
}
static inline GtkWidget *
_gtk_widget_get_prev_sibling (GtkWidget *widget)
{
......
......@@ -1724,7 +1724,7 @@ edge_under_coordinates (GtkWindow *window,
(priv->edge_constraints & constraints) != constraints)
return FALSE;
_gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
context = _gtk_widget_get_style_context (GTK_WIDGET (window));
gtk_style_context_save_to_node (context, priv->decoration_node);
......@@ -5224,7 +5224,7 @@ gtk_window_move (GtkWindow *window,
{
GtkAllocation allocation;
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
/* we have now sent a request with this position
* with currently-active constraints, so toggle flag.
......@@ -6017,7 +6017,7 @@ popover_get_rect (GtkWindowPopover *popover,
gdouble min, max;
gtk_widget_get_preferred_size (popover->widget, NULL, &req);
_gtk_widget_get_allocation (GTK_WIDGET (window), &win_alloc);
gtk_widget_get_allocation (GTK_WIDGET (window), &win_alloc);
get_shadow_width (window, &win_border);
win_alloc.x += win_border.left;
......@@ -6385,7 +6385,7 @@ gtk_window_realize (GtkWidget *widget)
if (!priv->client_decorated && gtk_window_should_use_csd (window))
create_decoration (widget);
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
/* ensure widget tree is properly size allocated */
if (allocation.x == -1 &&
......@@ -6411,12 +6411,12 @@ gtk_window_realize (GtkWidget *widget)
if (priv->hardcoded_surface)
{
surface = priv->hardcoded_surface;
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
gdk_surface_resize (surface, allocation.width, allocation.height);
}
else
{
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
switch (priv->type)
{
......@@ -6787,7 +6787,7 @@ gtk_window_configure (GtkWindow *window,
* have been a queued resize from child widgets, and so we
* need to reallocate our children in case *they* changed.
*/
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
if (priv->configure_request_count == 0 &&
(allocation.width == width && allocation.height == height))
{
......@@ -7008,7 +7008,7 @@ get_active_region_type (GtkWindow *window, gint x, gint y)
gtk_widget_get_visible (priv->title_box) &&
gtk_widget_get_child_visible (priv->title_box))
{
_gtk_widget_get_allocation (priv->title_box, &allocation);
gtk_widget_get_allocation (priv->title_box, &allocation);
if (allocation.x <= x && allocation.x + allocation.width > x &&
allocation.y <= y && allocation.y + allocation.height > y)
return GTK_WINDOW_REGION_TITLE;
......@@ -7386,7 +7386,7 @@ gtk_window_style_updated (GtkWidget *widget)
GtkAllocation allocation;
GtkBorder window_border;
_gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (widget, &allocation);
get_shadow_width (window, &window_border);
update_opaque_region (window, &window_border, &allocation);
......@@ -7932,7 +7932,7 @@ gtk_window_compute_configure_request (GtkWindow *window,
gdk_surface_get_origin (surface, &ox, &oy);
_gtk_widget_get_allocation (parent_widget, &allocation);
gtk_widget_get_allocation (parent_widget, &allocation);
x = ox + (allocation.width - w) / 2;
y = oy + (allocation.height - h) / 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment