2025-09-30 13:04:40 +00:00
|
|
|
/*!
|
2025-10-28 20:40:26 +00:00
|
|
|
* @file Mw/LowLevel.h
|
|
|
|
|
* @brief Low-level drawing API
|
|
|
|
|
* @warning This is used internally
|
2025-09-30 13:04:40 +00:00
|
|
|
*/
|
2025-09-29 00:06:16 +00:00
|
|
|
#ifndef __MW_LOWLEVEL_H__
|
|
|
|
|
#define __MW_LOWLEVEL_H__
|
|
|
|
|
|
2026-04-16 23:40:29 +09:00
|
|
|
#include <Mw/BaseTypes.h>
|
2025-09-29 00:06:16 +00:00
|
|
|
#include <Mw/MachDep.h>
|
|
|
|
|
|
2025-11-13 02:29:28 +00:00
|
|
|
typedef struct _MwLLHandler* MwLLHandler;
|
|
|
|
|
typedef struct _MwLLCommon* MwLLCommon;
|
|
|
|
|
typedef struct _MwLLCommonColor* MwLLCommonColor;
|
|
|
|
|
typedef struct _MwLLCommonPixmap* MwLLCommonPixmap;
|
2025-09-29 00:07:42 +00:00
|
|
|
#ifdef _MILSKO
|
2025-11-13 02:27:31 +00:00
|
|
|
typedef union _MwLL* MwLL;
|
|
|
|
|
typedef union _MwLLColor* MwLLColor;
|
|
|
|
|
typedef union _MwLLPixmap* MwLLPixmap;
|
2026-03-04 13:59:28 -06:00
|
|
|
typedef struct _MwFLFont* MwFLFont;
|
2025-09-29 00:06:16 +00:00
|
|
|
#else
|
|
|
|
|
typedef void* MwLL;
|
|
|
|
|
typedef void* MwLLColor;
|
2025-09-30 00:52:43 +00:00
|
|
|
typedef void* MwLLPixmap;
|
2026-03-04 13:59:28 -06:00
|
|
|
typedef void* MwFLFont;
|
2025-09-29 00:06:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
2025-11-13 05:46:06 +00:00
|
|
|
enum MwLLBackends {
|
|
|
|
|
MwLLBackendX11 = 0,
|
2025-12-09 20:11:01 -06:00
|
|
|
MwLLBackendGDI,
|
|
|
|
|
MwLLBackendWayland,
|
2026-01-09 21:35:23 -07:00
|
|
|
MwLLBackendCocoa,
|
2026-04-28 15:06:38 +00:00
|
|
|
MwLLBackendHaiku
|
2025-11-13 05:46:06 +00:00
|
|
|
};
|
|
|
|
|
|
2025-11-13 02:27:31 +00:00
|
|
|
struct _MwLLCommon {
|
2026-03-26 14:40:21 -07:00
|
|
|
void* user;
|
|
|
|
|
int copy_buffer;
|
|
|
|
|
int type;
|
|
|
|
|
int coordinate_type;
|
|
|
|
|
MwBool supports_transparency;
|
2025-11-13 02:27:31 +00:00
|
|
|
|
|
|
|
|
MwLLHandler handler;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct _MwLLCommonColor {
|
2026-01-14 17:13:12 -07:00
|
|
|
MwU8 red;
|
|
|
|
|
MwU8 green;
|
|
|
|
|
MwU8 blue;
|
2025-11-13 02:27:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct _MwLLCommonPixmap {
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
unsigned char* raw;
|
2025-12-15 07:05:42 +09:00
|
|
|
void* user;
|
2025-11-13 02:27:31 +00:00
|
|
|
};
|
|
|
|
|
|
2026-04-15 16:12:38 -07:00
|
|
|
#ifdef USE_DBUS
|
|
|
|
|
typedef struct _MwLLDBusFuncTable {
|
|
|
|
|
void* lib;
|
|
|
|
|
|
|
|
|
|
void (*dbus_error_init)(DBusError* error);
|
|
|
|
|
DBusConnection* (*dbus_bus_get)(DBusBusType type, DBusError* error);
|
|
|
|
|
dbus_bool_t (*dbus_error_is_set)(const DBusError* error);
|
|
|
|
|
void (*dbus_error_free)(DBusError* error);
|
|
|
|
|
DBusMessage* (*dbus_message_new_method_call)(const char* bus_name, const char* path, const char* iface, const char* method);
|
|
|
|
|
void (*dbus_message_iter_init_append)(DBusMessage* message, DBusMessageIter* iter);
|
|
|
|
|
dbus_bool_t (*dbus_message_iter_append_basic)(DBusMessageIter* iter, int type, const void* value);
|
2026-04-17 10:05:35 +02:00
|
|
|
void (*dbus_connection_flush)(DBusConnection* connection);
|
|
|
|
|
dbus_bool_t (*dbus_connection_read_write)(DBusConnection* connection, int timeout_milliseconds);
|
2026-04-15 16:12:38 -07:00
|
|
|
DBusMessage* (*dbus_connection_send_with_reply_and_block)(DBusConnection* connection, DBusMessage* message, int timeout_milliseconds, DBusError* error);
|
2026-04-17 10:05:35 +02:00
|
|
|
DBusMessage* (*dbus_connection_pop_message)(DBusConnection* connection);
|
|
|
|
|
void (*dbus_bus_add_match)(DBusConnection* connection, const char* rule, DBusError* error);
|
2026-04-15 16:12:38 -07:00
|
|
|
void (*dbus_message_unref)(DBusMessage* message);
|
|
|
|
|
dbus_bool_t (*dbus_message_iter_init)(DBusMessage* message, DBusMessageIter* iter);
|
2026-04-17 10:05:35 +02:00
|
|
|
dbus_bool_t (*dbus_message_is_signal)(DBusMessage* message, const char* iface, const char* signal_name);
|
2026-04-15 16:12:38 -07:00
|
|
|
int (*dbus_message_iter_get_arg_type)(DBusMessageIter* iter);
|
|
|
|
|
void (*dbus_message_iter_recurse)(DBusMessageIter* iter, DBusMessageIter* sub);
|
2026-04-17 10:05:35 +02:00
|
|
|
void (*dbus_message_iter_next)(DBusMessageIter* iter);
|
2026-04-15 16:12:38 -07:00
|
|
|
void (*dbus_connection_unref)(DBusConnection* connection);
|
|
|
|
|
void (*dbus_message_iter_get_basic)(DBusMessageIter* iter, void* value);
|
|
|
|
|
} MwLLDBusFuncTable;
|
|
|
|
|
|
|
|
|
|
typedef struct _MwLLDBusContext {
|
|
|
|
|
DBusConnection* dbus_conn;
|
|
|
|
|
DBusError dbus_err;
|
|
|
|
|
DBusMessage* dbus_msg;
|
|
|
|
|
DBusMessage* dbus_reply;
|
|
|
|
|
} MwLLDBusContext;
|
|
|
|
|
|
2026-04-16 23:05:41 +02:00
|
|
|
typedef void (*MwLLDBusPortalPollListener)(MwLL handle, MwU32 new_value);
|
|
|
|
|
|
2026-04-15 16:12:38 -07:00
|
|
|
/* setup the dbus func table. Returns false and prints a warning if dbus couldn't be found. */
|
|
|
|
|
MWDECL MwBool MwLLDBusFuncSetup(MwLLDBusFuncTable* tbl);
|
|
|
|
|
|
|
|
|
|
MWDECL MwBool MwLLDBusNewContext(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx);
|
|
|
|
|
MWDECL MwBool MwLLDBusPortalGet(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, const char* portal, const char* namespace, const char* key, void* out);
|
2026-04-16 23:05:41 +02:00
|
|
|
MWDECL MwBool MwLLDBusPortalWatch(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, const char* portal);
|
|
|
|
|
MWDECL MwBool MwLLDBusPortalPoll(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, MwLL handle, const char* portal, const char* namespace, const char* key, MwLLDBusPortalPollListener);
|
2026-04-15 16:12:38 -07:00
|
|
|
MWDECL void MwLLDBusFreeContext(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-09-29 00:07:42 +00:00
|
|
|
#ifdef _MILSKO
|
2025-09-29 00:06:16 +00:00
|
|
|
#ifdef USE_X11
|
2025-11-18 16:19:05 +00:00
|
|
|
#include <Mw/LowLevel/X11.h>
|
2025-09-29 00:06:16 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef USE_GDI
|
2025-11-18 16:19:05 +00:00
|
|
|
#include <Mw/LowLevel/GDI.h>
|
2025-09-29 00:06:16 +00:00
|
|
|
#endif
|
2025-12-09 20:11:01 -06:00
|
|
|
#ifdef USE_WAYLAND
|
|
|
|
|
#include <Mw/LowLevel/Wayland.h>
|
|
|
|
|
#endif
|
2026-01-09 21:35:23 -07:00
|
|
|
#ifdef USE_COCOA
|
|
|
|
|
#include <Mw/LowLevel/Cocoa.h>
|
2026-01-09 14:43:44 -07:00
|
|
|
#endif
|
2026-04-15 21:41:16 -07:00
|
|
|
#ifdef CLASSIC_MAC_OS
|
|
|
|
|
#include <Mw/LowLevel/ClassicMacOS.h>
|
|
|
|
|
#endif
|
2026-04-28 15:06:38 +00:00
|
|
|
#ifdef USE_HAIKU
|
|
|
|
|
#include <Mw/LowLevel/Haiku.h>
|
|
|
|
|
#endif
|
2025-11-13 02:27:31 +00:00
|
|
|
|
|
|
|
|
union _MwLL {
|
|
|
|
|
struct _MwLLCommon common;
|
|
|
|
|
#ifdef USE_X11
|
|
|
|
|
struct _MwLLX11 x11;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef USE_GDI
|
|
|
|
|
struct _MwLLGDI gdi;
|
|
|
|
|
#endif
|
2025-12-09 20:11:01 -06:00
|
|
|
#ifdef USE_WAYLAND
|
|
|
|
|
struct _MwLLWayland wayland;
|
2026-07-09 21:45:30 -07:00
|
|
|
struct _MwLLCairo cairo;
|
2025-12-09 20:11:01 -06:00
|
|
|
#endif
|
2026-01-09 21:35:23 -07:00
|
|
|
#ifdef USE_COCOA
|
|
|
|
|
struct _MwLLCocoa cocoa;
|
2026-01-09 14:43:44 -07:00
|
|
|
#endif
|
2026-04-15 21:41:16 -07:00
|
|
|
#ifdef CLASSIC_MAC_OS
|
2026-04-16 00:45:59 -07:00
|
|
|
struct _MwLLClassicMacOS cmacos;
|
2026-04-15 21:41:16 -07:00
|
|
|
#endif
|
2026-04-28 15:06:38 +00:00
|
|
|
#ifdef USE_HAIKU
|
|
|
|
|
struct _MwLLHaiku haiku;
|
|
|
|
|
#endif
|
2025-11-13 02:27:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
union _MwLLColor {
|
|
|
|
|
struct _MwLLCommonColor common;
|
|
|
|
|
#ifdef USE_X11
|
|
|
|
|
struct _MwLLX11Color x11;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef USE_GDI
|
|
|
|
|
struct _MwLLGDIColor gdi;
|
|
|
|
|
#endif
|
2025-12-09 20:11:01 -06:00
|
|
|
#ifdef USE_WAYLAND
|
2026-07-09 21:45:30 -07:00
|
|
|
struct _MwLLCairoColor wayland;
|
2025-12-09 20:11:01 -06:00
|
|
|
#endif
|
2026-01-09 21:35:23 -07:00
|
|
|
#ifdef USE_COCOA
|
|
|
|
|
struct _MwLLCocoaColor cocoa;
|
2026-01-09 14:43:44 -07:00
|
|
|
#endif
|
2026-04-28 15:06:38 +00:00
|
|
|
#ifdef USE_HAIKU
|
|
|
|
|
struct _MwLLHaikuColor haiku;
|
|
|
|
|
#endif
|
2025-11-13 02:27:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
union _MwLLPixmap {
|
|
|
|
|
struct _MwLLCommonPixmap common;
|
|
|
|
|
#ifdef USE_X11
|
|
|
|
|
struct _MwLLX11Pixmap x11;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef USE_GDI
|
|
|
|
|
struct _MwLLGDIPixmap gdi;
|
2025-10-06 21:01:50 +00:00
|
|
|
#endif
|
2025-12-09 20:11:01 -06:00
|
|
|
#ifdef USE_WAYLAND
|
|
|
|
|
struct _MwLLWaylandPixmap wayland;
|
2026-07-09 21:45:30 -07:00
|
|
|
struct _MwLLCairoPixmap cairo; /* same structure but we do this for code clarity */
|
2025-12-09 20:11:01 -06:00
|
|
|
#endif
|
2026-01-09 21:35:23 -07:00
|
|
|
#ifdef USE_COCOA
|
|
|
|
|
struct _MwLLCocoaPixmap cocoa;
|
2026-01-09 14:43:44 -07:00
|
|
|
#endif
|
2026-04-16 00:45:59 -07:00
|
|
|
#ifdef CLASSIC_MAC_OS
|
|
|
|
|
struct _MwLLClassicMacOSPixmap cmacos;
|
|
|
|
|
#endif
|
2026-04-28 15:06:38 +00:00
|
|
|
#ifdef USE_HAIKU
|
|
|
|
|
struct _MwLLHaikuPixmap haiku;
|
|
|
|
|
#endif
|
2025-11-13 02:27:31 +00:00
|
|
|
};
|
2025-09-29 00:06:16 +00:00
|
|
|
#endif
|
|
|
|
|
#include <Mw/TypeDefs.h>
|
|
|
|
|
|
2025-10-01 16:47:48 +00:00
|
|
|
#define MwLLDispatch(x, y, z) \
|
2025-11-13 02:27:31 +00:00
|
|
|
if(x->common.handler != NULL && x->common.handler->y != NULL) x->common.handler->y(x, z)
|
2025-09-29 00:06:16 +00:00
|
|
|
|
|
|
|
|
struct _MwLLHandler {
|
2025-10-01 16:47:48 +00:00
|
|
|
void (*draw)(MwLL handle, void* data);
|
|
|
|
|
void (*up)(MwLL handle, void* data);
|
|
|
|
|
void (*down)(MwLL handle, void* data);
|
|
|
|
|
void (*resize)(MwLL handle, void* data);
|
|
|
|
|
void (*close)(MwLL handle, void* data);
|
2025-10-02 02:50:28 +00:00
|
|
|
void (*move)(MwLL handle, void* data);
|
2025-10-08 18:03:46 +00:00
|
|
|
void (*key)(MwLL handle, void* data);
|
2025-10-11 11:46:28 +00:00
|
|
|
void (*key_released)(MwLL handle, void* data);
|
2025-10-17 19:11:32 +00:00
|
|
|
void (*focus_in)(MwLL handle, void* data);
|
|
|
|
|
void (*focus_out)(MwLL handle, void* data);
|
2025-12-31 04:35:10 +09:00
|
|
|
void (*clipboard)(MwLL handle, void* data);
|
2026-01-27 17:34:25 +09:00
|
|
|
void (*dark_theme)(MwLL handle, void* data);
|
2026-07-23 00:34:38 -07:00
|
|
|
void (*drag_and_drop)(MwLL handle, void* data);
|
2025-09-29 00:06:16 +00:00
|
|
|
};
|
|
|
|
|
|
2026-03-04 13:59:28 -06:00
|
|
|
struct _MwLLTextDispatchTable {
|
|
|
|
|
int (*drawText)(MwWidget handle, MwPoint* point, const char* text, int bold, int align, MwLLColor color);
|
|
|
|
|
int (*textWidth)(MwWidget handle, const char* text);
|
|
|
|
|
int (*textHeight)(MwWidget handle, int count);
|
|
|
|
|
void* (*fontLoad)(unsigned char* data, unsigned int size);
|
|
|
|
|
void (*fontFree)(void* handle);
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-06 17:29:09 +09:00
|
|
|
#define MwFLFlagMonospace (1 << 0)
|
|
|
|
|
#define MwFLFlagBold (1 << 1)
|
2026-05-06 06:10:45 +09:00
|
|
|
#define MwFLFlagBitmap (1 << 2)
|
2026-04-06 17:29:09 +09:00
|
|
|
#define MwFLBuildFont(x) ((MwFLFont)(void*)(size_t)(x))
|
|
|
|
|
|
2025-09-29 00:19:49 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-09-29 00:06:16 +00:00
|
|
|
/* lowlevel.c, common part */
|
|
|
|
|
MWDECL void MwLLCreateCommon(MwLL handle);
|
|
|
|
|
MWDECL void MwLLDestroyCommon(MwLL handle);
|
|
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
/* driver-specific, these get assigned by backend */
|
|
|
|
|
MWDECL MwLL (*MwLLCreate)(MwLL parent, int x, int y, int width, int height);
|
|
|
|
|
MWDECL void (*MwLLDestroy)(MwLL handle);
|
2025-09-29 00:06:16 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLPolygon)(MwLL handle, MwPoint* points, int points_count, MwLLColor color);
|
|
|
|
|
MWDECL void (*MwLLLine)(MwLL handle, MwPoint* points, MwLLColor color);
|
2026-04-27 13:45:39 +09:00
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* @brief Begin drawing sequence
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
*/
|
2026-03-19 16:05:44 -07:00
|
|
|
MWDECL void (*MwLLBeginDraw)(MwLL handle);
|
2026-04-27 13:45:39 +09:00
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* @brief End drawing sequence
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
*/
|
2026-03-19 16:05:44 -07:00
|
|
|
MWDECL void (*MwLLEndDraw)(MwLL handle);
|
2025-09-29 00:06:16 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL MwLLColor (*MwLLAllocColor)(MwLL handle, int r, int g, int b);
|
|
|
|
|
MWDECL void (*MwLLColorUpdate)(MwLL handle, MwLLColor c, int r, int g, int b);
|
|
|
|
|
MWDECL void (*MwLLFreeColor)(MwLLColor color);
|
2025-09-29 00:06:16 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLGetXYWH)(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h);
|
|
|
|
|
MWDECL void (*MwLLSetXY)(MwLL handle, int x, int y);
|
|
|
|
|
MWDECL void (*MwLLSetWH)(MwLL handle, int w, int h);
|
2025-09-29 00:06:16 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLSetTitle)(MwLL handle, const char* title);
|
2025-09-29 00:06:16 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL int (*MwLLPending)(MwLL handle);
|
|
|
|
|
MWDECL void (*MwLLNextEvent)(MwLL handle);
|
2025-09-29 00:06:16 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL MwLLPixmap (*MwLLCreatePixmap)(MwLL handle, unsigned char* data, int width, int height);
|
|
|
|
|
MWDECL void (*MwLLPixmapUpdate)(MwLLPixmap pixmap);
|
|
|
|
|
MWDECL void (*MwLLDestroyPixmap)(MwLLPixmap pixmap);
|
|
|
|
|
MWDECL void (*MwLLDrawPixmap)(MwLL handle, MwRect* rect, MwLLPixmap pixmap);
|
|
|
|
|
MWDECL void (*MwLLSetIcon)(MwLL handle, MwLLPixmap pixmap);
|
2025-09-30 00:52:43 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLForceRender)(MwLL handle);
|
2025-10-03 10:24:34 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLSetCursor)(MwLL handle, MwCursor* image, MwCursor* mask);
|
2026-04-27 13:45:39 +09:00
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* @brief Detach handle and make it toplevel window
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
* @param point Point to be detached at, relative from the parent handle
|
|
|
|
|
*/
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLDetach)(MwLL handle, MwPoint* point);
|
|
|
|
|
MWDECL void (*MwLLShow)(MwLL handle, int show);
|
2025-10-06 10:37:08 +00:00
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLSetSizeHints)(MwLL handle, int minx, int miny, int maxx, int maxy);
|
|
|
|
|
MWDECL void (*MwLLMakeBorderless)(MwLL handle, int toggle);
|
2026-04-27 13:45:39 +09:00
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* @brief Make handle "tool" window, e.g. Submenu, combobox menu, and etc.
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
*/
|
2025-11-14 10:52:44 +00:00
|
|
|
MWDECL void (*MwLLMakeToolWindow)(MwLL handle);
|
|
|
|
|
MWDECL void (*MwLLMakePopup)(MwLL handle, MwLL parent);
|
2025-10-11 06:21:43 +00:00
|
|
|
|
2026-04-27 13:45:39 +09:00
|
|
|
/*!
|
|
|
|
|
* @brief Begin changing state (has to be called before `MwLLSetSizeHints`, `MwLLMakeBorderless`, `MwLLMakeToolWindow`, and `MwLLMakePopup`)
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
*/
|
2025-11-14 12:13:31 +00:00
|
|
|
MWDECL void (*MwLLBeginStateChange)(MwLL handle);
|
2026-04-27 13:45:39 +09:00
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* @brief End changing state
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
*/
|
2025-11-14 12:13:31 +00:00
|
|
|
MWDECL void (*MwLLEndStateChange)(MwLL handle);
|
|
|
|
|
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLFocus)(MwLL handle);
|
2026-04-27 13:45:39 +09:00
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* @brief Grab pointer, and keep moving pointer to center of handle
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
* @param toggle Toggle
|
|
|
|
|
*/
|
2025-11-13 01:30:10 +00:00
|
|
|
MWDECL void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
2025-10-17 19:11:32 +00:00
|
|
|
|
2026-04-15 10:58:46 -07:00
|
|
|
MWDECL void (*MwLLSetClipboard)(MwLL handle, const char* text, int clipboard_type);
|
|
|
|
|
MWDECL void (*MwLLGetClipboard)(MwLL handle, int clipboard_type);
|
2025-11-03 19:05:33 +00:00
|
|
|
|
2025-11-25 20:21:15 +00:00
|
|
|
MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
|
2025-11-28 17:11:21 +00:00
|
|
|
MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
|
2025-11-25 20:21:15 +00:00
|
|
|
|
2026-07-23 11:45:01 +09:00
|
|
|
/*!
|
|
|
|
|
* @brief Setup drag and drop capabilities, should the user request it with MwNacceptsDnD
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
*/
|
|
|
|
|
MWDECL void (*MwLLSetupDragAndDrop)(MwLL handle);
|
|
|
|
|
|
2026-04-27 13:45:39 +09:00
|
|
|
/*!
|
2026-04-26 23:55:34 -07:00
|
|
|
* @brief Set any extra parameters for dark theme
|
2026-04-27 13:45:39 +09:00
|
|
|
* @param handle Handle
|
|
|
|
|
* @param toggle Toggle
|
|
|
|
|
* @warning Do not run `handle->common.handler->dark_theme` when this function gets called
|
2026-04-26 23:55:34 -07:00
|
|
|
* @warning This is for stuff like, i.e. setting the accent color on modern Windows. The user themselves sets dark theme with MwNdarkTheme.
|
2026-04-27 13:45:39 +09:00
|
|
|
*/
|
2026-04-16 09:35:53 +09:00
|
|
|
MWDECL void (*MwLLSetDarkTheme)(MwLL handle, int toggle);
|
|
|
|
|
|
2026-04-26 23:55:34 -07:00
|
|
|
/*!
|
|
|
|
|
* @brief Whether or not the platform should default to modern theme.
|
|
|
|
|
* @param handle Handle
|
|
|
|
|
* @return whether to default.
|
|
|
|
|
*/
|
|
|
|
|
MWDECL MwBool (*MwLLDoModern)(MwLL handle);
|
|
|
|
|
|
2026-05-04 19:24:09 +09:00
|
|
|
MWDECL void (*MwLLRaise)(MwLL handle);
|
|
|
|
|
|
2026-05-07 18:30:24 +09:00
|
|
|
MWDECL void (*MwLLClip)(MwLL handle, MwRect* rect);
|
|
|
|
|
|
2026-03-08 07:06:12 +09:00
|
|
|
/* font renderer */
|
|
|
|
|
MWDECL void MwFLSetup(void);
|
2026-03-04 13:59:28 -06:00
|
|
|
|
|
|
|
|
#ifdef USE_FREETYPE2
|
2026-07-19 20:37:04 +09:00
|
|
|
MWDECL int MwFL_FT2Setup(void);
|
2026-03-04 13:59:28 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef USE_STB_TRUETYPE
|
2026-03-08 07:06:12 +09:00
|
|
|
MWDECL int MwFL_STBTTSetup(void);
|
2026-03-04 13:59:28 -06:00
|
|
|
#endif
|
2026-07-19 14:16:14 -07:00
|
|
|
|
2026-07-19 20:37:04 +09:00
|
|
|
#ifdef USE_GDI_TEXT
|
|
|
|
|
MWDECL int MwFL_GDISetup(void);
|
2026-07-18 11:39:52 +09:00
|
|
|
#endif
|
2026-03-04 13:59:28 -06:00
|
|
|
|
2026-04-06 17:29:09 +09:00
|
|
|
MWDECL int (*MwFLDrawText)(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, MwLLColor color);
|
|
|
|
|
MWDECL int (*MwFLTextWidth)(MwFLFont ttf, const char* text);
|
|
|
|
|
MWDECL int (*MwFLTextHeight)(MwFLFont ttf, int count);
|
2026-07-19 20:37:04 +09:00
|
|
|
MWDECL int (*MwFLTextHeightWithText)(MwFLFont ttf, const char* text);
|
2026-04-06 23:27:27 +09:00
|
|
|
MWDECL void* (*MwFLFontLoad)(unsigned char* data, unsigned int size, int px);
|
2026-03-04 13:59:28 -06:00
|
|
|
MWDECL void (*MwFLFontFree)(void* handle);
|
|
|
|
|
|
2025-09-29 00:19:49 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-09-29 00:06:16 +00:00
|
|
|
#endif
|