11#pragma once
22
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+
38#define gw2al_hashed_name unsigned long long
49#define gw2al_event_id unsigned long
510
11+
612typedef struct gw2al_addon_dsc {
713 const wchar_t * name ;
814 const wchar_t * description ;
@@ -43,44 +49,47 @@ typedef void(*gw2al_api_event_handler)(void* data);
4349#define GW2AL_CORE_FUNN_QUERY_EVENT 11
4450#define GW2AL_CORE_FUNN_TRIGGER_EVENT 12
4551#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
4857
4958typedef enum gw2al_log_level {
5059 LL_INFO = 0 ,
5160 LL_ERR ,
52- LL_WARN ,
61+ LL_WARN ,
5362 LL_DEBUG
5463} gw2al_log_level ;
5564
5665typedef struct gw2al_core_vtable {
5766 //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 );
5968
6069 //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 );
6271 void (* unregister_function )(gw2al_hashed_name name );
6372
6473 //query function pointer from registered list
6574 void * (* query_function )(gw2al_hashed_name name );
6675
6776 //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+
7079 //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 );
7382
7483 //function to get currently loaded addon description
7584 gw2al_addon_dsc * (* query_addon )(gw2al_hashed_name name );
76-
85+
7786 //simple event api
7887 //watch event can add a number of handlers on event name with priority
7988 //query event will get internal event id to speedup trigger_event calls
8089
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 );
8291 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 );
8493 unsigned int (* trigger_event )(gw2al_event_id id , void * data );
8594
8695 //unload function to delete properly unload things on client exit
@@ -89,7 +98,8 @@ typedef struct gw2al_core_vtable {
8998
9099 //simple logging function
91100
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 );
93103
94104} gw2al_core_vtable ;
95105
0 commit comments