document some of lowlevel functions

This commit is contained in:
Nishi 2026-04-27 13:45:39 +09:00
commit c56bea32ed
6 changed files with 60 additions and 11 deletions

View file

@ -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.

View file

@ -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`

View file

@ -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
*/

View file

@ -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 */

View file

@ -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

View file

@ -1087,3 +1087,5 @@ void MwSetUser(MwWidget handle, void* user) {
void* MwGetUser(MwWidget handle) {
return handle->user;
}
const char* MwVersionString = MwVERSION;