From c56bea32ed5627b58ffbcb34b496f6d72d628589 Mon Sep 17 00:00:00 2001 From: Nishi Date: Mon, 27 Apr 2026 13:45:39 +0900 Subject: [PATCH] document some of lowlevel functions --- README.txt | 2 +- doc/LOWLEVEL.md | 5 ----- include/Mw/Core.h | 6 +++--- include/Mw/LowLevel.h | 42 ++++++++++++++++++++++++++++++++++++++++++ include/Mw/Version.h | 14 ++++++++++++-- src/core.c | 2 ++ 6 files changed, 60 insertions(+), 11 deletions(-) delete mode 100644 doc/LOWLEVEL.md diff --git a/README.txt b/README.txt index dc9d6bf..76a67a0 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,5 @@ -Greetings - Welcome to the Milsko GUI Toolkit (Version pre-1.0) +Greetings - Welcome to the Milsko GUI Toolkit (Version 1.0) This document contains a brief summary of the contents of this source distributions and building instructions for Milsko GUI Toolkit. diff --git a/doc/LOWLEVEL.md b/doc/LOWLEVEL.md deleted file mode 100644 index 9593e8d..0000000 --- a/doc/LOWLEVEL.md +++ /dev/null @@ -1,5 +0,0 @@ -# LowLevel.h function tips -@warning This is mainly for developers - -1. `MwLLSetSizeHints`, `MwLLMakeBorderless`, `MwLLMakeToolWindow`, `MwLLMakePopup` have to be called between `MwLLBeginStateChange` and `MwLLEndStateChange` - diff --git a/include/Mw/Core.h b/include/Mw/Core.h index 37cbc9f..80fbb97 100644 --- a/include/Mw/Core.h +++ b/include/Mw/Core.h @@ -355,21 +355,21 @@ MWDECL void MWAPI MwGetScreenSize(MwWidget handle, MwRect* rect); MWDECL int MWAPI MwGetCoordinateType(MwWidget handle); /*! - * @brief Queue to get clipboard content. + * @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 MWAPI MwGetClipboard(MwWidget handle, int clipboard_type); /*! - * @brief Set user pointer. + * @brief Set user pointer * @param handle Widget * @param user User pointer */ MWDECL void MWAPI MwSetUser(MwWidget handle, void* user); /*! - * @brief Get user pointer. + * @brief Get user pointer * @param handle Widget * @return User pointer */ diff --git a/include/Mw/LowLevel.h b/include/Mw/LowLevel.h index 3b3ae66..696fd51 100644 --- a/include/Mw/LowLevel.h +++ b/include/Mw/LowLevel.h @@ -218,7 +218,17 @@ MWDECL void (*MwLLDestroy)(MwLL handle); MWDECL void (*MwLLPolygon)(MwLL handle, MwPoint* points, int points_count, MwLLColor color); MWDECL void (*MwLLLine)(MwLL handle, MwPoint* points, MwLLColor color); + +/*! + * @brief Begin drawing sequence + * @param handle Handle + */ MWDECL void (*MwLLBeginDraw)(MwLL handle); + +/*! + * @brief End drawing sequence + * @param handle Handle + */ MWDECL void (*MwLLEndDraw)(MwLL handle); MWDECL MwLLColor (*MwLLAllocColor)(MwLL handle, int r, int g, int b); @@ -243,18 +253,44 @@ MWDECL void (*MwLLSetIcon)(MwLL handle, MwLLPixmap pixmap); MWDECL void (*MwLLForceRender)(MwLL handle); MWDECL void (*MwLLSetCursor)(MwLL handle, MwCursor* image, MwCursor* mask); + +/*! + * @brief Detach handle and make it toplevel window + * @param handle Handle + * @param point Point to be detached at, relative from the parent handle + */ MWDECL void (*MwLLDetach)(MwLL handle, MwPoint* point); MWDECL void (*MwLLShow)(MwLL handle, int show); MWDECL void (*MwLLSetSizeHints)(MwLL handle, int minx, int miny, int maxx, int maxy); MWDECL void (*MwLLMakeBorderless)(MwLL handle, int toggle); + +/*! + * @brief Make handle "tool" window, e.g. Submenu, combobox menu, and etc. + * @param handle Handle + */ MWDECL void (*MwLLMakeToolWindow)(MwLL handle); MWDECL void (*MwLLMakePopup)(MwLL handle, MwLL parent); +/*! + * @brief Begin changing state (has to be called before `MwLLSetSizeHints`, `MwLLMakeBorderless`, `MwLLMakeToolWindow`, and `MwLLMakePopup`) + * @param handle Handle + */ MWDECL void (*MwLLBeginStateChange)(MwLL handle); + +/*! + * @brief End changing state + * @param handle Handle + */ MWDECL void (*MwLLEndStateChange)(MwLL handle); MWDECL void (*MwLLFocus)(MwLL handle); + +/*! + * @brief Grab pointer, and keep moving pointer to center of handle + * @param handle Handle + * @param toggle Toggle + */ MWDECL void (*MwLLGrabPointer)(MwLL handle, int toggle); MWDECL void (*MwLLSetClipboard)(MwLL handle, const char* text, int clipboard_type); @@ -263,6 +299,12 @@ MWDECL void (*MwLLGetClipboard)(MwLL handle, int clipboard_type); MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point); MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect); +/*! + * @brief Set dark theme + * @param handle Handle + * @param toggle Toggle + * @warning Do not run `handle->common.handler->dark_theme` when this function gets called + */ MWDECL void (*MwLLSetDarkTheme)(MwLL handle, int toggle); /* font renderer */ diff --git a/include/Mw/Version.h b/include/Mw/Version.h index e83fe71..f59205c 100644 --- a/include/Mw/Version.h +++ b/include/Mw/Version.h @@ -8,16 +8,26 @@ /*! * @brief Major version */ -#define MwMAJOR 0 +#define MwMAJOR 1 /*! * @brief Minor version */ #define MwMINOR 0 +/*! + * @brief Patchlevel of version, calculated by `patchlevel_alphabet - 'a'` + */ +#define MwPATCH 0 + /*! * @brief Version in string */ -#define MwVERSION "pre-1.0" +#define MwVERSION "1.0" + +/*! + * @brief Version in string + */ +MWDECL const char* MwVersionString; #endif diff --git a/src/core.c b/src/core.c index 76507ea..1565963 100644 --- a/src/core.c +++ b/src/core.c @@ -1087,3 +1087,5 @@ void MwSetUser(MwWidget handle, void* user) { void* MwGetUser(MwWidget handle) { return handle->user; } + +const char* MwVersionString = MwVERSION;