Exemplo n.º 1
0
Graphic::Graphic (Graphic* gr) {
    _parent = nil;
    _fg = _bg = nil;
    _tag = nil;
    _t = nil;

    if (_identity == nil) {
        _identity = new Transformer;
        cachingOn();
    }

    if (_p == nil) {
        _p = new Painter;
        Ref(_p);
    }

    if (gr == nil) {
        FillBg(UNDEF);

    } else {
        FillBg(gr->BgFilled());
        Graphic::SetColors(gr->GetFgColor(), gr->GetBgColor());

        if (gr->_t != nil) {
            _t = new Transformer(gr->_t);
        }
    }
}
Exemplo n.º 2
0
Graphic::Graphic (Graphic* gr) {
#ifdef LEAKCHECK
    if(!_leakchecker) _leakchecker = new LeakChecker("Graphic");
    _leakchecker->create();
#endif
    _parent = nil;
    _fg = _bg = nil;
    _tag = nil;
    _t = nil;
    _flags = 0x0;

    if (_identity == nil) {
	_identity = new Transformer;
	cachingOn();
    }
    
    if (_p == nil && use_iv()) {
        _p = new Painter;
        Ref(_p);
    }

    if (gr == nil) {
	FillBg(UNDEF);

    } else {
	FillBg(gr->BgFilled());
	Graphic::SetColors(gr->GetFgColor(), gr->GetBgColor());

	if (gr->_t != nil) {
	    _t = new Transformer(gr->_t);
	}
    }
}
Exemplo n.º 3
0
void Painter::Init () {
    if (solid == nil) {
	solid = new Pattern(0xffff);
	clear = new Pattern(0);
	lightgray = new Pattern(0x8020);
	gray = new Pattern(0xa5a5);
	darkgray = new Pattern(0xfafa);
	single = new Brush(0xffff, 0);
    }
    foreground = nil;
    background = nil;
    pattern = nil;
    br = nil;
    font = nil;
    style = 0;
    matrix = nil;
    SetColors(black, white);
    SetPattern(solid);
    FillBg(true);
    SetBrush(single);
    SetFont(stdfont);
    SetStyle(Plain);
    SetOrigin(0, 0);
    MoveTo(0, 0);
}
Exemplo n.º 4
0
void Painter::Init() {
    foreground = nil;
    background = nil;
    pattern = nil;
    br = nil;
    font = nil;
    style = 0;
    matrix = nil;

    World* w = World::current();
    SetColors(w->foreground(), w->background());
    SetPattern(new Pattern);
    FillBg(true);
    SetBrush(new Brush(0xffff, 0));
    SetFont(w->font());
    SetStyle(Plain);
    SetOrigin(0, 0);
    MoveTo(0, 0);
}
Exemplo n.º 5
0
void BitmapGraphic::Read (istream& in) {
    Catalog* catalog = unidraw->GetCatalog();
    char* fg_name;

    FillBg(catalog->ReadBgFilled(in));
    SetBrush(catalog->ReadBrush(in));
    PSColor* fg = catalog->ReadColor(in);
    PSColor* bg = catalog->ReadColor(in);
    SetColors(fg, bg);
    SetFont(catalog->ReadFont(in));
    SetPattern(catalog->ReadPattern(in));

    Transformer* t = catalog->ReadTransformer(in);
    SetTransformer(t);
    Unref(t);

    fg_name = catalog->ReadString(in);
    Init(fg_name);
    delete fg_name;
}
Exemplo n.º 6
0
Graphic& Graphic::operator = (Graphic& g) {
    SetColors(g.GetFgColor(), g.GetBgColor());
    FillBg(g.BgFilled());
    SetPattern(g.GetPattern());
    SetBrush(g.GetBrush());
    SetFont(g.GetFont());

    if (g._t == nil) {
        Unref(_t);
        _t = nil;

    } else {
        if (_t == nil) {
            _t = new Transformer(g._t);
        } else {
            *_t = *g._t;
        }
    }
    invalidateCaches();
    return *this;
}