~ubuntu-branches/ubuntu/gutsy/goocanvas/gutsy

« back to all changes in this revision

Viewing changes to src/goocanvastext.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-20 18:25:58 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070220182558-tjofc7wdzkzlxzor
Tags: 0.6-0ubuntu1
* New upstream version (UVF exception #86533):
  - Major rewrite to make the model optional, so people can choose to have
    either a simple canvas or a model/view canvas. The standard items can be
    used in either scenario.
  - Added support for cascading style properties (things like fill color, 
    stroke width, font etc.). Properties use a GQuark for a unique 
    identifier, and a GValue for the property value, so they are very 
    flexible.
  - Added GooCanvasTable item to layout child items.
  - Made it much easier to create new items, by subclassing 
    GooCanvasItemSimple which handles most of the work. See demo/demo-item.c 
    for a simple item.
  - Added support for different units - pixels, points, inches or 
    millimeters, and allow setting of vertical 
    and horizontal resolution (dpi).
  - Added workaround for cairo's 16-bit limit, to support large canvases.
  - Added demo/scalability-demo which creates 100,000 items over a large 
    canvas. It takes a few seconds to create all the items, but once created 
    it seems to work fast enough.
  - Improved the animation code, supporting relative or absolute values for
    the x, y, scale and rotation.
  - Added "clip-path" and "clip-fill-rule" to specify a clip path 
    for an item.
* debian/control:
  - updated GTK requirement to 2.10
* debian/control, debian/libgoocanvas0.install, debian/libgoocanvas1.install,
  debian/rules:
  - updated for soname change

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
G_BEGIN_DECLS
14
14
 
15
15
 
 
16
/* This is the data used by both model and view classes. */
 
17
typedef struct _GooCanvasTextData   GooCanvasTextData;
 
18
struct _GooCanvasTextData
 
19
{
 
20
  gchar *text;
 
21
  gboolean use_markup;
 
22
 
 
23
  gdouble x, y, width;
 
24
  GtkAnchorType anchor;
 
25
  PangoAlignment alignment;
 
26
};
 
27
 
 
28
 
16
29
#define GOO_TYPE_CANVAS_TEXT            (goo_canvas_text_get_type ())
17
30
#define GOO_CANVAS_TEXT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TEXT, GooCanvasText))
18
31
#define GOO_CANVAS_TEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TEXT, GooCanvasTextClass))
33
46
{
34
47
  GooCanvasItemSimple parent;
35
48
 
36
 
  gchar *text;
37
 
  gboolean use_markup;
38
 
  PangoFontDescription *font_desc;
39
 
 
40
 
  gdouble x, y, width;
41
 
  GtkAnchorType anchor;
42
 
  PangoAlignment alignment;
 
49
  GooCanvasTextData *text_data;
43
50
};
44
51
 
45
52
struct _GooCanvasTextClass
46
53
{
47
54
  GooCanvasItemSimpleClass parent_class;
48
 
};
49
 
 
50
 
 
51
 
GType          goo_canvas_text_get_type        (void) G_GNUC_CONST;
52
 
GooCanvasItem* goo_canvas_text_new             (GooCanvasItem *parent,
53
 
                                                const char    *string,
54
 
                                                gdouble        x,
55
 
                                                gdouble        y,
56
 
                                                gdouble        width,
57
 
                                                GtkAnchorType  anchor,
58
 
                                                const gchar   *first_property,
59
 
                                                ...);
 
55
 
 
56
  /* The font options we always use. */
 
57
  cairo_font_options_t *font_options;
 
58
 
 
59
  /*< private >*/
 
60
 
 
61
  /* Padding for future expansion */
 
62
  void (*_goo_canvas_reserved1) (void);
 
63
  void (*_goo_canvas_reserved2) (void);
 
64
  void (*_goo_canvas_reserved3) (void);
 
65
  void (*_goo_canvas_reserved4) (void);
 
66
};
 
67
 
 
68
 
 
69
GType               goo_canvas_text_get_type  (void) G_GNUC_CONST;
 
70
 
 
71
GooCanvasItem*      goo_canvas_text_new       (GooCanvasItem      *parent,
 
72
                                               const char         *string,
 
73
                                               gdouble             x,
 
74
                                               gdouble             y,
 
75
                                               gdouble             width,
 
76
                                               GtkAnchorType       anchor,
 
77
                                               ...);
 
78
 
 
79
 
 
80
 
 
81
#define GOO_TYPE_CANVAS_TEXT_MODEL            (goo_canvas_text_model_get_type ())
 
82
#define GOO_CANVAS_TEXT_MODEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModel))
 
83
#define GOO_CANVAS_TEXT_MODEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModelClass))
 
84
#define GOO_IS_CANVAS_TEXT_MODEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TEXT_MODEL))
 
85
#define GOO_IS_CANVAS_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TEXT_MODEL))
 
86
#define GOO_CANVAS_TEXT_MODEL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModelClass))
 
87
 
 
88
 
 
89
typedef struct _GooCanvasTextModel       GooCanvasTextModel;
 
90
typedef struct _GooCanvasTextModelClass  GooCanvasTextModelClass;
 
91
 
 
92
/**
 
93
 * GooCanvasTextModel
 
94
 *
 
95
 * The #GooCanvasTextModel-struct struct contains private data only.
 
96
 */
 
97
struct _GooCanvasTextModel
 
98
{
 
99
  GooCanvasItemModelSimple parent_object;
 
100
 
 
101
  GooCanvasTextData text_data;
 
102
};
 
103
 
 
104
struct _GooCanvasTextModelClass
 
105
{
 
106
  GooCanvasItemModelSimpleClass parent_class;
 
107
 
 
108
  /*< private >*/
 
109
 
 
110
  /* Padding for future expansion */
 
111
  void (*_goo_canvas_reserved1) (void);
 
112
  void (*_goo_canvas_reserved2) (void);
 
113
  void (*_goo_canvas_reserved3) (void);
 
114
  void (*_goo_canvas_reserved4) (void);
 
115
};
 
116
 
 
117
 
 
118
GType               goo_canvas_text_model_get_type  (void) G_GNUC_CONST;
 
119
 
 
120
GooCanvasItemModel* goo_canvas_text_model_new (GooCanvasItemModel *parent,
 
121
                                               const char         *string,
 
122
                                               gdouble             x,
 
123
                                               gdouble             y,
 
124
                                               gdouble             width,
 
125
                                               GtkAnchorType       anchor,
 
126
                                               ...);
60
127
 
61
128
 
62
129
G_END_DECLS