53
/* If the item must be visible to receive events. */
54
51
GOO_CANVAS_EVENTS_VISIBLE_MASK = 1 << 0,
56
/* If the fill or stroke must be painted to receive events. */
57
52
GOO_CANVAS_EVENTS_PAINTED_MASK = 1 << 1,
59
/* If the fill should receive events. */
60
53
GOO_CANVAS_EVENTS_FILL_MASK = 1 << 2,
62
/* If the stroke should receive events. */
63
54
GOO_CANVAS_EVENTS_STROKE_MASK = 1 << 3,
66
56
GOO_CANVAS_EVENTS_NONE = 0,
68
GOO_CANVAS_EVENTS_VISIBLE_PAINTED = GOO_CANVAS_EVENTS_VISIBLE_MASK
69
| GOO_CANVAS_EVENTS_PAINTED_MASK
70
| GOO_CANVAS_EVENTS_FILL_MASK
71
| GOO_CANVAS_EVENTS_STROKE_MASK,
72
GOO_CANVAS_EVENTS_VISIBLE_FILL = GOO_CANVAS_EVENTS_VISIBLE_MASK
73
| GOO_CANVAS_EVENTS_FILL_MASK,
74
GOO_CANVAS_EVENTS_VISIBLE_STROKE = GOO_CANVAS_EVENTS_VISIBLE_MASK
75
| GOO_CANVAS_EVENTS_STROKE_MASK,
76
GOO_CANVAS_EVENTS_VISIBLE = GOO_CANVAS_EVENTS_VISIBLE_MASK
77
| GOO_CANVAS_EVENTS_FILL_MASK
78
| GOO_CANVAS_EVENTS_STROKE_MASK,
80
GOO_CANVAS_EVENTS_PAINTED = GOO_CANVAS_EVENTS_PAINTED_MASK
81
| GOO_CANVAS_EVENTS_FILL_MASK
82
| GOO_CANVAS_EVENTS_STROKE_MASK,
57
GOO_CANVAS_EVENTS_VISIBLE_PAINTED = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
58
GOO_CANVAS_EVENTS_VISIBLE_FILL = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK,
59
GOO_CANVAS_EVENTS_VISIBLE_STROKE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
60
GOO_CANVAS_EVENTS_VISIBLE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
61
GOO_CANVAS_EVENTS_PAINTED = GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
83
62
GOO_CANVAS_EVENTS_FILL = GOO_CANVAS_EVENTS_FILL_MASK,
84
63
GOO_CANVAS_EVENTS_STROKE = GOO_CANVAS_EVENTS_STROKE_MASK,
85
GOO_CANVAS_EVENTS_ALL = GOO_CANVAS_EVENTS_FILL_MASK
86
| GOO_CANVAS_EVENTS_STROKE_MASK
64
GOO_CANVAS_EVENTS_ALL = GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK
87
65
} GooCanvasPointerEvents;
90
#define GOO_TYPE_CANVAS_ITEM_VISIBILITY (goo_canvas_item_visibility_get_type ())
91
GType goo_canvas_item_visibility_get_type (void) G_GNUC_CONST;
94
69
* GooCanvasItemVisibility
70
* @GOO_CANVAS_ITEM_HIDDEN: the item is invisible, and is not allocated any
71
* space in layout container items such as #GooCanvasTable.
72
* @GOO_CANVAS_ITEM_INVISIBLE: the item is invisible, but it is still allocated
73
* space in layout container items.
95
74
* @GOO_CANVAS_ITEM_VISIBLE: the item is visible.
96
75
* @GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD: the item is visible when the
97
76
* canvas scale setting is greater than or equal to the item's visibility
98
77
* threshold setting.
99
* @GOO_CANVAS_ITEM_INVISIBLE: the item is invisible.
101
79
* The #GooCanvasItemVisibility enumeration is used to specify when a canvas
102
80
* item is visible.
82
/* NOTE: Values are important here, as we test for <= GOO_CANVAS_ITEM_INVISIBLE
83
to check if an item is invisible or hidden. */
106
GOO_CANVAS_ITEM_VISIBLE,
107
GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD,
108
GOO_CANVAS_ITEM_INVISIBLE
86
GOO_CANVAS_ITEM_HIDDEN = 0,
87
GOO_CANVAS_ITEM_INVISIBLE = 1,
88
GOO_CANVAS_ITEM_VISIBLE = 2,
89
GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD = 3,
109
90
} GooCanvasItemVisibility;
94
* GooCanvasPathCommandType
95
* @GOO_CANVAS_PATH_MOVE_TO: move to the given point.
96
* @GOO_CANVAS_PATH_CLOSE_PATH: close the current path, drawing a line from the
97
* current position to the start of the path.
98
* @GOO_CANVAS_PATH_LINE_TO: draw a line to the given point.
99
* @GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: draw a horizontal line to the given
101
* @GOO_CANVAS_PATH_VERTICAL_LINE_TO: draw a vertical line to the given y
103
* @GOO_CANVAS_PATH_CURVE_TO: draw a bezier curve using two control
104
* points to the given point.
105
* @GOO_CANVAS_PATH_SMOOTH_CURVE_TO: draw a bezier curve using a reflection
106
* of the last control point of the last curve as the first control point,
107
* and one new control point, to the given point.
108
* @GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve using
109
* a single control point to the given point.
110
* @GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve
111
* using a reflection of the control point from the previous curve as the
112
* control point, to the given point.
113
* @GOO_CANVAS_PATH_ELLIPTICAL_ARC: draw an elliptical arc, using the given
114
* 2 radii, the x axis rotation, and the 2 flags to disambiguate the arc,
115
* to the given point.
117
* GooCanvasPathCommandType specifies the type of each command in the path.
118
* See the path element in the <ulink url="http://www.w3.org/Graphics/SVG/">
119
* Scalable Vector Graphics (SVG) specification</ulink> for more details.
123
/* Simple commands like moveto and lineto: MmZzLlHhVv. */
124
GOO_CANVAS_PATH_MOVE_TO,
125
GOO_CANVAS_PATH_CLOSE_PATH,
126
GOO_CANVAS_PATH_LINE_TO,
127
GOO_CANVAS_PATH_HORIZONTAL_LINE_TO,
128
GOO_CANVAS_PATH_VERTICAL_LINE_TO,
130
/* Bezier curve commands: CcSsQqTt. */
131
GOO_CANVAS_PATH_CURVE_TO,
132
GOO_CANVAS_PATH_SMOOTH_CURVE_TO,
133
GOO_CANVAS_PATH_QUADRATIC_CURVE_TO,
134
GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO,
136
/* The elliptical arc commands: Aa. */
137
GOO_CANVAS_PATH_ELLIPTICAL_ARC
138
} GooCanvasPathCommandType;
141
typedef union _GooCanvasPathCommand GooCanvasPathCommand;
143
/* Note that the command type is always the first element in each struct, so
144
we can always use it whatever type of command it is. */
147
* GooCanvasPathCommand
149
* GooCanvasPathCommand holds the data for each command in the path.
151
* The @relative flag specifies that the coordinates for the command are
152
* relative to the current point. Otherwise they are assumed to be absolute
155
union _GooCanvasPathCommand
157
/* Simple commands like moveto and lineto: MmZzLlHhVv. */
159
guint type : 5; /* GooCanvasPathCommandType */
164
/* Bezier curve commands: CcSsQqTt. */
166
guint type : 5; /* GooCanvasPathCommandType */
168
gdouble x, y, x1, y1, x2, y2;
171
/* The elliptical arc commands: Aa. */
173
guint type : 5; /* GooCanvasPathCommandType */
175
guint large_arc_flag : 1;
176
guint sweep_flag : 1;
177
gdouble rx, ry, x_axis_rotation, x, y;
182
GArray* goo_canvas_parse_path_data (const gchar *path_data);
183
void goo_canvas_create_path (GArray *commands,
113
188
* Cairo utilities.