~ml-launchpad/ubuntu/natty/gcompris/fix-for-777349

« back to all changes in this revision

Viewing changes to src/goocanvas/src/goocanvaspolyline.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Gariepy, Marc Gariepy, Stephane Graber
  • Date: 2010-01-04 17:42:49 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20100104174249-7bupatd9dtxyhvs4
Tags: 9.0-0ubuntu1
[Marc Gariepy]
* New upstream release (9.0).
* Remove cache.c from POTFILES to avoid FTBFS
* Remove unneeded rm in debian/rules (file no longer exists upstream)

[Stephane Graber]
* Bump Debian standards to 3.8.3
* Add patch system (dpatch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * GooCanvas. Copyright (C) 2005 Damon Chaplin.
 
3
 * Released under the GNU LGPL license. See COPYING for details.
 
4
 *
 
5
 * goocanvaspolyline.h - polyline item, with optional arrows.
 
6
 */
 
7
#ifndef __GOO_CANVAS_POLYLINE_H__
 
8
#define __GOO_CANVAS_POLYLINE_H__
 
9
 
 
10
#include <gtk/gtk.h>
 
11
#include "goocanvasitemsimple.h"
 
12
 
 
13
G_BEGIN_DECLS
 
14
 
 
15
 
 
16
/**
 
17
 * GooCanvasPoints
 
18
 * @coords: the coordinates of the points, in pairs.
 
19
 * @num_points: the number of points.
 
20
 * @ref_count: the reference count of the struct.
 
21
 *
 
22
 * #GooCairoPoints represents an array of points.
 
23
 */
 
24
typedef struct _GooCanvasPoints GooCanvasPoints;
 
25
struct _GooCanvasPoints
 
26
{
 
27
  double *coords;
 
28
  int num_points;
 
29
  int ref_count;
 
30
};
 
31
 
 
32
#define GOO_TYPE_CANVAS_POINTS goo_canvas_points_get_type()
 
33
GType            goo_canvas_points_get_type (void);
 
34
GooCanvasPoints* goo_canvas_points_new      (int              num_points);
 
35
GooCanvasPoints* goo_canvas_points_ref      (GooCanvasPoints *points);
 
36
void             goo_canvas_points_unref    (GooCanvasPoints *points);
 
37
 
 
38
 
 
39
#define NUM_ARROW_POINTS     5          /* number of points in an arrowhead */
 
40
 
 
41
typedef struct _GooCanvasPolylineArrowData GooCanvasPolylineArrowData;
 
42
struct _GooCanvasPolylineArrowData
 
43
{
 
44
  /* These are specified in multiples of the line width, e.g. if arrow_width
 
45
     is 2 the width of the arrow will be twice the width of the line. */
 
46
  gdouble arrow_width, arrow_length, arrow_tip_length;
 
47
 
 
48
  gdouble line_start[2], line_end[2];
 
49
  gdouble start_arrow_coords[NUM_ARROW_POINTS * 2];
 
50
  gdouble end_arrow_coords[NUM_ARROW_POINTS * 2];
 
51
};
 
52
 
 
53
 
 
54
/* This is the data used by both model and view classes. */
 
55
typedef struct _GooCanvasPolylineData   GooCanvasPolylineData;
 
56
struct _GooCanvasPolylineData
 
57
{
 
58
  gdouble *coords;
 
59
 
 
60
  GooCanvasPolylineArrowData *arrow_data;
 
61
 
 
62
  guint num_points         : 16;
 
63
  guint close_path         : 1;
 
64
  guint start_arrow        : 1;
 
65
  guint end_arrow          : 1;
 
66
  guint reconfigure_arrows : 1;
 
67
};
 
68
 
 
69
 
 
70
#define GOO_TYPE_CANVAS_POLYLINE            (goo_canvas_polyline_get_type ())
 
71
#define GOO_CANVAS_POLYLINE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolyline))
 
72
#define GOO_CANVAS_POLYLINE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass))
 
73
#define GOO_IS_CANVAS_POLYLINE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE))
 
74
#define GOO_IS_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE))
 
75
#define GOO_CANVAS_POLYLINE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass))
 
76
 
 
77
 
 
78
typedef struct _GooCanvasPolyline       GooCanvasPolyline;
 
79
typedef struct _GooCanvasPolylineClass  GooCanvasPolylineClass;
 
80
 
 
81
/**
 
82
 * GooCanvasPolyline
 
83
 *
 
84
 * The #GooCanvasPolyline-struct struct contains private data only.
 
85
 */
 
86
struct _GooCanvasPolyline
 
87
{
 
88
  GooCanvasItemSimple parent;
 
89
 
 
90
  GooCanvasPolylineData *polyline_data;
 
91
};
 
92
 
 
93
struct _GooCanvasPolylineClass
 
94
{
 
95
  GooCanvasItemSimpleClass parent_class;
 
96
 
 
97
  /*< private >*/
 
98
 
 
99
  /* Padding for future expansion */
 
100
  void (*_goo_canvas_reserved1) (void);
 
101
  void (*_goo_canvas_reserved2) (void);
 
102
  void (*_goo_canvas_reserved3) (void);
 
103
  void (*_goo_canvas_reserved4) (void);
 
104
};
 
105
 
 
106
 
 
107
GType               goo_canvas_polyline_get_type       (void) G_GNUC_CONST;
 
108
 
 
109
GooCanvasItem*      goo_canvas_polyline_new            (GooCanvasItem      *parent,
 
110
                                                        gboolean            close_path,
 
111
                                                        gint                num_points,
 
112
                                                        ...);
 
113
 
 
114
GooCanvasItem*      goo_canvas_polyline_new_line       (GooCanvasItem      *parent,
 
115
                                                        gdouble             x1,
 
116
                                                        gdouble             y1,
 
117
                                                        gdouble             x2,
 
118
                                                        gdouble             y2,
 
119
                                                        ...);
 
120
 
 
121
 
 
122
 
 
123
#define GOO_TYPE_CANVAS_POLYLINE_MODEL            (goo_canvas_polyline_model_get_type ())
 
124
#define GOO_CANVAS_POLYLINE_MODEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModel))
 
125
#define GOO_CANVAS_POLYLINE_MODEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass))
 
126
#define GOO_IS_CANVAS_POLYLINE_MODEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL))
 
127
#define GOO_IS_CANVAS_POLYLINE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL))
 
128
#define GOO_CANVAS_POLYLINE_MODEL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass))
 
129
 
 
130
 
 
131
typedef struct _GooCanvasPolylineModel       GooCanvasPolylineModel;
 
132
typedef struct _GooCanvasPolylineModelClass  GooCanvasPolylineModelClass;
 
133
 
 
134
/**
 
135
 * GooCanvasPolylineModel
 
136
 *
 
137
 * The #GooCanvasPolylineModel-struct struct contains private data only.
 
138
 */
 
139
struct _GooCanvasPolylineModel
 
140
{
 
141
  GooCanvasItemModelSimple parent_object;
 
142
 
 
143
  GooCanvasPolylineData polyline_data;
 
144
};
 
145
 
 
146
struct _GooCanvasPolylineModelClass
 
147
{
 
148
  GooCanvasItemModelSimpleClass parent_class;
 
149
 
 
150
  /*< private >*/
 
151
 
 
152
  /* Padding for future expansion */
 
153
  void (*_goo_canvas_reserved1) (void);
 
154
  void (*_goo_canvas_reserved2) (void);
 
155
  void (*_goo_canvas_reserved3) (void);
 
156
  void (*_goo_canvas_reserved4) (void);
 
157
};
 
158
 
 
159
 
 
160
GType               goo_canvas_polyline_model_get_type  (void) G_GNUC_CONST;
 
161
 
 
162
GooCanvasItemModel* goo_canvas_polyline_model_new      (GooCanvasItemModel *parent,
 
163
                                                        gboolean            close_path,
 
164
                                                        gint                num_points,
 
165
                                                        ...);
 
166
 
 
167
GooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent,
 
168
                                                        gdouble             x1,
 
169
                                                        gdouble             y1,
 
170
                                                        gdouble             x2,
 
171
                                                        gdouble             y2,
 
172
                                                        ...);
 
173
 
 
174
G_END_DECLS
 
175
 
 
176
#endif /* __GOO_CANVAS_POLYLINE_H__ */