Set up stacked widget.

This commit is contained in:
jmsgrogan 2020-06-27 10:47:30 +01:00
parent 4e85edacc8
commit ee51f3ee09
51 changed files with 808 additions and 195 deletions

View file

@ -1,8 +1,10 @@
#include "XcbTextInterface.h"
#include "XcbLayerInterface.h"
#include <string.h>
xcb_gcontext_t XcbTextInterface::GetFontGC(xcb_connection_t *connection,
xcb_screen_t *screen, xcb_window_t window, const char*font_name)
xcb_screen_t *screen, xcb_window_t window, const char*font_name,
const TextElement* textElement)
{
/* get font */
xcb_font_t font = xcb_generate_id(connection);
@ -11,7 +13,8 @@ xcb_gcontext_t XcbTextInterface::GetFontGC(xcb_connection_t *connection,
/* create graphics context */
xcb_gcontext_t gc = xcb_generate_id(connection);
uint32_t mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_FONT;
uint32_t value_list[3] = {screen->black_pixel, screen->white_pixel, font };
auto fillColor = XcbLayerInterface::GetColor(textElement->GetFillColor());
uint32_t value_list[3] = {screen->black_pixel, fillColor, font };
xcb_create_gc(connection, gc, window, mask, value_list);
@ -26,7 +29,7 @@ void XcbTextInterface::AddTextElement(xcb_connection_t* connection,
{
/* get graphics context */
xcb_gcontext_t gc = XcbTextInterface::GetFontGC(connection, screen, window,
textElement->GetFontLabel().c_str());
textElement->GetFontLabel().c_str(), textElement);
/* draw the text */
std::string content = textElement->GetContent();