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
29G_BEGIN_DECLS
30
31typedef 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
40GtkCssValue * gtk_css_dimension_value_new (double value,
41 GtkCssUnit unit);
42
43GtkCssValue * _gtk_css_number_value_new (double value,
44 GtkCssUnit unit);
45gboolean gtk_css_number_value_can_parse (GtkCssParser *parser);
46GtkCssValue * _gtk_css_number_value_parse (GtkCssParser *parser,
47 GtkCssNumberParseFlags flags);
48
49GtkCssDimension gtk_css_number_value_get_dimension (const GtkCssValue *value) G_GNUC_PURE;
50gboolean gtk_css_number_value_has_percent (const GtkCssValue *value) G_GNUC_PURE;
51GtkCssValue * gtk_css_number_value_multiply (GtkCssValue *value,
52 double factor);
53GtkCssValue * gtk_css_number_value_add (GtkCssValue *value1,
54 GtkCssValue *value2);
55GtkCssValue * gtk_css_number_value_try_add (GtkCssValue *value1,
56 GtkCssValue *value2);
57double _gtk_css_number_value_get (const GtkCssValue *number,
58 double one_hundred_percent) G_GNUC_PURE;
59
60gboolean gtk_css_dimension_value_is_zero (const GtkCssValue *value) G_GNUC_PURE;
61
62G_END_DECLS
63
64#endif /* __GTK_CSS_NUMBER_VALUE_PRIVATE_H__ */
65

source code of gtk/gtk/gtkcssnumbervalueprivate.h