void MainWindow::sendEvent() { QString textToDisplay("Me: "); textToDisplay.append(ui->txtParameter->property("plainText").toString()); ui->textBrowser->append(textToDisplay); // event bus starts here QVariantList localEventList; localEventList.append("ctk/remote/eventBus/comunication/receive/xmlrpc"); QVariantList dataList; dataList.append("myUser"); dataList.append(ui->txtParameter->property("plainText").toString()); ctkDictionary dic; dic.insert("localEvent",localEventList); dic.insert("localData",dataList); QString value = "ctk/remote/eventBus/comunication/send/xmlrpc"; ctkEvent event(value,dic); m_EventBus->sendEvent(event); }
void Font::print(const char *str, u16 x, u16 y, FontSize size, Color color) { TTF_Font *font = NULL; switch(size) { case FONT_SMALL: font = m_fontSmall; break; case FONT_MEDIUM: font = m_fontMedium; break; case FONT_LARGE: font = m_fontLarge; break; case FONT_MAXI: font = m_fontMaxi; break; default: error("Bad font size"); return; } SDL_Surface *textSurface = TTF_RenderUTF8_Blended(font, str, SDL_Color{color.r, color.g, color.b, color.a}); Image textToDisplay(textSurface); textToDisplay.render(x, y); }
void Font::printTextBox(const char *str, u16 x, u16 y, u16 width, u16 height, FontSize size, const gk::Color &color) { TTF_Font *font = nullptr; switch(size) { case FONT_SMALL: font = m_fontSmall; break; case FONT_MEDIUM: font = m_fontMedium; break; case FONT_LARGE: font = m_fontLarge; break; case FONT_MAXI: font = m_fontMaxi; break; default: error("Bad font size"); return; } SDL_Surface *textSurface = TTF_RenderUTF8_Blended_Wrapped(font, str, SDL_Color{color.r255(), color.g255(), color.b255(), color.a255()}, width); Image textToDisplay(textSurface); textToDisplay.render(x, y, 0, 0, 0, 0, width, height); }