示例#1
0
// constructor
Painter::Painter()
	: fBuffer(NULL),
	  fPixelFormat(NULL),
	  fBaseRenderer(NULL),
	  fOutlineRenderer(NULL),
	  fOutlineRasterizer(NULL),
	  fScanline(NULL),
	  fRasterizer(NULL),
	  fRenderer(NULL),
	  fFontRendererSolid(NULL),
	  fFontRendererBin(NULL),
	  fLineProfile(),
	  fSubpixelPrecise(false),
	  fScale(1.0),
	  fPenSize(1.0),
	  fOrigin(0.0, 0.0),
	  fClippingRegion(NULL),
	  fDrawingMode(B_OP_COPY),
	  fAlphaSrcMode(B_PIXEL_ALPHA),
//	  fAlphaSrcMode(B_CONSTANT_ALPHA),
	  fAlphaFncMode(B_ALPHA_OVERLAY),
	  fPenLocation(0.0, 0.0),
	  fPatternHandler(new PatternHandler()),
	  fTextRenderer(new AGGTextRenderer()),
	  fLastFamilyAndStyle(0)
{
	if (fontserver)
		fFont = *fontserver->GetSystemPlain();
	
	_UpdateFont();
	_UpdateLineWidth();
}
示例#2
0
WinDecorator::WinDecorator(DesktopSettings& settings, BRect rect,
		window_look look, uint32 flags)
	:
	Decorator(settings, rect, look, flags),
	taboffset(0)
{

	_UpdateFont(settings);

	// common colors to both focus and non focus state
	frame_highcol = (rgb_color){ 255, 255, 255, 255 };
	frame_midcol = (rgb_color){ 216, 216, 216, 255 };
	frame_lowcol = (rgb_color){ 110, 110, 110, 255 };
	frame_lowercol = (rgb_color){ 0, 0, 0, 255 };

	// state based colors
	fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR);
	fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR);
	fNonFocusTabColor = settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
	fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);

	// Set appropriate colors based on the current focus value. In this case,
	// each decorator defaults to not having the focus.
	_SetFocus();

	// Do initial decorator setup
	_DoLayout();
	
	textoffset=5;

	STRACE(("WinDecorator()\n"));
}
示例#3
0
bool
TabDecorator::_AddTab(DesktopSettings& settings, int32 index,
	BRegion* updateRegion)
{
	_UpdateFont(settings);

	_DoLayout();
	if (updateRegion != NULL)
		updateRegion->Include(fTitleBarRect);
	return true;
}
示例#4
0
// SetFont
void
Painter::SetFont(const BFont& font)
{
	//fFont.SetFamilyAndStyle(font.GetFamily(), font.GetStyle());
	fFont.SetSpacing(font.Spacing());
	fFont.SetShear(font.Shear());
	fFont.SetRotation(font.Rotation());
	fFont.SetSize(font.Size());
	
	_UpdateFont();
}
示例#5
0
void
MacDecorator::_FontsChanged(DesktopSettings& settings,
                            BRegion* updateRegion)
{
    // get previous extent
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());

    _UpdateFont(settings);
    _DoLayout();

    _InvalidateFootprint();
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());
}
示例#6
0
void
TextViewTest::MessageReceived(BMessage* message)
{
	switch (message->what) {
		case MSG_UPDATE_INSETS:
			_UpdateInsets();
			break;
		case MSG_UPDATE_TEXT:
			_UpdateText();
			break;
		case MSG_UPDATE_FONT:
			_UpdateFont();
			break;
		default:
			Test::MessageReceived(message);
			break;
	}
}
示例#7
0
void
WinDecorator::FontsChanged(DesktopSettings& settings, BRegion* updateRegion)
{
	// get previous extent
	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}

	_UpdateFont(settings);
	_DoLayout();

	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}
}
示例#8
0
void
MacDecorator::_SetLook(DesktopSettings& settings, window_look look,
                       BRegion* updateRegion)
{
    // TODO: we could be much smarter about the update region

    // get previous extent
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());

    fLook = look;

    _UpdateFont(settings);
    _DoLayout();

    _InvalidateFootprint();
    if (updateRegion != NULL)
        updateRegion->Include(&GetFootprint());
}
示例#9
0
WinDecorator::WinDecorator(DesktopSettings& settings, BRect rect,
		window_look look, uint32 flags)
	:
	Decorator(settings, rect, look, flags)
{
	taboffset=0;

	frame_highcol = (rgb_color){ 255, 255, 255, 255 };
	frame_midcol = (rgb_color){ 216, 216, 216, 255 };
	frame_lowcol = (rgb_color){ 110, 110, 110, 255 };
	frame_lowercol = (rgb_color){ 0, 0, 0, 255 };

	fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR);
	fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR);
	fNonFocusTabColor = settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
	fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);

	_UpdateFont(settings);
	_DoLayout();
	
	textoffset=5;

	STRACE(("WinDecorator()\n"));
}
示例#10
0
void
WinDecorator::SetLook(DesktopSettings& settings, window_look look,
	BRegion* updateRegion)
{
	// TODO: we could be much smarter about the update region

	// get previous extent
	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}

	fLook = look;

	_UpdateFont(settings);
	_DoLayout();

	if (updateRegion != NULL) {
		BRegion extent;
		GetFootprint(&extent);
		updateRegion->Include(&extent);
	}
}
示例#11
0
// SetFont
void
Painter::SetFont(const ServerFont& font)
{
	fFont = font;
	_UpdateFont();
}