2025-09-28 02:51:15 +00:00
|
|
|
/* $Id$ */
|
2025-09-29 00:06:16 +00:00
|
|
|
#ifndef __MW_TYPEDEFS_H__
|
|
|
|
|
#define __MW_TYPEDEFS_H__
|
2025-09-28 02:51:15 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
#include <Mw/MachDep.h>
|
2025-09-28 07:03:05 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
typedef struct _MwClass * MwClass, MwClassRec;
|
|
|
|
|
typedef struct _MwPoint MwPoint;
|
|
|
|
|
typedef struct _MwRect MwRect;
|
|
|
|
|
typedef struct _MwIntegerKeyValue MwIntegerKeyValue;
|
|
|
|
|
typedef struct _MwTextKeyValue MwTextKeyValue;
|
|
|
|
|
typedef struct _MwUserHandlerKeyValue MwUserHandlerKeyValue;
|
2025-09-29 00:07:42 +00:00
|
|
|
#ifdef _MILSKO
|
2025-09-29 00:04:04 +00:00
|
|
|
typedef struct _MwWidget *MwWidget, MwWidgetRec;
|
2025-09-28 21:55:50 +00:00
|
|
|
#else
|
2025-09-29 00:04:04 +00:00
|
|
|
typedef void* MwWidget;
|
2025-09-28 21:55:50 +00:00
|
|
|
#endif
|
2025-09-29 00:04:04 +00:00
|
|
|
typedef void (*MwHandler)(MwWidget handle);
|
|
|
|
|
typedef void (*MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
2025-09-28 21:55:50 +00:00
|
|
|
|
2025-09-29 00:07:42 +00:00
|
|
|
#ifdef _MILSKO
|
2025-09-29 00:04:04 +00:00
|
|
|
#include <Mw/LowLevel.h>
|
2025-09-28 21:55:50 +00:00
|
|
|
#endif
|
|
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwPoint {
|
2025-09-28 02:51:15 +00:00
|
|
|
int x;
|
|
|
|
|
int y;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 02:51:15 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwRect {
|
2025-09-28 09:27:28 +00:00
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
unsigned int width;
|
|
|
|
|
unsigned int height;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 09:27:28 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwTextKeyValue {
|
2025-09-28 09:14:57 +00:00
|
|
|
char* key;
|
|
|
|
|
char* value;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 09:14:57 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwIntegerKeyValue {
|
2025-09-28 09:14:57 +00:00
|
|
|
char* key;
|
|
|
|
|
int value;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 08:37:12 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwUserHandlerKeyValue {
|
2025-09-29 00:01:58 +00:00
|
|
|
char* key;
|
|
|
|
|
void* user_data;
|
2025-09-29 00:04:04 +00:00
|
|
|
MwUserHandler value;
|
2025-09-28 22:21:51 +00:00
|
|
|
};
|
|
|
|
|
|
2025-09-29 00:07:42 +00:00
|
|
|
#ifdef _MILSKO
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwWidget {
|
2025-09-28 10:06:00 +00:00
|
|
|
char* name;
|
|
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
MwLL lowlevel;
|
|
|
|
|
MwWidget parent;
|
|
|
|
|
MwWidget* children;
|
|
|
|
|
MwClass class;
|
2025-09-28 09:14:57 +00:00
|
|
|
|
2025-09-28 22:10:42 +00:00
|
|
|
int pressed;
|
|
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
MwIntegerKeyValue* integer;
|
|
|
|
|
MwTextKeyValue* text;
|
|
|
|
|
MwUserHandlerKeyValue* handler;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 08:37:12 +00:00
|
|
|
#endif
|
|
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwClass {
|
2025-09-28 09:50:28 +00:00
|
|
|
void* opaque;
|
2025-09-29 00:04:04 +00:00
|
|
|
MwHandler create;
|
|
|
|
|
MwHandler destroy;
|
|
|
|
|
MwHandler draw;
|
|
|
|
|
MwHandler click;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 08:37:12 +00:00
|
|
|
|
2025-09-28 02:51:15 +00:00
|
|
|
#endif
|