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 | |
25 | G_BEGIN_DECLS |
26 | |
27 | typedef 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 | |
40 | GDK_AVAILABLE_IN_ALL |
41 | G_DECLARE_INTERFACE (GtkConstraintTarget, gtk_constraint_target, GTK, CONSTRAINT_TARGET, GObject) |
42 | |
43 | #define GTK_TYPE_CONSTRAINT (gtk_constraint_get_type ()) |
44 | |
45 | GDK_AVAILABLE_IN_ALL |
46 | G_DECLARE_FINAL_TYPE (GtkConstraint, gtk_constraint, GTK, CONSTRAINT, GObject) |
47 | |
48 | GDK_AVAILABLE_IN_ALL |
49 | GtkConstraint * 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); |
57 | GDK_AVAILABLE_IN_ALL |
58 | GtkConstraint * gtk_constraint_new_constant (gpointer target, |
59 | GtkConstraintAttribute target_attribute, |
60 | GtkConstraintRelation relation, |
61 | double constant, |
62 | int strength); |
63 | |
64 | GDK_AVAILABLE_IN_ALL |
65 | GtkConstraintTarget * gtk_constraint_get_target (GtkConstraint *constraint); |
66 | GDK_AVAILABLE_IN_ALL |
67 | GtkConstraintAttribute gtk_constraint_get_target_attribute (GtkConstraint *constraint); |
68 | GDK_AVAILABLE_IN_ALL |
69 | GtkConstraintTarget * gtk_constraint_get_source (GtkConstraint *constraint); |
70 | GDK_AVAILABLE_IN_ALL |
71 | GtkConstraintAttribute gtk_constraint_get_source_attribute (GtkConstraint *constraint); |
72 | GDK_AVAILABLE_IN_ALL |
73 | GtkConstraintRelation gtk_constraint_get_relation (GtkConstraint *constraint); |
74 | GDK_AVAILABLE_IN_ALL |
75 | double gtk_constraint_get_multiplier (GtkConstraint *constraint); |
76 | GDK_AVAILABLE_IN_ALL |
77 | double gtk_constraint_get_constant (GtkConstraint *constraint); |
78 | GDK_AVAILABLE_IN_ALL |
79 | int gtk_constraint_get_strength (GtkConstraint *constraint); |
80 | |
81 | GDK_AVAILABLE_IN_ALL |
82 | gboolean gtk_constraint_is_required (GtkConstraint *constraint); |
83 | GDK_AVAILABLE_IN_ALL |
84 | gboolean gtk_constraint_is_attached (GtkConstraint *constraint); |
85 | GDK_AVAILABLE_IN_ALL |
86 | gboolean gtk_constraint_is_constant (GtkConstraint *constraint); |
87 | |
88 | G_END_DECLS |
89 | |