1/* gtkconstraintvflparserprivate.h: VFL constraint definition parser
2 *
3 * Copyright 2017 Endless
4 * Copyright 2019 GNOME Foundation
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "gtkconstrainttypesprivate.h"
25
26G_BEGIN_DECLS
27
28typedef struct _GtkConstraintVflParser GtkConstraintVflParser;
29
30typedef struct {
31 const char *view1;
32 const char *attr1;
33 GtkConstraintRelation relation;
34 const char *view2;
35 const char *attr2;
36 double constant;
37 double multiplier;
38 double strength;
39} GtkConstraintVfl;
40
41GtkConstraintVflParser *
42gtk_constraint_vfl_parser_new (void);
43
44void
45gtk_constraint_vfl_parser_free (GtkConstraintVflParser *parser);
46
47void
48gtk_constraint_vfl_parser_set_default_spacing (GtkConstraintVflParser *parser,
49 int hspacing,
50 int vspacing);
51
52void
53gtk_constraint_vfl_parser_set_metrics (GtkConstraintVflParser *parser,
54 GHashTable *metrics);
55
56void
57gtk_constraint_vfl_parser_set_views (GtkConstraintVflParser *parser,
58 GHashTable *views);
59
60gboolean
61gtk_constraint_vfl_parser_parse_line (GtkConstraintVflParser *parser,
62 const char *line,
63 gssize len,
64 GError **error);
65
66int
67gtk_constraint_vfl_parser_get_error_offset (GtkConstraintVflParser *parser);
68
69int
70gtk_constraint_vfl_parser_get_error_range (GtkConstraintVflParser *parser);
71
72GtkConstraintVfl *
73gtk_constraint_vfl_parser_get_constraints (GtkConstraintVflParser *parser,
74 int *n_constraints);
75
76G_END_DECLS
77

source code of gtk/gtk/gtkconstraintvflparserprivate.h