~ubuntu-branches/ubuntu/trusty/goocanvas/trusty-proposed

« back to all changes in this revision

Viewing changes to src/goocanvasstyle.c

  • Committer: Bazaar Package Importer
  • Author(s): Jose Carlos Garcia Sogo
  • Date: 2007-05-14 22:49:11 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070514224911-vyv39khpicv46oe2
Tags: 0.8-2
Link gtk-doc to /usr/share/doc/libgoocanvas-dev (Closes: #423410)

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
 **/
106
106
GQuark goo_canvas_style_font_desc_id;
107
107
 
 
108
/**
 
109
 * goo_canvas_style_hint_metrics_id:
 
110
 * 
 
111
 * Unique #GQuark identifier used for the standard hint metrics property.
 
112
 **/
 
113
GQuark goo_canvas_style_hint_metrics_id;
 
114
 
 
115
static void goo_canvas_style_dispose  (GObject *object);
108
116
static void goo_canvas_style_finalize (GObject *object);
109
117
 
110
118
G_DEFINE_TYPE (GooCanvasStyle, goo_canvas_style, G_TYPE_OBJECT)
132
140
      goo_canvas_style_line_join_miter_limit_id = g_quark_from_static_string ("GooCanvasStyle:line_join_miter_limit");
133
141
      goo_canvas_style_line_dash_id = g_quark_from_static_string ("GooCanvasStyle:line_dash");
134
142
      goo_canvas_style_font_desc_id = g_quark_from_static_string ("GooCanvasStyle:font_desc");
 
143
      goo_canvas_style_hint_metrics_id = g_quark_from_static_string ("GooCanvasStyle:hint_metrics");
135
144
 
136
145
      initialized = TRUE;
137
146
    }
143
152
{
144
153
  GObjectClass *gobject_class = (GObjectClass*) klass;
145
154
 
 
155
  gobject_class->dispose  = goo_canvas_style_dispose;
146
156
  gobject_class->finalize = goo_canvas_style_finalize;
147
157
 
148
158
  _goo_canvas_style_init ();
171
181
 
172
182
 
173
183
static void
174
 
goo_canvas_style_finalize (GObject *object)
 
184
goo_canvas_style_dispose (GObject *object)
175
185
{
176
186
  GooCanvasStyle *style = (GooCanvasStyle*) object;
177
187
  GooCanvasStyleProperty *property;
189
199
      property = &g_array_index (style->properties, GooCanvasStyleProperty, i);
190
200
      g_value_unset (&property->value);
191
201
    }
 
202
  g_array_set_size (style->properties, 0);
 
203
 
 
204
  G_OBJECT_CLASS (goo_canvas_style_parent_class)->dispose (object);
 
205
}
 
206
 
 
207
 
 
208
static void
 
209
goo_canvas_style_finalize (GObject *object)
 
210
{
 
211
  GooCanvasStyle *style = (GooCanvasStyle*) object;
 
212
 
192
213
  g_array_free (style->properties, TRUE);
193
214
 
194
215
  G_OBJECT_CLASS (goo_canvas_style_parent_class)->finalize (object);
471
492
  GooCanvasStyleProperty *property;
472
493
  gboolean operator_set = FALSE, antialias_set = FALSE;
473
494
  gboolean fill_rule_set = FALSE, fill_pattern_set = FALSE;
 
495
  gboolean need_fill = FALSE;
474
496
  gint i;
475
497
 
476
498
  if (!style)
501
523
            }
502
524
          else if (property->id == goo_canvas_style_fill_pattern_id && !fill_pattern_set)
503
525
            {
504
 
              cairo_set_source (cr, property->value.data[0].v_pointer);
 
526
              if (property->value.data[0].v_pointer)
 
527
                {
 
528
                  cairo_set_source (cr, property->value.data[0].v_pointer);
 
529
                  need_fill = TRUE;
 
530
                }
505
531
              fill_pattern_set = TRUE;
506
532
            }
507
533
        }
509
535
      style = style->parent;
510
536
    }
511
537
 
512
 
  return fill_pattern_set;
 
538
  return need_fill;
513
539
}