1 | /* |
2 | * Copyright © 2012 Red Hat Inc. |
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 | * Authors: Alexander Larsson <alexl@gnome.org> |
18 | */ |
19 | |
20 | #ifndef __GTK_CSS_NUMBER_VALUE_PRIVATE_H__ |
21 | #define __GTK_CSS_NUMBER_VALUE_PRIVATE_H__ |
22 | |
23 | #include <gtk/css/gtkcss.h> |
24 | #include "gtk/css/gtkcsstokenizerprivate.h" |
25 | #include "gtk/css/gtkcssparserprivate.h" |
26 | #include "gtkcsstypesprivate.h" |
27 | #include "gtkcssvalueprivate.h" |
28 | |
29 | G_BEGIN_DECLS |
30 | |
31 | typedef enum /*< skip >*/ { |
32 | GTK_CSS_POSITIVE_ONLY = (1 << 0), |
33 | GTK_CSS_PARSE_PERCENT = (1 << 1), |
34 | GTK_CSS_PARSE_NUMBER = (1 << 2), |
35 | GTK_CSS_PARSE_LENGTH = (1 << 3), |
36 | GTK_CSS_PARSE_ANGLE = (1 << 4), |
37 | GTK_CSS_PARSE_TIME = (1 << 5) |
38 | } GtkCssNumberParseFlags; |
39 | |
40 | GtkCssValue * gtk_css_dimension_value_new (double value, |
41 | GtkCssUnit unit); |
42 | |
43 | GtkCssValue * _gtk_css_number_value_new (double value, |
44 | GtkCssUnit unit); |
45 | gboolean gtk_css_number_value_can_parse (GtkCssParser *parser); |
46 | GtkCssValue * _gtk_css_number_value_parse (GtkCssParser *parser, |
47 | GtkCssNumberParseFlags flags); |
48 | |
49 | GtkCssDimension gtk_css_number_value_get_dimension (const GtkCssValue *value) G_GNUC_PURE; |
50 | gboolean gtk_css_number_value_has_percent (const GtkCssValue *value) G_GNUC_PURE; |
51 | GtkCssValue * gtk_css_number_value_multiply (GtkCssValue *value, |
52 | double factor); |
53 | GtkCssValue * gtk_css_number_value_add (GtkCssValue *value1, |
54 | GtkCssValue *value2); |
55 | GtkCssValue * gtk_css_number_value_try_add (GtkCssValue *value1, |
56 | GtkCssValue *value2); |
57 | double _gtk_css_number_value_get (const GtkCssValue *number, |
58 | double one_hundred_percent) G_GNUC_PURE; |
59 | |
60 | gboolean gtk_css_dimension_value_is_zero (const GtkCssValue *value) G_GNUC_PURE; |
61 | |
62 | G_END_DECLS |
63 | |
64 | #endif /* __GTK_CSS_NUMBER_VALUE_PRIVATE_H__ */ |
65 | |