introduce MWAPI
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
This commit is contained in:
parent
77ca92452e
commit
2dd2c3870f
41 changed files with 189 additions and 166 deletions
|
|
@ -17,32 +17,32 @@ extern "C" {
|
|||
* @param path Path
|
||||
* @return Handle
|
||||
*/
|
||||
MWDECL void* MwDirectoryOpen(const char* path);
|
||||
MWDECL void* MWAPI MwDirectoryOpen(const char* path);
|
||||
|
||||
/*!
|
||||
* @brief Closes a directory
|
||||
* @param handle Handle
|
||||
*/
|
||||
MWDECL void MwDirectoryClose(void* handle);
|
||||
MWDECL void MWAPI MwDirectoryClose(void* handle);
|
||||
|
||||
/*!
|
||||
* @brief Reads a directory
|
||||
* @param handle Handle
|
||||
* @return Directory entry
|
||||
*/
|
||||
MWDECL MwDirectoryEntry* MwDirectoryRead(void* handle);
|
||||
MWDECL MwDirectoryEntry* MWAPI MwDirectoryRead(void* handle);
|
||||
|
||||
/*!
|
||||
* @brief Frees a directory entry
|
||||
* @param entry Entry
|
||||
*/
|
||||
MWDECL void MwDirectoryFreeEntry(MwDirectoryEntry* entry);
|
||||
MWDECL void MWAPI MwDirectoryFreeEntry(MwDirectoryEntry* entry);
|
||||
|
||||
/*!
|
||||
* @brief Gets a current directory
|
||||
* @param Directory
|
||||
*/
|
||||
MWDECL char* MwDirectoryCurrent(void);
|
||||
MWDECL char* MWAPI MwDirectoryCurrent(void);
|
||||
|
||||
/*!
|
||||
* @brief Joins 2 paths
|
||||
|
|
@ -50,7 +50,7 @@ MWDECL char* MwDirectoryCurrent(void);
|
|||
* @param b Path
|
||||
* @return Path
|
||||
*/
|
||||
MWDECL char* MwDirectoryJoin(char* a, char* b);
|
||||
MWDECL char* MWAPI MwDirectoryJoin(char* a, char* b);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,20 +16,20 @@ extern "C" {
|
|||
* @param path Path
|
||||
* @return Handle
|
||||
*/
|
||||
MWDECL void* MwDynamicOpen(const char* path);
|
||||
MWDECL void* MWAPI MwDynamicOpen(const char* path);
|
||||
|
||||
/*!
|
||||
* @brief Gets a symbol from the dynamic library
|
||||
* @param handle Handle
|
||||
* @param symbol Symbol
|
||||
*/
|
||||
MWDECL void* MwDynamicSymbol(void* handle, const char* symbol);
|
||||
MWDECL void* MWAPI MwDynamicSymbol(void* handle, const char* symbol);
|
||||
|
||||
/*!
|
||||
* @brief Closes a dynamic library
|
||||
* @param handle Handle
|
||||
*/
|
||||
MWDECL void MwDynamicClose(void* handle);
|
||||
MWDECL void MWAPI MwDynamicClose(void* handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ extern "C" {
|
|||
* @brief Sleeps for milliseconds
|
||||
* @param ms Milliseconds
|
||||
*/
|
||||
MWDECL void MwTimeSleep(int ms);
|
||||
MWDECL void MWAPI MwTimeSleep(int ms);
|
||||
|
||||
/*!
|
||||
* @brief Gets a monotonic time
|
||||
* @return Monotonic time
|
||||
*/
|
||||
MWDECL long MwTimeGetTick(void);
|
||||
MWDECL long MWAPI MwTimeGetTick(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ extern "C" {
|
|||
* @brief Initializes the Milsko Toolkit
|
||||
* @return `0` if successful
|
||||
*/
|
||||
MWDECL int MwLibraryInit(void);
|
||||
MWDECL int MWAPI MwLibraryInit(void);
|
||||
|
||||
/*!
|
||||
* @brief Creates a widget
|
||||
|
|
@ -73,7 +73,7 @@ MWDECL int MwLibraryInit(void);
|
|||
* @param height Height
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height);
|
||||
MWDECL MwWidget MWAPI MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
/*!
|
||||
* @brief Creates a widget
|
||||
|
|
@ -87,7 +87,7 @@ MWDECL MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget
|
|||
* @param ... Same with MwVaApply
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwVaCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, ...);
|
||||
MWDECL MwWidget MWAPI MwVaCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, ...);
|
||||
|
||||
/*!
|
||||
* @brief Creates a widget
|
||||
|
|
@ -101,13 +101,13 @@ MWDECL MwWidget MwVaCreateWidget(MwClass widget_class, const char* name, MwWidge
|
|||
* @param va Same with MwVaListApply
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwVaListCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, va_list va);
|
||||
MWDECL MwWidget MWAPI MwVaListCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, va_list va);
|
||||
|
||||
/*!
|
||||
* @brief Destroys the widget and its child widgets
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL void MwDestroyWidget(MwWidget handle);
|
||||
MWDECL void MWAPI MwDestroyWidget(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Executes a method specific to the widget (varadic version).
|
||||
|
|
@ -115,7 +115,7 @@ MWDECL void MwDestroyWidget(MwWidget handle);
|
|||
* @param handle Widget
|
||||
* @param ... Widget function arguments.
|
||||
*/
|
||||
MWDECL void MwVaWidgetExecute(MwWidget handle, const char* func_name, void* out, ...);
|
||||
MWDECL void MWAPI MwVaWidgetExecute(MwWidget handle, const char* func_name, void* out, ...);
|
||||
|
||||
/*!
|
||||
* @brief Executes a method specific to the widget (va_list version).
|
||||
|
|
@ -123,27 +123,27 @@ MWDECL void MwVaWidgetExecute(MwWidget handle, const char* func_name, void* out,
|
|||
* @param handle Widget
|
||||
* @param va Widget function arguments.
|
||||
*/
|
||||
MWDECL void MwVaListWidgetExecute(MwWidget handle, const char* func_name, void* out, va_list va);
|
||||
MWDECL void MWAPI MwVaListWidgetExecute(MwWidget handle, const char* func_name, void* out, va_list va);
|
||||
|
||||
/*!
|
||||
* @brief Runs the main loop
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL void MwLoop(MwWidget handle);
|
||||
MWDECL void MWAPI MwLoop(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Runs the single step
|
||||
* @param handle Widget
|
||||
* @return `0` if successful
|
||||
*/
|
||||
MWDECL int MwStep(MwWidget handle);
|
||||
MWDECL int MWAPI MwStep(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Check if any event is pending
|
||||
* @param handle Widget
|
||||
* @return `1` if any event is pending
|
||||
*/
|
||||
MWDECL int MwPending(MwWidget handle);
|
||||
MWDECL int MWAPI MwPending(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Sets an integer property
|
||||
|
|
@ -151,7 +151,7 @@ MWDECL int MwPending(MwWidget handle);
|
|||
* @param key Key
|
||||
* @param n Value
|
||||
*/
|
||||
MWDECL void MwSetInteger(MwWidget handle, const char* key, int n);
|
||||
MWDECL void MWAPI MwSetInteger(MwWidget handle, const char* key, int n);
|
||||
|
||||
/*!
|
||||
* @brief Sets a text property
|
||||
|
|
@ -159,7 +159,7 @@ MWDECL void MwSetInteger(MwWidget handle, const char* key, int n);
|
|||
* @param key Key
|
||||
* @param value Value
|
||||
*/
|
||||
MWDECL void MwSetText(MwWidget handle, const char* key, const char* value);
|
||||
MWDECL void MWAPI MwSetText(MwWidget handle, const char* key, const char* value);
|
||||
|
||||
/*!
|
||||
* @brief Sets a void pointer property
|
||||
|
|
@ -167,7 +167,7 @@ MWDECL void MwSetText(MwWidget handle, const char* key, const char* value);
|
|||
* @param key Key
|
||||
* @param value Value
|
||||
*/
|
||||
MWDECL void MwSetVoid(MwWidget handle, const char* key, void* value);
|
||||
MWDECL void MWAPI MwSetVoid(MwWidget handle, const char* key, void* value);
|
||||
|
||||
/*!
|
||||
* @brief Gets the integer property
|
||||
|
|
@ -175,7 +175,7 @@ MWDECL void MwSetVoid(MwWidget handle, const char* key, void* value);
|
|||
* @param key Key
|
||||
* @return Value
|
||||
*/
|
||||
MWDECL int MwGetInteger(MwWidget handle, const char* key);
|
||||
MWDECL int MWAPI MwGetInteger(MwWidget handle, const char* key);
|
||||
|
||||
/*!
|
||||
* @brief Gets the text property
|
||||
|
|
@ -183,7 +183,7 @@ MWDECL int MwGetInteger(MwWidget handle, const char* key);
|
|||
* @param key Key
|
||||
* @return Value
|
||||
*/
|
||||
MWDECL const char* MwGetText(MwWidget handle, const char* key);
|
||||
MWDECL const char* MWAPI MwGetText(MwWidget handle, const char* key);
|
||||
|
||||
/*!
|
||||
* @brief Gets the void pointer property
|
||||
|
|
@ -191,28 +191,28 @@ MWDECL const char* MwGetText(MwWidget handle, const char* key);
|
|||
* @param key Key
|
||||
* @return Value
|
||||
*/
|
||||
MWDECL void* MwGetVoid(MwWidget handle, const char* key);
|
||||
MWDECL void* MWAPI MwGetVoid(MwWidget handle, const char* key);
|
||||
|
||||
/*!
|
||||
* @brief Sets the default property
|
||||
* @param handle Widget
|
||||
* @warning This is called when widget is created
|
||||
*/
|
||||
MWDECL void MwSetDefault(MwWidget handle);
|
||||
MWDECL void MWAPI MwSetDefault(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Sets the properties
|
||||
* @param handle Widget
|
||||
* @param ... Properties
|
||||
*/
|
||||
MWDECL void MwVaApply(MwWidget handle, ...);
|
||||
MWDECL void MWAPI MwVaApply(MwWidget handle, ...);
|
||||
|
||||
/*!
|
||||
* @brief Sets properties
|
||||
* @param handle Widget
|
||||
* @param va Properties
|
||||
*/
|
||||
MWDECL void MwVaListApply(MwWidget handle, va_list va);
|
||||
MWDECL void MWAPI MwVaListApply(MwWidget handle, va_list va);
|
||||
|
||||
/*!
|
||||
* @brief Sets a user handler
|
||||
|
|
@ -221,7 +221,7 @@ MWDECL void MwVaListApply(MwWidget handle, va_list va);
|
|||
* @param handler Handler
|
||||
* @param user_data User data passed to handler
|
||||
*/
|
||||
MWDECL void MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler handler, void* user_data);
|
||||
MWDECL void MWAPI MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler handler, void* user_data);
|
||||
|
||||
/*!
|
||||
* @brief Dispatches the user handler
|
||||
|
|
@ -229,7 +229,7 @@ MWDECL void MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler han
|
|||
* @param key Key
|
||||
* @param handler_data Handler data passed to handler
|
||||
*/
|
||||
MWDECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data);
|
||||
MWDECL void MWAPI MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data);
|
||||
|
||||
/*!
|
||||
* @brief Sets an error handler
|
||||
|
|
@ -237,52 +237,52 @@ MWDECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handle
|
|||
* @param handler Handler
|
||||
* @param user_data User data passed to handler
|
||||
*/
|
||||
MWDECL void MwSetErrorHandler(MwErrorHandler handler, void* user_data);
|
||||
MWDECL void MWAPI MwSetErrorHandler(MwErrorHandler handler, void* user_data);
|
||||
|
||||
/*!
|
||||
* @brief Dispatches the error handler
|
||||
* @param code Error code
|
||||
* @param message Error message
|
||||
*/
|
||||
MWDECL void MwDispatchError(int code, const char* message);
|
||||
MWDECL void MWAPI MwDispatchError(int code, const char* message);
|
||||
|
||||
/*!
|
||||
* @brief Forcefully makes widget render
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL void MwForceRender(MwWidget handle);
|
||||
MWDECL void MWAPI MwForceRender(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Forcefully makes widget render
|
||||
* @param handle Widget
|
||||
* @param ptr Ignored
|
||||
*/
|
||||
MWDECL void MwForceRender2(MwWidget handle, void* ptr);
|
||||
MWDECL void MWAPI MwForceRender2(MwWidget handle, void* ptr);
|
||||
|
||||
/*!
|
||||
* @brief Adds an widget to tick handler list
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL void MwAddTickList(MwWidget handle);
|
||||
MWDECL void MWAPI MwAddTickList(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Focus the widget
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL void MwFocus(MwWidget handle);
|
||||
MWDECL void MWAPI MwFocus(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Grabs the pointer
|
||||
* @param handle Widget
|
||||
* @param toggle Toggle
|
||||
*/
|
||||
MWDECL void MwGrabPointer(MwWidget handle, int toggle);
|
||||
MWDECL void MWAPI MwGrabPointer(MwWidget handle, int toggle);
|
||||
|
||||
/*!
|
||||
* @brief Hides the cursor
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL void MwHideCursor(MwWidget handle);
|
||||
MWDECL void MWAPI MwHideCursor(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Toggles the dark theme
|
||||
|
|
@ -290,76 +290,84 @@ MWDECL void MwHideCursor(MwWidget handle);
|
|||
* @param toggle Toggle
|
||||
* @deprecated Use MwNdarkTheme instead
|
||||
*/
|
||||
MWDECL void MwSetDarkTheme(MwWidget handle, int toggle);
|
||||
MWDECL void MWAPI MwSetDarkTheme(MwWidget handle, int toggle);
|
||||
|
||||
/*!
|
||||
* @brief Gets the parent widget
|
||||
* @param handle Widget
|
||||
* @return Parent widget
|
||||
*/
|
||||
MWDECL MwWidget MwGetParent(MwWidget handle);
|
||||
MWDECL MwWidget MWAPI MwGetParent(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Show widget
|
||||
* @param handle Widget
|
||||
* @param toggle Toggle
|
||||
*/
|
||||
MWDECL void MwShow(MwWidget handle, int toggle);
|
||||
MWDECL void MWAPI MwShow(MwWidget handle, int toggle);
|
||||
|
||||
/*!
|
||||
* @brief Reparents widget
|
||||
* @param handle Widget
|
||||
* @param new_parent New parent
|
||||
*/
|
||||
MWDECL void MwReparent(MwWidget handle, MwWidget new_parent);
|
||||
MWDECL void MWAPI MwReparent(MwWidget handle, MwWidget new_parent);
|
||||
|
||||
/*!
|
||||
* @brief Gets class of widget
|
||||
* @param handle Widget
|
||||
* @return Class
|
||||
*/
|
||||
MWDECL MwClass MwGetClass(MwWidget handle);
|
||||
MWDECL MwClass MWAPI MwGetClass(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Gets name of widget
|
||||
* @param handle Widget
|
||||
* @return Name
|
||||
*/
|
||||
MWDECL const char* MwGetName(MwWidget handle);
|
||||
MWDECL const char* MWAPI MwGetName(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Gets children of widget
|
||||
* @param handle Widget
|
||||
* @return Children (NULL-terminated array)
|
||||
*/
|
||||
MWDECL MwWidget* MwGetChildren(MwWidget handle);
|
||||
MWDECL MwWidget* MWAPI MwGetChildren(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Gets the cursor coordinate
|
||||
* @param handle Widget
|
||||
* @param point Point
|
||||
*/
|
||||
MWDECL void MwGetCursorCoord(MwWidget handle, MwPoint* point);
|
||||
MWDECL void MWAPI MwGetCursorCoord(MwWidget handle, MwPoint* point);
|
||||
|
||||
/*!
|
||||
* @brief Gets the screen size
|
||||
* @param handle Widget
|
||||
* @param rect Rectangle
|
||||
*/
|
||||
MWDECL void MwGetScreenSize(MwWidget handle, MwRect* rect);
|
||||
MWDECL void MWAPI MwGetScreenSize(MwWidget handle, MwRect* rect);
|
||||
|
||||
/*!
|
||||
* @brief Reports whether a widget reports global or local coordinates upon GetXY/SetXY. Anything with a parent reports local, and most backends report global coordinates being supported for top level windows, but some (Wayland) do not.
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL int MwGetCoordinateType(MwWidget handle);
|
||||
MWDECL int MWAPI MwGetCoordinateType(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Queue to get clipboard content.
|
||||
* @param handle Widget
|
||||
* @param clipboard_type The Clipboard Type to get. See MwClipboardType. This is ignored on backends that aren't X11/Wayland, so if you're unsure, just use MwClipboardMain
|
||||
*/
|
||||
MWDECL void MwGetClipboard(MwWidget handle, int clipboard_type);
|
||||
MWDECL void MWAPI MwGetClipboard(MwWidget handle, int clipboard_type);
|
||||
|
||||
#ifdef _MILSKO
|
||||
MWDECL void MwForceRender_Internal(MwWidget handle);
|
||||
MWDECL void MwForceRender2_Internal(MwWidget handle, void* ptr);
|
||||
|
||||
#define MwForceRender MwForceRender_Internal
|
||||
#define MwForceRender2 MwForceRender2_Internal
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ MWDECL const int MwDefaultShadow;
|
|||
* @brief Gets default border width
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL int MwDefaultBorderWidth(MwWidget handle);
|
||||
MWDECL int MWAPI MwDefaultBorderWidth(MwWidget handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ extern "C" {
|
|||
* @param title Title text
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwColorPicker(MwWidget handle, const char* title);
|
||||
MWDECL MwWidget MWAPI MwColorPicker(MwWidget handle, const char* title);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ extern "C" {
|
|||
* @param title Title text
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwDirectoryChooser(MwWidget handle, const char* title);
|
||||
MWDECL MwWidget MWAPI MwDirectoryChooser(MwWidget handle, const char* title);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ extern "C" {
|
|||
* @param title Title text
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwFileChooser(MwWidget handle, const char* title);
|
||||
MWDECL MwWidget MWAPI MwFileChooser(MwWidget handle, const char* title);
|
||||
|
||||
/*!
|
||||
* @brief Creates a file chooser
|
||||
|
|
@ -27,7 +27,7 @@ MWDECL MwWidget MwFileChooser(MwWidget handle, const char* title);
|
|||
* @param dir Show directory only or not
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwFileChooserEx(MwWidget handle, const char* title, int dir);
|
||||
MWDECL MwWidget MWAPI MwFileChooserEx(MwWidget handle, const char* title, int dir);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ extern "C" {
|
|||
* @param flag Flag
|
||||
* @return Widget
|
||||
*/
|
||||
MWDECL MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsigned int flag);
|
||||
MWDECL MwWidget MWAPI MwMessageBox(MwWidget handle, const char* text, const char* title, unsigned int flag);
|
||||
|
||||
/*!
|
||||
* @brief Gets a child of the message box
|
||||
* @param handle Widget
|
||||
* @param child Child
|
||||
*/
|
||||
MWDECL MwWidget MwMessageBoxGetChild(MwWidget handle, int child);
|
||||
MWDECL MwWidget MWAPI MwMessageBoxGetChild(MwWidget handle, int child);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ extern "C" {
|
|||
* @param text Color text
|
||||
* @return Color
|
||||
*/
|
||||
MWDECL MwLLColor MwParseColor(MwWidget handle, const char* text);
|
||||
MWDECL MwLLColor MWAPI MwParseColor(MwWidget handle, const char* text);
|
||||
|
||||
/*!
|
||||
* @brief Parses a color text
|
||||
* @param text Color text
|
||||
* @param rgb RGB
|
||||
*/
|
||||
MWDECL void MwParseColorNoAllocate(const char* text, MwRGB* rgb);
|
||||
MWDECL void MWAPI MwParseColorNoAllocate(const char* text, MwRGB* rgb);
|
||||
|
||||
/*!
|
||||
* @brief Lighten a color
|
||||
|
|
@ -37,7 +37,7 @@ MWDECL void MwParseColorNoAllocate(const char* text, MwRGB* rgb);
|
|||
* @param b Blue
|
||||
* @return Color
|
||||
*/
|
||||
MWDECL MwLLColor MwLightenColor(MwWidget handle, MwLLColor color, int r, int g, int b);
|
||||
MWDECL MwLLColor MWAPI MwLightenColor(MwWidget handle, MwLLColor color, int r, int g, int b);
|
||||
|
||||
/*!
|
||||
* @brief Draws a filled rectangle
|
||||
|
|
@ -45,7 +45,7 @@ MWDECL MwLLColor MwLightenColor(MwWidget handle, MwLLColor color, int r, int g,
|
|||
* @param rect Rectangle area
|
||||
* @param color Color
|
||||
*/
|
||||
MWDECL void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||
MWDECL void MWAPI MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||
|
||||
/*!
|
||||
* @brief Draws a filled rectangle that fades to a darker color
|
||||
|
|
@ -53,7 +53,7 @@ MWDECL void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
|
|||
* @param rect Rectangle area
|
||||
* @param color Color
|
||||
*/
|
||||
MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||
MWDECL void MWAPI MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||
|
||||
/*!
|
||||
* @brief Draws a frame
|
||||
|
|
@ -63,7 +63,7 @@ MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color);
|
|||
* @param invert Invert the 3D border color or not
|
||||
* @warning `rect` gets changed to the area of rectangle inside
|
||||
*/
|
||||
MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
||||
MWDECL void MWAPI MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
||||
|
||||
/*!
|
||||
* @brief Does the DrawFrame/DrawRect combo used for drawing widget.
|
||||
|
|
@ -73,7 +73,7 @@ MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int inve
|
|||
* @param invert Invert the 3D border color or not
|
||||
* @warning `rect` gets changed to the area of rectangle inside
|
||||
*/
|
||||
MWDECL void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border);
|
||||
MWDECL void MWAPI MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border);
|
||||
|
||||
/*!
|
||||
* @brief Draws a triangle
|
||||
|
|
@ -82,7 +82,7 @@ MWDECL void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int
|
|||
* @param color Color
|
||||
* @param invert Invert the 3D border color or not
|
||||
*/
|
||||
MWDECL void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int direction);
|
||||
MWDECL void MWAPI MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int direction);
|
||||
|
||||
/*!
|
||||
* @brief Draws a frame with specified border width
|
||||
|
|
@ -96,7 +96,7 @@ MWDECL void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int i
|
|||
* @param rounded Rounded or not
|
||||
* @warning `rect` gets changed to the area of rectangle inside
|
||||
*/
|
||||
MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same);
|
||||
MWDECL void MWAPI MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same);
|
||||
|
||||
/*!
|
||||
* @brief Creates a pixmap from image
|
||||
|
|
@ -104,7 +104,7 @@ MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int in
|
|||
* @param path Path
|
||||
* @return Pixmap
|
||||
*/
|
||||
MWDECL MwLLPixmap MwLoadImage(MwWidget handle, const char* path);
|
||||
MWDECL MwLLPixmap MWAPI MwLoadImage(MwWidget handle, const char* path);
|
||||
|
||||
/*!
|
||||
* @brief Get color components
|
||||
|
|
@ -113,7 +113,7 @@ MWDECL MwLLPixmap MwLoadImage(MwWidget handle, const char* path);
|
|||
* @param green Pointer to green color
|
||||
* @param blue Pointer to blue color
|
||||
*/
|
||||
MWDECL void MwColorGet(MwLLColor color, int* red, int* green, int* blue);
|
||||
MWDECL void MWAPI MwColorGet(MwLLColor color, int* red, int* green, int* blue);
|
||||
|
||||
/*!
|
||||
* @brief Creates a pixmap from raw data
|
||||
|
|
@ -123,28 +123,28 @@ MWDECL void MwColorGet(MwLLColor color, int* red, int* green, int* blue);
|
|||
* @param height Height
|
||||
* @return Pixmap
|
||||
*/
|
||||
MWDECL MwLLPixmap MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height);
|
||||
MWDECL MwLLPixmap MWAPI MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height);
|
||||
|
||||
/*!
|
||||
* @brief Updates a pixmap using raw data
|
||||
* @param pixmap Pixmap to update
|
||||
* @param rgb RGBA data
|
||||
*/
|
||||
MWDECL void MwPixmapReloadRaw(MwLLPixmap pixmap, unsigned char* rgb);
|
||||
MWDECL void MWAPI MwPixmapReloadRaw(MwLLPixmap pixmap, unsigned char* rgb);
|
||||
|
||||
/*!
|
||||
* @brief Gets the raw data of pixmap
|
||||
* @param pixmap Pixmap
|
||||
* @return RFBA data
|
||||
*/
|
||||
MWDECL unsigned char* MwPixmapGetRaw(MwLLPixmap pixmap);
|
||||
MWDECL unsigned char* MWAPI MwPixmapGetRaw(MwLLPixmap pixmap);
|
||||
|
||||
/*!
|
||||
* @brief Gets the size of pixmap
|
||||
* @param pixmap Pixmap
|
||||
* @param rect Size
|
||||
*/
|
||||
MWDECL void MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
||||
MWDECL void MWAPI MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
||||
|
||||
/*!
|
||||
* @brief Creates a pixmap from XPM data
|
||||
|
|
@ -152,7 +152,7 @@ MWDECL void MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
|||
* @param data Data
|
||||
* @return Pixmap
|
||||
*/
|
||||
MWDECL MwLLPixmap MwLoadXPM(MwWidget handle, char** data);
|
||||
MWDECL MwLLPixmap MWAPI MwLoadXPM(MwWidget handle, char** data);
|
||||
|
||||
/*!
|
||||
* @brief Creates a pixmap from icon data
|
||||
|
|
@ -160,7 +160,7 @@ MWDECL MwLLPixmap MwLoadXPM(MwWidget handle, char** data);
|
|||
* @param data Data
|
||||
* @return Pixmap
|
||||
*/
|
||||
MWDECL MwLLPixmap MwLoadIcon(MwWidget handle, MwU32* data);
|
||||
MWDECL MwLLPixmap MWAPI MwLoadIcon(MwWidget handle, MwU32* data);
|
||||
|
||||
/*!
|
||||
* @brief Draws a diamond
|
||||
|
|
@ -169,7 +169,7 @@ MWDECL MwLLPixmap MwLoadIcon(MwWidget handle, MwU32* data);
|
|||
* @param color Color
|
||||
* @param invert Invert the 3D border color or not
|
||||
*/
|
||||
MWDECL void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
||||
MWDECL void MWAPI MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
||||
|
||||
/* text.c */
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ MWDECL void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int in
|
|||
* @param align Align
|
||||
* @param color Color
|
||||
*/
|
||||
MWDECL void MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, int align, MwLLColor color);
|
||||
MWDECL void MWAPI MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, int align, MwLLColor color);
|
||||
|
||||
/*!
|
||||
* @brief Calculates a text width
|
||||
|
|
@ -191,7 +191,7 @@ MWDECL void MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char
|
|||
* @param font Font, NULLable
|
||||
* @return Text width
|
||||
*/
|
||||
MWDECL int MwTextWidth(MwWidget handle, MwFLFont font, const char* text);
|
||||
MWDECL int MWAPI MwTextWidth(MwWidget handle, MwFLFont font, const char* text);
|
||||
|
||||
/*!
|
||||
* @brief Calculates a text height
|
||||
|
|
@ -200,7 +200,7 @@ MWDECL int MwTextWidth(MwWidget handle, MwFLFont font, const char* text);
|
|||
* @param font Font, NULLable
|
||||
* @return Text height
|
||||
*/
|
||||
MWDECL int MwTextHeight(MwWidget handle, MwFLFont font, const char* text);
|
||||
MWDECL int MWAPI MwTextHeight(MwWidget handle, MwFLFont font, const char* text);
|
||||
|
||||
/* color.c */
|
||||
|
||||
|
|
@ -210,14 +210,14 @@ MWDECL int MwTextHeight(MwWidget handle, MwFLFont font, const char* text);
|
|||
* @param color Color name
|
||||
* @return Color
|
||||
*/
|
||||
MWDECL MwLLColor MwParseColorName(MwWidget handle, const char* color);
|
||||
MWDECL MwLLColor MWAPI MwParseColorName(MwWidget handle, const char* color);
|
||||
|
||||
/*!
|
||||
* @brief Parses a color name
|
||||
* @param color Color name
|
||||
* @param rgb RGB
|
||||
*/
|
||||
MWDECL void MwParseColorNameNoAllocate(const char* color, MwRGB* rgb);
|
||||
MWDECL void MWAPI MwParseColorNameNoAllocate(const char* color, MwRGB* rgb);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ extern "C" {
|
|||
* @param size Data size
|
||||
* @return Font handle
|
||||
*/
|
||||
MWDECL void* MwFontLoad(unsigned char* data, unsigned int size);
|
||||
MWDECL void* MWAPI MwFontLoad(unsigned char* data, unsigned int size);
|
||||
|
||||
/*!
|
||||
* @brief Frees a font handle
|
||||
* @param handle Handle
|
||||
*/
|
||||
MWDECL void MwFontFree(void* handle);
|
||||
MWDECL void MWAPI MwFontFree(void* handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,12 @@
|
|||
#define MWDECL extern
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define MWAPI __cdecl
|
||||
#else
|
||||
#define MWAPI
|
||||
#endif
|
||||
|
||||
#define MwInline static __inline
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ extern "C" {
|
|||
* @param str String
|
||||
* @return String
|
||||
*/
|
||||
MWDECL char* MwStringDuplicate(const char* str);
|
||||
MWDECL char* MWAPI MwStringDuplicate(const char* str);
|
||||
|
||||
/*!
|
||||
* @brief Concatenates 2 strings
|
||||
|
|
@ -25,21 +25,21 @@ MWDECL char* MwStringDuplicate(const char* str);
|
|||
* @param str2 String
|
||||
* @return String
|
||||
*/
|
||||
MWDECL char* MwStringConcat(const char* str1, const char* str2);
|
||||
MWDECL char* MWAPI MwStringConcat(const char* str1, const char* str2);
|
||||
|
||||
/*!
|
||||
* @brief Converts size to string
|
||||
* @param out Output
|
||||
* @param size Size
|
||||
*/
|
||||
MWDECL void MwStringSize(char* out, MwOffset size);
|
||||
MWDECL void MWAPI MwStringSize(char* out, MwOffset size);
|
||||
|
||||
/*!
|
||||
* @brief Converts time to string
|
||||
* @param out Output
|
||||
* @param t Time
|
||||
*/
|
||||
MWDECL void MwStringTime(char* out, time_t t);
|
||||
MWDECL void MWAPI MwStringTime(char* out, time_t t);
|
||||
|
||||
/*!
|
||||
* @brief Prints up to n characters into a bufferMwStringPrintIntoBuffer.
|
||||
|
|
@ -47,14 +47,14 @@ MWDECL void MwStringTime(char* out, time_t t);
|
|||
* @param out Buffer
|
||||
* @param size Max size
|
||||
*/
|
||||
MWDECL void MwStringPrintIntoBuffer(char* out, MwU32 size, const char* fmt, ...);
|
||||
MWDECL void MWAPI MwStringPrintIntoBuffer(char* out, MwU32 size, const char* fmt, ...);
|
||||
|
||||
/*!
|
||||
* @brief Check if the given key is UTF8
|
||||
* @param key Input
|
||||
* @return whether its utf8
|
||||
*/
|
||||
MWDECL MwBool MwStringIsKeyUTF8(MwU32 key);
|
||||
MWDECL MwBool MWAPI MwStringIsKeyUTF8(MwU32 key);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ typedef void (*MwHandlerMouse)(MwWidget handle, void* ptr);
|
|||
typedef void (*MwHandlerExecute)(MwWidget handle, const char* name, void* out, va_list args);
|
||||
typedef void (*MwHandlerClipboardReceived)(MwWidget handle, const char* data);
|
||||
|
||||
typedef void (*MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
||||
typedef void (*MwErrorHandler)(int code, const char* message, void* user_data);
|
||||
typedef void (MWAPI *MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
||||
typedef void (MWAPI *MwErrorHandler)(int code, const char* message, void* user_data);
|
||||
|
||||
struct _MwTextKeyValue {
|
||||
char* key;
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ extern "C" {
|
|||
* @brief output Output
|
||||
* @return Bytes this multibyte takes
|
||||
*/
|
||||
MWDECL int MwUTF8ToUTF32(const char* input, int* output);
|
||||
MWDECL int MWAPI MwUTF8ToUTF32(const char* input, int* output);
|
||||
|
||||
/*!
|
||||
* @brief Calculates UTF-8 string length
|
||||
* @brief input Input
|
||||
* @return Length
|
||||
*/
|
||||
MWDECL int MwUTF8Length(const char* input);
|
||||
MWDECL int MWAPI MwUTF8Length(const char* input);
|
||||
|
||||
/*!
|
||||
* @brief Copies UTF-8 string to other string
|
||||
|
|
@ -36,7 +36,7 @@ MWDECL int MwUTF8Length(const char* input);
|
|||
* @brief len Length
|
||||
* @return Copied length in bytes
|
||||
*/
|
||||
MWDECL int MwUTF8Copy(const char* src, int srcskip, char* dst, int dstskip, int len);
|
||||
MWDECL int MWAPI MwUTF8Copy(const char* src, int srcskip, char* dst, int dstskip, int len);
|
||||
|
||||
/*!
|
||||
* @brief Converts UTF-32 to UTF-8
|
||||
|
|
@ -44,7 +44,7 @@ MWDECL int MwUTF8Copy(const char* src, int srcskip, char* dst, int dstskip, int
|
|||
* @brief output Output
|
||||
* @return Bytes this wide byte takes
|
||||
*/
|
||||
MWDECL int MwUTF32ToUTF8(int input, char* output);
|
||||
MWDECL int MWAPI MwUTF32ToUTF8(int input, char* output);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ MwInline void* MwVulkanGetField(MwWidget handle, int field, int* err) {
|
|||
/*!
|
||||
* @brief Return whether Vulkan is installed on the target platform.
|
||||
*/
|
||||
MWDECL int MwVulkanSupported(void);
|
||||
MWDECL int MWAPI MwVulkanSupported(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue