示例#1
0
 virtual void newChild(const std::shared_ptr<Poco::Net::WebSocket> &socket) override
 {
     Log::info("Fetching font list from kit");
     socket->sendFrame("unit-getfontlist: \n",
                       sizeof("unit-getfontlist: \n") - 1);
     _fontsKit = readFontList(socket);
     check();
 }
示例#2
0
//--------------------------------------------------------------
// create the user interface
void createUI()
{
  readFontList();

  m_surface = new BitmapSurface();
  m_ui = new SampleUI(m_surface, "docs\\help.xml");

  // resize the UI to the window, since window create and initial resize
  // have already happened.
  m_ui->resize(m_windowWidth, m_windowHeight);
}
示例#3
0
    virtual bool filterHandleRequest(
                     TestRequest type,
                     Poco::Net::HTTPServerRequest& request,
                     Poco::Net::HTTPServerResponse& response) override
    {
        if (type == UnitWSD::TestRequest::TEST_REQ_PRISONER &&
            request.getURI().find(UNIT_URI) == 0)
        {
            auto ws = std::make_shared<Poco::Net::WebSocket>(request, response);
            _fontsBroker = readFontList(ws);
            check();
            return true;
        }

        return false;
    }