1 | /* gtkconstraintsolverprivate.h: Constraint solver based on the Cassowary method |
2 | * Copyright 2019 GNOME Foundation |
3 | * |
4 | * SPDX-License-Identifier: LGPL-2.1-or-later |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Lesser General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2.1 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Lesser General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
18 | * |
19 | * Author: Emmanuele Bassi |
20 | */ |
21 | |
22 | #pragma once |
23 | |
24 | #include "gtkconstrainttypesprivate.h" |
25 | |
26 | G_BEGIN_DECLS |
27 | |
28 | #define GTK_TYPE_CONSTRAINT_SOLVER (gtk_constraint_solver_get_type()) |
29 | |
30 | G_DECLARE_FINAL_TYPE (GtkConstraintSolver, gtk_constraint_solver, GTK, CONSTRAINT_SOLVER, GObject) |
31 | |
32 | GtkConstraintSolver * |
33 | gtk_constraint_solver_new (void); |
34 | |
35 | void |
36 | gtk_constraint_solver_freeze (GtkConstraintSolver *solver); |
37 | |
38 | void |
39 | gtk_constraint_solver_thaw (GtkConstraintSolver *solver); |
40 | |
41 | void |
42 | gtk_constraint_solver_resolve (GtkConstraintSolver *solver); |
43 | |
44 | GtkConstraintVariable * |
45 | gtk_constraint_solver_create_variable (GtkConstraintSolver *solver, |
46 | const char *prefix, |
47 | const char *name, |
48 | double value); |
49 | |
50 | GtkConstraintRef * |
51 | gtk_constraint_solver_add_constraint (GtkConstraintSolver *solver, |
52 | GtkConstraintVariable *variable, |
53 | GtkConstraintRelation relation, |
54 | GtkConstraintExpression *expression, |
55 | int strength); |
56 | |
57 | void |
58 | gtk_constraint_solver_remove_constraint (GtkConstraintSolver *solver, |
59 | GtkConstraintRef *reference); |
60 | |
61 | GtkConstraintRef * |
62 | gtk_constraint_solver_add_stay_variable (GtkConstraintSolver *solver, |
63 | GtkConstraintVariable *variable, |
64 | int strength); |
65 | |
66 | void |
67 | gtk_constraint_solver_remove_stay_variable (GtkConstraintSolver *solver, |
68 | GtkConstraintVariable *variable); |
69 | |
70 | gboolean |
71 | gtk_constraint_solver_has_stay_variable (GtkConstraintSolver *solver, |
72 | GtkConstraintVariable *variable); |
73 | |
74 | GtkConstraintRef * |
75 | gtk_constraint_solver_add_edit_variable (GtkConstraintSolver *solver, |
76 | GtkConstraintVariable *variable, |
77 | int strength); |
78 | |
79 | void |
80 | gtk_constraint_solver_remove_edit_variable (GtkConstraintSolver *solver, |
81 | GtkConstraintVariable *variable); |
82 | |
83 | gboolean |
84 | gtk_constraint_solver_has_edit_variable (GtkConstraintSolver *solver, |
85 | GtkConstraintVariable *variable); |
86 | |
87 | void |
88 | gtk_constraint_solver_suggest_value (GtkConstraintSolver *solver, |
89 | GtkConstraintVariable *variable, |
90 | double value); |
91 | |
92 | void |
93 | gtk_constraint_solver_begin_edit (GtkConstraintSolver *solver); |
94 | |
95 | void |
96 | gtk_constraint_solver_end_edit (GtkConstraintSolver *solver); |
97 | |
98 | void |
99 | gtk_constraint_solver_note_added_variable (GtkConstraintSolver *self, |
100 | GtkConstraintVariable *variable, |
101 | GtkConstraintVariable *subject); |
102 | |
103 | void |
104 | gtk_constraint_solver_note_removed_variable (GtkConstraintSolver *self, |
105 | GtkConstraintVariable *variable, |
106 | GtkConstraintVariable *subject); |
107 | |
108 | void |
109 | gtk_constraint_solver_clear (GtkConstraintSolver *solver); |
110 | |
111 | char * |
112 | gtk_constraint_solver_to_string (GtkConstraintSolver *solver); |
113 | |
114 | char * |
115 | gtk_constraint_solver_statistics (GtkConstraintSolver *solver); |
116 | |
117 | G_END_DECLS |
118 | |