2019-03-28 03:47:32 +00:00
|
|
|
/* gtkoverlaylayout.c: Overlay layout manager
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
*
|
|
|
|
* Copyright 2019 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2020-05-25 18:22:10 +00:00
|
|
|
#include "gtkoverlaylayout.h"
|
2019-03-28 03:47:32 +00:00
|
|
|
|
|
|
|
#include "gtkintl.h"
|
|
|
|
#include "gtklayoutchild.h"
|
|
|
|
#include "gtkoverlay.h"
|
|
|
|
#include "gtkprivate.h"
|
|
|
|
#include "gtkwidgetprivate.h"
|
|
|
|
|
|
|
|
#include <graphene-gobject.h>
|
|
|
|
|
2020-07-25 23:02:33 +00:00
|
|
|
|
|
|
|
/**
|
2021-02-27 23:23:07 +00:00
|
|
|
* GtkOverlayLayout:
|
|
|
|
*
|
|
|
|
* `GtkOverlayLayout` is the layout manager used by `GtkOverlay`.
|
2020-07-25 23:02:33 +00:00
|
|
|
*
|
|
|
|
* It places widgets as overlays on top of the main child.
|
|
|
|
*
|
|
|
|
* This is not a reusable layout manager, since it expects its widget
|
2021-02-27 23:23:07 +00:00
|
|
|
* to be a `GtkOverlay`. It only listed here so that its layout
|
2020-07-25 23:02:33 +00:00
|
|
|
* properties get documented.
|
|
|
|
*/
|
|
|
|
|
2021-03-01 06:45:50 +00:00
|
|
|
/**
|
|
|
|
* GtkOverlayLayoutChild:
|
|
|
|
*
|
|
|
|
* `GtkLayoutChild` subclass for children in a `GtkOverlayLayout`.
|
|
|
|
*/
|
|
|
|
|
2019-03-28 03:47:32 +00:00
|
|
|
struct _GtkOverlayLayout
|
|
|
|
{
|
|
|
|
GtkLayoutManager parent_instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkOverlayLayoutChild
|
|
|
|
{
|
|
|
|
GtkLayoutChild parent_instance;
|
|
|
|
|
|
|
|
guint measure : 1;
|
|
|
|
guint clip_overlay : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_MEASURE = 1,
|
|
|
|
PROP_CLIP_OVERLAY,
|
|
|
|
|
|
|
|
N_CHILD_PROPERTIES
|
|
|
|
};
|
|
|
|
|
|
|
|
static GParamSpec *child_props[N_CHILD_PROPERTIES];
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GtkOverlayLayoutChild, gtk_overlay_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_child_set_property (GObject *gobject,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkOverlayLayoutChild *self = GTK_OVERLAY_LAYOUT_CHILD (gobject);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_MEASURE:
|
|
|
|
gtk_overlay_layout_child_set_measure (self, g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_CLIP_OVERLAY:
|
|
|
|
gtk_overlay_layout_child_set_clip_overlay (self, g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_child_get_property (GObject *gobject,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkOverlayLayoutChild *self = GTK_OVERLAY_LAYOUT_CHILD (gobject);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_MEASURE:
|
|
|
|
g_value_set_boolean (value, self->measure);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_CLIP_OVERLAY:
|
|
|
|
g_value_set_boolean (value, self->clip_overlay);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_child_class_init (GtkOverlayLayoutChildClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
gobject_class->set_property = gtk_overlay_layout_child_set_property;
|
|
|
|
gobject_class->get_property = gtk_overlay_layout_child_get_property;
|
|
|
|
|
2020-05-27 14:45:38 +00:00
|
|
|
/**
|
2021-02-27 23:23:07 +00:00
|
|
|
* GtkOverlayLayoutChild:measure: (attributes org.gtk.Property.get=gtk_overlay_layout_child_get_measure org.gtk.Property.set=gtk_overlay_layout_child_set_measure)
|
2020-05-27 14:45:38 +00:00
|
|
|
*
|
2021-02-27 23:23:07 +00:00
|
|
|
* Whether the child size should contribute to the `GtkOverlayLayout`'s
|
2020-05-27 14:45:38 +00:00
|
|
|
* measurement.
|
|
|
|
*/
|
2019-03-28 03:47:32 +00:00
|
|
|
child_props[PROP_MEASURE] =
|
|
|
|
g_param_spec_boolean ("measure",
|
|
|
|
P_("Measure"),
|
|
|
|
P_("Include in size measurement"),
|
|
|
|
FALSE,
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2021-02-27 23:23:07 +00:00
|
|
|
|
2020-05-27 14:45:38 +00:00
|
|
|
/**
|
2021-02-27 23:23:07 +00:00
|
|
|
* GtkOverlayLayoutChild:clip-overlay: (attributes org.gtk.Property.get=gtk_overlay_layout_child_get_clip_overlay org.gtk.Property.set=gtk_overlay_layout_child_set_clip_overlay)
|
2020-05-27 14:45:38 +00:00
|
|
|
*
|
|
|
|
* Whether the child should be clipped to fit the parent's size.
|
|
|
|
*/
|
2019-03-28 03:47:32 +00:00
|
|
|
child_props[PROP_CLIP_OVERLAY] =
|
|
|
|
g_param_spec_boolean ("clip-overlay",
|
|
|
|
P_("Clip Overlay"),
|
|
|
|
P_("Clip the overlay child widget so as to fit the parent"),
|
|
|
|
FALSE,
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
g_object_class_install_properties (gobject_class, N_CHILD_PROPERTIES, child_props);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_child_init (GtkOverlayLayoutChild *self)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-02-27 23:23:07 +00:00
|
|
|
* gtk_overlay_layout_child_set_measure: (attributes org.gtk.Method.set_property=measure)
|
|
|
|
* @child: a `GtkOverlayLayoutChild`
|
2019-03-28 03:47:32 +00:00
|
|
|
* @measure: whether to measure this child
|
|
|
|
*
|
|
|
|
* Sets whether to measure this child.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_overlay_layout_child_set_measure (GtkOverlayLayoutChild *child,
|
|
|
|
gboolean measure)
|
|
|
|
{
|
|
|
|
GtkLayoutManager *layout;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OVERLAY_LAYOUT_CHILD (child));
|
|
|
|
|
|
|
|
if (child->measure == measure)
|
|
|
|
return;
|
|
|
|
|
|
|
|
child->measure = measure;
|
|
|
|
|
|
|
|
layout = gtk_layout_child_get_layout_manager (GTK_LAYOUT_CHILD (child));
|
|
|
|
gtk_layout_manager_layout_changed (layout);
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (child), child_props[PROP_MEASURE]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-02-27 23:23:07 +00:00
|
|
|
* gtk_overlay_layout_child_get_measure: (attributes org.gtk.Method.get_property=measure)
|
|
|
|
* @child: a `GtkOverlayLayoutChild`
|
2019-03-28 03:47:32 +00:00
|
|
|
*
|
|
|
|
* Retrieves whether the child is measured.
|
|
|
|
*
|
2020-05-27 14:46:19 +00:00
|
|
|
* Returns: whether the child is measured
|
2019-03-28 03:47:32 +00:00
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gtk_overlay_layout_child_get_measure (GtkOverlayLayoutChild *child)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_OVERLAY_LAYOUT_CHILD (child), FALSE);
|
|
|
|
|
|
|
|
return child->measure;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-02-27 23:23:07 +00:00
|
|
|
* gtk_overlay_layout_child_set_clip_overlay: (attributes org.gtk.Method.set_property=clip-overlay)
|
|
|
|
* @child: a `GtkOverlayLayoutChild`
|
2019-03-28 03:47:32 +00:00
|
|
|
* @clip_overlay: whether to clip this child
|
|
|
|
*
|
|
|
|
* Sets whether to clip this child.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_overlay_layout_child_set_clip_overlay (GtkOverlayLayoutChild *child,
|
|
|
|
gboolean clip_overlay)
|
|
|
|
{
|
|
|
|
GtkLayoutManager *layout;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OVERLAY_LAYOUT_CHILD (child));
|
|
|
|
|
|
|
|
if (child->clip_overlay == clip_overlay)
|
|
|
|
return;
|
|
|
|
|
|
|
|
child->clip_overlay = clip_overlay;
|
|
|
|
|
|
|
|
layout = gtk_layout_child_get_layout_manager (GTK_LAYOUT_CHILD (child));
|
|
|
|
gtk_layout_manager_layout_changed (layout);
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (child), child_props[PROP_CLIP_OVERLAY]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-02-27 23:23:07 +00:00
|
|
|
* gtk_overlay_layout_child_get_clip_overlay: (attributes org.gtk.Method.get_property=clip-overlay)
|
|
|
|
* @child: a `GtkOverlayLayoutChild`
|
2019-03-28 03:47:32 +00:00
|
|
|
*
|
|
|
|
* Retrieves whether the child is clipped.
|
|
|
|
*
|
2020-05-27 14:46:19 +00:00
|
|
|
* Returns: whether the child is clipped
|
2019-03-28 03:47:32 +00:00
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gtk_overlay_layout_child_get_clip_overlay (GtkOverlayLayoutChild *child)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_OVERLAY_LAYOUT_CHILD (child), FALSE);
|
|
|
|
|
|
|
|
return child->clip_overlay;
|
|
|
|
}
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GtkOverlayLayout, gtk_overlay_layout, GTK_TYPE_LAYOUT_MANAGER)
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_measure (GtkLayoutManager *layout_manager,
|
|
|
|
GtkWidget *widget,
|
|
|
|
GtkOrientation orientation,
|
|
|
|
int for_size,
|
|
|
|
int *minimum,
|
|
|
|
int *natural,
|
|
|
|
int *minimum_baseline,
|
|
|
|
int *natural_baseline)
|
|
|
|
{
|
|
|
|
GtkOverlayLayoutChild *child_info;
|
|
|
|
GtkWidget *child;
|
|
|
|
int min, nat;
|
|
|
|
GtkWidget *main_widget;
|
|
|
|
|
2020-05-03 14:32:24 +00:00
|
|
|
main_widget = gtk_overlay_get_child (GTK_OVERLAY (widget));
|
2019-03-28 03:47:32 +00:00
|
|
|
|
|
|
|
min = 0;
|
|
|
|
nat = 0;
|
|
|
|
|
|
|
|
for (child = _gtk_widget_get_first_child (widget);
|
|
|
|
child != NULL;
|
|
|
|
child = _gtk_widget_get_next_sibling (child))
|
|
|
|
{
|
2019-06-10 18:01:59 +00:00
|
|
|
if (!gtk_widget_should_layout (child))
|
|
|
|
continue;
|
|
|
|
|
2019-03-28 03:47:32 +00:00
|
|
|
child_info = GTK_OVERLAY_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (layout_manager, child));
|
|
|
|
|
|
|
|
if (child == main_widget || child_info->measure)
|
|
|
|
{
|
|
|
|
int child_min, child_nat, child_min_baseline, child_nat_baseline;
|
|
|
|
|
|
|
|
gtk_widget_measure (child,
|
|
|
|
orientation,
|
|
|
|
for_size,
|
|
|
|
&child_min, &child_nat,
|
|
|
|
&child_min_baseline, &child_nat_baseline);
|
|
|
|
|
|
|
|
min = MAX (min, child_min);
|
|
|
|
nat = MAX (nat, child_nat);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (minimum != NULL)
|
|
|
|
*minimum = min;
|
|
|
|
if (natural != NULL)
|
|
|
|
*natural = nat;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_compute_child_allocation (GtkOverlay *overlay,
|
|
|
|
GtkWidget *widget,
|
|
|
|
GtkOverlayLayoutChild *child,
|
|
|
|
GtkAllocation *widget_allocation)
|
|
|
|
{
|
|
|
|
GtkAllocation allocation;
|
|
|
|
gboolean result;
|
|
|
|
|
|
|
|
g_signal_emit_by_name (overlay, "get-child-position",
|
|
|
|
widget, &allocation, &result);
|
|
|
|
|
|
|
|
widget_allocation->x = allocation.x;
|
|
|
|
widget_allocation->y = allocation.y;
|
|
|
|
widget_allocation->width = allocation.width;
|
|
|
|
widget_allocation->height = allocation.height;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkAlign
|
|
|
|
effective_align (GtkAlign align,
|
|
|
|
GtkTextDirection direction)
|
|
|
|
{
|
|
|
|
switch (align)
|
|
|
|
{
|
|
|
|
case GTK_ALIGN_START:
|
|
|
|
return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_END : GTK_ALIGN_START;
|
|
|
|
case GTK_ALIGN_END:
|
|
|
|
return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_START : GTK_ALIGN_END;
|
|
|
|
case GTK_ALIGN_FILL:
|
|
|
|
case GTK_ALIGN_CENTER:
|
|
|
|
case GTK_ALIGN_BASELINE:
|
|
|
|
default:
|
|
|
|
return align;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_child_update_style_classes (GtkOverlay *overlay,
|
|
|
|
GtkWidget *child,
|
|
|
|
GtkAllocation *child_allocation)
|
|
|
|
{
|
2020-01-29 11:11:39 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (overlay);
|
2019-03-28 03:47:32 +00:00
|
|
|
int width, height;
|
|
|
|
GtkAlign valign, halign;
|
|
|
|
gboolean is_left, is_right, is_top, is_bottom;
|
|
|
|
gboolean has_left, has_right, has_top, has_bottom;
|
|
|
|
|
2022-03-27 14:59:10 +00:00
|
|
|
has_left = gtk_widget_has_css_class (child, "left");
|
|
|
|
has_right = gtk_widget_has_css_class (child, "right");
|
|
|
|
has_top = gtk_widget_has_css_class (child, "top");
|
|
|
|
has_bottom = gtk_widget_has_css_class (child, "bottom");
|
2019-03-28 03:47:32 +00:00
|
|
|
|
|
|
|
is_left = is_right = is_top = is_bottom = FALSE;
|
|
|
|
|
2020-01-29 11:11:39 +00:00
|
|
|
width = gtk_widget_get_width (widget);
|
|
|
|
height = gtk_widget_get_height (widget);
|
2019-03-28 03:47:32 +00:00
|
|
|
|
|
|
|
halign = effective_align (gtk_widget_get_halign (child),
|
|
|
|
gtk_widget_get_direction (child));
|
|
|
|
|
|
|
|
if (halign == GTK_ALIGN_START)
|
|
|
|
is_left = (child_allocation->x == 0);
|
|
|
|
else if (halign == GTK_ALIGN_END)
|
|
|
|
is_right = (child_allocation->x + child_allocation->width == width);
|
|
|
|
|
|
|
|
valign = gtk_widget_get_valign (child);
|
|
|
|
|
|
|
|
if (valign == GTK_ALIGN_START)
|
|
|
|
is_top = (child_allocation->y == 0);
|
|
|
|
else if (valign == GTK_ALIGN_END)
|
|
|
|
is_bottom = (child_allocation->y + child_allocation->height == height);
|
|
|
|
|
|
|
|
if (has_left && !is_left)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_remove_css_class (child, "left");
|
2019-03-28 03:47:32 +00:00
|
|
|
else if (!has_left && is_left)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_add_css_class (child, "left");
|
2019-03-28 03:47:32 +00:00
|
|
|
|
|
|
|
if (has_right && !is_right)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_remove_css_class (child, "right");
|
2019-03-28 03:47:32 +00:00
|
|
|
else if (!has_right && is_right)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_add_css_class (child, "right");
|
2019-03-28 03:47:32 +00:00
|
|
|
|
|
|
|
if (has_top && !is_top)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_remove_css_class (child, "top");
|
2019-03-28 03:47:32 +00:00
|
|
|
else if (!has_top && is_top)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_add_css_class (child, "top");
|
2019-03-28 03:47:32 +00:00
|
|
|
|
|
|
|
if (has_bottom && !is_bottom)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_remove_css_class (child, "bottom");
|
2019-03-28 03:47:32 +00:00
|
|
|
else if (!has_bottom && is_bottom)
|
2022-03-27 14:59:10 +00:00
|
|
|
gtk_widget_add_css_class (child, "bottom");
|
2019-03-28 03:47:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_child_allocate (GtkOverlay *overlay,
|
|
|
|
GtkWidget *widget,
|
|
|
|
GtkOverlayLayoutChild *child)
|
|
|
|
{
|
|
|
|
GtkAllocation child_allocation;
|
|
|
|
|
2019-06-10 18:01:59 +00:00
|
|
|
if (!gtk_widget_should_layout (widget))
|
2019-03-28 03:47:32 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
gtk_overlay_compute_child_allocation (overlay, widget, child, &child_allocation);
|
|
|
|
|
|
|
|
gtk_overlay_child_update_style_classes (overlay, widget, &child_allocation);
|
|
|
|
gtk_widget_size_allocate (widget, &child_allocation, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_allocate (GtkLayoutManager *layout_manager,
|
|
|
|
GtkWidget *widget,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
int baseline)
|
|
|
|
{
|
|
|
|
GtkWidget *child;
|
|
|
|
GtkWidget *main_widget;
|
|
|
|
|
2020-05-03 14:32:24 +00:00
|
|
|
main_widget = gtk_overlay_get_child (GTK_OVERLAY (widget));
|
2019-03-28 03:47:32 +00:00
|
|
|
if (main_widget && gtk_widget_get_visible (main_widget))
|
|
|
|
gtk_widget_size_allocate (main_widget,
|
|
|
|
&(GtkAllocation) { 0, 0, width, height },
|
|
|
|
-1);
|
|
|
|
|
|
|
|
for (child = _gtk_widget_get_first_child (widget);
|
|
|
|
child != NULL;
|
|
|
|
child = _gtk_widget_get_next_sibling (child))
|
|
|
|
{
|
|
|
|
if (child != main_widget)
|
|
|
|
{
|
|
|
|
GtkOverlayLayoutChild *child_data;
|
|
|
|
child_data = GTK_OVERLAY_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (layout_manager, child));
|
|
|
|
|
|
|
|
gtk_overlay_child_allocate (GTK_OVERLAY (widget), child, child_data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_class_init (GtkOverlayLayoutClass *klass)
|
|
|
|
{
|
|
|
|
GtkLayoutManagerClass *layout_class = GTK_LAYOUT_MANAGER_CLASS (klass);
|
|
|
|
|
2021-01-16 03:35:11 +00:00
|
|
|
layout_class->layout_child_type = GTK_TYPE_OVERLAY_LAYOUT_CHILD;
|
2019-03-28 03:47:32 +00:00
|
|
|
layout_class->measure = gtk_overlay_layout_measure;
|
|
|
|
layout_class->allocate = gtk_overlay_layout_allocate;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_overlay_layout_init (GtkOverlayLayout *self)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-05-27 14:45:38 +00:00
|
|
|
/**
|
|
|
|
* gtk_overlay_layout_new:
|
|
|
|
*
|
2021-02-27 23:23:07 +00:00
|
|
|
* Creates a new `GtkOverlayLayout` instance.
|
2020-05-27 14:45:38 +00:00
|
|
|
*
|
|
|
|
* Returns: the newly created instance
|
|
|
|
*/
|
2019-03-28 03:47:32 +00:00
|
|
|
GtkLayoutManager *
|
|
|
|
gtk_overlay_layout_new (void)
|
|
|
|
{
|
|
|
|
return g_object_new (GTK_TYPE_OVERLAY_LAYOUT, NULL);
|
|
|
|
}
|