mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-16 14:14:07 +00:00
things
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@36 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
#ifndef __MILSKO_BUTTON_H__
|
||||
#define __MILSKO_BUTTON_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
MILSKODECL MilskoClass MilskoButtonClass;
|
||||
MILSKODECL MwClass MwButtonClass;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,30 +2,30 @@
|
||||
#ifndef __MILSKO_CORE_H__
|
||||
#define __MILSKO_CORE_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Milsko/TypeDefs.h>
|
||||
#include <Mw/MachDep.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
|
||||
#define MilskoDispatch(x, y) \
|
||||
#define MwDispatch(x, y) \
|
||||
if(x->class != NULL && x->class->y != NULL) x->class->y(x)
|
||||
|
||||
MILSKODECL MilskoWidget MilskoCreateWidget(MilskoClass class, const char* name, MilskoWidget parent, int x, int y, unsigned int width, unsigned int height);
|
||||
MILSKODECL MilskoWidget MilskoVaCreateWidget(MilskoClass class, const char* name, MilskoWidget parent, int x, int y, unsigned int width, unsigned int height, ...);
|
||||
MILSKODECL MilskoWidget MilskoVaListCreateWidget(MilskoClass class, const char* name, MilskoWidget parent, int x, int y, unsigned int width, unsigned int height, va_list va);
|
||||
MILSKODECL void MilskoDestroyWidget(MilskoWidget handle);
|
||||
MILSKODECL MwWidget MwCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height);
|
||||
MILSKODECL MwWidget MwVaCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, ...);
|
||||
MILSKODECL MwWidget MwVaListCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, va_list va);
|
||||
MILSKODECL void MwDestroyWidget(MwWidget handle);
|
||||
|
||||
MILSKODECL void MilskoLoop(MilskoWidget handle);
|
||||
MILSKODECL void MilskoStep(MilskoWidget handle);
|
||||
MILSKODECL int MilskoPending(MilskoWidget handle);
|
||||
MILSKODECL void MwLoop(MwWidget handle);
|
||||
MILSKODECL void MwStep(MwWidget handle);
|
||||
MILSKODECL int MwPending(MwWidget 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 MilskoSetDefault(MilskoWidget handle);
|
||||
MILSKODECL void MilskoVaApply(MilskoWidget handle, ...);
|
||||
MILSKODECL void MilskoVaListApply(MilskoWidget handle, va_list va);
|
||||
MILSKODECL void MwSetInteger(MwWidget handle, const char* key, int n);
|
||||
MILSKODECL void MwSetText(MwWidget handle, const char* key, const char* value);
|
||||
MILSKODECL int MwGetInteger(MwWidget handle, const char* key);
|
||||
MILSKODECL const char* MwGetText(MwWidget handle, const char* key);
|
||||
MILSKODECL void MwSetDefault(MwWidget handle);
|
||||
MILSKODECL void MwVaApply(MwWidget handle, ...);
|
||||
MILSKODECL void MwVaListApply(MwWidget handle, va_list va);
|
||||
|
||||
MILSKODECL void MilskoAddUserHandler(MilskoWidget handle, const char* key, MilskoUserHandler handler, void* user_data);
|
||||
MILSKODECL void MilskoDispatchUserHandler(MilskoWidget handle, const char* key, void* handler_data);
|
||||
MILSKODECL void MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler handler, void* user_data);
|
||||
MILSKODECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#ifndef __MILSKO_DEFAULT_H__
|
||||
#define __MILSKO_DEFAULT_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
MILSKODECL const char* MilskoDefaultBackground;
|
||||
MILSKODECL const char* MwDefaultBackground;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#ifndef __MILSKO_DRAW_H__
|
||||
#define __MILSKO_DRAW_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Milsko/TypeDefs.h>
|
||||
#include <Milsko/LowLevel.h>
|
||||
#include <Mw/MachDep.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
#include <Mw/LowLevel.h>
|
||||
|
||||
MILSKODECL MilskoLLColor MilskoParseColor(MilskoWidget handle, const char* text);
|
||||
MILSKODECL MwLLColor MwParseColor(MwWidget handle, const char* text);
|
||||
|
||||
MILSKODECL void MilskoDrawRect(MilskoWidget handle, MilskoRect* rect, MilskoLLColor color);
|
||||
MILSKODECL void MilskoDrawFrame(MilskoWidget handle, MilskoRect* rect, MilskoLLColor color, int invert);
|
||||
MILSKODECL void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||
MILSKODECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
#ifndef __MILSKO_GDI_H__
|
||||
#define __MILSKO_GDI_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
typedef struct _MilskoLL * MilskoLL, MilskoLLRec;
|
||||
typedef struct _MilskoLLColor *MilskoLLColor, MilskoLLColorRec;
|
||||
typedef struct _MwLL * MwLL, MwLLRec;
|
||||
typedef struct _MwLLColor *MwLLColor, MwLLColorRec;
|
||||
|
||||
#include <Milsko/TypeDefs.h>
|
||||
#include <Milsko/LowLevel.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
#include <Mw/LowLevel.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
struct _MilskoLL {
|
||||
struct _MwLL {
|
||||
void* user;
|
||||
|
||||
MilskoLLHandler handler;
|
||||
MwLLHandler handler;
|
||||
};
|
||||
|
||||
struct _MilskoColor {
|
||||
struct _MwColor {
|
||||
int red;
|
||||
int green;
|
||||
int blue;
|
||||
|
||||
@@ -2,57 +2,57 @@
|
||||
#ifndef __MILSKO_LOWLEVEL_H__
|
||||
#define __MILSKO_LOWLEVEL_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
typedef struct _MilskoLLHandler *MilskoLLHandler, MilskoLLHandlerRec;
|
||||
typedef struct _MwLLHandler *MwLLHandler, MwLLHandlerRec;
|
||||
#ifdef _MILSKO
|
||||
typedef struct _MilskoLL * MilskoLL, MilskoLLRec;
|
||||
typedef struct _MilskoLLColor *MilskoLLColor, MilskoLLColorRec;
|
||||
typedef struct _MwLL * MwLL, MwLLRec;
|
||||
typedef struct _MwLLColor *MwLLColor, MwLLColorRec;
|
||||
#else
|
||||
typedef void* MilskoLL;
|
||||
typedef void* MilskoLLColor;
|
||||
typedef void* MwLL;
|
||||
typedef void* MwLLColor;
|
||||
#endif
|
||||
|
||||
#ifdef _MILSKO
|
||||
#ifdef USE_X11
|
||||
#include <Milsko/X11.h>
|
||||
#include <Mw/X11.h>
|
||||
#endif
|
||||
#ifdef USE_GDI
|
||||
#include <Milsko/GDI.h>
|
||||
#include <Mw/GDI.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <Milsko/TypeDefs.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
|
||||
#define MilskoLLDispatch(x, y) \
|
||||
#define MwLLDispatch(x, y) \
|
||||
if(x->handler != NULL && x->handler->y != NULL) x->handler->y(x)
|
||||
|
||||
struct _MilskoLLHandler {
|
||||
void (*draw)(MilskoLL handle);
|
||||
void (*up)(MilskoLL handle);
|
||||
void (*down)(MilskoLL handle);
|
||||
struct _MwLLHandler {
|
||||
void (*draw)(MwLL handle);
|
||||
void (*up)(MwLL handle);
|
||||
void (*down)(MwLL handle);
|
||||
};
|
||||
|
||||
/* lowlevel.c, common part */
|
||||
MILSKODECL void MilskoLLCreateCommon(MilskoLL handle);
|
||||
MILSKODECL void MilskoLLDestroyCommon(MilskoLL handle);
|
||||
MILSKODECL void MwLLCreateCommon(MwLL handle);
|
||||
MILSKODECL void MwLLDestroyCommon(MwLL handle);
|
||||
|
||||
/* driver-specific */
|
||||
MILSKODECL MilskoLL MilskoLLCreate(MilskoLL parent, int x, int y, int width, int height);
|
||||
MILSKODECL void MilskoLLDestroy(MilskoLL handle);
|
||||
MILSKODECL MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height);
|
||||
MILSKODECL void MwLLDestroy(MwLL handle);
|
||||
|
||||
MILSKODECL void MilskoLLPolygon(MilskoLL handle, MilskoPoint* points, int points_count, MilskoLLColor color);
|
||||
MILSKODECL void MwLLPolygon(MwLL handle, MwPoint* points, int points_count, MwLLColor color);
|
||||
|
||||
MILSKODECL MilskoLLColor MilskoLLAllocColor(MilskoLL handle, int r, int g, int b);
|
||||
MILSKODECL void MilskoLLFreeColor(MilskoLLColor color);
|
||||
MILSKODECL MwLLColor MwLLAllocColor(MwLL handle, int r, int g, int b);
|
||||
MILSKODECL void MwLLFreeColor(MwLLColor color);
|
||||
|
||||
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 MwLLGetXYWH(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h);
|
||||
MILSKODECL void MwLLSetXY(MwLL handle, int x, int y);
|
||||
MILSKODECL void MwLLSetWH(MwLL handle, int w, int h);
|
||||
|
||||
MILSKODECL void MilskoLLSetTitle(MilskoLL handle, const char* title);
|
||||
MILSKODECL void MwLLSetTitle(MwLL handle, const char* title);
|
||||
|
||||
MILSKODECL int MilskoLLPending(MilskoLL handle);
|
||||
MILSKODECL void MilskoLLNextEvent(MilskoLL handle);
|
||||
MILSKODECL void MilskoLLSleep(int ms);
|
||||
MILSKODECL int MwLLPending(MwLL handle);
|
||||
MILSKODECL void MwLLNextEvent(MwLL handle);
|
||||
MILSKODECL void MwLLSleep(int ms);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
#ifndef __MILSKO_MILSKO_H__
|
||||
#define __MILSKO_MILSKO_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Milsko/LowLevel.h>
|
||||
#include <Milsko/StringDefs.h>
|
||||
#include <Milsko/TypeDefs.h>
|
||||
#include <Milsko/Core.h>
|
||||
#include <Milsko/Default.h>
|
||||
#include <Milsko/Draw.h>
|
||||
#include <Mw/MachDep.h>
|
||||
#include <Mw/LowLevel.h>
|
||||
#include <Mw/StringDefs.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
#include <Mw/Core.h>
|
||||
#include <Mw/Default.h>
|
||||
#include <Mw/Draw.h>
|
||||
|
||||
#include <Milsko/Window.h>
|
||||
#include <Milsko/Button.h>
|
||||
#include <Mw/Window.h>
|
||||
#include <Mw/Button.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
#ifndef __MILSKO_STRINGDEFS_H__
|
||||
#define __MILSKO_STRINGDEFS_H__
|
||||
|
||||
#define MilskoNx "Ix"
|
||||
#define MilskoNy "Iy"
|
||||
#define MilskoNwidth "Iwidth"
|
||||
#define MilskoNheight "Iheight"
|
||||
#define MwNx "Ix"
|
||||
#define MwNy "Iy"
|
||||
#define MwNwidth "Iwidth"
|
||||
#define MwNheight "Iheight"
|
||||
|
||||
#define MilskoNtitle "Stitle"
|
||||
#define MilskoNbackground "Sbackground"
|
||||
#define MwNtitle "Stitle"
|
||||
#define MwNbackground "Sbackground"
|
||||
|
||||
#define MilskoNactivateHandler "Cactivate"
|
||||
#define MwNactivateHandler "Cactivate"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,77 +2,77 @@
|
||||
#ifndef __MILSKO_TYPEDEFS_H__
|
||||
#define __MILSKO_TYPEDEFS_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
typedef struct _MilskoClass * MilskoClass, MilskoClassRec;
|
||||
typedef struct _MilskoPoint MilskoPoint;
|
||||
typedef struct _MilskoRect MilskoRect;
|
||||
typedef struct _MilskoIntegerKeyValue MilskoIntegerKeyValue;
|
||||
typedef struct _MilskoTextKeyValue MilskoTextKeyValue;
|
||||
typedef struct _MilskoUserHandlerKeyValue MilskoUserHandlerKeyValue;
|
||||
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;
|
||||
#ifdef _MILSKO
|
||||
typedef struct _MilskoWidget *MilskoWidget, MilskoWidgetRec;
|
||||
typedef struct _MwWidget *MwWidget, MwWidgetRec;
|
||||
#else
|
||||
typedef void* MilskoWidget;
|
||||
typedef void* MwWidget;
|
||||
#endif
|
||||
typedef void (*MilskoHandler)(MilskoWidget handle);
|
||||
typedef void (*MilskoUserHandler)(MilskoWidget handle, void* user_data, void* call_data);
|
||||
typedef void (*MwHandler)(MwWidget handle);
|
||||
typedef void (*MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
||||
|
||||
#ifdef _MILSKO
|
||||
#include <Milsko/LowLevel.h>
|
||||
#include <Mw/LowLevel.h>
|
||||
#endif
|
||||
|
||||
struct _MilskoPoint {
|
||||
struct _MwPoint {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct _MilskoRect {
|
||||
struct _MwRect {
|
||||
int x;
|
||||
int y;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
};
|
||||
|
||||
struct _MilskoTextKeyValue {
|
||||
struct _MwTextKeyValue {
|
||||
char* key;
|
||||
char* value;
|
||||
};
|
||||
|
||||
struct _MilskoIntegerKeyValue {
|
||||
struct _MwIntegerKeyValue {
|
||||
char* key;
|
||||
int value;
|
||||
};
|
||||
|
||||
struct _MilskoUserHandlerKeyValue {
|
||||
struct _MwUserHandlerKeyValue {
|
||||
char* key;
|
||||
void* user_data;
|
||||
MilskoUserHandler value;
|
||||
MwUserHandler value;
|
||||
};
|
||||
|
||||
#ifdef _MILSKO
|
||||
struct _MilskoWidget {
|
||||
struct _MwWidget {
|
||||
char* name;
|
||||
|
||||
MilskoLL lowlevel;
|
||||
MilskoWidget parent;
|
||||
MilskoWidget* children;
|
||||
MilskoClass class;
|
||||
MwLL lowlevel;
|
||||
MwWidget parent;
|
||||
MwWidget* children;
|
||||
MwClass class;
|
||||
|
||||
int pressed;
|
||||
|
||||
MilskoIntegerKeyValue* integer;
|
||||
MilskoTextKeyValue* text;
|
||||
MilskoUserHandlerKeyValue* handler;
|
||||
MwIntegerKeyValue* integer;
|
||||
MwTextKeyValue* text;
|
||||
MwUserHandlerKeyValue* handler;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct _MilskoClass {
|
||||
struct _MwClass {
|
||||
void* opaque;
|
||||
MilskoHandler create;
|
||||
MilskoHandler destroy;
|
||||
MilskoHandler draw;
|
||||
MilskoHandler click;
|
||||
MwHandler create;
|
||||
MwHandler destroy;
|
||||
MwHandler draw;
|
||||
MwHandler click;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#ifndef __MILSKO_WINDOW_H__
|
||||
#define __MILSKO_WINDOW_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
MILSKODECL MilskoClass MilskoWindowClass;
|
||||
MILSKODECL MwClass MwWindowClass;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
#ifndef __MILSKO_X11_H__
|
||||
#define __MILSKO_X11_H__
|
||||
|
||||
#include <Milsko/MachDep.h>
|
||||
#include <Mw/MachDep.h>
|
||||
|
||||
typedef struct _MilskoLL * MilskoLL, MilskoLLRec;
|
||||
typedef struct _MilskoLLColor *MilskoLLColor, MilskoLLColorRec;
|
||||
typedef struct _MwLL * MwLL, MwLLRec;
|
||||
typedef struct _MwLLColor *MwLLColor, MwLLColorRec;
|
||||
|
||||
#include <Milsko/TypeDefs.h>
|
||||
#include <Milsko/LowLevel.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
#include <Mw/LowLevel.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
struct _MilskoLL {
|
||||
struct _MwLL {
|
||||
Display* display;
|
||||
Window window;
|
||||
GC gc;
|
||||
Colormap colormap;
|
||||
void* user;
|
||||
|
||||
MilskoLLHandler handler;
|
||||
MwLLHandler handler;
|
||||
};
|
||||
|
||||
struct _MilskoLLColor {
|
||||
struct _MwLLColor {
|
||||
unsigned long pixel;
|
||||
int red;
|
||||
int green;
|
||||
|
||||
Reference in New Issue
Block a user