qmlfrontend/flib.h
changeset 14154 8354b390f1a2
parent 14153 b273b43b16d2
child 14155 8f82d87d223f
equal deleted inserted replaced
14153:b273b43b16d2 14154:8354b390f1a2
     1 #ifndef FLIB_H
       
     2 #define FLIB_H
       
     3 
       
     4 #include <stdint.h>
       
     5 
       
     6 #ifdef __cplusplus
       
     7 extern "C" {
       
     8 #endif
       
     9 
       
    10 enum MessageType {
       
    11   MSG_PREVIEW,
       
    12   MSG_PREVIEWHOGCOUNT,
       
    13   MSG_TONET,
       
    14   MSG_GAMEFINISHED,
       
    15 };
       
    16 
       
    17 typedef union string255_ {
       
    18   struct {
       
    19     unsigned char s[256];
       
    20   };
       
    21   struct {
       
    22     unsigned char len;
       
    23     unsigned char str[255];
       
    24   };
       
    25 } string255;
       
    26 
       
    27 typedef void RunEngine_t(int argc, const char** argv);
       
    28 typedef void GameTick_t(uint32_t time_delta);
       
    29 typedef void ResizeWindow_t(uint32_t width, uint32_t height);
       
    30 typedef void ipcToEngineRaw_t(const char* msg, uint32_t len);
       
    31 typedef void ipcSetEngineBarrier_t();
       
    32 typedef void ipcRemoveBarrierFromEngineQueue_t();
       
    33 typedef bool updateMousePosition_t(int32_t centerX, int32_t centerY, int32_t x,
       
    34                                    int32_t y);
       
    35 
       
    36 typedef void registerUIMessagesCallback_t(
       
    37     void* context,
       
    38     void (*)(void* context, MessageType mt, const char* msg, uint32_t len));
       
    39 typedef void flibInit_t(const char* localPrefix, const char* userPrefix);
       
    40 typedef void flibFree_t();
       
    41 typedef void passFlibEvent_t(const char* data);
       
    42 
       
    43 #ifdef __cplusplus
       
    44 }
       
    45 #endif
       
    46 
       
    47 #endif  // FLIB_H