1 | /* gtkconstraintlayout.h: Layout manager using constraints |
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 | #pragma once |
20 | |
21 | #include <gtk/gtklayoutmanager.h> |
22 | #include <gtk/gtkconstraint.h> |
23 | #include <gtk/gtkconstraintguide.h> |
24 | |
25 | G_BEGIN_DECLS |
26 | |
27 | #define GTK_TYPE_CONSTRAINT_LAYOUT (gtk_constraint_layout_get_type ()) |
28 | #define GTK_TYPE_CONSTRAINT_LAYOUT_CHILD (gtk_constraint_layout_child_get_type ()) |
29 | #define GTK_CONSTRAINT_VFL_PARSER_ERROR (gtk_constraint_vfl_parser_error_quark ()) |
30 | |
31 | GDK_AVAILABLE_IN_ALL |
32 | G_DECLARE_FINAL_TYPE (GtkConstraintLayoutChild, gtk_constraint_layout_child, GTK, CONSTRAINT_LAYOUT_CHILD, GtkLayoutChild) |
33 | |
34 | GDK_AVAILABLE_IN_ALL |
35 | G_DECLARE_FINAL_TYPE (GtkConstraintLayout, gtk_constraint_layout, GTK, CONSTRAINT_LAYOUT, GtkLayoutManager) |
36 | |
37 | GDK_AVAILABLE_IN_ALL |
38 | GQuark gtk_constraint_vfl_parser_error_quark (void); |
39 | |
40 | GDK_AVAILABLE_IN_ALL |
41 | GtkLayoutManager * gtk_constraint_layout_new (void); |
42 | |
43 | GDK_AVAILABLE_IN_ALL |
44 | void gtk_constraint_layout_add_constraint (GtkConstraintLayout *layout, |
45 | GtkConstraint *constraint); |
46 | GDK_AVAILABLE_IN_ALL |
47 | void gtk_constraint_layout_remove_constraint (GtkConstraintLayout *layout, |
48 | GtkConstraint *constraint); |
49 | |
50 | GDK_AVAILABLE_IN_ALL |
51 | void gtk_constraint_layout_add_guide (GtkConstraintLayout *layout, |
52 | GtkConstraintGuide *guide); |
53 | GDK_AVAILABLE_IN_ALL |
54 | void gtk_constraint_layout_remove_guide (GtkConstraintLayout *layout, |
55 | GtkConstraintGuide *guide); |
56 | GDK_AVAILABLE_IN_ALL |
57 | void gtk_constraint_layout_remove_all_constraints (GtkConstraintLayout *layout); |
58 | |
59 | GDK_AVAILABLE_IN_ALL |
60 | GList * gtk_constraint_layout_add_constraints_from_description (GtkConstraintLayout *layout, |
61 | const char * const lines[], |
62 | gsize n_lines, |
63 | int hspacing, |
64 | int vspacing, |
65 | GError **error, |
66 | const char *first_view, |
67 | ...) G_GNUC_NULL_TERMINATED; |
68 | GDK_AVAILABLE_IN_ALL |
69 | GList * gtk_constraint_layout_add_constraints_from_descriptionv (GtkConstraintLayout *layout, |
70 | const char * const lines[], |
71 | gsize n_lines, |
72 | int hspacing, |
73 | int vspacing, |
74 | GHashTable *views, |
75 | GError **error); |
76 | |
77 | GDK_AVAILABLE_IN_ALL |
78 | GListModel * gtk_constraint_layout_observe_constraints (GtkConstraintLayout *layout); |
79 | GDK_AVAILABLE_IN_ALL |
80 | GListModel * gtk_constraint_layout_observe_guides (GtkConstraintLayout *layout); |
81 | |
82 | G_END_DECLS |
83 | |