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
26G_BEGIN_DECLS
27
28#define GTK_TYPE_CONSTRAINT_SOLVER (gtk_constraint_solver_get_type())
29
30G_DECLARE_FINAL_TYPE (GtkConstraintSolver, gtk_constraint_solver, GTK, CONSTRAINT_SOLVER, GObject)
31
32GtkConstraintSolver *
33gtk_constraint_solver_new (void);
34
35void
36gtk_constraint_solver_freeze (GtkConstraintSolver *solver);
37
38void
39gtk_constraint_solver_thaw (GtkConstraintSolver *solver);
40
41void
42gtk_constraint_solver_resolve (GtkConstraintSolver *solver);
43
44GtkConstraintVariable *
45gtk_constraint_solver_create_variable (GtkConstraintSolver *solver,
46 const char *prefix,
47 const char *name,
48 double value);
49
50GtkConstraintRef *
51gtk_constraint_solver_add_constraint (GtkConstraintSolver *solver,
52 GtkConstraintVariable *variable,
53 GtkConstraintRelation relation,
54 GtkConstraintExpression *expression,
55 int strength);
56
57void
58gtk_constraint_solver_remove_constraint (GtkConstraintSolver *solver,
59 GtkConstraintRef *reference);
60
61GtkConstraintRef *
62gtk_constraint_solver_add_stay_variable (GtkConstraintSolver *solver,
63 GtkConstraintVariable *variable,
64 int strength);
65
66void
67gtk_constraint_solver_remove_stay_variable (GtkConstraintSolver *solver,
68 GtkConstraintVariable *variable);
69
70gboolean
71gtk_constraint_solver_has_stay_variable (GtkConstraintSolver *solver,
72 GtkConstraintVariable *variable);
73
74GtkConstraintRef *
75gtk_constraint_solver_add_edit_variable (GtkConstraintSolver *solver,
76 GtkConstraintVariable *variable,
77 int strength);
78
79void
80gtk_constraint_solver_remove_edit_variable (GtkConstraintSolver *solver,
81 GtkConstraintVariable *variable);
82
83gboolean
84gtk_constraint_solver_has_edit_variable (GtkConstraintSolver *solver,
85 GtkConstraintVariable *variable);
86
87void
88gtk_constraint_solver_suggest_value (GtkConstraintSolver *solver,
89 GtkConstraintVariable *variable,
90 double value);
91
92void
93gtk_constraint_solver_begin_edit (GtkConstraintSolver *solver);
94
95void
96gtk_constraint_solver_end_edit (GtkConstraintSolver *solver);
97
98void
99gtk_constraint_solver_note_added_variable (GtkConstraintSolver *self,
100 GtkConstraintVariable *variable,
101 GtkConstraintVariable *subject);
102
103void
104gtk_constraint_solver_note_removed_variable (GtkConstraintSolver *self,
105 GtkConstraintVariable *variable,
106 GtkConstraintVariable *subject);
107
108void
109gtk_constraint_solver_clear (GtkConstraintSolver *solver);
110
111char *
112gtk_constraint_solver_to_string (GtkConstraintSolver *solver);
113
114char *
115gtk_constraint_solver_statistics (GtkConstraintSolver *solver);
116
117G_END_DECLS
118

source code of gtk/gtk/gtkconstraintsolverprivate.h