コード例 #1
0
static void
sp_canvas_arena_init (SPCanvasArena *arena)
{
    arena->sticky = FALSE;

    new (&arena->drawing) Inkscape::Drawing(arena);

    Inkscape::DrawingGroup *root = new DrawingGroup(arena->drawing);
    root->setPickChildren(true);
    arena->drawing.setRoot(root);

    arena->observer = new CachePrefObserver(arena);

    arena->drawing.signal_request_update.connect(
        sigc::bind<0>(
            sigc::ptr_fun(&sp_canvas_arena_request_update),
            arena));
    arena->drawing.signal_request_render.connect(
        sigc::bind<0>(
            sigc::ptr_fun(&sp_canvas_arena_request_render),
            arena));
    arena->drawing.signal_item_deleted.connect(
        sigc::bind<0>(
            sigc::ptr_fun(&sp_canvas_arena_item_deleted),
            arena));

    arena->active = NULL;
}
コード例 #2
0
Inkscape::DrawingItem* SPFlowtext::show(Inkscape::Drawing &drawing, unsigned int /*key*/, unsigned int /*flags*/) {
    Inkscape::DrawingGroup *flowed = new Inkscape::DrawingGroup(drawing);
    flowed->setPickChildren(false);
    flowed->setStyle(this->style);

    // pass the bbox of the flowtext object as paintbox (used for paintserver fills)
    Geom::OptRect bbox = this->geometricBounds();
    this->layout.show(flowed, bbox);

    return flowed;
}
コード例 #3
0
ファイル: sp-item-group.cpp プロジェクト: Spin0za/inkscape
Inkscape::DrawingItem *CGroup::show (Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
    Inkscape::DrawingGroup *ai;
    SPObject *object = _group;

    ai = new Inkscape::DrawingGroup(drawing);
    ai->setPickChildren(_group->effectiveLayerMode(key) == SPGroup::LAYER);
    ai->setStyle(object->style);

    _showChildren(drawing, ai, key, flags);
    return ai;
}
コード例 #4
0
ファイル: sp-item-group.cpp プロジェクト: Spin0za/inkscape
void SPGroup::_updateLayerMode(unsigned int display_key) {
    SPItemView *view;
    for ( view = this->display ; view ; view = view->next ) {
        if ( !display_key || view->key == display_key ) {
            Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(view->arenaitem);
            if (g) {
                g->setPickChildren(effectiveLayerMode(view->key) == SPGroup::LAYER);
            }
        }
    }
}
コード例 #5
0
ファイル: sp-use.cpp プロジェクト: tik0/inkscapeGrid
Inkscape::DrawingItem* SPUse::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
    Inkscape::DrawingGroup *ai = new Inkscape::DrawingGroup(drawing);
    ai->setPickChildren(false);
    ai->setStyle(this->style);

    if (this->child) {
        Inkscape::DrawingItem *ac = this->child->invoke_show(drawing, key, flags);

        if (ac) {
            ai->prependChild(ac);
        }

        Geom::Translate t(this->x.computed, this->y.computed);
        ai->setChildTransform(t);
    }

    return ai;
}
コード例 #6
0
ファイル: sp-use.cpp プロジェクト: AakashDabas/inkscape
Inkscape::DrawingItem* SPUse::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {

    // std::cout << "SPUse::show: " << (getId()?getId():"null") << std::endl;
    Inkscape::DrawingGroup *ai = new Inkscape::DrawingGroup(drawing);
    ai->setPickChildren(false);
    this->context_style = this->style;
    ai->setStyle(this->style, this->context_style);
    
    if (this->child) {
        Inkscape::DrawingItem *ac = this->child->invoke_show(drawing, key, flags);

        if (ac) {
            ai->prependChild(ac);
        }

        Geom::Translate t(this->x.computed, this->y.computed);
        ai->setChildTransform(t);
    }

    return ai;
}