milsko/include/Mw/TypeDefs.h

246 lines
5 KiB
C
Raw Normal View History

/*!
* @file Mw/TypeDefs.h
* @brief Type definitions
*/
#ifndef __MW_TYPEDEFS_H__
#define __MW_TYPEDEFS_H__
#include <Mw/MachDep.h>
#include <Mw/BaseTypes.h>
typedef struct _MwClass * MwClass, MwClassRec;
typedef struct _MwIntegerKeyValue MwIntegerKeyValue;
typedef struct _MwTextKeyValue MwTextKeyValue;
typedef struct _MwUserHandlerArray MwUserHandlerArray;
typedef struct _MwUserHandlerKeyValue MwUserHandlerKeyValue;
typedef struct _MwVoidKeyValue MwVoidKeyValue;
typedef struct _MwMenu* MwMenu;
typedef struct _MwEntry* MwEntry;
typedef struct _MwViewport* MwViewport;
typedef struct _MwListBox* MwListBox;
typedef struct _MwComboBox* MwComboBox;
typedef struct _MwTreeView* MwTreeView;
2025-12-21 14:38:07 +09:00
typedef struct _MwScrollBar* MwScrollBar;
typedef struct _MwLabel* MwLabel;
typedef struct _MwLabelSegment MwLabelSegment;
typedef struct _MwListBoxEntry MwListBoxEntry;
typedef struct _MwTreeViewEntry MwTreeViewEntry;
typedef struct _MwDirectoryEntry MwDirectoryEntry;
2026-03-29 09:42:34 +09:00
typedef struct _MwBox* MwBox;
2026-04-30 14:28:56 +09:00
typedef struct _MwSubWindow* MwSubWindow;
2026-04-17 01:36:34 +09:00
typedef struct _MwMouse MwMouse;
#ifdef _MILSKO
typedef struct _MwWidget* MwWidget;
#else
typedef void* MwWidget;
#endif
typedef void (*MwHandler)(MwWidget handle);
typedef int (*MwHandlerWithStatus)(MwWidget handle);
2026-04-20 16:22:06 +09:00
typedef void (*MwHandlerProps)(MwWidget handle, char** key);
typedef void (*MwHandlerProp)(MwWidget handle, const char* key);
2025-12-15 14:09:30 +09:00
typedef void (*MwHandlerChildrenProp)(MwWidget handle, MwWidget child, const char* key);
typedef void (*MwHandlerKey)(MwWidget handle, int key);
typedef void (*MwHandlerMouse)(MwWidget handle, void* ptr);
2025-12-15 14:09:30 +09:00
typedef void (*MwHandlerExecute)(MwWidget handle, const char* name, void* out, va_list args);
2025-12-31 04:29:04 +09:00
typedef void (*MwHandlerClipboardReceived)(MwWidget handle, const char* data);
2025-12-15 14:09:30 +09:00
typedef void(MWAPI* MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
typedef void(MWAPI* MwErrorHandler)(int code, const char* message, void* user_data);
struct _MwTextKeyValue {
char* key;
char* value;
};
struct _MwIntegerKeyValue {
char* key;
int value;
};
struct _MwUserHandlerArray {
void* user_data;
MwUserHandler handler;
};
struct _MwUserHandlerKeyValue {
char* key;
MwUserHandlerArray* value;
};
struct _MwVoidKeyValue {
char* key;
void* value;
};
#include <Mw/LowLevel.h>
#ifdef _MILSKO
struct _MwWidget {
char* name;
MwLLColor bgcolor;
MwLL lowlevel;
MwWidget parent;
MwWidget* children;
MwClass widget_class;
int pressed;
MwPoint mouse_point;
int close;
int prop_event;
void* internal;
void* opaque;
2026-04-26 23:08:52 +09:00
void* user;
void (*draw_inject)(MwWidget handle);
void (*destroy_inject)(MwWidget handle);
MwIntegerKeyValue* integer;
MwTextKeyValue* text;
MwUserHandlerKeyValue* handler;
MwVoidKeyValue* data;
MwWidget* destroy_queue;
MwWidget* tick_list;
int destroyed;
2026-01-15 05:16:14 +09:00
void* root_font;
void* root_boldfont;
2026-04-06 17:29:09 +09:00
void* root_monofont;
void* root_boldmonofont;
2026-01-23 15:29:32 +09:00
2026-04-07 22:42:19 +09:00
int top_step;
MwWidget* draw_queue;
2026-01-23 15:29:32 +09:00
int berserk;
};
#endif
struct _MwMenu {
char* name;
int keep;
MwWidget wsub;
MwMenu* sub;
2025-12-23 22:11:22 +09:00
void* opaque;
};
struct _MwEntry {
int cursor;
int right;
int length;
MwPoint mouse;
};
struct _MwViewport {
MwWidget vscroll;
MwWidget hscroll;
MwWidget frame;
MwWidget inframe;
int vchanged;
int hchanged;
};
struct _MwListBoxEntry {
char** name;
MwLLPixmap pixmap;
};
struct _MwListBox {
MwWidget vscroll;
MwWidget frame;
MwListBoxEntry* list;
unsigned long click_time;
int pressed;
int* width;
int* alignment;
int changed;
};
struct _MwComboBox {
char** list;
int opened;
MwWidget listbox;
};
struct _MwTreeViewEntry {
char* label;
MwLLPixmap pixmap;
MwTreeViewEntry** tree;
int opened;
int selected;
unsigned long click_time;
MwTreeViewEntry* parent;
};
struct _MwTreeView {
MwWidget frame;
MwWidget vscroll;
int changed;
MwTreeViewEntry** tree;
MwPoint pressed;
};
2025-12-21 14:38:07 +09:00
struct _MwScrollBar {
MwPoint point;
int drag;
int pos;
};
struct _MwLabel {
MwLabelSegment* segment;
};
struct _MwLabelSegment {
int key;
unsigned char value;
};
struct _MwDirectoryEntry {
char* name;
int type;
MwOffset size;
time_t mtime;
};
2026-03-27 16:41:32 +09:00
struct _MwBox {
int layout;
};
2026-04-30 14:28:56 +09:00
struct _MwSubWindow {
MwWidget frame;
MwWidget minimize;
MwWidget maximize;
MwWidget close;
};
2026-04-17 01:36:34 +09:00
struct _MwMouse {
MwPoint point;
int button;
};
struct _MwClass {
2025-12-31 04:29:27 +09:00
MwHandlerWithStatus create;
MwHandler destroy;
MwHandler draw;
MwHandler click;
MwHandler parent_resize;
MwHandlerProp prop_change;
MwHandler mouse_move;
MwHandlerMouse mouse_up;
MwHandlerMouse mouse_down;
MwHandlerKey key;
MwHandlerExecute execute;
MwHandler tick;
MwHandler resize;
MwHandler children_update;
MwHandlerChildrenProp children_prop_change;
2025-12-31 04:35:10 +09:00
MwHandlerClipboardReceived clipboard;
2026-04-20 15:51:51 +09:00
MwHandlerProps props_change;
2025-12-31 04:29:27 +09:00
void* reserved1;
void* reserved2;
void* reserved3;
};
#endif