1 /* goocanvas-custom.vala
3 * Copyright (C) 2008 Matias De la Puente
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Eric ALBER <eric.alber@gmail.com>
21 * Matias De la Puente <mfpuente.ar@gmail.com>
24 /* Written for GooCanvas v0.15 */
29 [CCode (type_id
= "GOO_TYPE_CAIRO_MATRIX")]
30 public class CairoMatrix
42 [CCode (has_construct_function
= false)]
44 public static void create_path(GLib
.Array
<CanvasPathCommand
> commands
, Cairo
.Context cr
);
45 public static GLib
.Array
<CanvasPathCommand
> parse_path_data (string path_data
);
46 public GLib
.List
<unowned CanvasItem
>?
get_items_at (double x
, double y
, bool is_pointer_event
);
47 public GLib
.List
<unowned CanvasItem
>?
get_items_in_area (Goo
.CanvasBounds area
, bool inside_area
, bool allow_overlaps
, bool include_containers
);
50 public class CanvasEllipse
52 [CCode (cname
="goo_canvas_ellipse_new", type
="GooCanvasItem*")]
53 public static unowned CanvasEllipse
create (Goo
.CanvasItem? parent
, double center_x
, double center_y
, double radius_x
, double radius_y
, ...);
56 public class CanvasEllipseModel
58 [CCode (cname
="goo_canvas_ellipse_model_new", type
="GooCanvasItemModel*")]
59 public static unowned CanvasEllipseModel
create (Goo
.CanvasItemModel? parent
, double center_x
, double center_y
, double radius_x
, double radius_y
, ...);
62 public class CanvasGrid
64 [CCode (cname
="goo_canvas_grid_new", type
="GooCanvasItemModel*")]
65 public static unowned CanvasGrid
create(Goo
.CanvasItem? parent
, double x
, double y
, double width
, double height
, double x_step
, double y_step
, double x_offset
, double y_offset
, ...);
68 public class CanvasGridModel
70 [CCode (cname
="goo_canvas_grid_model_new", type
="GooCanvasItemModel*")]
71 public static unowned CanvasGridModel
create(CanvasItemModel? parent
, double x
, double y
, double width
, double height
, double x_step
, double y_step
, double x_offset
, double y_offset
, ...);
74 public class CanvasGroup
76 [CCode (cname
="goo_canvas_group_new", type
="GooCanvasItem*")]
77 public static unowned CanvasGroup
create (Goo
.CanvasItem? parent
, ...);
80 public class CanvasGroupModel
82 [CCode (cname
="goo_canvas_group_model_new", type
="GooCanvasItemModel*")]
83 public static unowned CanvasGroupModel
create (Goo
.CanvasItemModel? parent
, ...);
86 public class CanvasImage
88 [CCode (cname
="goo_canvas_image_new", type
="GooCanvasItem*")]
89 public static unowned CanvasImage
create (Goo
.CanvasItem? parent
, Gdk
.Pixbuf pixbuf
, double x
, double y
, ...);
92 public class CanvasImageModel
94 [CCode (cname
="goo_canvas_image_model_new", type
="GooCanvasItemModel*")]
95 public static unowned CanvasImageModel
create (Goo
.CanvasItemModel? parent
, Gdk
.Pixbuf pixbuf
, double x
, double y
, ...);
99 [CCode (type_id
= "GOO_TYPE_CANVAS_LINE_DASH")]
100 public class CanvasLineDash
{
101 public double* dashes
;
102 [CCode (has_construct_function
= false)]
103 public CanvasLineDash
.newv (int num_dashes
, double* dashes
);
106 public class CanvasPath
108 [CCode (cname
="goo_canvas_path_new", type
="GooCanvasItem*")]
109 public static unowned CanvasPath
create (Goo
.CanvasItem? parent
, string path_data
, ...);
112 public class CanvasPathModel
114 [CCode (cname
="goo_canvas_path_model_new", type
="GooCanvasItemModel*")]
115 public static unowned CanvasPathModel
create (Goo
.CanvasItemModel? parent
, string path_data
, ...);
119 [CCode (type_id
= "GOO_TYPE_CANVAS_POINTS")]
120 public class CanvasPoints
{
121 public double* coords
;
124 public class CanvasPolyline
126 [CCode (cname
="goo_canvas_polyline_new", type
="GooCanvasItem*")]
127 public static unowned CanvasPolyline
create (Goo
.CanvasItem? parent
, bool close_path
, int num_points
, ...);
128 [CCode (cname
="goo_canvas_polyline_new_line", type
="GooCanvasItem*")]
129 public static unowned CanvasPolyline
create_line (Goo
.CanvasItem? parent
, double x1
, double y1
, double x2
, double y2
, ...);
132 public class CanvasPolylineModel
134 [CCode (cname
="goo_canvas_polyline_model_new", type
="GooCanvasItemModel*")]
135 public static unowned CanvasPolylineModel
create (Goo
.CanvasItemModel? parent
, bool close_path
, int num_points
, ...);
136 [CCode (cname
="goo_canvas_polyline_model_new_line", type
="GooCanvasItemModel*")]
137 public static unowned CanvasPolylineModel
create_line (Goo
.CanvasItemModel? parent
, double x1
, double y1
, double x2
, double y2
, ...);
140 public class CanvasRect
142 [CCode (cname
= "goo_canvas_rect_new", type
="GooCanvasItem*")]
143 public static unowned CanvasRect
create (Goo
.CanvasItem? parent
, double x
, double y
, double width
, double height
, ...);
146 public class CanvasRectModel
148 [CCode (cname
= "goo_canvas_rect_model_new", type
="GooCanvasItemModel*")]
149 public static unowned CanvasRectModel
create (Goo
.CanvasItemModel? parent
, double x
, double y
, double width
, double height
, ...);
152 public class CanvasStyle
154 public unowned Goo
.CanvasStyle? parent
;
155 public unowned GLib
.Array
<CanvasStyleProperty
> properties
;
158 public class CanvasTable
160 [CCode (cname
="goo_canvas_table_new", type
="GooCanvasItem*")]
161 public static unowned CanvasTable
create (Goo
.CanvasItem? parent
, ...);
164 public class CanvasTableModel
166 [CCode (cname
="goo_canvas_table_model_new", type
="GooCanvasItemModel*")]
167 public static unowned CanvasTableModel
create (Goo
.CanvasItemModel? parent
, ...);
170 public class CanvasText
172 [CCode (cname
="goo_canvas_text_new", type
="GooCanvasItem*")]
173 public static unowned CanvasText
create (Goo
.CanvasItem? parent
, string str
, double x
, double y
, double width
, Gtk
.AnchorType anchor
, ...);
176 public class CanvasTextModel
178 [CCode (cname
="goo_canvas_text_model_new", type
="GooCanvasItemModel*")]
179 public static unowned CanvasTextModel
create (Goo
.CanvasItemModel? parent
, string str
, double x
, double y
, double width
, Gtk
.AnchorType anchor
, ...);
182 public class CanvasWidget
184 [CCode (cname
="goo_canvas_widget_new", type
="GooCanvasItem*")]
185 public static unowned CanvasWidget
create (Goo
.CanvasItem? parent
, Gtk
.Widget widget
, double x
, double y
, double width
, double height
, ...);
188 public interface CanvasItem
: GLib
.Object
190 public static GLib
.ParamSpec
[] class_list_child_properties (GLib
.ObjectClass iclass
, out uint n_properties
);
191 public void get_child_properties (Goo
.CanvasItem child
, ...);
192 public void set_child_properties (Goo
.CanvasItem child
, ...);
193 public abstract unowned GLib
.List
<CanvasItem
> get_items_at (double x
, double y
, Cairo
.Context cr
, bool is_pointer_event
, bool parent_is_visible
, GLib
.List
<CanvasItem
> found_items
);
196 public interface CanvasItemModel
: GLib
.Object
198 public static GLib
.ParamSpec
[] class_list_child_properties (GLib
.ObjectClass iclass
, out uint n_properties
);
199 public void get_child_properties (Goo
.CanvasItem child
, ...);
200 public void set_child_properties (Goo
.CanvasItem child
, ...);
203 public struct CanvasItemSimpleData
205 public Cairo
.Matrix? transform
;
206 public weak GLib
.Array
<CanvasPathCommand
> clip_path_commands
;
209 /* Trying to describe a C union with dummy structs */
210 public struct CanvasPathCommandSimple
217 public struct CanvasPathCommandCurve
228 public struct CanvasPathCommandArc
236 double x_axis_rotation
;
240 [CCode (type_id
= "GOO_TYPE_CANVAS_PATH_COMMAND", cheader_filename
= "goocanvas.h")]
241 public struct CanvasPathCommand
{
242 public CanvasPathCommandSimple simple
;
243 public CanvasPathCommandCurve curve
;
244 public CanvasPathCommandArc arc
;