1
1
#pragma once
2
2
3
+ #define GW2AL_API_VER_MAJOR 1
4
+ #define GW2AL_API_VER_MINOR 0
5
+
6
+ #define GW2AL_CORE_DEP_ENTRY { L"loader_core", L"core gw2 al API", GW2AL_API_VER_MAJOR, GW2AL_API_VER_MINOR, 1, 0 }
7
+
3
8
#define gw2al_hashed_name unsigned long long
4
9
#define gw2al_event_id unsigned long
5
10
11
+
6
12
typedef struct gw2al_addon_dsc {
7
13
const wchar_t * name ;
8
14
const wchar_t * description ;
@@ -43,44 +49,47 @@ typedef void(*gw2al_api_event_handler)(void* data);
43
49
#define GW2AL_CORE_FUNN_QUERY_EVENT 11
44
50
#define GW2AL_CORE_FUNN_TRIGGER_EVENT 12
45
51
#define GW2AL_CORE_FUNN_CLIENT_UNLOAD 13
46
- #define GW2AL_CORE_FUNN_LOG_TEXT 14
47
- #define GW2AL_CORE_FUNN_D3DCREATE_HOOK 15
52
+ #define GW2AL_CORE_FUNN_LOG_TEXT_SYNC 14
53
+ #define GW2AL_CORE_FUNN_LOG_TEXT 15
54
+ #define GW2AL_CORE_FUNN_D3DCREATE_HOOK 16
55
+ #define GW2AL_CORE_FUNN_D3D11CREATE_HOOK 17
56
+ #define GW2AL_CORE_FUNN_DXGICREATE_HOOK 18
48
57
49
58
typedef enum gw2al_log_level {
50
59
LL_INFO = 0 ,
51
60
LL_ERR ,
52
- LL_WARN ,
61
+ LL_WARN ,
53
62
LL_DEBUG
54
63
} gw2al_log_level ;
55
64
56
65
typedef struct gw2al_core_vtable {
57
66
//converts string to hash for usage in other functions
58
- gw2al_hashed_name (* hash_name )(wchar_t * name );
67
+ gw2al_hashed_name (* hash_name )(const wchar_t * name );
59
68
60
69
//register/unregister user functions to be called by other addons
61
- gw2al_api_ret (* register_function )(void * function , gw2al_hashed_name name );
70
+ gw2al_api_ret (* register_function )(void * function , gw2al_hashed_name name );
62
71
void (* unregister_function )(gw2al_hashed_name name );
63
72
64
73
//query function pointer from registered list
65
74
void * (* query_function )(gw2al_hashed_name name );
66
75
67
76
//fills table of functions using query_function
68
- void (* fill_vtable )(gw2al_hashed_name * nameList , void * * vtable );
69
-
77
+ void (* fill_vtable )(const gw2al_hashed_name * nameList , void * * vtable );
78
+
70
79
//functions to unload/load addons
71
- gw2al_api_ret (* unload_addon )(gw2al_hashed_name name );
72
- gw2al_api_ret (* load_addon )(wchar_t * name );
80
+ gw2al_api_ret (* unload_addon )(gw2al_hashed_name name );
81
+ gw2al_api_ret (* load_addon )(const wchar_t * name );
73
82
74
83
//function to get currently loaded addon description
75
84
gw2al_addon_dsc * (* query_addon )(gw2al_hashed_name name );
76
-
85
+
77
86
//simple event api
78
87
//watch event can add a number of handlers on event name with priority
79
88
//query event will get internal event id to speedup trigger_event calls
80
89
81
- gw2al_api_ret (* watch_event )(gw2al_event_id id , gw2al_hashed_name subscriber , gw2al_api_event_handler handler , unsigned int priority );
90
+ gw2al_api_ret (* watch_event )(gw2al_event_id id , gw2al_hashed_name subscriber , gw2al_api_event_handler handler , unsigned int priority );
82
91
void (* unwatch_event )(gw2al_event_id id , gw2al_hashed_name subscriber );
83
- gw2al_event_id (* query_event )(gw2al_hashed_name name );
92
+ gw2al_event_id (* query_event )(gw2al_hashed_name name );
84
93
unsigned int (* trigger_event )(gw2al_event_id id , void * data );
85
94
86
95
//unload function to delete properly unload things on client exit
@@ -89,7 +98,8 @@ typedef struct gw2al_core_vtable {
89
98
90
99
//simple logging function
91
100
92
- void (* log_text )(gw2al_log_level level , wchar_t * source , wchar_t * text );
101
+ void (* log_text_sync )(gw2al_log_level level , const wchar_t * source , const wchar_t * text );
102
+ void (* log_text )(gw2al_log_level level , const wchar_t * source , const wchar_t * text );
93
103
94
104
} gw2al_core_vtable ;
95
105
0 commit comments