diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 3ce551b983199f763841b7acdaaa622dbfa0be80..0f7031f56c9fe4f15ad0c0e9631d2e3bfbd3d452 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
# include "config.h"
#endif
# include "config.h"
#endif
-#if defined(WIN32) || defined(__APPLE__)
-# include <glibmm/i18n.h>
-#endif
+#include <glibmm/i18n.h>
#include "display/nr-arena-group.h"
#include "libnr/nr-matrix-ops.h"
#include "display/nr-arena-group.h"
#include "libnr/nr-matrix-ops.h"
#include "document.h"
#include "style.h"
#include "attributes.h"
#include "document.h"
#include "style.h"
#include "attributes.h"
+#include "sp-item-transform.h"
#include "sp-root.h"
#include "sp-use.h"
#include "sp-root.h"
#include "sp-use.h"
items = g_slist_remove (items, items->data);
}
items = g_slist_remove (items, items->data);
}
- if (do_done) sp_document_done (doc);
+ if (do_done) sp_document_done (doc, SP_VERB_NONE,
+ /* TODO: annotate */ "sp-item-group.cpp:448");
}
/*
}
/*
}
}
}
}
+void SPGroup::translateChildItems(NR::translate const &tr)
+{
+ if (this->hasChildren())
+ {
+ SPObject *o = NULL;
+ for (o = sp_object_first_child(SP_OBJECT(this)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ if (SP_IS_ITEM (o)) {
+ sp_item_move_rel(static_cast<SPItem *>(o), tr);
+ }
+ }
+ }
+}
+
CGroup::CGroup(SPGroup *group) {
_group = group;
}
CGroup::CGroup(SPGroup *group) {
_group = group;
}
}
void CGroup::onUpdate(SPCtx *ctx, unsigned int flags) {
}
void CGroup::onUpdate(SPCtx *ctx, unsigned int flags) {
- SPObject *child;
SPItemCtx *ictx, cctx;
ictx = (SPItemCtx *) ctx;
cctx = *ictx;
SPItemCtx *ictx, cctx;
ictx = (SPItemCtx *) ctx;
cctx = *ictx;
- if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
+ if (flags & SP_OBJECT_MODIFIED_FLAG) {
+ flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
+ }
+
flags &= SP_OBJECT_MODIFIED_CASCADE;
flags &= SP_OBJECT_MODIFIED_CASCADE;
- GSList *l = g_slist_reverse(_childList(true, ActionUpdate));
+ if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
+ SPObject *object = SP_OBJECT(_group);
+ for (SPItemView *v = SP_ITEM(_group)->display; v != NULL; v = v->next) {
+ nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
+ }
+ }
+
+ GSList *l = g_slist_reverse(_group->childList(true, SPObject::ActionUpdate));
while (l) {
while (l) {
- child = SP_OBJECT (l->data);
+ SPObject *child = SP_OBJECT (l->data);
l = g_slist_remove (l, child);
if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
if (SP_IS_ITEM (child)) {
l = g_slist_remove (l, child);
if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
if (SP_IS_ITEM (child)) {
}
}
}
}
-GSList *CGroup::_childList(bool add_ref, Action) {
- GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(_group) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
- if (add_ref)
- g_object_ref (G_OBJECT (child));
-
- l = g_slist_prepend (l, child);
- }
- return l;
-}
-
void CGroup::onModified(guint flags) {
SPObject *child;
if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
flags &= SP_OBJECT_MODIFIED_CASCADE;
void CGroup::onModified(guint flags) {
SPObject *child;
if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
flags &= SP_OBJECT_MODIFIED_CASCADE;
- GSList *l = g_slist_reverse(_childList(true));
+ if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
+ SPObject *object = SP_OBJECT(_group);
+ for (SPItemView *v = SP_ITEM(_group)->display; v != NULL; v = v->next) {
+ nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
+ }
+ }
+
+ GSList *l = g_slist_reverse(_group->childList(true));
while (l) {
child = SP_OBJECT (l->data);
l = g_slist_remove (l, child);
while (l) {
child = SP_OBJECT (l->data);
l = g_slist_remove (l, child);
}
void CGroup::calculateBBox(NRRect *bbox, NR::Matrix const &transform, unsigned const flags) {
}
void CGroup::calculateBBox(NRRect *bbox, NR::Matrix const &transform, unsigned const flags) {
- GSList *l = _childList(false, ActionBBox);
+ GSList *l = _group->childList(false, SPObject::ActionBBox);
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM(o)) {
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM(o)) {
@@ -648,7 +666,7 @@ void CGroup::calculateBBox(NRRect *bbox, NR::Matrix const &transform, unsigned c
}
void CGroup::onPrint(SPPrintContext *ctx) {
}
void CGroup::onPrint(SPPrintContext *ctx) {
- GSList *l = _childList(false);
+ GSList *l = g_slist_reverse(_group->childList(false));
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM(o)) {
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM(o)) {
NRArenaItem *CGroup::show (NRArena *arena, unsigned int key, unsigned int flags) {
NRArenaItem *ai;
NRArenaItem *CGroup::show (NRArena *arena, unsigned int key, unsigned int flags) {
NRArenaItem *ai;
+ SPObject *object = SP_OBJECT(_group);
ai = NRArenaGroup::create(arena);
ai = NRArenaGroup::create(arena);
+
nr_arena_group_set_transparent(NR_ARENA_GROUP (ai),
_group->effectiveLayerMode(key) ==
SPGroup::LAYER);
nr_arena_group_set_transparent(NR_ARENA_GROUP (ai),
_group->effectiveLayerMode(key) ==
SPGroup::LAYER);
+ nr_arena_group_set_style(NR_ARENA_GROUP(ai), SP_OBJECT_STYLE(object));
_showChildren(arena, ai, key, flags);
return ai;
_showChildren(arena, ai, key, flags);
return ai;
@@ -693,7 +714,7 @@ void CGroup::_showChildren (NRArena *arena, NRArenaItem *ai, unsigned int key, u
NRArenaItem *ac = NULL;
NRArenaItem *ar = NULL;
SPItem * child = NULL;
NRArenaItem *ac = NULL;
NRArenaItem *ar = NULL;
SPItem * child = NULL;
- GSList *l = _childList(false, ActionShow);
+ GSList *l = g_slist_reverse(_group->childList(false, SPObject::ActionShow));
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM (o)) {
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM (o)) {
@@ -712,7 +733,7 @@ void CGroup::_showChildren (NRArena *arena, NRArenaItem *ai, unsigned int key, u
void CGroup::hide (unsigned int key) {
SPItem * child;
void CGroup::hide (unsigned int key) {
SPItem * child;
- GSList *l = _childList(false, ActionShow);
+ GSList *l = g_slist_reverse(_group->childList(false, SPObject::ActionShow));
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM (o)) {
while (l) {
SPObject *o = SP_OBJECT (l->data);
if (SP_IS_ITEM (o)) {