summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-06-25 15:04:05 -0400
committerEmmanuele Bassi <ebassi@gnome.org>2019-06-28 13:11:22 +0100
commit4de3e99fbe93ad7748a7ce724fcc37921faaab47 (patch)
treecb55eaaedf4c3119ab67201aedb69aa48c0b4d21
parentc81e04755dd7f7378a1704959f552f1108760d6b (diff)
downloadgtk+-4de3e99fbe93ad7748a7ce724fcc37921faaab47.tar.gz
Add GtkConstraintTarget
This is an marker interface that we will use to accept other things that widgets in constraints.
-rw-r--r--gtk/gtkconstraint.c14
-rw-r--r--gtk/gtkconstraint.h15
2 files changed, 29 insertions, 0 deletions
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 ())
/**