// 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(); }
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")); }
bool TabDecorator::_AddTab(DesktopSettings& settings, int32 index, BRegion* updateRegion) { _UpdateFont(settings); _DoLayout(); if (updateRegion != NULL) updateRegion->Include(fTitleBarRect); return true; }
// 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(); }
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()); }
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; } }
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); } }
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()); }
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")); }
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); } }
// SetFont void Painter::SetFont(const ServerFont& font) { fFont = font; _UpdateFont(); }