/*	Copyright  (c)	Günter Woigk 2016 - 2016
					mailto:kio@little-bat.de

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

	Permission to use, copy, modify, distribute, and sell this software and
	its documentation for any purpose is hereby granted without fee, provided
	that the above copyright notice appear in all copies and that both that
	copyright notice and this permission notice appear in supporting
	documentation, and that the name of the copyright holder not be used
	in advertising or publicity pertaining to distribution of the software
	without specific, written prior permission.  The copyright holder makes no
	representations about the suitability of this software for any purpose.
	It is provided "as is" without express or implied warranty.

	THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
	INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
	EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
	CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
	DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
	TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
	PERFORMANCE OF THIS SOFTWARE.
*/

#define SAFE 3
#define LOG 1
#include "kio/kio.h"
#include "Pixmap.h"
#include <QRgb>
#include <QPainter>


// Arial, Lucida Grande, Helvetica, Geneva (weiter), Gill Sans (enger)
QFont  default_gfx_font("Lucida Grande"/*family*/, 12/*pointSize*/, -1/*weight*/, false/*italic*/);
QPen   default_gfx_pen(0xff000000);			// solid black 1px
QBrush default_gfx_paper(0xffdddddd);		// white
QPen   default_gfx_text(0xff000000);		// solid black 1px





// =============================================================
//				Pixmap for GTerm Painters
// =============================================================


Pixmap::Pixmap(int w, int h, QRgb color)
:
	QPixmap(w,h),
	rcnt(0),
	fillcolor(color)
{
	fill(color);
}


Pixmap::~Pixmap()
{
	XXXASSERT(rcnt==0);
}



// =============================================================
//				Pixmap for GFXPainter
// =============================================================


GFXPixmap::GFXPixmap(int w, int h, QRgb c)
:
	Pixmap(w,h,c),
	font(default_gfx_font),
	pen(default_gfx_pen),
	paper(default_gfx_paper),
	text(default_gfx_text)
{}

GFXPixmap::GFXPixmap(int w, int h)
:
	GFXPixmap(w,h,default_gfx_paper.color().rgba())
{}












