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 | |
26 | G_BEGIN_DECLS |
27 | |
28 | typedef struct _GtkConstraintVflParser GtkConstraintVflParser; |
29 | |
30 | typedef 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 | |
41 | GtkConstraintVflParser * |
42 | gtk_constraint_vfl_parser_new (void); |
43 | |
44 | void |
45 | gtk_constraint_vfl_parser_free (GtkConstraintVflParser *parser); |
46 | |
47 | void |
48 | gtk_constraint_vfl_parser_set_default_spacing (GtkConstraintVflParser *parser, |
49 | int hspacing, |
50 | int vspacing); |
51 | |
52 | void |
53 | gtk_constraint_vfl_parser_set_metrics (GtkConstraintVflParser *parser, |
54 | GHashTable *metrics); |
55 | |
56 | void |
57 | gtk_constraint_vfl_parser_set_views (GtkConstraintVflParser *parser, |
58 | GHashTable *views); |
59 | |
60 | gboolean |
61 | gtk_constraint_vfl_parser_parse_line (GtkConstraintVflParser *parser, |
62 | const char *line, |
63 | gssize len, |
64 | GError **error); |
65 | |
66 | int |
67 | gtk_constraint_vfl_parser_get_error_offset (GtkConstraintVflParser *parser); |
68 | |
69 | int |
70 | gtk_constraint_vfl_parser_get_error_range (GtkConstraintVflParser *parser); |
71 | |
72 | GtkConstraintVfl * |
73 | gtk_constraint_vfl_parser_get_constraints (GtkConstraintVflParser *parser, |
74 | int *n_constraints); |
75 | |
76 | G_END_DECLS |
77 | |