make cursor related functions public

This commit is contained in:
NishiOwO
2025-12-08 14:42:16 +09:00
parent b239dd3819
commit 6f331d613d
3 changed files with 13 additions and 6 deletions

View File

@@ -38,6 +38,7 @@ struct _MwLLGDIPixmap {
HBITMAP hMask2;
};
MWDECL int MwLLGDICallInit(void);
MWDECL int MwLLGDICallInit(void);
MWDECL HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask);
#endif

View File

@@ -69,6 +69,6 @@ struct _MwLLX11Pixmap {
};
MWDECL int MwLLX11CallInit(void);
MWDECL Cursor MwLLX11CreateCursor();
MWDECL Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask);
#endif

View File

@@ -520,7 +520,7 @@ static void MwLLForceRenderImpl(MwLL handle) {
}
}
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask) {
HCURSOR cursor;
BYTE* dmask = malloc((MwCursorDataHeight / 8) * MwCursorDataHeight);
BYTE* dimage = malloc((MwCursorDataHeight / 8) * MwCursorDataHeight);
@@ -561,12 +561,18 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
cursor = CreateCursor(GetModuleHandle(NULL), xs, ys, MwCursorDataHeight, MwCursorDataHeight, dmask, dimage);
free(dimage);
free(dmask);
return cursor;
}
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
HCURSOR cursor = MwLLGDICreateCursor(image, mask);
if(handle->gdi.cursor != NULL) DestroyCursor(handle->gdi.cursor);
if(handle->gdi.icon != NULL) DestroyIcon(handle->gdi.icon);
handle->gdi.cursor = cursor;
free(dimage);
free(dmask);
}
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {