From 04562a76e3233a7cf69b98eca89059e66f55c713 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 25 Jun 2019 15:04:05 -0400 Subject: [PATCH] Add GtkConstraintTarget This is an marker interface that we will use to accept other things that widgets in constraints. --- gtk/gtkconstraint.c | 14 ++++++++++++++ gtk/gtkconstraint.h | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/gtk/gtkconstraint.c b/gtk/gtkconstraint.c index d0c152b56d..d7bf3e0a08 100644 --- a/gtk/gtkconstraint.c +++ b/gtk/gtkconstraint.c @@ -581,3 +581,17 @@ gtk_constraint_detach (GtkConstraint *constraint) constraint->constraint_ref = NULL; constraint->solver = NULL; } + +typedef struct _GtkConstraintTargetInterface GtkConstraintTargetInterface; + +struct _GtkConstraintTargetInterface +{ + GTypeInterface g_iface; +}; + +G_DEFINE_INTERFACE (GtkConstraintTarget, gtk_constraint_target, G_TYPE_OBJECT) + +static void +gtk_constraint_target_default_init (GtkConstraintTargetInterface *iface) +{ +} diff --git a/gtk/gtkconstraint.h b/gtk/gtkconstraint.h index 1ca9fd7f5e..1467c86d9c 100644 --- a/gtk/gtkconstraint.h +++ b/gtk/gtkconstraint.h @@ -24,6 +24,21 @@ G_BEGIN_DECLS +typedef struct _GtkConstraintTarget GtkConstraintTarget; + +#define GTK_TYPE_CONSTRAINT_TARGET (gtk_constraint_target_get_type ()) + +/** + * GtkConstraintTarget: + * + * The GtkConstraintTarget interface is implemented by objects that + * can be used as source or target in #GtkConstraints. Besides + * #GtkWidget, it is also implemented by #GtkConstraintGuide. + */ + +GDK_AVAILABLE_IN_ALL +G_DECLARE_INTERFACE (GtkConstraintTarget, gtk_constraint_target, GTK, CONSTRAINT_TARGET, GObject) + #define GTK_TYPE_CONSTRAINT (gtk_constraint_get_type ()) /**