Release 0.36.14
[vala-gnome.git] / vapi / ccss-1.vapi
blob06b8cd72e09ce625333a3fb2b290480d487aafcf
1 [CCode (cprefix = "ccss_", lower_case_cprefix = "ccss_", cheader_filename = "ccss/ccss.h")]
2 namespace CCss {
3         [Compact]
4         [CCode (cprefix = "ccss_background_attachment_", cname = "ccss_background_attachment_t")]
5         public class BackgroundAttachment: Property {
6                 [CCode (cprefix = "CCSS_BACKGROUND_", has_type_id = false, cname = "ccss_background_attachment_type_t")]
7                 public enum Type {
8                         SCROLL,
9                         FIXED
10                 }
11                 public Type attachment {
12                         get;
13                 }
14         }
15         [Compact]
16         [CCode (cprefix = "ccss_background_image_", cname = "ccss_background_image_t")]
17         public class BackgroundImage: Property {
18                 public string uri {
19                         get;
20                 }
21         }
22         [Compact]
23         [CCode (cprefix = "ccss_background_position_", cname = "ccss_background_position_t")]
24         public class BackgroundPosition: Property {
25                 public Position horizontal_position {
26                         get;
27                 }
28                 public Position vertical_position {
29                         get;
30                 }
31         }
32         [Compact]
33         [CCode (cprefix = "ccss_background_repeat_", cname = "ccss_background_repeat_t")]
34         public class BackgroundRepeat: Property {
35                 [CCode (cprefix = "CCSS_BACKGROUND_", has_type_id = false, cname = "ccss_background_repeat_type_t")]
36                 public enum Type {
37                         REPEAT,
38                         REPEAT_X,
39                         REPEAT_Y,
40                         NO_REPEAT
41                 }
42                 public Type repeat {
43                         get;
44                 }
45         }
46         [Compact]
47         [CCode (cprefix = "ccss_background_size_", cname = "ccss_background_size_t")]
48         public class BackgroundSize: Property {
49                 public Position height {
50                         get;
51                 }
52                 public Position width {
53                         get;
54                 }
55         }
56         [Compact]
57         [CCode (cprefix = "ccss_background_", cname = "ccss_background_t")]
58         public class Background: Property {
59                 public BackgroundAttachment attachment {
60                         get;
61                 }
62                 public Color color {
63                         get;
64                 }
65                 public BackgroundImage image {
66                         get;
67                 }
68                 public BackgroundPosition position {
69                         get;
70                 }
71                 public BackgroundRepeat repeat {
72                         get;
73                 }
74                 public BackgroundSize size {
75                         get;
76                 }
77         }
78         [Compact]
79         [CCode (cprefix = "ccss_block_", cname = "ccss_block_t")]
80         public class Block {
81                 public void add_property (string property_name, Property property);
82         }
83         [Compact]
84         [CCode (cprefix = "ccss_border_image_", cname = "ccss_border_image_t")]
85         public class BorderImage: Property {
86                 [CCode (cprefix = "CCSS_BORDER_IMAGE_TILING_", has_type_id = false, cname = "ccss_border_image_tiling_t")]
87                 public enum Tiling {
88                         REPEAT,
89                         ROUND,
90                         STRETCH
91                 }
92                 public string uri {
93                         get;
94                 }
95                 public Position top {
96                         get;
97                 }
98                 public Position right {
99                         get;
100                 }
101                 public Position bottom {
102                         get;
103                 }
104                 public Position left {
105                         get;
106                 }
107                 public Tiling top_middle_bottom_horizontal_tiling {
108                         get;
109                 }
110                 public Tiling left_middle_right_vertical_tiling  {
111                         get;
112                 }
113         }
114         [Compact]
115         [CCode (cprefix = "ccss_border_join_", cname = "ccss_border_join_t")]
116         public class BorderRadius: Property {
117                 public double radius {
118                         get;
119                 }
120         }
121         [Compact]
122         [CCode (cprefix = "ccss_border_spacing_", cname = "ccss_border_spacing_t")]
123         public class BorderSpacing: Property {
124                 public double spacing {
125                         get;
126                 }
127         }
128         [Compact]
129         [CCode (cprefix = "ccss_border_style_", cname = "ccss_border_style_t")]
130         public class BorderStyle: Property {
131                 [CCode (cprefix = "CCSS_BORDER_STYLE_", has_type_id = false, cname = "ccss_border_style_type_t")]
132                 public enum Type {
133                         HIDDEN,
134                         DOTTED,
135                         DASHED,
136                         SOLID,
137                         DOUBLE,
138                         GROOVE,
139                         RIDGE,
140                         INSET,
141                         OUTSET
142                 }
143                 public Type style {
144                         get;
145                 }
146         }
147         [Compact]
148         [CCode (cprefix = "ccss_border_width_", cname = "ccss_border_width_t")]
149         public class BorderWidth: Property {
150                 public double width {
151                         get;
152                 }
153         }
154         [Compact]
155         [CCode (cprefix = "ccss_color_", cname = "ccss_color_t", free_function = "ccss_color_destroy")]
156         public class Color: Property {
157                 public double alpha {
158                         get;
159                 }
160                 public double blue {
161                         get;
162                 }
163                 public double green {
164                         get;
165                 }
166                 public double red {
167                         get;
168                 }
169         }
170         [Compact]
171         [CCode (cprefix = "ccss_function_", cname = "ccss_function_t", ref_function = "ccss_function_reference", unref_function = "ccss_function_destroy")]
172         public class Function {
173                 [CCode (cname = "ccss_function_create")]
174                 public Function (string name, FunctionDelegate function);
175         }
176         [CCode (cname = "ccss_function_f", has_target = false)]
177         public delegate string? FunctionDelegate (GLib.SList<string> args, void* user_data);
179         [Compact]
180         [CCode (cprefix = "ccss_grammar_", cname = "ccss_grammar_t", ref_function = "ccss_grammar_reference", unref_function = "ccss_grammar_destroy")]
181         public class Grammar {
182                 [CCode (cname = "ccss_grammar_create_generic")]
183                 public Grammar.generic ();
184                 [CCode (cname = "ccss_grammar_create_css")]
185                 public Grammar.css ();
187                 /*public void add_properties (PropertyClass properties);
188                 public unowned PropertyClass lookup_property (string name);*/
190                 public void add_function (Function function);
191                 public unowned Function lookup_function (string name);
193                 public Stylesheet create_stylesheet ();
194                 public Stylesheet create_stylesheet_from_buffer (char[] buffer, void* user_data);
195                 public Stylesheet create_stylesheet_from_file (string css_file, void* user_data);
196         }
197         [CCode (cname = "ccss_node_class_t")]
198         public struct NodeClass {
199                 public Node.IsA is_a;
200                 public Node.GetContainer get_container;
201                 public Node.GetBaseStyle get_base_style;
202                 public Node.GetInstance get_instance;
203                 public Node.GetId get_id;
204                 public Node.GetType get_type;
205                 public Node.GetClasses get_classes;
206                 public Node.GetPseudoClasses get_pseudo_classes;
207                 public Node.GetAttribute get_attribute;
208                 public Node.GetStyle get_style;
209                 public Node.GetViewport get_viewport;
210                 public Node.Release release;
211         }
213         [Compact]
214         [CCode (cprefix = "ccss_node_", cname = "ccss_node_t", free_function = "ccss_node_destroy")]
215         public class Node {
216                 [CCode (cname = "ccss_node_create")]
217                 public Node (NodeClass node_class, uint n_methods, void* user_data);
218                 public void* get_user_data ();
220                 [CCode (cname = "ccss_node_get_attribute_f", has_target = false)]
221                 public delegate string? GetAttribute (Node node, string name);
222                 [CCode (cname = "ccss_node_get_base_style_f", has_target = false)]
223                 public delegate Node? GetBaseStyle (Node node);
224                 [CCode (cname = "ccss_node_get_classes_f", array_length = false, array_null_terminated = true, has_target = false)]
225                 public delegate string[]? GetClasses (Node node);
226                 [CCode (cname = "ccss_node_get_container_f", has_target = false)]
227                 public delegate Node? GetContainer (Node node);
228                 [CCode (cname = "ccss_node_get_id_f", has_target = false)]
229                 public delegate string? GetId (Node node);
230                 [CCode (cname = "ccss_node_get_instance_f", has_target = false)]
231                 public delegate long GetInstance (Node node);
232                 [CCode (cname = "ccss_node_get_pseudo_classes_f", array_length = false, array_null_terminated = true, has_target = false)]
233                 public delegate string[]? GetPseudoClasses (Node node);
234                 [CCode (cname = "ccss_node_get_style_f", has_target = false)]
235                 public delegate string? GetStyle (Node node, uint descriptor);
236                 [CCode (cname = "ccss_node_get_type_f", has_target = false)]
237                 public delegate string? GetType (Node node);
238                 [CCode (cname = "ccss_node_get_viewport_f", has_target = false)]
239                 public delegate bool GetViewport (Node node, double x, double y, double width, double height);
240                 [CCode (cname = "ccss_node_is_a_f", has_target = false)]
241                 public delegate bool IsA (Node node, string type_name);
242                 [CCode (cname = "ccss_node_release_f", has_target = false)]
243                 public delegate void Release (Node node);
244         }
245         [Compact]
246         [CCode (cname = "ccss_padding_t")]
247         public class Padding: Property {
248                 public double padding {
249                         get;
250                 }
251         }
252         [Compact]
253         [CCode (cprefix = "ccss_position_", cname = "ccss_position_t")]
254         public class Position: Property {
255                 [CCode (cprefix = "CCSS_POSITION_", has_type_id = false, cname = "ccss_position_type_t")]
256                 public enum Type {
257                         LENGTH,
258                         PERCENTAGE,
259                         MASK_NUMERIC,
260                         LEFT,
261                         TOP,
262                         RIGHT,
263                         BOTTOM,
264                         CENTER,
265                         MASK_HORIZONTAL,
266                         MASK_VERTICAL,
267                         AUTO,
268                         CONTAIN,
269                         COVER,
270                         MASK_AUTO
271                 }
272                 public double get_hsize (double extent_x, double extent_y, double width, double height);
273                 public double get_pos (double extent, double size);
274                 public double get_size (double extent);
275                 public double get_vsize (double extent_x, double extent_y, double width, double height);
276                 public string serialize ();
277         }
278         [Compact]
279         [CCode (cname = "ccss_property_class_t")]
280         public class PropertyClass {
281                 public string name;
282                 public Property.Convert convert;
283                 public Property.Create create;
284                 public Property.Destroy destroy;
285                 public Property.Factory factory;
286                 public Property.Inherit inherit;
287                 public Property.Serialize serialize;
288         }
290         /*[Compact]
291         [CCode (cname = "ccss_property_generic_t")]
292         public class PropertyGeneric: Property {
293                 public weak string name;
294                 public void* values;
295         }*/
297         [Compact]
298         [CCode (cprefix = "ccss_property_", cname = "ccss_property_t", free_function = "ccss_property_destroy")]
299         public class Property {
300                 [CCode (cprefix = "CCSS_PROPERTY_STATE_", has_type_id = false, cname = "ccss_property_state_t")]
301                 public enum State {
302                         INVALID,
303                         NONE,
304                         INHERIT,
305                         SET,
306                         ERROR_OVERFLOW;
308                         [CCode (cname = "ccss_property_parse_state")]
309                         public static State parse (string value);
310                         [CCode (cname = "ccss_property_state_serialize")]
311                         public unowned string serialize ();
312                 }
313                 [CCode (cprefix = "CCSS_PROPERTY_TYPE_", has_type_id = false, cname = "ccss_property_type_t")]
314                 public enum Type {
315                         DOUBLE,
316                         STRING
317                 }
318                 public Type type {
319                         get;
320                 }
321                 public State get_state {
322                         get;
323                 }
325                 [CCode (cname = "ccss_property_create_f")]
326                 public delegate Property Create (Grammar grammar, void* values);
327                 [CCode (cname = "ccss_property_convert_f", has_target = false)]
328                 public delegate bool Convert (Property property, Type target, void* value);
329                 [CCode (cname = "ccss_property_destroy_f", has_target = false)]
330                 public delegate void Destroy (Property property);
331                 [CCode (cname = "ccss_property_factory_f")]
332                 public delegate bool Factory (Grammar grammar, Block block, string name, void* values);
333                 [CCode (cname = "ccss_property_inherit_f", has_target = false)]
334                 public delegate bool Inherit (Style container_style, Style style);
335                 [CCode (cname = "ccss_property_serialize_f", has_target = false)]
336                 public delegate string Serialize (Property property);
337         }
338         [Compact]
339         [CCode (cprefix = "ccss_style_", cname = "ccss_style_t", free_function = "ccss_style_destroy")]
340         public class Style {
341                 public void dump ();
342                 public void @foreach (Iterator func);
343                 public bool get_double (string property_name, out double value);
344                 public bool get_property (string property_name, out unowned Property value);
345                 public bool get_string (string property_name, out unowned string value);
346                 public Stylesheet stylesheet {
347                         get;
348                 }
350                 [CCode (cname = "ccss_style_iterator_f")]
351                 public delegate void Iterator (Style style, string property_name);
353                 public static GLib.HashFunc hash;
354         }
355         [Compact]
356         [CCode (cprefix = "ccss_stylesheet_", cname = "ccss_stylesheet_t", ref_function = "ccss_stylesheet_reference", unref_function = "ccss_stylesheet_destroy")]
357         public class Stylesheet {
358                 [CCode (cprefix = "CCSS_STYLESHEET_", has_type_id = false, cname = "ccss_stylesheet_precedence_t")]
359                 public enum Precedence {
360                         USER_AGENT,
361                         USER,
362                         AUTHOR
363                 }
364                 public uint add_from_buffer (char[] buffer, Precedence precedence, void* user_data);
365                 public uint add_from_file (string css_file, Precedence precedence, void* user_data);
366                 public void dump ();
367                 public void @foreach (Iterator func);
368                 public Grammar grammar {
369                         owned get;
370                 }
371                 public Style? query (Node node);
372                 public Style? query_type (string type_name);
373                 public bool unload (uint descriptor);
375                 [CCode (cname = "ccss_stylesheet_iterator_f")]
376                 public delegate void Iterator (Stylesheet stylesheet, string type_name);
377         }