drawing-item.h revision 7674bbcd155943a9c273cd0d21542fbfe6efdc6c
/**
* @file
* Canvas item belonging to an SVG drawing element.
*//*
* Authors:
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright (C) 2011 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <list>
#include <exception>
#include <boost/operators.hpp>
#include <boost/utility.hpp>
struct SPStyle;
} // namespace Filters
struct UpdateContext {
};
struct CacheRecord
{
double score;
};
return "Invalid item in drawing";
}
};
: boost::noncopyable
{
enum RenderFlags {
RENDER_DEFAULT = 0,
RENDER_CACHE_ONLY = 1,
RENDER_BYPASS_CACHE = 2,
};
enum StateFlags {
STATE_NONE = 0,
};
enum PickFlags {
PICK_NORMAL = 0, // normal pick
};
virtual ~DrawingItem();
DrawingItem *parent() const;
void clearChildren();
void setVisible(bool v);
bool sensitive() const { return _sensitive; }
void setSensitive(bool v);
void setCached(bool c, bool persistent = false);
void setOpacity(float opacity);
void setBlendMode(unsigned blend_mode);
void setZOrder(unsigned z);
void *data() const { return _user_data; }
void update(Geom::IntRect const &area = Geom::IntRect::infinite(), UpdateContext const &ctx = UpdateContext(), unsigned flags = STATE_ALL, unsigned reset = 0);
unsigned render(DrawingContext &ct, Geom::IntRect const &area, unsigned flags = 0, DrawingItem *stop_at = NULL);
enum ChildType {
CHILD_ORPHAN = 0, // no parent - implies _parent == NULL
};
enum RenderResult {
RENDER_OK = 0,
RENDER_STOP = 1
};
void _markForRendering();
double _cacheScore();
unsigned /*flags*/, unsigned /*reset*/) { return 0; }
virtual unsigned _renderItem(DrawingContext &/*ct*/, Geom::IntRect const &/*area*/, unsigned /*flags*/,
virtual DrawingItem *_pickItem(Geom::Point const &/*p*/, double /*delta*/, unsigned /*flags*/) { return NULL; }
// member variables start here
> ChildrenList;
unsigned _key; ///< Some SPItems can have more than one DrawingItem;
/// this value is a hack used to distinguish between them
float _opacity;
Geom::OptIntRect _drawbox; ///< Full visual bounding box - enlarged by filters, shrunk by clips and masks
/// This is used to compute the filter effect region and render in
/// objectBoundingBox units.
void *_user_data; ///< Used to associate DrawingItems with SPItems that created them
unsigned _state : 8;
unsigned _propagate_state : 8;
/// (has any ancestor with enable-background: new)
unsigned _visible : 1;
//unsigned _renders_opacity : 1; ///< Whether object needs temporary surface for opacity
/// otherwise the group is returned
unsigned _isolation : 1;
unsigned _blend_mode : 4;
};
struct DeleteDisposer {
};
} // end namespace Inkscape
#endif // !SEEN_INKSCAPE_DISPLAY_DRAWING_ITEM_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :