2025-09-28 02:51:15 +00:00
|
|
|
/* $Id$ */
|
2025-09-30 13:04:40 +00:00
|
|
|
/*!
|
|
|
|
|
* %file Mw/TypeDefs.h
|
|
|
|
|
* %brief Type definitions
|
|
|
|
|
*/
|
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:10:20 +00:00
|
|
|
typedef struct _MwClass * MwClass, MwClassRec;
|
|
|
|
|
typedef struct _MwPoint MwPoint;
|
|
|
|
|
typedef struct _MwRect MwRect;
|
|
|
|
|
typedef struct _MwIntegerKeyValue MwIntegerKeyValue;
|
|
|
|
|
typedef struct _MwTextKeyValue MwTextKeyValue;
|
2025-09-29 00:04:04 +00:00
|
|
|
typedef struct _MwUserHandlerKeyValue MwUserHandlerKeyValue;
|
2025-09-30 17:47:03 +00:00
|
|
|
typedef struct _MwVoidKeyValue MwVoidKeyValue;
|
2025-09-29 02:43:10 +00:00
|
|
|
typedef struct _MwFont MwFont;
|
2025-10-06 10:37:08 +00:00
|
|
|
typedef struct _MwCursor MwCursor;
|
2025-10-14 16:41:38 +00:00
|
|
|
typedef struct _MwMenu* MwMenu;
|
2025-10-10 06:08:19 +00:00
|
|
|
typedef struct _MwEntry* MwEntry;
|
2025-10-14 14:39:40 +00:00
|
|
|
typedef struct _MwViewport* MwViewport;
|
2025-10-14 16:41:38 +00:00
|
|
|
typedef struct _MwListBox* MwListBox;
|
2025-10-11 08:46:58 +00:00
|
|
|
typedef struct _MwSizeHints MwSizeHints;
|
2025-10-15 16:17:47 +00:00
|
|
|
typedef struct _MwDirectoryEntry MwDirectoryEntry;
|
2025-09-29 00:07:42 +00:00
|
|
|
#ifdef _MILSKO
|
2025-10-06 10:37:08 +00:00
|
|
|
typedef struct _MwWidget* MwWidget;
|
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);
|
2025-10-04 13:57:28 +00:00
|
|
|
typedef int (*MwHandler2)(MwWidget handle);
|
2025-10-08 15:42:57 +00:00
|
|
|
typedef void (*MwHandler3)(MwWidget handle, const char* key);
|
2025-10-08 18:03:46 +00:00
|
|
|
typedef void (*MwHandler4)(MwWidget handle, int key);
|
2025-10-11 13:01:41 +00:00
|
|
|
typedef void (*MwHandler5)(MwWidget handle, void* ptr);
|
2025-09-29 00:04:04 +00:00
|
|
|
typedef void (*MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
2025-09-30 03:08:26 +00:00
|
|
|
typedef void (*MwErrorHandler)(int code, const char* message, void* user_data);
|
2025-09-28 21:55:50 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
#include <Mw/LowLevel.h>
|
2025-09-28 21:55:50 +00:00
|
|
|
|
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:10:20 +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-30 17:47:03 +00:00
|
|
|
struct _MwVoidKeyValue {
|
|
|
|
|
char* key;
|
|
|
|
|
void* value;
|
|
|
|
|
};
|
|
|
|
|
|
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:10:20 +00:00
|
|
|
MwLL lowlevel;
|
2025-09-29 00:04:04 +00:00
|
|
|
MwWidget parent;
|
|
|
|
|
MwWidget* children;
|
2025-09-29 00:19:49 +00:00
|
|
|
MwClass widget_class;
|
2025-09-28 09:14:57 +00:00
|
|
|
|
2025-09-30 03:14:02 +00:00
|
|
|
int pressed;
|
2025-10-02 02:50:28 +00:00
|
|
|
MwPoint mouse_point;
|
2025-09-30 03:14:02 +00:00
|
|
|
int close;
|
|
|
|
|
jmp_buf before_step;
|
2025-10-08 15:42:57 +00:00
|
|
|
int prop_event;
|
2025-09-28 22:10:42 +00:00
|
|
|
|
2025-09-29 08:20:45 +00:00
|
|
|
void* internal;
|
2025-10-11 07:25:16 +00:00
|
|
|
void* opaque;
|
2025-10-14 16:41:38 +00:00
|
|
|
void (*draw_inject)(MwWidget handle);
|
2025-09-29 08:20:45 +00:00
|
|
|
|
2025-09-29 00:10:20 +00:00
|
|
|
MwIntegerKeyValue* integer;
|
|
|
|
|
MwTextKeyValue* text;
|
2025-09-29 00:04:04 +00:00
|
|
|
MwUserHandlerKeyValue* handler;
|
2025-09-30 17:47:03 +00:00
|
|
|
MwVoidKeyValue* data;
|
2025-10-05 01:51:38 +00:00
|
|
|
|
|
|
|
|
MwWidget* destroy_queue;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-10-06 10:37:08 +00:00
|
|
|
#endif
|
2025-10-02 02:17:27 +00:00
|
|
|
|
|
|
|
|
struct _MwMenu {
|
|
|
|
|
char* name;
|
2025-10-02 02:50:28 +00:00
|
|
|
int keep;
|
2025-10-02 02:17:27 +00:00
|
|
|
MwWidget wsub;
|
|
|
|
|
MwMenu* sub;
|
|
|
|
|
};
|
2025-10-06 10:37:08 +00:00
|
|
|
|
2025-10-10 06:08:19 +00:00
|
|
|
struct _MwEntry {
|
2025-10-10 13:49:35 +00:00
|
|
|
int cursor;
|
|
|
|
|
int right;
|
|
|
|
|
MwPoint mouse;
|
2025-10-10 06:08:19 +00:00
|
|
|
};
|
|
|
|
|
|
2025-10-14 14:39:40 +00:00
|
|
|
struct _MwViewport {
|
|
|
|
|
MwWidget vscroll;
|
|
|
|
|
MwWidget hscroll;
|
|
|
|
|
MwWidget frame;
|
|
|
|
|
MwWidget inframe;
|
|
|
|
|
};
|
|
|
|
|
|
2025-10-14 16:41:38 +00:00
|
|
|
struct _MwListBox {
|
2025-10-14 18:34:29 +00:00
|
|
|
MwWidget vscroll;
|
|
|
|
|
MwWidget frame;
|
|
|
|
|
char** list;
|
2025-10-16 10:33:12 +00:00
|
|
|
MwLLPixmap* pixmap_list;
|
2025-10-14 18:34:29 +00:00
|
|
|
int selected;
|
|
|
|
|
unsigned long click_time;
|
2025-10-15 10:32:40 +00:00
|
|
|
int pressed;
|
2025-10-14 16:41:38 +00:00
|
|
|
};
|
|
|
|
|
|
2025-10-11 08:46:58 +00:00
|
|
|
struct _MwSizeHints {
|
|
|
|
|
int min_width;
|
|
|
|
|
int min_height;
|
|
|
|
|
int max_width;
|
|
|
|
|
int max_height;
|
|
|
|
|
};
|
|
|
|
|
|
2025-10-15 16:17:47 +00:00
|
|
|
struct _MwDirectoryEntry {
|
2025-10-15 18:55:41 +00:00
|
|
|
char* name;
|
|
|
|
|
int type;
|
2025-10-15 16:17:47 +00:00
|
|
|
};
|
|
|
|
|
|
2025-10-06 10:37:08 +00:00
|
|
|
#define MwCursorDataHeight 16
|
|
|
|
|
struct _MwCursor {
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
unsigned int data[MwCursorDataHeight];
|
|
|
|
|
};
|
2025-09-28 08:37:12 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
struct _MwClass {
|
2025-10-04 13:57:28 +00:00
|
|
|
MwHandler2 create;
|
|
|
|
|
MwHandler destroy;
|
|
|
|
|
MwHandler draw;
|
|
|
|
|
MwHandler click;
|
|
|
|
|
MwHandler parent_resize;
|
2025-10-08 15:24:30 +00:00
|
|
|
MwHandler3 prop_change;
|
2025-10-04 19:22:47 +00:00
|
|
|
MwHandler mouse_move;
|
2025-10-11 13:01:41 +00:00
|
|
|
MwHandler5 mouse_up;
|
|
|
|
|
MwHandler5 mouse_down;
|
2025-10-08 18:03:46 +00:00
|
|
|
MwHandler4 key;
|
|
|
|
|
void* reserved1;
|
|
|
|
|
void* reserved2;
|
|
|
|
|
void* reserved3;
|
|
|
|
|
void* reserved4;
|
|
|
|
|
void* reserved5;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 08:37:12 +00:00
|
|
|
|
2025-09-29 02:43:01 +00:00
|
|
|
struct _MwFont {
|
2025-09-29 02:43:10 +00:00
|
|
|
int left;
|
|
|
|
|
int top;
|
2025-09-29 02:54:08 +00:00
|
|
|
unsigned char data[16];
|
2025-09-29 02:43:01 +00:00
|
|
|
};
|
|
|
|
|
|
2025-09-28 02:51:15 +00:00
|
|
|
#endif
|