qmlFrontend/hwengine.cpp
branchqmlfrontend
changeset 11416 78d6b99ddcb0
parent 11415 05cf35103206
child 11418 091149424aa4
equal deleted inserted replaced
11415:05cf35103206 11416:78d6b99ddcb0
    34     tryRemoveTeam_t * flibTryRemoveTeam;
    34     tryRemoveTeam_t * flibTryRemoveTeam;
    35     changeTeamColor_t * flibChangeTeamColor;
    35     changeTeamColor_t * flibChangeTeamColor;
    36 
    36 
    37     connectOfficialServer_t * flibConnectOfficialServer;
    37     connectOfficialServer_t * flibConnectOfficialServer;
    38     passNetData_t * flibPassNetData;
    38     passNetData_t * flibPassNetData;
       
    39     sendChatLine_t * flibSendChatLine;
    39 }
    40 }
    40 
    41 
    41 Q_DECLARE_METATYPE(MessageType);
    42 Q_DECLARE_METATYPE(MessageType);
    42 
    43 
    43 HWEngine::HWEngine(QQmlEngine *engine, QObject *parent) :
    44 HWEngine::HWEngine(QQmlEngine *engine, QObject *parent) :
    80     flibTryRemoveTeam = (tryRemoveTeam_t*) hwlib.resolve("tryRemoveTeam");
    81     flibTryRemoveTeam = (tryRemoveTeam_t*) hwlib.resolve("tryRemoveTeam");
    81     flibChangeTeamColor = (changeTeamColor_t*) hwlib.resolve("changeTeamColor");
    82     flibChangeTeamColor = (changeTeamColor_t*) hwlib.resolve("changeTeamColor");
    82 
    83 
    83     flibConnectOfficialServer = (connectOfficialServer_t*) hwlib.resolve("connectOfficialServer");
    84     flibConnectOfficialServer = (connectOfficialServer_t*) hwlib.resolve("connectOfficialServer");
    84     flibPassNetData = (passNetData_t*) hwlib.resolve("passNetData");
    85     flibPassNetData = (passNetData_t*) hwlib.resolve("passNetData");
       
    86     flibSendChatLine = (sendChatLine_t*) hwlib.resolve("sendChatLine");
    85 
    87 
    86     flibInit("/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-GC/share/hedgewars/Data", "/usr/home/unC0Rr/.hedgewars");
    88     flibInit("/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-GC/share/hedgewars/Data", "/usr/home/unC0Rr/.hedgewars");
    87     flibRegisterUIMessagesCallback(this, &guiMessagesCallback);
    89     flibRegisterUIMessagesCallback(this, &guiMessagesCallback);
    88 
    90 
    89     ThemeIconProvider * themeIcon = (ThemeIconProvider *)m_engine->imageProvider(QLatin1String("theme"));
    91     ThemeIconProvider * themeIcon = (ThemeIconProvider *)m_engine->imageProvider(QLatin1String("theme"));
   271 void HWEngine::connect(const QString &host, quint16 port)
   273 void HWEngine::connect(const QString &host, quint16 port)
   272 {
   274 {
   273     flibConnectOfficialServer();
   275     flibConnectOfficialServer();
   274 }
   276 }
   275 
   277 
       
   278 void HWEngine::sendChatMessage(const QString &msg)
       
   279 {
       
   280     flibSendChatLine(msg.toUtf8().constData());
       
   281 }
       
   282 
   276 void HWEngine::setTheme(const QString &theme)
   283 void HWEngine::setTheme(const QString &theme)
   277 {
   284 {
   278     flibSetTheme(theme.toUtf8().constData());
   285     flibSetTheme(theme.toUtf8().constData());
   279 }
   286 }
   280 
   287