More window cleaning

This commit is contained in:
James Grogan 2022-11-11 14:22:31 +00:00
parent 6adc441e6f
commit 53c98a227d
29 changed files with 422 additions and 261 deletions

View file

@ -180,8 +180,7 @@ void XcbInterface::onPaint()
auto mainWindow = mDesktopManager->GetWindowManager()->GetMainWindow();
auto defaultScreen = mDesktopManager->GetDefaultScreen();
auto xcb_screen = dynamic_cast<XcbScreen*>(defaultScreen->GetPlatformScreen());
mXcbWindowInterface->Paint(mainWindow, mConnection,
xcb_screen->GetNativeScreen(), xcb_screen->GetGraphicsContext());
mXcbWindowInterface->Paint(mainWindow, mConnection, xcb_screen->GetNativeScreen(), xcb_screen->GetGraphicsContext());
}
void XcbInterface::onExposeEvent(xcb_expose_event_t* event)

View file

@ -8,8 +8,7 @@
uint32_t XcbLayerInterface::GetColor(const Color* color)
{
return XcbLayerInterface::GetColor(color->GetR(),
color->GetG(), color->GetB());
return XcbLayerInterface::GetColor(color->GetR(), color->GetG(), color->GetB());
}
uint32_t XcbLayerInterface::GetColor(int r, int g, int b)
@ -17,8 +16,7 @@ uint32_t XcbLayerInterface::GetColor(int r, int g, int b)
return b + (g<<8) + (r<<16);
}
void XcbLayerInterface::ModifyGcColor(xcb_connection_t* connection, xcb_gcontext_t gc,
const Color* color)
void XcbLayerInterface::ModifyGcColor(xcb_connection_t* connection, xcb_gcontext_t gc, const Color* color)
{
uint32_t mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
uint32_t values[2] = {XcbLayerInterface::GetColor(color), 0};
@ -26,9 +24,7 @@ void XcbLayerInterface::ModifyGcColor(xcb_connection_t* connection, xcb_gcontext
xcb_change_gc(connection, gc, mask, values);
}
void XcbLayerInterface::AddLayer(xcb_connection_t* connection,
xcb_screen_t* screen, xcb_window_t window, xcb_gcontext_t gc,
VisualLayer* layer)
void XcbLayerInterface::AddLayer(xcb_connection_t* connection, xcb_screen_t* screen, xcb_window_t window, xcb_gcontext_t gc, VisualLayer* layer)
{
if(layer->HasText())
{

View file

@ -8,16 +8,12 @@ class VisualLayer;
class XcbLayerInterface
{
public:
static uint32_t GetColor(const Color* color);
static uint32_t GetColor(int r, int g, int b);
static void ModifyGcColor(xcb_connection_t* connection, xcb_gcontext_t gc,
const Color* color);
static void ModifyGcColor(xcb_connection_t* connection, xcb_gcontext_t gc, const Color* color);
static void AddLayer(xcb_connection_t* connection,
xcb_screen_t* screen, xcb_window_t window, xcb_gcontext_t gc,
VisualLayer* layer);
static void AddLayer(xcb_connection_t* connection, xcb_screen_t* screen, xcb_window_t window, xcb_gcontext_t gc, VisualLayer* layer);
};