introduce widget->user
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-04-26 23:08:52 +09:00
commit 833947c1ec
Signed by: nishi
GPG key ID: 27EF69B208EB9343
3 changed files with 24 additions and 0 deletions

View file

@ -361,6 +361,20 @@ MWDECL int MWAPI MwGetCoordinateType(MwWidget handle);
*/
MWDECL void MWAPI MwGetClipboard(MwWidget handle, int clipboard_type);
/*!
* @brief Set user pointer.
* @param handle Widget
* @param user User pointer
*/
MWDECL void MWAPI MwSetUser(MwWidget handle, void* user);
/*!
* @brief Get user pointer.
* @param handle Widget
* @return User pointer
*/
MWDECL void* MWAPI MwGetUser(MwWidget handle);
#ifdef _MILSKO
MWDECL void MwForceRender_Internal(MwWidget handle);
MWDECL void MwForceRender2_Internal(MwWidget handle, void* ptr);

View file

@ -90,6 +90,7 @@ struct _MwWidget {
void* internal;
void* opaque;
void* user;
void (*draw_inject)(MwWidget handle);
void (*destroy_inject)(MwWidget handle);

View file

@ -211,6 +211,7 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
h->internal = NULL;
h->opaque = NULL;
h->user = NULL;
h->top_step = 0;
h->draw_queue = NULL;
@ -1066,3 +1067,11 @@ int MwGetCoordinateType(MwWidget handle) {
void MwGetClipboard(MwWidget handle, int clipboard_type) {
MwLLGetClipboard(handle->lowlevel, clipboard_type);
}
void MwSetUser(MwWidget handle, void* user){
handle->user = user;
}
void* MwGetUser(MwWidget handle){
return handle->user;
}