qmlfrontend/engine_interface.h
changeset 15222 b32c52c76977
parent 14859 aed75d439027
equal deleted inserted replaced
15221:387345a14b3f 15222:b32c52c76977
     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 #define ENUM_CLASS enum
       
     9 
       
    10 #ifndef Q_NAMESPACE
       
    11 #define Q_NAMESPACE
       
    12 #endif
       
    13 
       
    14 #ifndef Q_ENUM_NS
       
    15 #define Q_ENUM_NS(x)
       
    16 #endif
       
    17 
       
    18 #ifndef Q_DECLARE_METATYPE
       
    19 #define Q_DECLARE_METATYPE(x)
       
    20 #endif
       
    21 
     9 namespace Engine {
    22 namespace Engine {
    10 extern "C" {
    23 extern "C" {
    11 #else
    24 #else
    12 #define ENUM_CLASS enum
    25 #define ENUM_CLASS enum class
    13 #endif
    26 #endif
    14 
    27 
    15 typedef struct _EngineInstance EngineInstance;
    28 typedef struct _EngineInstance EngineInstance;
    16 
    29 
    17 typedef struct {
    30 typedef struct {
    66 typedef void long_event_t(EngineInstance* engine_state,
    79 typedef void long_event_t(EngineInstance* engine_state,
    67                           LongEventType event_type, LongEventState state);
    80                           LongEventType event_type, LongEventState state);
    68 typedef void positioned_event_t(EngineInstance* engine_state,
    81 typedef void positioned_event_t(EngineInstance* engine_state,
    69                                 PositionedEventType event_type, int32_t x,
    82                                 PositionedEventType event_type, int32_t x,
    70                                 int32_t y);
    83                                 int32_t y);
       
    84 }  // extern "C"
       
    85 
    71 #ifdef __cplusplus
    86 #ifdef __cplusplus
    72 }
    87 Q_NAMESPACE
    73 };
    88 
       
    89 Q_ENUM_NS(SimpleEventType)
       
    90 Q_ENUM_NS(LongEventType)
       
    91 Q_ENUM_NS(LongEventState)
       
    92 Q_ENUM_NS(PositionedEventType)
       
    93 
       
    94 };  // namespace
       
    95 
       
    96 Q_DECLARE_METATYPE(Engine::SimpleEventType)
       
    97 Q_DECLARE_METATYPE(Engine::LongEventType)
       
    98 Q_DECLARE_METATYPE(Engine::LongEventState)
       
    99 Q_DECLARE_METATYPE(Engine::PositionedEventType)
    74 #endif
   100 #endif
    75 
   101 
    76 #endif  // ENGINE_H
   102 #endif  // ENGINE_H