git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@19 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-09-28 09:50:28 +00:00
parent 6c44baff6c
commit 9f96056a1a
8 changed files with 83 additions and 63 deletions

View File

@@ -5,17 +5,17 @@
#include <Milsko/MachDep.h>
#include <Milsko/TypeDefs.h>
MILSKODECL HMILSKO MilskoCreateWidget(MilskoClass class, HMILSKO parent, int x, int y, unsigned int width, unsigned int height);
MILSKODECL void MilskoDestroyWidget(HMILSKO handle);
MILSKODECL MilskoWidget MilskoCreateWidget(MilskoClass class, MilskoWidget parent, int x, int y, unsigned int width, unsigned int height);
MILSKODECL void MilskoDestroyWidget(MilskoWidget handle);
MILSKODECL void MilskoLoop(HMILSKO handle);
MILSKODECL void MilskoStep(HMILSKO handle);
MILSKODECL int MilskoPending(HMILSKO handle);
MILSKODECL void MilskoLoop(MilskoWidget handle);
MILSKODECL void MilskoStep(MilskoWidget handle);
MILSKODECL int MilskoPending(MilskoWidget handle);
MILSKODECL void MilskoSetInteger(HMILSKO handle, const char* key, int n);
MILSKODECL void MilskoSetText(HMILSKO handle, const char* key, const char* value);
MILSKODECL int MilskoGetInteger(HMILSKO handle, const char* key);
MILSKODECL const char* MilskoGetText(HMILSKO handle, const char* key);
MILSKODECL void MilskoApply(HMILSKO handle, ...);
MILSKODECL void MilskoSetInteger(MilskoWidget handle, const char* key, int n);
MILSKODECL void MilskoSetText(MilskoWidget handle, const char* key, const char* value);
MILSKODECL int MilskoGetInteger(MilskoWidget handle, const char* key);
MILSKODECL const char* MilskoGetText(MilskoWidget handle, const char* key);
MILSKODECL void MilskoApply(MilskoWidget handle, ...);
#endif

View File

@@ -10,23 +10,23 @@
#include <Milsko/GDI.h>
#endif
#else
typedef void* HMILSKOLL;
typedef void* HMILSKOCOLOR;
typedef void* MilskoLL;
typedef void* MilskoLLColor;
#endif
#include <Milsko/MachDep.h>
#include <Milsko/TypeDefs.h>
MILSKODECL HMILSKOLL MilskoLLCreate(HMILSKOLL parent, int x, int y, int width, int height);
MILSKODECL void MilskoLLDestroy(HMILSKOLL handle);
MILSKODECL void MilskoLLPolygon(HMILSKOLL handle, MilskoPoint* points, int points_count, HMILSKOCOLOR color);
MILSKODECL HMILSKOCOLOR MilskoLLAllocColor(HMILSKOLL handle, int r, int g, int b);
MILSKODECL void MilskoLLGetXYWH(HMILSKOLL handle, int* x, int* y, unsigned int* w, unsigned int* h);
MILSKODECL void MilskoLLSetXY(HMILSKOLL handle, int x, int y);
MILSKODECL void MilskoLLSetWH(HMILSKOLL handle, int w, int h);
MILSKODECL void MilskoLLSetTitle(HMILSKOLL handle, const char* title);
MILSKODECL int MilskoLLPending(HMILSKOLL handle);
MILSKODECL void MilskoLLNextEvent(HMILSKOLL handle);
MILSKODECL void MilskoLLSleep(int ms);
MILSKODECL MilskoLL MilskoLLCreate(MilskoLL parent, int x, int y, int width, int height);
MILSKODECL void MilskoLLDestroy(MilskoLL handle);
MILSKODECL void MilskoLLPolygon(MilskoLL handle, MilskoPoint* points, int points_count, MilskoLLColor color);
MILSKODECL MilskoLLColor MilskoLLAllocColor(MilskoLL handle, int r, int g, int b);
MILSKODECL void MilskoLLGetXYWH(MilskoLL handle, int* x, int* y, unsigned int* w, unsigned int* h);
MILSKODECL void MilskoLLSetXY(MilskoLL handle, int x, int y);
MILSKODECL void MilskoLLSetWH(MilskoLL handle, int w, int h);
MILSKODECL void MilskoLLSetTitle(MilskoLL handle, const char* title);
MILSKODECL int MilskoLLPending(MilskoLL handle);
MILSKODECL void MilskoLLNextEvent(MilskoLL handle);
MILSKODECL void MilskoLLSleep(int ms);
#endif

View File

@@ -31,27 +31,29 @@ typedef struct _MilskoClass* MilskoClass;
#ifdef _MILSKO
#include <Milsko/LowLevel.h>
typedef struct _Milsko* HMILSKO;
typedef struct _Milsko* MilskoWidget;
typedef struct _Milsko {
HMILSKOLL lowlevel;
HMILSKO parent;
HMILSKO* children;
MilskoLL lowlevel;
MilskoWidget parent;
MilskoWidget* children;
MilskoClass class;
MilskoTextKeyValue* text;
MilskoIntegerKeyValue* integer;
}* HMILSKO;
}* MilskoWidget;
#else
typedef void* HMILSKO;
typedef void* MilskoWidget;
#endif
typedef void (*MilskoHandler)(MilskoWidget handle);
typedef struct _MilskoClass {
void* opaque;
void (*create)(HMILSKO handle);
void (*destroy)(HMILSKO handle);
void (*draw)(HMILSKO handle);
void (*click)(HMILSKO handle);
void* opaque;
MilskoHandler create;
MilskoHandler destroy;
MilskoHandler draw;
MilskoHandler click;
} *MilskoClass, MilskoClassRec;
#endif

View File

@@ -2,7 +2,11 @@
#ifndef __MILSKO_X11_H__
#define __MILSKO_X11_H__
typedef struct _MilskoLowLevel* MilskoLL;
typedef struct _MilskoColor* MilskoLLColor;
#include <Milsko/MachDep.h>
#include <Milsko/TypeDefs.h>
#include <X11/X.h>
#include <X11/Xutil.h>
@@ -16,10 +20,13 @@ typedef struct _MilskoLowLevel {
int y;
unsigned int width;
unsigned int height;
}* HMILSKOLL;
void* user;
void (*draw)(MilskoLL handle);
}* MilskoLL;
typedef struct _MilskoColor {
unsigned long pixel;
}* HMILSKOCOLOR;
}* MilskoLLColor;
#endif