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"
19 static void sp_flowdiv_class_init (SPFlowdivClass *klass);
20 static void sp_flowdiv_init (SPFlowdiv *group);
21 static void sp_flowdiv_release (SPObject *object);
22 static Inkscape::XML::Node *sp_flowdiv_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
23 static void sp_flowdiv_update (SPObject *object, SPCtx *ctx, unsigned int flags);
24 static void sp_flowdiv_modified (SPObject *object, guint flags);
25 static void sp_flowdiv_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
26 static void sp_flowdiv_set (SPObject *object, unsigned int key, const gchar *value);
28 static void sp_flowtspan_class_init (SPFlowtspanClass *klass);
29 static void sp_flowtspan_init (SPFlowtspan *group);
30 static void sp_flowtspan_release (SPObject *object);
31 static Inkscape::XML::Node *sp_flowtspan_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
32 static void sp_flowtspan_update (SPObject *object, SPCtx *ctx, unsigned int flags);
33 static void sp_flowtspan_modified (SPObject *object, guint flags);
34 static void sp_flowtspan_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
35 static void sp_flowtspan_set (SPObject *object, unsigned int key, const gchar *value);
37 static void sp_flowpara_class_init (SPFlowparaClass *klass);
38 static void sp_flowpara_init (SPFlowpara *group);
39 static void sp_flowpara_release (SPObject *object);
40 static Inkscape::XML::Node *sp_flowpara_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
41 static void sp_flowpara_update (SPObject *object, SPCtx *ctx, unsigned int flags);
42 static void sp_flowpara_modified (SPObject *object, guint flags);
43 static void sp_flowpara_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
44 static void sp_flowpara_set (SPObject *object, unsigned int key, const gchar *value);
46 static void sp_flowline_class_init (SPFlowlineClass *klass);
47 static void sp_flowline_release (SPObject *object);
48 static void sp_flowline_init (SPFlowline *group);
49 static Inkscape::XML::Node *sp_flowline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
50 static void sp_flowline_modified (SPObject *object, guint flags);
52 static void sp_flowregionbreak_class_init (SPFlowregionbreakClass *klass);
53 static void sp_flowregionbreak_release (SPObject *object);
54 static void sp_flowregionbreak_init (SPFlowregionbreak *group);
55 static Inkscape::XML::Node *sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
56 static void sp_flowregionbreak_modified (SPObject *object, guint flags);
58 static SPItemClass * flowdiv_parent_class;
59 static SPItemClass * flowtspan_parent_class;
60 static SPItemClass * flowpara_parent_class;
61 static SPObjectClass * flowline_parent_class;
62 static SPObjectClass * flowregionbreak_parent_class;
64 GType
65 sp_flowdiv_get_type (void)
66 {
67 static GType group_type = 0;
68 if (!group_type) {
69 GTypeInfo group_info = {
70 sizeof (SPFlowdivClass),
71 NULL, /* base_init */
72 NULL, /* base_finalize */
73 (GClassInitFunc) sp_flowdiv_class_init,
74 NULL, /* class_finalize */
75 NULL, /* class_data */
76 sizeof (SPFlowdiv),
77 16, /* n_preallocs */
78 (GInstanceInitFunc) sp_flowdiv_init,
79 NULL, /* value_table */
80 };
81 group_type = g_type_register_static (SP_TYPE_ITEM, "SPFlowdiv", &group_info, (GTypeFlags)0);
82 }
83 return group_type;
84 }
86 static void
87 sp_flowdiv_class_init (SPFlowdivClass *klass)
88 {
89 GObjectClass * object_class;
90 SPObjectClass * sp_object_class;
92 object_class = (GObjectClass *) klass;
93 sp_object_class = (SPObjectClass *) klass;
95 flowdiv_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM);
97 sp_object_class->build = sp_flowdiv_build;
98 sp_object_class->set = sp_flowdiv_set;
99 sp_object_class->release = sp_flowdiv_release;
100 sp_object_class->write = sp_flowdiv_write;
101 sp_object_class->update = sp_flowdiv_update;
102 sp_object_class->modified = sp_flowdiv_modified;
103 }
105 static void
106 sp_flowdiv_init (SPFlowdiv *group)
107 {
108 }
110 static void
111 sp_flowdiv_release (SPObject *object)
112 {
113 if (((SPObjectClass *) flowdiv_parent_class)->release)
114 ((SPObjectClass *) flowdiv_parent_class)->release (object);
115 }
116 static void
117 sp_flowdiv_update (SPObject *object, SPCtx *ctx, unsigned int flags)
118 {
119 SPItemCtx *ictx=(SPItemCtx *) ctx;
120 SPItemCtx cctx=*ictx;
122 if (((SPObjectClass *) (flowdiv_parent_class))->update)
123 ((SPObjectClass *) (flowdiv_parent_class))->update (object, ctx, flags);
125 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
126 flags &= SP_OBJECT_MODIFIED_CASCADE;
128 GSList* l = NULL;
129 for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
130 g_object_ref (G_OBJECT (child));
131 l = g_slist_prepend (l, child);
132 }
133 l = g_slist_reverse (l);
134 while (l) {
135 SPObject *child = SP_OBJECT (l->data);
136 l = g_slist_remove (l, child);
137 if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
138 if (SP_IS_ITEM (child)) {
139 SPItem const &chi = *SP_ITEM(child);
140 cctx.i2doc = chi.transform * ictx->i2doc;
141 cctx.i2vp = chi.transform * ictx->i2vp;
142 child->updateDisplay((SPCtx *)&cctx, flags);
143 } else {
144 child->updateDisplay(ctx, flags);
145 }
146 }
147 g_object_unref (G_OBJECT (child));
148 }
149 }
150 static void
151 sp_flowdiv_modified (SPObject *object, guint flags)
152 {
153 SPObject *child;
154 GSList *l;
156 if (((SPObjectClass *) (flowdiv_parent_class))->modified)
157 ((SPObjectClass *) (flowdiv_parent_class))->modified (object, flags);
159 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
160 flags &= SP_OBJECT_MODIFIED_CASCADE;
162 l = NULL;
163 for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
164 g_object_ref (G_OBJECT (child));
165 l = g_slist_prepend (l, child);
166 }
167 l = g_slist_reverse (l);
168 while (l) {
169 child = SP_OBJECT (l->data);
170 l = g_slist_remove (l, child);
171 if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
172 child->emitModified(flags);
173 }
174 g_object_unref (G_OBJECT (child));
175 }
176 }
178 static void
179 sp_flowdiv_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
180 {
181 object->_requireSVGVersion(Inkscape::Version(1, 2));
183 if (((SPObjectClass *) flowdiv_parent_class)->build)
184 ((SPObjectClass *) flowdiv_parent_class)->build (object, doc, repr);
185 }
187 static void
188 sp_flowdiv_set (SPObject *object, unsigned int key, const gchar *value)
189 {
190 if (((SPObjectClass *) flowdiv_parent_class)->set)
191 (((SPObjectClass *) flowdiv_parent_class)->set) (object, key, value);
192 }
194 static Inkscape::XML::Node *
195 sp_flowdiv_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
196 {
197 // SPFlowdiv *group = SP_FLOWDIV (object);
199 if ( flags&SP_OBJECT_WRITE_BUILD ) {
200 if ( repr == NULL ) repr = sp_repr_new ("svg:flowDiv");
201 GSList *l = NULL;
202 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
203 Inkscape::XML::Node* c_repr=NULL;
204 if ( SP_IS_FLOWTSPAN (child) ) {
205 c_repr = child->updateRepr(NULL, flags);
206 } else if ( SP_IS_FLOWPARA(child) ) {
207 c_repr = child->updateRepr(NULL, flags);
208 } else if ( SP_IS_STRING(child) ) {
209 c_repr = sp_repr_new_text(SP_STRING(child)->string.c_str());
210 }
211 if ( c_repr ) l = g_slist_prepend (l, c_repr);
212 }
213 while ( l ) {
214 repr->addChild((Inkscape::XML::Node *) l->data, NULL);
215 Inkscape::GC::release((Inkscape::XML::Node *) l->data);
216 l = g_slist_remove (l, l->data);
217 }
218 } else {
219 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
220 if ( SP_IS_FLOWTSPAN (child) ) {
221 child->updateRepr(flags);
222 } else if ( SP_IS_FLOWPARA(child) ) {
223 child->updateRepr(flags);
224 } else if ( SP_IS_STRING(child) ) {
225 SP_OBJECT_REPR (child)->setContent(SP_STRING(child)->string.c_str());
226 }
227 }
228 }
230 if (((SPObjectClass *) (flowdiv_parent_class))->write)
231 ((SPObjectClass *) (flowdiv_parent_class))->write (object, repr, flags);
233 return repr;
234 }
237 /*
238 *
239 */
241 GType
242 sp_flowtspan_get_type (void)
243 {
244 static GType group_type = 0;
245 if (!group_type) {
246 GTypeInfo group_info = {
247 sizeof (SPFlowtspanClass),
248 NULL, /* base_init */
249 NULL, /* base_finalize */
250 (GClassInitFunc) sp_flowtspan_class_init,
251 NULL, /* class_finalize */
252 NULL, /* class_data */
253 sizeof (SPFlowtspan),
254 16, /* n_preallocs */
255 (GInstanceInitFunc) sp_flowtspan_init,
256 NULL, /* value_table */
257 };
258 group_type = g_type_register_static (SP_TYPE_ITEM, "SPFlowtspan", &group_info, (GTypeFlags)0);
259 }
260 return group_type;
261 }
263 static void
264 sp_flowtspan_class_init (SPFlowtspanClass *klass)
265 {
266 GObjectClass * object_class;
267 SPObjectClass * sp_object_class;
269 object_class = (GObjectClass *) klass;
270 sp_object_class = (SPObjectClass *) klass;
272 flowtspan_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM);
274 sp_object_class->build = sp_flowtspan_build;
275 sp_object_class->set = sp_flowtspan_set;
276 sp_object_class->release = sp_flowtspan_release;
277 sp_object_class->write = sp_flowtspan_write;
278 sp_object_class->update = sp_flowtspan_update;
279 sp_object_class->modified = sp_flowtspan_modified;
280 }
282 static void
283 sp_flowtspan_init (SPFlowtspan *group)
284 {
285 }
287 static void
288 sp_flowtspan_release (SPObject *object)
289 {
290 if (((SPObjectClass *) flowtspan_parent_class)->release)
291 ((SPObjectClass *) flowtspan_parent_class)->release (object);
292 }
293 static void
294 sp_flowtspan_update (SPObject *object, SPCtx *ctx, unsigned int flags)
295 {
296 // SPFlowtspan *group=SP_FLOWTSPAN (object);
297 SPItemCtx *ictx=(SPItemCtx *) ctx;
298 SPItemCtx cctx=*ictx;
300 if (((SPObjectClass *) (flowtspan_parent_class))->update)
301 ((SPObjectClass *) (flowtspan_parent_class))->update (object, ctx, flags);
303 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
304 flags &= SP_OBJECT_MODIFIED_CASCADE;
306 GSList* l = NULL;
307 for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
308 g_object_ref (G_OBJECT (child));
309 l = g_slist_prepend (l, child);
310 }
311 l = g_slist_reverse (l);
312 while (l) {
313 SPObject *child = SP_OBJECT (l->data);
314 l = g_slist_remove (l, child);
315 if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
316 if (SP_IS_ITEM (child)) {
317 SPItem const &chi = *SP_ITEM(child);
318 cctx.i2doc = chi.transform * ictx->i2doc;
319 cctx.i2vp = chi.transform * ictx->i2vp;
320 child->updateDisplay((SPCtx *)&cctx, flags);
321 } else {
322 child->updateDisplay(ctx, flags);
323 }
324 }
325 g_object_unref (G_OBJECT (child));
326 }
327 }
328 static void
329 sp_flowtspan_modified (SPObject *object, guint flags)
330 {
331 SPObject *child;
332 GSList *l;
334 if (((SPObjectClass *) (flowtspan_parent_class))->modified)
335 ((SPObjectClass *) (flowtspan_parent_class))->modified (object, flags);
337 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
338 flags &= SP_OBJECT_MODIFIED_CASCADE;
340 l = NULL;
341 for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
342 g_object_ref (G_OBJECT (child));
343 l = g_slist_prepend (l, child);
344 }
345 l = g_slist_reverse (l);
346 while (l) {
347 child = SP_OBJECT (l->data);
348 l = g_slist_remove (l, child);
349 if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
350 child->emitModified(flags);
351 }
352 g_object_unref (G_OBJECT (child));
353 }
354 }
355 static void
356 sp_flowtspan_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
357 {
358 if (((SPObjectClass *) flowtspan_parent_class)->build)
359 ((SPObjectClass *) flowtspan_parent_class)->build (object, doc, repr);
360 }
361 static void
362 sp_flowtspan_set (SPObject *object, unsigned int key, const gchar *value)
363 {
364 if (((SPObjectClass *) flowtspan_parent_class)->set)
365 (((SPObjectClass *) flowtspan_parent_class)->set) (object, key, value);
366 }
367 static Inkscape::XML::Node *
368 sp_flowtspan_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
369 {
370 if ( flags&SP_OBJECT_WRITE_BUILD ) {
371 if ( repr == NULL ) repr = sp_repr_new ("svg:flowSpan");
372 GSList *l = NULL;
373 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
374 Inkscape::XML::Node* c_repr=NULL;
375 if ( SP_IS_FLOWTSPAN (child) ) {
376 c_repr = child->updateRepr(NULL, flags);
377 } else if ( SP_IS_FLOWPARA (child) ) {
378 c_repr = child->updateRepr(NULL, flags);
379 } else if ( SP_IS_STRING(child) ) {
380 c_repr = sp_repr_new_text(SP_STRING(child)->string.c_str());
381 }
382 if ( c_repr ) l = g_slist_prepend (l, c_repr);
383 }
384 while ( l ) {
385 repr->addChild((Inkscape::XML::Node *) l->data, NULL);
386 Inkscape::GC::release((Inkscape::XML::Node *) l->data);
387 l = g_slist_remove (l, l->data);
388 }
389 } else {
390 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
391 if ( SP_IS_FLOWTSPAN (child) ) {
392 child->updateRepr(flags);
393 } else if ( SP_IS_FLOWPARA (child) ) {
394 child->updateRepr(flags);
395 } else if ( SP_IS_STRING(child) ) {
396 SP_OBJECT_REPR (child)->setContent(SP_STRING(child)->string.c_str());
397 }
398 }
399 }
401 if (((SPObjectClass *) (flowtspan_parent_class))->write)
402 ((SPObjectClass *) (flowtspan_parent_class))->write (object, repr, flags);
404 return repr;
405 }
409 /*
410 *
411 */
413 GType
414 sp_flowpara_get_type (void)
415 {
416 static GType group_type = 0;
417 if (!group_type) {
418 GTypeInfo group_info = {
419 sizeof (SPFlowparaClass),
420 NULL, /* base_init */
421 NULL, /* base_finalize */
422 (GClassInitFunc) sp_flowpara_class_init,
423 NULL, /* class_finalize */
424 NULL, /* class_data */
425 sizeof (SPFlowpara),
426 16, /* n_preallocs */
427 (GInstanceInitFunc) sp_flowpara_init,
428 NULL, /* value_table */
429 };
430 group_type = g_type_register_static (SP_TYPE_ITEM, "SPFlowpara", &group_info, (GTypeFlags)0);
431 }
432 return group_type;
433 }
435 static void
436 sp_flowpara_class_init (SPFlowparaClass *klass)
437 {
438 GObjectClass * object_class;
439 SPObjectClass * sp_object_class;
441 object_class = (GObjectClass *) klass;
442 sp_object_class = (SPObjectClass *) klass;
444 flowpara_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM);
446 sp_object_class->build = sp_flowpara_build;
447 sp_object_class->set = sp_flowpara_set;
448 sp_object_class->release = sp_flowpara_release;
449 sp_object_class->write = sp_flowpara_write;
450 sp_object_class->update = sp_flowpara_update;
451 sp_object_class->modified = sp_flowpara_modified;
452 }
454 static void
455 sp_flowpara_init (SPFlowpara *group)
456 {
457 }
458 static void
459 sp_flowpara_release (SPObject *object)
460 {
461 if (((SPObjectClass *) flowpara_parent_class)->release)
462 ((SPObjectClass *) flowpara_parent_class)->release (object);
463 }
465 static void
466 sp_flowpara_update (SPObject *object, SPCtx *ctx, unsigned int flags)
467 {
468 SPItemCtx *ictx=(SPItemCtx *) ctx;
469 SPItemCtx cctx=*ictx;
471 if (((SPObjectClass *) (flowpara_parent_class))->update)
472 ((SPObjectClass *) (flowpara_parent_class))->update (object, ctx, flags);
474 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
475 flags &= SP_OBJECT_MODIFIED_CASCADE;
477 GSList* l = NULL;
478 for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
479 g_object_ref (G_OBJECT (child));
480 l = g_slist_prepend (l, child);
481 }
482 l = g_slist_reverse (l);
483 while (l) {
484 SPObject *child = SP_OBJECT (l->data);
485 l = g_slist_remove (l, child);
486 if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
487 if (SP_IS_ITEM (child)) {
488 SPItem const &chi = *SP_ITEM(child);
489 cctx.i2doc = chi.transform * ictx->i2doc;
490 cctx.i2vp = chi.transform * ictx->i2vp;
491 child->updateDisplay((SPCtx *)&cctx, flags);
492 } else {
493 child->updateDisplay(ctx, flags);
494 }
495 }
496 g_object_unref (G_OBJECT (child));
497 }
498 }
499 static void
500 sp_flowpara_modified (SPObject *object, guint flags)
501 {
502 SPObject *child;
503 GSList *l;
505 if (((SPObjectClass *) (flowpara_parent_class))->modified)
506 ((SPObjectClass *) (flowpara_parent_class))->modified (object, flags);
508 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
509 flags &= SP_OBJECT_MODIFIED_CASCADE;
511 l = NULL;
512 for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
513 g_object_ref (G_OBJECT (child));
514 l = g_slist_prepend (l, child);
515 }
516 l = g_slist_reverse (l);
517 while (l) {
518 child = SP_OBJECT (l->data);
519 l = g_slist_remove (l, child);
520 if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
521 child->emitModified(flags);
522 }
523 g_object_unref (G_OBJECT (child));
524 }
525 }
526 static void
527 sp_flowpara_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
528 {
529 if (((SPObjectClass *) flowpara_parent_class)->build)
530 ((SPObjectClass *) flowpara_parent_class)->build (object, doc, repr);
531 }
532 static void
533 sp_flowpara_set (SPObject *object, unsigned int key, const gchar *value)
534 {
535 if (((SPObjectClass *) flowpara_parent_class)->set)
536 (((SPObjectClass *) flowpara_parent_class)->set) (object, key, value);
537 }
538 static Inkscape::XML::Node *
539 sp_flowpara_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
540 {
541 // SPFlowpara *group = SP_FLOWPARA (object);
543 if ( flags&SP_OBJECT_WRITE_BUILD ) {
544 if ( repr == NULL ) repr = sp_repr_new ("svg:flowPara");
545 GSList *l = NULL;
546 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
547 Inkscape::XML::Node* c_repr=NULL;
548 if ( SP_IS_FLOWTSPAN (child) ) {
549 c_repr = child->updateRepr(NULL, flags);
550 } else if ( SP_IS_FLOWPARA (child) ) {
551 c_repr = child->updateRepr(NULL, flags);
552 } else if ( SP_IS_STRING(child) ) {
553 c_repr = sp_repr_new_text(SP_STRING(child)->string.c_str());
554 }
555 if ( c_repr ) l = g_slist_prepend (l, c_repr);
556 }
557 while ( l ) {
558 repr->addChild((Inkscape::XML::Node *) l->data, NULL);
559 Inkscape::GC::release((Inkscape::XML::Node *) l->data);
560 l = g_slist_remove (l, l->data);
561 }
562 } else {
563 for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
564 if ( SP_IS_FLOWTSPAN (child) ) {
565 child->updateRepr(flags);
566 } else if ( SP_IS_FLOWPARA (child) ) {
567 child->updateRepr(flags);
568 } else if ( SP_IS_STRING(child) ) {
569 SP_OBJECT_REPR (child)->setContent(SP_STRING(child)->string.c_str());
570 }
571 }
572 }
574 if (((SPObjectClass *) (flowpara_parent_class))->write)
575 ((SPObjectClass *) (flowpara_parent_class))->write (object, repr, flags);
577 return repr;
578 }
580 /*
581 *
582 */
584 GType
585 sp_flowline_get_type (void)
586 {
587 static GType group_type = 0;
588 if (!group_type) {
589 GTypeInfo group_info = {
590 sizeof (SPFlowlineClass),
591 NULL, /* base_init */
592 NULL, /* base_finalize */
593 (GClassInitFunc) sp_flowline_class_init,
594 NULL, /* class_finalize */
595 NULL, /* class_data */
596 sizeof (SPFlowline),
597 16, /* n_preallocs */
598 (GInstanceInitFunc) sp_flowline_init,
599 NULL, /* value_table */
600 };
601 group_type = g_type_register_static (SP_TYPE_OBJECT, "SPFlowline", &group_info, (GTypeFlags)0);
602 }
603 return group_type;
604 }
606 static void
607 sp_flowline_class_init (SPFlowlineClass *klass)
608 {
609 GObjectClass * object_class;
610 SPObjectClass * sp_object_class;
612 object_class = (GObjectClass *) klass;
613 sp_object_class = (SPObjectClass *) klass;
615 flowline_parent_class = (SPObjectClass *)g_type_class_ref (SP_TYPE_OBJECT);
617 sp_object_class->release = sp_flowline_release;
618 sp_object_class->write = sp_flowline_write;
619 sp_object_class->modified = sp_flowline_modified;
620 }
622 static void
623 sp_flowline_init (SPFlowline *group)
624 {
625 }
626 static void
627 sp_flowline_release (SPObject *object)
628 {
629 if (((SPObjectClass *) flowline_parent_class)->release)
630 ((SPObjectClass *) flowline_parent_class)->release (object);
631 }
633 static void
634 sp_flowline_modified (SPObject *object, guint flags)
635 {
636 if (((SPObjectClass *) (flowline_parent_class))->modified)
637 ((SPObjectClass *) (flowline_parent_class))->modified (object, flags);
639 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
640 flags &= SP_OBJECT_MODIFIED_CASCADE;
641 }
642 static Inkscape::XML::Node *
643 sp_flowline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
644 {
645 if ( flags&SP_OBJECT_WRITE_BUILD ) {
646 if ( repr == NULL ) repr = sp_repr_new ("svg:flowLine");
647 } else {
648 }
650 if (((SPObjectClass *) (flowline_parent_class))->write)
651 ((SPObjectClass *) (flowline_parent_class))->write (object, repr, flags);
653 return repr;
654 }
656 /*
657 *
658 */
660 GType
661 sp_flowregionbreak_get_type (void)
662 {
663 static GType group_type = 0;
664 if (!group_type) {
665 GTypeInfo group_info = {
666 sizeof (SPFlowregionbreakClass),
667 NULL, /* base_init */
668 NULL, /* base_finalize */
669 (GClassInitFunc) sp_flowregionbreak_class_init,
670 NULL, /* class_finalize */
671 NULL, /* class_data */
672 sizeof (SPFlowregionbreak),
673 16, /* n_preallocs */
674 (GInstanceInitFunc) sp_flowregionbreak_init,
675 NULL, /* value_table */
676 };
677 group_type = g_type_register_static (SP_TYPE_OBJECT, "SPFlowregionbreak", &group_info, (GTypeFlags)0);
678 }
679 return group_type;
680 }
682 static void
683 sp_flowregionbreak_class_init (SPFlowregionbreakClass *klass)
684 {
685 GObjectClass * object_class;
686 SPObjectClass * sp_object_class;
688 object_class = (GObjectClass *) klass;
689 sp_object_class = (SPObjectClass *) klass;
691 flowregionbreak_parent_class = (SPObjectClass *)g_type_class_ref (SP_TYPE_OBJECT);
693 sp_object_class->release = sp_flowregionbreak_release;
694 sp_object_class->write = sp_flowregionbreak_write;
695 sp_object_class->modified = sp_flowregionbreak_modified;
696 }
698 static void
699 sp_flowregionbreak_init (SPFlowregionbreak *group)
700 {
701 }
702 static void
703 sp_flowregionbreak_release (SPObject *object)
704 {
705 if (((SPObjectClass *) flowregionbreak_parent_class)->release)
706 ((SPObjectClass *) flowregionbreak_parent_class)->release (object);
707 }
709 static void
710 sp_flowregionbreak_modified (SPObject *object, guint flags)
711 {
712 if (((SPObjectClass *) (flowregionbreak_parent_class))->modified)
713 ((SPObjectClass *) (flowregionbreak_parent_class))->modified (object, flags);
715 if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
716 flags &= SP_OBJECT_MODIFIED_CASCADE;
717 }
718 static Inkscape::XML::Node *
719 sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
720 {
721 if ( flags&SP_OBJECT_WRITE_BUILD ) {
722 if ( repr == NULL ) repr = sp_repr_new ("svg:flowLine");
723 } else {
724 }
726 if (((SPObjectClass *) (flowregionbreak_parent_class))->write)
727 ((SPObjectClass *) (flowregionbreak_parent_class))->write (object, repr, flags);
729 return repr;
730 }