1/* gtkconstraint.h: Constraint between two widgets
2 * Copyright 2019 GNOME Foundation
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Author: Emmanuele Bassi
18 */
19
20#pragma once
21
22#include <gtk/gtktypes.h>
23#include <gtk/gtkenums.h>
24
25G_BEGIN_DECLS
26
27typedef struct _GtkConstraintTarget GtkConstraintTarget;
28
29#define GTK_TYPE_CONSTRAINT_TARGET (gtk_constraint_target_get_type ())
30
31/**
32 * GtkConstraintTarget:
33 *
34 * The `GtkConstraintTarget` interface is implemented by objects that
35 * can be used as source or target in `GtkConstraint`s.
36 *
37 * Besides `GtkWidget`, it is also implemented by `GtkConstraintGuide`.
38 */
39
40GDK_AVAILABLE_IN_ALL
41G_DECLARE_INTERFACE (GtkConstraintTarget, gtk_constraint_target, GTK, CONSTRAINT_TARGET, GObject)
42
43#define GTK_TYPE_CONSTRAINT (gtk_constraint_get_type ())
44
45GDK_AVAILABLE_IN_ALL
46G_DECLARE_FINAL_TYPE (GtkConstraint, gtk_constraint, GTK, CONSTRAINT, GObject)
47
48GDK_AVAILABLE_IN_ALL
49GtkConstraint * gtk_constraint_new (gpointer target,
50 GtkConstraintAttribute target_attribute,
51 GtkConstraintRelation relation,
52 gpointer source,
53 GtkConstraintAttribute source_attribute,
54 double multiplier,
55 double constant,
56 int strength);
57GDK_AVAILABLE_IN_ALL
58GtkConstraint * gtk_constraint_new_constant (gpointer target,
59 GtkConstraintAttribute target_attribute,
60 GtkConstraintRelation relation,
61 double constant,
62 int strength);
63
64GDK_AVAILABLE_IN_ALL
65GtkConstraintTarget * gtk_constraint_get_target (GtkConstraint *constraint);
66GDK_AVAILABLE_IN_ALL
67GtkConstraintAttribute gtk_constraint_get_target_attribute (GtkConstraint *constraint);
68GDK_AVAILABLE_IN_ALL
69GtkConstraintTarget * gtk_constraint_get_source (GtkConstraint *constraint);
70GDK_AVAILABLE_IN_ALL
71GtkConstraintAttribute gtk_constraint_get_source_attribute (GtkConstraint *constraint);
72GDK_AVAILABLE_IN_ALL
73GtkConstraintRelation gtk_constraint_get_relation (GtkConstraint *constraint);
74GDK_AVAILABLE_IN_ALL
75double gtk_constraint_get_multiplier (GtkConstraint *constraint);
76GDK_AVAILABLE_IN_ALL
77double gtk_constraint_get_constant (GtkConstraint *constraint);
78GDK_AVAILABLE_IN_ALL
79int gtk_constraint_get_strength (GtkConstraint *constraint);
80
81GDK_AVAILABLE_IN_ALL
82gboolean gtk_constraint_is_required (GtkConstraint *constraint);
83GDK_AVAILABLE_IN_ALL
84gboolean gtk_constraint_is_attached (GtkConstraint *constraint);
85GDK_AVAILABLE_IN_ALL
86gboolean gtk_constraint_is_constant (GtkConstraint *constraint);
87
88G_END_DECLS
89

source code of gtk/gtk/gtkconstraint.h