1 #define __SP_FLOWDIV_C__
3 /*
4 */
6 #ifdef HAVE_CONFIG_H
7 # include "config.h"
8 #endif
10 #include "libnr/nr-matrix-ops.h"
11 #include "xml/repr.h"
12 //#include "svg/svg.h"
14 //#include "style.h"
16 #include "sp-flowdiv.h"
17 #include "sp-string.h"
18 #include "document.h"
20 static void sp_flowdiv_class_init (SPFlowdivClass *klass);
21 static void sp_flowdiv_init (SPFlowdiv *group);
22 static void sp_flowdiv_release (SPObject *object);
23 static Inkscape::XML::Node *sp_flowdiv_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
24 static void sp_flowdiv_update (SPObject *object, SPCtx *ctx, unsigned int flags);
25 static void sp_flowdiv_modified (SPObject *object, guint flags);
26 static void sp_flowdiv_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
27 static void sp_flowdiv_set (SPObject *object, unsigned int key, const gchar *value);
29 static void sp_flowtspan_class_init (SPFlowtspanClass *klass);
30 static void sp_flowtspan_init (SPFlowtspan *group);
31 static void sp_flowtspan_release (SPObject *object);
32 static Inkscape::XML::Node *sp_flowtspan_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
33 static void sp_flowtspan_update (SPObject *object, SPCtx *ctx, unsigned int flags);
34 static void sp_flowtspan_modified (SPObject *object, guint flags);
35 static void sp_flowtspan_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
36 static void sp_flowtspan_set (SPObject *object, unsigned int key, const gchar *value);
38 static void sp_flowpara_class_init (SPFlowparaClass *klass);
39 static void sp_flowpara_init (SPFlowpara *group);
40 static void sp_flowpara_release (SPObject *object);
41 static Inkscape::XML::Node *sp_flowpara_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
42 static void sp_flowpara_update (SPObject *object, SPCtx *ctx, unsigned int flags);
43 static void sp_flowpara_modified (SPObject *object, guint flags);
44 static void sp_flowpara_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
45 static void sp_flowpara_set (SPObject *object, unsigned int key, const gchar *value);
47 static void sp_flowline_class_init (SPFlowlineClass *klass);
48 static void sp_flowline_release (SPObject *object);
49 static void sp_flowline_init (SPFlowline *group);
50 static Inkscape::XML::Node *sp_flowline_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
51 static void sp_flowline_modified (SPObject *object, guint flags);
53 static void sp_flowregionbreak_class_init (SPFlowregionbreakClass *klass);
54 static void sp_flowregionbreak_release (SPObject *object);
55 static void sp_flowregionbreak_init (SPFlowregionbreak *group);
56 static Inkscape::XML::Node *sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
57 static void sp_flowregionbreak_modified (SPObject *object, guint flags);
59 static SPItemClass * flowdiv_parent_class;
60 static SPItemClass * flowtspan_parent_class;
61 static SPItemClass * flowpara_parent_class;
62 static SPObjectClass * flowline_parent_class;
63 static SPObjectClass * flowregionbreak_parent_class;
65 GType
66 sp_flowdiv_get_type (void)
67 {
68 static GType group_type = 0;
69 if (!group_type) {
70 GTypeInfo group_info = {
71 sizeof (SPFlowdivClass),
72 NULL, /* base_init */
73 NULL, /* base_finalize */
74 (GClassInitFunc) sp_flowdiv_class_init,
75 NULL, /* class_finalize */
76 NULL, /* class_data */
77 sizeof (SPFlowdiv),
78 16, /* n_preallocs */
79 (GInstanceInitFunc) sp_flowdiv_init,
80 NULL, /* value_table */
81 };
82 group_type = g_type_register_static (SP_TYPE_ITEM, "SPFlowdiv", &group_info, (GTypeFlags)0);
83 }
84 return group_type;
85 }
87 static void
88 sp_flowdiv_class_init (SPFlowdivClass *klass)
89 {
90 GObjectClass * object_class;
91 SPObjectClass * sp_object_class;
93 object_class = (GObjectClass *) klass;
94 sp_object_class = (SPObjectClass *) klass;
96 flowdiv_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM);
98 sp_object_class->build = sp_flowdiv_build;
99 sp_object_class->set = sp_flowdiv_set;
100 sp_object_class->release = sp_flowdiv_release;
101 sp_object_class->write = sp_flowdiv_write;
102 sp_object_class->update = sp_flowdiv_update;
103 sp_object_class->modified = sp_flowdiv_modified;
104 }
106 static void
107 sp_flowdiv_init (SPFlowdiv */*group*/)
108 {
109 }
111 static void
112 sp_flowdiv_release (SPObject *object)
113 {
114 if (((SPObjectClass *) flowdiv_parent_class)->release)
115 ((SPObjectClass *) flowdiv_parent_class)->release (object);
116 }
117 static void
118 sp_flowdiv_update (SPObject *object, SPCtx *ctx, unsigned int flags)
119 {
120 SPItemCtx *ictx=(SPItemCtx *) ctx;
121 SPItemCtx cctx=*ictx;
123 if (((SPObjectClass *) (flowdiv_parent_class))->update)
124 ((SPObjectClass *) (flowdiv_parent_class))->update (object, ctx, flags);
126 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
127 flags &= SP_OBJECT_MODIFIED_CASCADE;
129 GSList* l = NULL;
130 for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
131 g_object_ref (G_OBJECT (child));
132 l = g_slist_prepend (l, child);
133 }
134 l = g_slist_reverse (l);
135 while (l) {
136 SPObject *child = SP_OBJECT (l->data);
137 l = g_slist_remove (l, child);
138 if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
139 if (SP_IS_ITEM (child)) {
140 SPItem const &chi = *SP_ITEM(child);
141 cctx.i2doc = chi.transform * ictx->i2doc;
142 cctx.i2vp = chi.transform * ictx->i2vp;
143 child->updateDisplay((SPCtx *)&cctx, flags);
144 } else {
145 child->updateDisplay(ctx, flags);
146 }
147 }
148 g_object_unref (G_OBJECT (child));
149 }
150 }
151 static void
152 sp_flowdiv_modified (SPObject *object, guint flags)
153 {
154 SPObject *child;
155 GSList *l;
157 if (((SPObjectClass *) (flowdiv_parent_class))->modified)
158 ((SPObjectClass *) (flowdiv_parent_class))->modified (object, flags);
160 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
161 flags &= SP_OBJECT_MODIFIED_CASCADE;
163 l = NULL;
164 for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
165 g_object_ref (G_OBJECT (child));
166 l = g_slist_prepend (l, child);
167 }
168 l = g_slist_reverse (l);
169 while (l) {
170 child = SP_OBJECT (l->data);
171 l = g_slist_remove (l, child);
172 if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
173 child->emitModified(flags);
174 }
175 g_object_unref (G_OBJECT (child));
176 }
177 }
179 static void
180 sp_flowdiv_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
181 {
182 object->_requireSVGVersion(Inkscape::Version(1, 2));
184 if (((SPObjectClass *) flowdiv_parent_class)->build)
185 ((SPObjectClass *) flowdiv_parent_class)->build (object, doc, repr);
186 }
188 static void
189 sp_flowdiv_set (SPObject *object, unsigned int key, const gchar *value)
190 {
191 if (((SPObjectClass *) flowdiv_parent_class)->set)
192 (((SPObjectClass *) flowdiv_parent_class)->set) (object, key, value);
193 }
195 static Inkscape::XML::Node *
196 sp_flowdiv_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
197 {
198 // SPFlowdiv *group = SP_FLOWDIV (object);
200 if ( flags&SP_OBJECT_WRITE_BUILD ) {
201 if ( repr == NULL ) repr = xml_doc->createElement("svg:flowDiv");
202 GSList *l = NULL;
203 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
204 Inkscape::XML::Node* c_repr=NULL;
205 if ( SP_IS_FLOWTSPAN (child) ) {
206 c_repr = child->updateRepr(xml_doc, NULL, flags);
207 } else if ( SP_IS_FLOWPARA(child) ) {
208 c_repr = child->updateRepr(xml_doc, NULL, flags);
209 } else if ( SP_IS_STRING(child) ) {
210 c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
211 }
212 if ( c_repr ) l = g_slist_prepend (l, c_repr);
213 }
214 while ( l ) {
215 repr->addChild((Inkscape::XML::Node *) l->data, NULL);
216 Inkscape::GC::release((Inkscape::XML::Node *) l->data);
217 l = g_slist_remove (l, l->data);
218 }
219 } else {
220 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
221 if ( SP_IS_FLOWTSPAN (child) ) {
222 child->updateRepr(flags);
223 } else if ( SP_IS_FLOWPARA(child) ) {
224 child->updateRepr(flags);
225 } else if ( SP_IS_STRING(child) ) {
226 SP_OBJECT_REPR (child)->setContent(SP_STRING(child)->string.c_str());
227 }
228 }
229 }
231 if (((SPObjectClass *) (flowdiv_parent_class))->write)
232 ((SPObjectClass *) (flowdiv_parent_class))->write (object, xml_doc, repr, flags);
234 return repr;
235 }
238 /*
239 *
240 */
242 GType
243 sp_flowtspan_get_type (void)
244 {
245 static GType group_type = 0;
246 if (!group_type) {
247 GTypeInfo group_info = {
248 sizeof (SPFlowtspanClass),
249 NULL, /* base_init */
250 NULL, /* base_finalize */
251 (GClassInitFunc) sp_flowtspan_class_init,
252 NULL, /* class_finalize */
253 NULL, /* class_data */
254 sizeof (SPFlowtspan),
255 16, /* n_preallocs */
256 (GInstanceInitFunc) sp_flowtspan_init,
257 NULL, /* value_table */
258 };
259 group_type = g_type_register_static (SP_TYPE_ITEM, "SPFlowtspan", &group_info, (GTypeFlags)0);
260 }
261 return group_type;
262 }
264 static void
265 sp_flowtspan_class_init (SPFlowtspanClass *klass)
266 {
267 GObjectClass * object_class;
268 SPObjectClass * sp_object_class;
270 object_class = (GObjectClass *) klass;
271 sp_object_class = (SPObjectClass *) klass;
273 flowtspan_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM);
275 sp_object_class->build = sp_flowtspan_build;
276 sp_object_class->set = sp_flowtspan_set;
277 sp_object_class->release = sp_flowtspan_release;
278 sp_object_class->write = sp_flowtspan_write;
279 sp_object_class->update = sp_flowtspan_update;
280 sp_object_class->modified = sp_flowtspan_modified;
281 }
283 static void
284 sp_flowtspan_init (SPFlowtspan */*group*/)
285 {
286 }
288 static void
289 sp_flowtspan_release (SPObject *object)
290 {
291 if (((SPObjectClass *) flowtspan_parent_class)->release)
292 ((SPObjectClass *) flowtspan_parent_class)->release (object);
293 }
294 static void
295 sp_flowtspan_update (SPObject *object, SPCtx *ctx, unsigned int flags)
296 {
297 // SPFlowtspan *group=SP_FLOWTSPAN (object);
298 SPItemCtx *ictx=(SPItemCtx *) ctx;
299 SPItemCtx cctx=*ictx;
301 if (((SPObjectClass *) (flowtspan_parent_class))->update)
302 ((SPObjectClass *) (flowtspan_parent_class))->update (object, ctx, flags);
304 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
305 flags &= SP_OBJECT_MODIFIED_CASCADE;
307 GSList* l = NULL;
308 for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
309 g_object_ref (G_OBJECT (child));
310 l = g_slist_prepend (l, child);
311 }
312 l = g_slist_reverse (l);
313 while (l) {
314 SPObject *child = SP_OBJECT (l->data);
315 l = g_slist_remove (l, child);
316 if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
317 if (SP_IS_ITEM (child)) {
318 SPItem const &chi = *SP_ITEM(child);
319 cctx.i2doc = chi.transform * ictx->i2doc;
320 cctx.i2vp = chi.transform * ictx->i2vp;
321 child->updateDisplay((SPCtx *)&cctx, flags);
322 } else {
323 child->updateDisplay(ctx, flags);
324 }
325 }
326 g_object_unref (G_OBJECT (child));
327 }
328 }
329 static void
330 sp_flowtspan_modified (SPObject *object, guint flags)
331 {
332 SPObject *child;
333 GSList *l;
335 if (((SPObjectClass *) (flowtspan_parent_class))->modified)
336 ((SPObjectClass *) (flowtspan_parent_class))->modified (object, flags);
338 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
339 flags &= SP_OBJECT_MODIFIED_CASCADE;
341 l = NULL;
342 for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
343 g_object_ref (G_OBJECT (child));
344 l = g_slist_prepend (l, child);
345 }
346 l = g_slist_reverse (l);
347 while (l) {
348 child = SP_OBJECT (l->data);
349 l = g_slist_remove (l, child);
350 if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
351 child->emitModified(flags);
352 }
353 g_object_unref (G_OBJECT (child));
354 }
355 }
356 static void
357 sp_flowtspan_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
358 {
359 if (((SPObjectClass *) flowtspan_parent_class)->build)
360 ((SPObjectClass *) flowtspan_parent_class)->build (object, doc, repr);
361 }
362 static void
363 sp_flowtspan_set (SPObject *object, unsigned int key, const gchar *value)
364 {
365 if (((SPObjectClass *) flowtspan_parent_class)->set)
366 (((SPObjectClass *) flowtspan_parent_class)->set) (object, key, value);
367 }
368 static Inkscape::XML::Node *
369 sp_flowtspan_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
370 {
371 if ( flags&SP_OBJECT_WRITE_BUILD ) {
372 if ( repr == NULL ) repr = xml_doc->createElement("svg:flowSpan");
373 GSList *l = NULL;
374 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
375 Inkscape::XML::Node* c_repr=NULL;
376 if ( SP_IS_FLOWTSPAN (child) ) {
377 c_repr = child->updateRepr(xml_doc, NULL, flags);
378 } else if ( SP_IS_FLOWPARA (child) ) {
379 c_repr = child->updateRepr(xml_doc, NULL, flags);
380 } else if ( SP_IS_STRING(child) ) {
381 c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
382 }
383 if ( c_repr ) l = g_slist_prepend (l, c_repr);
384 }
385 while ( l ) {
386 repr->addChild((Inkscape::XML::Node *) l->data, NULL);
387 Inkscape::GC::release((Inkscape::XML::Node *) l->data);
388 l = g_slist_remove (l, l->data);
389 }
390 } else {
391 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
392 if ( SP_IS_FLOWTSPAN (child) ) {
393 child->updateRepr(flags);
394 } else if ( SP_IS_FLOWPARA (child) ) {
395 child->updateRepr(flags);
396 } else if ( SP_IS_STRING(child) ) {
397 SP_OBJECT_REPR (child)->setContent(SP_STRING(child)->string.c_str());
398 }
399 }
400 }
402 if (((SPObjectClass *) (flowtspan_parent_class))->write)
403 ((SPObjectClass *) (flowtspan_parent_class))->write (object, xml_doc, repr, flags);
405 return repr;
406 }
410 /*
411 *
412 */
414 GType
415 sp_flowpara_get_type (void)
416 {
417 static GType group_type = 0;
418 if (!group_type) {
419 GTypeInfo group_info = {
420 sizeof (SPFlowparaClass),
421 NULL, /* base_init */
422 NULL, /* base_finalize */
423 (GClassInitFunc) sp_flowpara_class_init,
424 NULL, /* class_finalize */
425 NULL, /* class_data */
426 sizeof (SPFlowpara),
427 16, /* n_preallocs */
428 (GInstanceInitFunc) sp_flowpara_init,
429 NULL, /* value_table */
430 };
431 group_type = g_type_register_static (SP_TYPE_ITEM, "SPFlowpara", &group_info, (GTypeFlags)0);
432 }
433 return group_type;
434 }
436 static void
437 sp_flowpara_class_init (SPFlowparaClass *klass)
438 {
439 GObjectClass * object_class;
440 SPObjectClass * sp_object_class;
442 object_class = (GObjectClass *) klass;
443 sp_object_class = (SPObjectClass *) klass;
445 flowpara_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM);
447 sp_object_class->build = sp_flowpara_build;
448 sp_object_class->set = sp_flowpara_set;
449 sp_object_class->release = sp_flowpara_release;
450 sp_object_class->write = sp_flowpara_write;
451 sp_object_class->update = sp_flowpara_update;
452 sp_object_class->modified = sp_flowpara_modified;
453 }
455 static void
456 sp_flowpara_init (SPFlowpara */*group*/)
457 {
458 }
459 static void
460 sp_flowpara_release (SPObject *object)
461 {
462 if (((SPObjectClass *) flowpara_parent_class)->release)
463 ((SPObjectClass *) flowpara_parent_class)->release (object);
464 }
466 static void
467 sp_flowpara_update (SPObject *object, SPCtx *ctx, unsigned int flags)
468 {
469 SPItemCtx *ictx=(SPItemCtx *) ctx;
470 SPItemCtx cctx=*ictx;
472 if (((SPObjectClass *) (flowpara_parent_class))->update)
473 ((SPObjectClass *) (flowpara_parent_class))->update (object, ctx, flags);
475 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
476 flags &= SP_OBJECT_MODIFIED_CASCADE;
478 GSList* l = NULL;
479 for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
480 g_object_ref (G_OBJECT (child));
481 l = g_slist_prepend (l, child);
482 }
483 l = g_slist_reverse (l);
484 while (l) {
485 SPObject *child = SP_OBJECT (l->data);
486 l = g_slist_remove (l, child);
487 if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
488 if (SP_IS_ITEM (child)) {
489 SPItem const &chi = *SP_ITEM(child);
490 cctx.i2doc = chi.transform * ictx->i2doc;
491 cctx.i2vp = chi.transform * ictx->i2vp;
492 child->updateDisplay((SPCtx *)&cctx, flags);
493 } else {
494 child->updateDisplay(ctx, flags);
495 }
496 }
497 g_object_unref (G_OBJECT (child));
498 }
499 }
500 static void
501 sp_flowpara_modified (SPObject *object, guint flags)
502 {
503 SPObject *child;
504 GSList *l;
506 if (((SPObjectClass *) (flowpara_parent_class))->modified)
507 ((SPObjectClass *) (flowpara_parent_class))->modified (object, flags);
509 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
510 flags &= SP_OBJECT_MODIFIED_CASCADE;
512 l = NULL;
513 for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
514 g_object_ref (G_OBJECT (child));
515 l = g_slist_prepend (l, child);
516 }
517 l = g_slist_reverse (l);
518 while (l) {
519 child = SP_OBJECT (l->data);
520 l = g_slist_remove (l, child);
521 if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
522 child->emitModified(flags);
523 }
524 g_object_unref (G_OBJECT (child));
525 }
526 }
527 static void
528 sp_flowpara_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
529 {
530 if (((SPObjectClass *) flowpara_parent_class)->build)
531 ((SPObjectClass *) flowpara_parent_class)->build (object, doc, repr);
532 }
533 static void
534 sp_flowpara_set (SPObject *object, unsigned int key, const gchar *value)
535 {
536 if (((SPObjectClass *) flowpara_parent_class)->set)
537 (((SPObjectClass *) flowpara_parent_class)->set) (object, key, value);
538 }
539 static Inkscape::XML::Node *
540 sp_flowpara_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
541 {
542 // SPFlowpara *group = SP_FLOWPARA (object);
544 if ( flags&SP_OBJECT_WRITE_BUILD ) {
545 if ( repr == NULL ) repr = xml_doc->createElement("svg:flowPara");
546 GSList *l = NULL;
547 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
548 Inkscape::XML::Node* c_repr=NULL;
549 if ( SP_IS_FLOWTSPAN (child) ) {
550 c_repr = child->updateRepr(xml_doc, NULL, flags);
551 } else if ( SP_IS_FLOWPARA (child) ) {
552 c_repr = child->updateRepr(xml_doc, NULL, flags);
553 } else if ( SP_IS_STRING(child) ) {
554 c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
555 }
556 if ( c_repr ) l = g_slist_prepend (l, c_repr);
557 }
558 while ( l ) {
559 repr->addChild((Inkscape::XML::Node *) l->data, NULL);
560 Inkscape::GC::release((Inkscape::XML::Node *) l->data);
561 l = g_slist_remove (l, l->data);
562 }
563 } else {
564 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
565 if ( SP_IS_FLOWTSPAN (child) ) {
566 child->updateRepr(flags);
567 } else if ( SP_IS_FLOWPARA (child) ) {
568 child->updateRepr(flags);
569 } else if ( SP_IS_STRING(child) ) {
570 SP_OBJECT_REPR (child)->setContent(SP_STRING(child)->string.c_str());
571 }
572 }
573 }
575 if (((SPObjectClass *) (flowpara_parent_class))->write)
576 ((SPObjectClass *) (flowpara_parent_class))->write (object, xml_doc, repr, flags);
578 return repr;
579 }
581 /*
582 *
583 */
585 GType
586 sp_flowline_get_type (void)
587 {
588 static GType group_type = 0;
589 if (!group_type) {
590 GTypeInfo group_info = {
591 sizeof (SPFlowlineClass),
592 NULL, /* base_init */
593 NULL, /* base_finalize */
594 (GClassInitFunc) sp_flowline_class_init,
595 NULL, /* class_finalize */
596 NULL, /* class_data */
597 sizeof (SPFlowline),
598 16, /* n_preallocs */
599 (GInstanceInitFunc) sp_flowline_init,
600 NULL, /* value_table */
601 };
602 group_type = g_type_register_static (SP_TYPE_OBJECT, "SPFlowline", &group_info, (GTypeFlags)0);
603 }
604 return group_type;
605 }
607 static void
608 sp_flowline_class_init (SPFlowlineClass *klass)
609 {
610 GObjectClass * object_class;
611 SPObjectClass * sp_object_class;
613 object_class = (GObjectClass *) klass;
614 sp_object_class = (SPObjectClass *) klass;
616 flowline_parent_class = (SPObjectClass *)g_type_class_ref (SP_TYPE_OBJECT);
618 sp_object_class->release = sp_flowline_release;
619 sp_object_class->write = sp_flowline_write;
620 sp_object_class->modified = sp_flowline_modified;
621 }
623 static void
624 sp_flowline_init (SPFlowline */*group*/)
625 {
626 }
627 static void
628 sp_flowline_release (SPObject *object)
629 {
630 if (((SPObjectClass *) flowline_parent_class)->release)
631 ((SPObjectClass *) flowline_parent_class)->release (object);
632 }
634 static void
635 sp_flowline_modified (SPObject *object, guint flags)
636 {
637 if (((SPObjectClass *) (flowline_parent_class))->modified)
638 ((SPObjectClass *) (flowline_parent_class))->modified (object, flags);
640 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
641 flags &= SP_OBJECT_MODIFIED_CASCADE;
642 }
643 static Inkscape::XML::Node *
644 sp_flowline_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
645 {
646 if ( flags&SP_OBJECT_WRITE_BUILD ) {
647 if ( repr == NULL ) repr = xml_doc->createElement("svg:flowLine");
648 } else {
649 }
651 if (((SPObjectClass *) (flowline_parent_class))->write)
652 ((SPObjectClass *) (flowline_parent_class))->write (object, xml_doc, repr, flags);
654 return repr;
655 }
657 /*
658 *
659 */
661 GType
662 sp_flowregionbreak_get_type (void)
663 {
664 static GType group_type = 0;
665 if (!group_type) {
666 GTypeInfo group_info = {
667 sizeof (SPFlowregionbreakClass),
668 NULL, /* base_init */
669 NULL, /* base_finalize */
670 (GClassInitFunc) sp_flowregionbreak_class_init,
671 NULL, /* class_finalize */
672 NULL, /* class_data */
673 sizeof (SPFlowregionbreak),
674 16, /* n_preallocs */
675 (GInstanceInitFunc) sp_flowregionbreak_init,
676 NULL, /* value_table */
677 };
678 group_type = g_type_register_static (SP_TYPE_OBJECT, "SPFlowregionbreak", &group_info, (GTypeFlags)0);
679 }
680 return group_type;
681 }
683 static void
684 sp_flowregionbreak_class_init (SPFlowregionbreakClass *klass)
685 {
686 GObjectClass * object_class;
687 SPObjectClass * sp_object_class;
689 object_class = (GObjectClass *) klass;
690 sp_object_class = (SPObjectClass *) klass;
692 flowregionbreak_parent_class = (SPObjectClass *)g_type_class_ref (SP_TYPE_OBJECT);
694 sp_object_class->release = sp_flowregionbreak_release;
695 sp_object_class->write = sp_flowregionbreak_write;
696 sp_object_class->modified = sp_flowregionbreak_modified;
697 }
699 static void
700 sp_flowregionbreak_init (SPFlowregionbreak */*group*/)
701 {
702 }
703 static void
704 sp_flowregionbreak_release (SPObject *object)
705 {
706 if (((SPObjectClass *) flowregionbreak_parent_class)->release)
707 ((SPObjectClass *) flowregionbreak_parent_class)->release (object);
708 }
710 static void
711 sp_flowregionbreak_modified (SPObject *object, guint flags)
712 {
713 if (((SPObjectClass *) (flowregionbreak_parent_class))->modified)
714 ((SPObjectClass *) (flowregionbreak_parent_class))->modified (object, flags);
716 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
717 flags &= SP_OBJECT_MODIFIED_CASCADE;
718 }
719 static Inkscape::XML::Node *
720 sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
721 {
722 if ( flags&SP_OBJECT_WRITE_BUILD ) {
723 if ( repr == NULL ) repr = xml_doc->createElement("svg:flowLine");
724 } else {
725 }
727 if (((SPObjectClass *) (flowregionbreak_parent_class))->write)
728 ((SPObjectClass *) (flowregionbreak_parent_class))->write (object, xml_doc, repr, flags);
730 return repr;
731 }