AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
PluginAPI.h
Go to the documentation of this file.
1/*
2Copyright (C) 2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
52#ifndef AEONGUI_PLUGIN_API_H
53#define AEONGUI_PLUGIN_API_H
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
60#ifdef _WIN32
61#define AEONGUI_PLUGIN_EXPORT __declspec(dllexport)
62#else
63#define AEONGUI_PLUGIN_EXPORT __attribute__((visibility("default")))
64#endif
65
67typedef struct AeonGUI_Document_s AeonGUI_Document;
69typedef struct AeonGUI_Element_s AeonGUI_Element;
71typedef struct AeonGUI_Event_s AeonGUI_Event;
72
77typedef void ( *AeonGUI_EventCallback ) ( AeonGUI_Event* event, void* userData );
78
87{
90
96 AeonGUI_Element* ( *getElementById ) ( AeonGUI_Document* doc, const char* id );
97
104 void ( *addEventListener ) ( AeonGUI_Element* element, const char* type, AeonGUI_EventCallback callback, void* userData );
105
112 void ( *removeEventListener ) ( AeonGUI_Element* element, const char* type, AeonGUI_EventCallback callback, void* userData );
113
120 const char* ( *getAttribute ) ( AeonGUI_Element* element, const char* name );
121
127 const char* ( *getEventType ) ( AeonGUI_Event* event );
128
134 void ( *setAttribute ) ( AeonGUI_Element* element, const char* name, const char* value );
135
141 AeonGUI_Element* ( *querySelector ) ( AeonGUI_Element* element, const char* selector );
143
152typedef void ( *AeonGUI_OnLoadFunc ) ( AeonGUI_PluginContext* ctx );
153
163
164#ifdef __cplusplus
165}
166#endif
167
168#endif /* AEONGUI_PLUGIN_API_H */
void(* AeonGUI_OnLoadFunc)(AeonGUI_PluginContext *ctx)
Plugin entry point — called after the document is loaded.
Definition PluginAPI.h:152
struct AeonGUI_Document_s AeonGUI_Document
Opaque handle to a Document.
Definition PluginAPI.h:67
struct AeonGUI_Element_s AeonGUI_Element
Opaque handle to an Element.
Definition PluginAPI.h:69
struct AeonGUI_Event_s AeonGUI_Event
Opaque handle to an Event.
Definition PluginAPI.h:71
void(* AeonGUI_EventCallback)(AeonGUI_Event *event, void *userData)
Callback type for event listeners.
Definition PluginAPI.h:77
void(* AeonGUI_OnUnloadFunc)(AeonGUI_PluginContext *ctx)
Plugin cleanup — called before the document is unloaded.
Definition PluginAPI.h:162
Plugin context passed to OnLoad and OnUnload.
Definition PluginAPI.h:87
AeonGUI_Document * document
The document that loaded this plugin.
Definition PluginAPI.h:89
void(* addEventListener)(AeonGUI_Element *element, const char *type, AeonGUI_EventCallback callback, void *userData)
Register an event listener on an element.
Definition PluginAPI.h:104
void(* removeEventListener)(AeonGUI_Element *element, const char *type, AeonGUI_EventCallback callback, void *userData)
Remove a previously registered event listener.
Definition PluginAPI.h:112
void(* setAttribute)(AeonGUI_Element *element, const char *name, const char *value)
Set (or add) an attribute on an element.
Definition PluginAPI.h:134