qmlFrontend/flib.h
author unc0rr
Tue, 18 Nov 2014 23:39:30 +0300
branchqmlfrontend
changeset 10515 7705784902e1
parent 10456 6fd99bb73524
child 10517 844bd43db47a
permissions -rw-r--r--
merge default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10416
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     1
#ifndef FLIB_H
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     2
#define FLIB_H
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     3
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     4
#include <stdint.h>
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     5
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     6
#ifdef __cplusplus
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     7
extern "C" {
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     8
#endif
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
     9
10428
7c25297720f1 More refactoring: move PoC preview getting code into flib
unc0rr
parents: 10426
diff changeset
    10
enum MessageType {
7c25297720f1 More refactoring: move PoC preview getting code into flib
unc0rr
parents: 10426
diff changeset
    11
    MSG_PREVIEW
10444
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10440
diff changeset
    12
    , MSG_ADDPLAYINGTEAM
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10440
diff changeset
    13
    , MSG_REMOVEPLAYINGTEAM
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10440
diff changeset
    14
    , MSG_ADDTEAM
47a6231f1fc1 Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents: 10440
diff changeset
    15
    , MSG_REMOVETEAM
10452
03519fd9f98d Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents: 10450
diff changeset
    16
    , MSG_TEAMCOLOR
10428
7c25297720f1 More refactoring: move PoC preview getting code into flib
unc0rr
parents: 10426
diff changeset
    17
};
7c25297720f1 More refactoring: move PoC preview getting code into flib
unc0rr
parents: 10426
diff changeset
    18
10416
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    19
typedef union string255_
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    20
    {
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    21
        struct {
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    22
            unsigned char s[256];
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    23
        };
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    24
        struct {
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    25
            unsigned char len;
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    26
            unsigned char str[255];
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    27
        };
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    28
    } string255;
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    29
10418
091d2c0216c3 Move away from passing shortstrings into C code, now IPC works
unc0rr
parents: 10416
diff changeset
    30
typedef void RunEngine_t(int argc, const char ** argv);
10428
7c25297720f1 More refactoring: move PoC preview getting code into flib
unc0rr
parents: 10426
diff changeset
    31
typedef void registerGUIMessagesCallback_t(void * context, void (*)(void * context, MessageType mt, const char * msg, uint32_t len));
10430
899a30018ede Getter and setter for seed
unc0rr
parents: 10428
diff changeset
    32
typedef void getPreview_t();
10432
b0abef0ee78c Quick Game PoC
unc0rr
parents: 10430
diff changeset
    33
typedef void runQuickGame_t();
10448
4cb727e029fa - Allow to delete teams from config
unc0rr
parents: 10444
diff changeset
    34
typedef void runLocalGame_t();
10450
bf9e30b4ef9b - Store index of color instead of its value
unc0rr
parents: 10448
diff changeset
    35
typedef void resetGameConfig_t();
10430
899a30018ede Getter and setter for seed
unc0rr
parents: 10428
diff changeset
    36
typedef void setSeed_t(const char * seed);
899a30018ede Getter and setter for seed
unc0rr
parents: 10428
diff changeset
    37
typedef char *getSeed_t();
10456
6fd99bb73524 Theme can be changed
unc0rr
parents: 10452
diff changeset
    38
typedef void setTheme_t(const char * theme);
10424
4be6cd55f1cf - Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents: 10420
diff changeset
    39
typedef void flibInit_t(const char * localPrefix, const char * userPrefix);
4be6cd55f1cf - Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents: 10420
diff changeset
    40
typedef void flibFree_t();
10416
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    41
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    42
typedef char **getThemesList_t();
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    43
typedef void freeThemesList_t(char **list);
10436
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    44
typedef uint32_t getThemeIcon_t(char * theme, char * buffer, uint32_t size);
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    45
10440
b74a7bbe224e - Implement getTeamsList (not tested)
unc0rr
parents: 10436
diff changeset
    46
typedef char **getTeamsList_t();
10452
03519fd9f98d Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents: 10450
diff changeset
    47
typedef void tryAddTeam_t(const char * teamName);
03519fd9f98d Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents: 10450
diff changeset
    48
typedef void tryRemoveTeam_t(const char * teamName);
03519fd9f98d Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents: 10450
diff changeset
    49
typedef void changeTeamColor_t(const char * teamName, int32_t dir);
10440
b74a7bbe224e - Implement getTeamsList (not tested)
unc0rr
parents: 10436
diff changeset
    50
10416
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    51
#ifdef __cplusplus
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    52
}
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    53
#endif
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    54
1c301054694d - Remove --port command
unc0rr
parents:
diff changeset
    55
#endif // FLIB_H