mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-31 14:40:49 +00:00
better api for mouse
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@269 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -33,10 +33,10 @@
|
||||
* %brief Dispatches the handler of widget class
|
||||
* %param x Widget
|
||||
* %param y Handler name
|
||||
* %param name Property name
|
||||
* %param z Argument
|
||||
*/
|
||||
#define MwDispatch3(x, y, name) \
|
||||
if(x->widget_class != NULL && x->widget_class->y != NULL) x->widget_class->y(x, name)
|
||||
#define MwDispatch3(x, y, z) \
|
||||
if(x->widget_class != NULL && x->widget_class->y != NULL) x->widget_class->y(x, z)
|
||||
|
||||
#define MwWaitMS 5
|
||||
|
||||
@@ -224,6 +224,13 @@ MWDECL void MwGetBeforeStep(MwWidget handle, jmp_buf* jmpbuf);
|
||||
*/
|
||||
MWDECL void MwForceRender(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* %brief Forcefully makes widget render
|
||||
* %param handle Widget
|
||||
* %param ptr Ignored
|
||||
*/
|
||||
MWDECL void MwForceRender2(MwWidget handle, void* ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
typedef struct _MwLLHandler* MwLLHandler;
|
||||
typedef struct _MwLLMouse MwLLMouse;
|
||||
#ifdef _MILSKO
|
||||
typedef struct _MwLL* MwLL;
|
||||
typedef struct _MwLLColor* MwLLColor;
|
||||
@@ -44,6 +45,17 @@ enum MwLLKey {
|
||||
MwLLKeyDown
|
||||
};
|
||||
|
||||
enum MwLLMouse {
|
||||
MwLLMouseLeft = 1,
|
||||
MwLLMouseMiddle = 2,
|
||||
MwLLMouseRight = 3,
|
||||
};
|
||||
|
||||
struct _MwLLMouse {
|
||||
MwPoint point;
|
||||
int button;
|
||||
};
|
||||
|
||||
struct _MwLLHandler {
|
||||
void (*draw)(MwLL handle, void* data);
|
||||
void (*up)(MwLL handle, void* data);
|
||||
|
||||
@@ -29,6 +29,7 @@ typedef void (*MwHandler)(MwWidget handle);
|
||||
typedef int (*MwHandler2)(MwWidget handle);
|
||||
typedef void (*MwHandler3)(MwWidget handle, const char* key);
|
||||
typedef void (*MwHandler4)(MwWidget handle, int key);
|
||||
typedef void (*MwHandler5)(MwWidget handle, void* ptr);
|
||||
typedef void (*MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
||||
typedef void (*MwErrorHandler)(int code, const char* message, void* user_data);
|
||||
|
||||
@@ -133,8 +134,8 @@ struct _MwClass {
|
||||
MwHandler parent_resize;
|
||||
MwHandler3 prop_change;
|
||||
MwHandler mouse_move;
|
||||
MwHandler mouse_up;
|
||||
MwHandler mouse_down;
|
||||
MwHandler5 mouse_up;
|
||||
MwHandler5 mouse_down;
|
||||
MwHandler4 key;
|
||||
void* reserved1;
|
||||
void* reserved2;
|
||||
|
||||
Reference in New Issue
Block a user