sp-symbol.h revision 203b91a85466178dd14a24236e0e42539bc4a24b
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#ifndef __SP_SYMBOL_H__
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#define __SP_SYMBOL_H__
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib/*
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib * SVG <symbol> implementation
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib *
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib * Authors:
dc661981841afbd8a4fb4e94d510f080531ddc16theAdib * Lauris Kaplinski <lauris@kaplinski.com>
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz *
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib * Copyright (C) 1999-2003 Lauris Kaplinski
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib *
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib * Released under GNU GPL, read the file 'COPYING' for more information
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib */
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib/*
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib * This is quite similar in logic to <svg>
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib * Maybe we should merge them somehow (Lauris)
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib */
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib
d5ad05ac17abfd7d2eae333a8c1233971e1c1a8fAbhishek Sharma Public#define SP_TYPE_SYMBOL (sp_symbol_get_type ())
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#define SP_SYMBOL(obj) (dynamic_cast<SPSymbol*>((SPObject*)obj))
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#define SP_IS_SYMBOL(obj) (dynamic_cast<const SPSymbol*>((SPObject*)obj) != NULL)
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#include <2geom/affine.h>
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#include "svg/svg-length.h"
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#include "enums.h"
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#include "sp-item-group.h"
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibclass SPSymbol : public SPGroup {
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibpublic:
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib SPSymbol();
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib virtual ~SPSymbol();
09ba3247163582bf2e30e17c4c154aa259ce038acilix
884edd729abf49df5b3c9a4679a0d5b6c85d182cpjrm /* viewBox; */
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib unsigned int viewBox_set : 1;
3fa7c9044653435c086b5a985a08442bef9a41c4theAdib Geom::Rect viewBox;
3fa7c9044653435c086b5a985a08442bef9a41c4theAdib
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib /* preserveAspectRatio */
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib unsigned int aspect_set : 1;
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak unsigned int aspect_align : 4;
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak unsigned int aspect_clip : 1;
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak /* Child to parent additional transform */
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak Geom::Affine c2p;
09ba3247163582bf2e30e17c4c154aa259ce038acilix
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak virtual void release();
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak virtual void set(unsigned int key, gchar const* value);
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak virtual void update(SPCtx *ctx, guint flags);
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib virtual void modified(unsigned int flags);
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib virtual void child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref);
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib virtual Inkscape::DrawingItem* show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags);
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib virtual void print(SPPrintContext *ctx);
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib virtual Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType type) const;
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib virtual void hide (unsigned int key);
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib};
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib#endif
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib