author | unc0rr |
Fri, 05 Jan 2018 21:44:00 +0100 | |
branch | qmlfrontend |
changeset 12878 | b3426030a426 |
parent 11842 | 93e6c401cc3d |
permissions | -rw-r--r-- |
10416 | 1 |
#ifndef FLIB_H |
2 |
#define FLIB_H |
|
3 |
||
4 |
#include <stdint.h> |
|
5 |
||
6 |
#ifdef __cplusplus |
|
7 |
extern "C" { |
|
8 |
#endif |
|
9 |
||
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
10 |
enum MessageType { |
11434 | 11 |
MSG_RENDERINGPREVIEW |
12 |
, MSG_PREVIEW |
|
11827
8c71c5a1172f
- Add state to engine callback for it to know what engine is sending
unc0rr
parents:
11443
diff
changeset
|
13 |
, MSG_PREVIEWHOGCOUNT |
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
|
14 |
, 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
|
15 |
, 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
|
16 |
, 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
|
17 |
, MSG_REMOVETEAM |
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
18 |
, MSG_TEAMCOLOR |
11443 | 19 |
, MSG_HEDGEHOGSNUMBER |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10896
diff
changeset
|
20 |
, MSG_NETDATA |
11842 | 21 |
, MSG_TONET |
11434 | 22 |
, MSG_FLIBEVENT |
11415 | 23 |
, MSG_CONNECTED |
24 |
, MSG_DISCONNECTED |
|
25 |
, MSG_ADDLOBBYCLIENT |
|
26 |
, MSG_REMOVELOBBYCLIENT |
|
27 |
, MSG_LOBBYCHATLINE |
|
11424 | 28 |
, MSG_ADDROOMCLIENT |
29 |
, MSG_REMOVEROOMCLIENT |
|
30 |
, MSG_ROOMCHATLINE |
|
11418 | 31 |
, MSG_ADDROOM |
32 |
, MSG_UPDATEROOM |
|
33 |
, MSG_REMOVEROOM |
|
11423 | 34 |
, MSG_ERROR |
35 |
, MSG_WARNING |
|
11424 | 36 |
, MSG_MOVETOLOBBY |
37 |
, MSG_MOVETOROOM |
|
11430 | 38 |
, MSG_NICKNAME |
11431 | 39 |
, MSG_SEED |
40 |
, MSG_THEME |
|
41 |
, MSG_SCRIPT |
|
11433 | 42 |
, MSG_FEATURESIZE |
43 |
, MSG_MAPGEN |
|
44 |
, MSG_MAP |
|
45 |
, MSG_MAZESIZE |
|
46 |
, MSG_TEMPLATE |
|
11437 | 47 |
, MSG_AMMO |
11440 | 48 |
, MSG_SCHEME |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
49 |
}; |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
50 |
|
10416 | 51 |
typedef union string255_ |
52 |
{ |
|
53 |
struct { |
|
54 |
unsigned char s[256]; |
|
55 |
}; |
|
56 |
struct { |
|
57 |
unsigned char len; |
|
58 |
unsigned char str[255]; |
|
59 |
}; |
|
60 |
} string255; |
|
61 |
||
10418
091d2c0216c3
Move away from passing shortstrings into C code, now IPC works
unc0rr
parents:
10416
diff
changeset
|
62 |
typedef void RunEngine_t(int argc, const char ** argv); |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10896
diff
changeset
|
63 |
typedef void registerUIMessagesCallback_t(void * context, void (*)(void * context, MessageType mt, const char * msg, uint32_t len)); |
10430 | 64 |
typedef void getPreview_t(); |
10432 | 65 |
typedef void runQuickGame_t(); |
10448 | 66 |
typedef void runLocalGame_t(); |
10450 | 67 |
typedef void resetGameConfig_t(); |
10430 | 68 |
typedef void setSeed_t(const char * seed); |
69 |
typedef char *getSeed_t(); |
|
10612 | 70 |
typedef void setTheme_t(const char * themeName); |
71 |
typedef void setScript_t(const char * scriptName); |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
72 |
typedef void setScheme_t(const char * schemeName); |
10888 | 73 |
typedef void setAmmo_t(const char * ammoName); |
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
74 |
typedef void flibInit_t(const char * localPrefix, const char * userPrefix); |
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
75 |
typedef void flibFree_t(); |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10896
diff
changeset
|
76 |
typedef void passNetData_t(const char * data); |
11842 | 77 |
typedef void passToNet_t(const char * data, uint32_t size); |
11434 | 78 |
typedef void passFlibEvent_t(const char * data); |
11416 | 79 |
typedef void sendChatLine_t(const char * msg); |
11423 | 80 |
typedef void joinRoom_t(const char * roomName); |
11424 | 81 |
typedef void partRoom_t(const char * message); |
10416 | 82 |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
83 |
typedef char **getThemesList_t(); |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
84 |
typedef void freeThemesList_t(char **list); |
10436 | 85 |
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
|
86 |
|
10517 | 87 |
typedef char **getScriptsList_t(); |
10616 | 88 |
typedef char **getSchemesList_t(); |
10888 | 89 |
typedef char **getAmmosList_t(); |
10517 | 90 |
|
10440 | 91 |
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
|
92 |
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
|
93 |
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
|
94 |
typedef void changeTeamColor_t(const char * teamName, int32_t dir); |
10440 | 95 |
|
10896
5a74923120d5
Start network support: only setting up a connection for now
unc0rr
parents:
10888
diff
changeset
|
96 |
typedef void connectOfficialServer_t(); |
5a74923120d5
Start network support: only setting up a connection for now
unc0rr
parents:
10888
diff
changeset
|
97 |
|
10416 | 98 |
#ifdef __cplusplus |
99 |
} |
|
100 |
#endif |
|
101 |
||
102 |
#endif // FLIB_H |