[gtk/wip/ebassi/constraint-layout: 4/5] window: Create a GtkConstraintSolver
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/ebassi/constraint-layout: 4/5] window: Create a GtkConstraintSolver
- Date: Fri, 3 May 2019 16:10:03 +0000 (UTC)
commit 7e9b0c8fb0fae313d3be542068bf21d2b9199c9f
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Apr 9 14:22:19 2019 +0100
window: Create a GtkConstraintSolver
Implement the GtkRoot getter for GtkConstraintSolver.
gtk/gtkwindow.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index de59910b0c..0039fe5326 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -282,6 +282,8 @@ typedef struct
GskRenderer *renderer;
GList *foci;
+
+ GtkConstraintSolver *constraint_solver;
} GtkWindowPrivate;
#ifdef GDK_WINDOWING_X11
@@ -1893,6 +1895,8 @@ gtk_window_init (GtkWindow *window)
gtk_widget_add_controller (widget, priv->key_controller);
add_actions (window);
+
+ priv->constraint_solver = gtk_constraint_solver_new ();
}
static GtkGesture *
@@ -2360,6 +2364,15 @@ gtk_window_root_get_renderer (GtkRoot *root)
return priv->renderer;
}
+static GtkConstraintSolver *
+gtk_window_root_get_constraint_solver (GtkRoot *root)
+{
+ GtkWindow *self = GTK_WINDOW (root);
+ GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
+
+ return priv->constraint_solver;
+}
+
static void
gtk_window_root_get_surface_transform (GtkRoot *root,
int *x,
@@ -2384,6 +2397,7 @@ gtk_window_root_interface_init (GtkRootInterface *iface)
iface->get_display = gtk_window_root_get_display;
iface->get_renderer = gtk_window_root_get_renderer;
iface->get_surface_transform = gtk_window_root_get_surface_transform;
+ iface->get_constraint_solver = gtk_window_root_get_constraint_solver;
}
/**
@@ -4782,6 +4796,7 @@ gtk_window_finalize (GObject *object)
priv->mnemonics_display_timeout_id = 0;
}
+ g_clear_object (&priv->constraint_solver);
g_clear_object (&priv->renderer);
G_OBJECT_CLASS (gtk_window_parent_class)->finalize (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]