qmlfrontend/engine_interface.h
changeset 14854 aed75d439027
parent 14713 cc6ab1e3f7d5
child 15217 b32c52c76977
equal deleted inserted replaced
14853:b96ba3c1ab67 14854:aed75d439027
     3 
     3 
     4 #include <stddef.h>
     4 #include <stddef.h>
     5 #include <stdint.h>
     5 #include <stdint.h>
     6 
     6 
     7 #ifdef __cplusplus
     7 #ifdef __cplusplus
       
     8 #define ENUM_CLASS enum
     8 namespace Engine {
     9 namespace Engine {
     9 extern "C" {
    10 extern "C" {
       
    11 #else
       
    12 #define ENUM_CLASS enum
    10 #endif
    13 #endif
    11 
    14 
    12 typedef struct _EngineInstance EngineInstance;
    15 typedef struct _EngineInstance EngineInstance;
    13 
    16 
    14 typedef struct {
    17 typedef struct {
    38 typedef bool advance_simulation_t(EngineInstance* engine_state, uint32_t ticks);
    41 typedef bool advance_simulation_t(EngineInstance* engine_state, uint32_t ticks);
    39 
    42 
    40 typedef void move_camera_t(EngineInstance* engine_state, int32_t delta_x,
    43 typedef void move_camera_t(EngineInstance* engine_state, int32_t delta_x,
    41                            int32_t delta_y);
    44                            int32_t delta_y);
    42 
    45 
       
    46 ENUM_CLASS SimpleEventType{
       
    47     SwitchHedgehog, Timer, LongJump, HighJump, Accept, Deny,
       
    48 };
       
    49 
       
    50 ENUM_CLASS LongEventType{
       
    51     ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Precision, Attack,
       
    52 };
       
    53 
       
    54 ENUM_CLASS LongEventState{
       
    55     Set,
       
    56     Unset,
       
    57 };
       
    58 
       
    59 ENUM_CLASS PositionedEventType{
       
    60     CursorMove,
       
    61     CursorClick,
       
    62 };
       
    63 
       
    64 typedef void simple_event_t(EngineInstance* engine_state,
       
    65                             SimpleEventType event_type);
       
    66 typedef void long_event_t(EngineInstance* engine_state,
       
    67                           LongEventType event_type, LongEventState state);
       
    68 typedef void positioned_event_t(EngineInstance* engine_state,
       
    69                                 PositionedEventType event_type, int32_t x,
       
    70                                 int32_t y);
    43 #ifdef __cplusplus
    71 #ifdef __cplusplus
    44 }
    72 }
    45 };
    73 };
    46 #endif
    74 #endif
    47 
    75