sodipodi-ctrlrect.cpp revision 2748588ecde62686a15c24a597507dbf8a13782b
#define __INKSCAPE_CTRLRECT_C__
/*
* Simple non-transformed rectangle, usable for rubberband
*
* Author:
* Lauris Kaplinski <lauris@ximian.com>
* bulia byak <buliabyak@users.sf.net>
* Carl Hetherington <inkscape@carlh.net>
*
* Copyright (C) 1999-2001 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL
*
*/
#include "display-forward.h"
#include "sp-canvas-util.h"
#include "sodipodi-ctrlrect.h"
#include "libnr/nr-pixops.h"
/*
* Currently we do not have point method, as it should always be painted
* during some transformation, which takes care of events...
*
* Corner coords can be in any order - i.e. x1 < x0 is allowed
*/
static void sp_ctrlrect_class_init(SPCtrlRectClass *c);
static SPCanvasItemClass *parent_class;
{
if (!type) {
sizeof(SPCtrlRectClass),
0, // base_init
0, // base_finalize
0, // class_finalize
0, // class_data
sizeof(CtrlRect),
0, // n_preallocs
0 // value_table
};
type = g_type_register_static(SP_TYPE_CANVAS_ITEM, "SPCtrlRect", &info, static_cast<GTypeFlags>(0));
}
return type;
}
static void sp_ctrlrect_class_init(SPCtrlRectClass *c)
{
}
{
}
{
}
}
/* FIXME: use definitions from somewhere else */
#define RGBA_R(v) ((v) >> 24)
#define RGBA_A(v) ((v) & 0xff)
static void sp_ctrlrect_hline(SPCanvasBuf *buf, gint y, gint xs, gint xe, guint32 rgba, guint dashed)
{
p[0] = INK_COMPOSE(r, a, p[0]);
}
p += 4;
}
}
}
static void sp_ctrlrect_vline(SPCanvasBuf *buf, gint x, gint ys, gint ye, guint32 rgba, guint dashed)
{
p[0] = INK_COMPOSE(r, a, p[0]);
}
p += buf->buf_rowstride;
}
}
}
/** Fills the pixels in [xs, xe)*[ys,ye) clipped to the tile with rgb * a. */
{
p[0] = INK_COMPOSE(r, a, p[0]);
p += 4;
}
}
}
{
}
{
}
{
_has_fill = false;
_dashed = false;
_shadow = 0;
_shadow_size = 0;
_border_color = 0x000000ff;
_fill_color = 0xffffffff;
_shadow_color = 0x000000ff;
}
{
/* Top */
/* Bottom */
/* Left */
/* Right */
if (_shadow_size > 0) {
/* Right shadow */
/* Bottom shadow */
}
if (_has_fill) {
/* Fill */
}
}
}
{
}
sp_canvas_item_reset_bounds(this);
/* Request redraw old */
if (!_has_fill) {
/* Top */
/* Left */
/* Right */
/* Bottom */
} else {
}
}
/* Request redraw new */
if (!_has_fill) {
/* Top */
/* Left */
/* Right */
/* Bottom */
} else {
}
}
}
{
_border_color = b;
_has_fill = h;
_fill_color = f;
}
{
_shadow = s;
_shadow_color = c;
}
{
_rect = r;
}
{
_dashed = d;
}
void CtrlRect::_requestUpdate()
{
}
/*
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:encoding=utf-8:textwidth=99 :