Gdiplus::Brush* CFDE_GdiDevice::CreateGdiBrush(IFDE_Brush* pBrush) { if (pBrush == NULL) { return NULL; } Gdiplus::Brush* pGdiBrush = NULL; switch (pBrush->GetType()) { case FDE_BRUSHTYPE_Solid: { IFDE_SolidBrush* pSolidBrush = (IFDE_SolidBrush*)pBrush; Gdiplus::Color gdiColor((Gdiplus::ARGB)pSolidBrush->GetColor()); pGdiBrush = new Gdiplus::SolidBrush(gdiColor); } break; case FDE_BRUSHTYPE_Hatch: { IFDE_HatchBrush* pHatchBrush = (IFDE_HatchBrush*)pBrush; Gdiplus::Color foreColor((Gdiplus::ARGB)pHatchBrush->GetColor(TRUE)); Gdiplus::Color backColor((Gdiplus::ARGB)pHatchBrush->GetColor(FALSE)); Gdiplus::HatchStyle hatchStyle = (Gdiplus::HatchStyle)pHatchBrush->GetHatchStyle(); pGdiBrush = new Gdiplus::HatchBrush(hatchStyle, foreColor, backColor); } break; case FDE_BRUSHTYPE_Texture: { IFDE_TextureBrush* pTextureBrush = (IFDE_TextureBrush*)pBrush; CFDE_GdiImage* pImgHolder = (CFDE_GdiImage*)pTextureBrush->GetImage(); Gdiplus::Image* pGdiImage = pImgHolder ? pImgHolder->m_pImage : NULL; Gdiplus::WrapMode wrapMode = (Gdiplus::WrapMode)pTextureBrush->GetWrapMode(); pGdiBrush = new Gdiplus::TextureBrush(pGdiImage, wrapMode); } break; case FDE_BRUSHTYPE_LinearGradient: { IFDE_LinearGradientBrush* pLinearBrush = (IFDE_LinearGradientBrush*)pBrush; Gdiplus::WrapMode wrapMode = (Gdiplus::WrapMode)pLinearBrush->GetWrapMode(); CFX_PointF ptStart, ptEnd; pLinearBrush->GetLinearPoints(ptStart, ptEnd); FX_ARGB crStart, crEnd; pLinearBrush->GetLinearColors(crStart, crEnd); pGdiBrush = new Gdiplus::LinearGradientBrush( (const Gdiplus::PointF&)ptStart, (const Gdiplus::PointF&)ptEnd, (const Gdiplus::Color&)crStart, (const Gdiplus::Color&)crEnd); } break; } return pGdiBrush; }
/** * Constructs the default theme */ Theme::Theme() { Color backColor(0.27, 0.44, 0.58, 1.0); Color foreColor(1.0, 1.0, 1.0, 1.0); Color backSelector(1.9, 1.0, 1.0, 0.3); Color foreSelector(1.1, 1.1, 1.0, 1.0); this->m_window = new ColorWindow(); this->m_panel = new ColorWindow(true, backColor, foreColor, 0.7, 4.0); this->m_panelSelector = new ColorWindow(true, backSelector, foreSelector, 1.5, 4.0); this->m_panelTitle = new ColorWindow(true, backColor, foreColor, 0.0, 4.0); this->m_panelTitleText = new ColorWindow(true, Color(), Color(1.0, 1.0, 1.0, 1.0), 0.0, 0.0); this->m_preview = new ColorWindow(true, backColor, foreColor, 0.7, 4.0); this->m_previewTitle = new ColorWindow(true, Color(0.0, 0.0, 1.0, 0.0), Color(1.0, 1.0, 1.0, 0.0), 1.0, 0.0); this->m_previewTitleText = new ColorWindow(true, Color(), Color(), 0.0, 0.0); this->m_previewSelector = new ColorWindow(true, backSelector, foreSelector, 2.0, 4.0); this->m_previewSelectorClose = new ColorWindow(true, Color(0.0, 0.50, 0.0, 1.0), foreColor, 4.0, 4.0); }
void EmulationHandler::load( const Profile& prof) { // try to read the fontconfig from the profile QString aFont = prof.readEntry( "Font" ); int aFontSize = prof.readNumEntry( "FontSize" ); // use defaults from qpe.conf if no profile yet if ( ( aFontSize == -1 ) || ( aFont == QString::null ) ) { Config c( "qpe" ); c.setGroup( "Appearance" ); aFont = c.readEntry( "FixedFontFamily", "Fixed" ); aFontSize = c.readNumEntry( "FixedFontSize", 7 ); } QFont font( aFont, aFontSize ); font.setFixedPitch( TRUE ); m_teWid->setVTFont( font ); int num = prof.readNumEntry("Color", 0); setColor( foreColor(num), backColor(num) ); m_teWid->setBackgroundColor(backColor(num) ); int term = prof.readNumEntry("Terminal", Profile::Linux ) ; switch(term) { default: case Profile::VT102: case Profile::VT100: m_teEmu->setKeytrans("vt100.keytab"); break; case Profile::Linux: m_teEmu->setKeytrans("linux.keytab"); break; case Profile::XTerm: m_teEmu->setKeytrans("default.Keytab"); break; } }