]> Pileus Git - ~andy/gtk/blob - gtk/gtkcsstypesprivate.h
css: Introduce a corner order enum
[~andy/gtk] / gtk / gtkcsstypesprivate.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
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 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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GTK_CSS_TYPES_PRIVATE_H__
21 #define __GTK_CSS_TYPES_PRIVATE_H__
22
23 #include <glib-object.h>
24
25 G_BEGIN_DECLS
26
27 typedef enum {
28   GTK_CSS_INHERIT,
29   GTK_CSS_INITIAL,
30   GTK_CSS_CURRENT_COLOR /*< nick=currentColor >*/
31 } GtkCssSpecialValue;
32
33 /* We encode horizontal and vertical repeat in one enum value.
34  * This eases parsing and storage, but you need to be aware that
35  * you have to "unpack" this value.
36  */
37 #define GTK_CSS_BACKGROUND_REPEAT_SHIFT (8)
38 #define GTK_CSS_BACKGROUND_REPEAT_MASK ((1 << GTK_CSS_BACKGROUND_REPEAT_SHIFT) - 1)
39 #define GTK_CSS_BACKGROUND_HORIZONTAL(repeat) ((repeat) & GTK_CSS_BACKGROUND_REPEAT_MASK)
40 #define GTK_CSS_BACKGROUND_VERTICAL(repeat) (((repeat) >> GTK_CSS_BACKGROUND_REPEAT_SHIFT) & GTK_CSS_BACKGROUND_REPEAT_MASK)
41 typedef enum /*< enum >*/
42 {
43   GTK_CSS_BACKGROUND_INVALID, /*< skip >*/
44   GTK_CSS_BACKGROUND_REPEAT, /* start at one so we know if a value has been set */
45   GTK_CSS_BACKGROUND_SPACE,
46   GTK_CSS_BACKGROUND_ROUND,
47   GTK_CSS_BACKGROUND_NO_REPEAT,
48   /* need to hardcode the numer or glib-mkenums makes us into a flags type */
49   GTK_CSS_BACKGROUND_REPEAT_X = 1025,
50   GTK_CSS_BACKGROUND_REPEAT_Y = 260
51 } GtkCssBackgroundRepeat;
52
53 typedef enum {
54   GTK_CSS_REPEAT_STYLE_STRETCH,
55   GTK_CSS_REPEAT_STYLE_REPEAT,
56   GTK_CSS_REPEAT_STYLE_ROUND,
57   GTK_CSS_REPEAT_STYLE_SPACE
58 } GtkCssBorderRepeatStyle;
59
60 typedef enum {
61   GTK_CSS_AREA_BORDER_BOX,
62   GTK_CSS_AREA_PADDING_BOX,
63   GTK_CSS_AREA_CONTENT_BOX
64 } GtkCssArea;
65
66 /* for the order in arrays */
67 typedef enum /*< skip >*/ {
68   GTK_CSS_TOP,
69   GTK_CSS_RIGHT,
70   GTK_CSS_BOTTOM,
71   GTK_CSS_LEFT
72 } GtkCssSide;
73
74 typedef enum /*< skip >*/ {
75   GTK_CSS_TOP_LEFT,
76   GTK_CSS_TOP_RIGHT,
77   GTK_CSS_BOTTOM_RIGHT,
78   GTK_CSS_BOTTOM_LEFT
79 } GtkCssCorner;
80
81 typedef struct _GtkCssBorderCornerRadius GtkCssBorderCornerRadius;
82 typedef struct _GtkCssBorderImageRepeat GtkCssBorderImageRepeat;
83
84 struct _GtkCssBorderCornerRadius {
85   double horizontal;
86   double vertical;
87 };
88
89 struct _GtkCssBorderImageRepeat {
90   GtkCssBorderRepeatStyle vrepeat;
91   GtkCssBorderRepeatStyle hrepeat;
92 };
93
94 #define GTK_TYPE_CSS_BORDER_CORNER_RADIUS _gtk_css_border_corner_radius_get_type ()
95 #define GTK_TYPE_CSS_BORDER_RADIUS _gtk_css_border_radius_get_type ()
96 #define GTK_TYPE_CSS_BORDER_IMAGE_REPEAT _gtk_css_border_image_repeat_get_type ()
97
98 GType           _gtk_css_border_corner_radius_get_type          (void);
99 GType           _gtk_css_border_radius_get_type                 (void);
100 GType           _gtk_css_border_image_repeat_get_type           (void);
101
102 G_END_DECLS
103
104 #endif /* __GTK_CSS_TYPES_PRIVATE_H__ */