diff --git a/GNUmakefile b/GNUmakefile index e0f41a6..869d80b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,6 +9,7 @@ LIBS = L_OBJS = src/ds.o src/core.o src/default.o src/draw.o L_OBJS += src/window.o src/button.o +L_LIBS = -lfreetype ifeq ($(TARGET),NetBSD) CFLAGS += -I/usr/X11R7/include -I/usr/pkg/include @@ -16,6 +17,8 @@ LDFLAGS += -L/usr/X11R7/lib -L/usr/pkg/lib -Wl,-R/usr/X11R7/lib -Wl,-R/usr/pkg/l UNIX = 1 else ifeq ($(TARGET),Linux) UNIX = 1 +else ifeq ($(TARGET),Windows) +WINDOWS = 1 else $(error Add your platform definition) endif @@ -26,6 +29,12 @@ LIB = lib SO = .so L_OBJS += src/x11.o L_LIBS += -lX11 +else ifeq ($(WINDOWS),1) +CFLAGS += -DUSE_GDI +LIB = +SO = .dll +L_OBJS += src/gdi.o +L_LIBS += -lgdi32 endif .PHONY: all format clean diff --git a/include/Milsko/GDI.h b/include/Milsko/GDI.h new file mode 100644 index 0000000..5d55a86 --- /dev/null +++ b/include/Milsko/GDI.h @@ -0,0 +1,25 @@ +/* $Id$ */ +#ifndef __MILSKO_X11_H__ +#define __MILSKO_X11_H__ + +typedef struct _MilskoLowLevel* MilskoLL; +typedef struct _MilskoColor* MilskoLLColor; + +#include +#include + +#include + +typedef struct _MilskoLowLevel { + void* user; + + void (*draw)(MilskoLL handle); +}* MilskoLL; + +typedef struct _MilskoColor { + int red; + int green; + int blue; +}* MilskoLLColor; + +#endif diff --git a/include/Milsko/MachDep.h b/include/Milsko/MachDep.h index 406d95b..2b88ea9 100644 --- a/include/Milsko/MachDep.h +++ b/include/Milsko/MachDep.h @@ -12,9 +12,9 @@ #endif #if defined(_MILSKO) && defined(_WIN32) -#define MILSKODECL extern __declsped(dllexport) +#define MILSKODECL extern __declspec(dllexport) #elif defined(_WIN32) -#define MILSKODECL extern __declsped(dllimport) +#define MILSKODECL extern __declspec(dllimport) #else #define MILSKODECL extern #endif diff --git a/src/button.c b/src/button.c index 1289dad..77faa54 100644 --- a/src/button.c +++ b/src/button.c @@ -14,6 +14,7 @@ static void draw(MilskoWidget handle) { r.height = MilskoGetInteger(handle, MilskoNheight); MilskoDrawFrame(handle, &r, MilskoParseColor(handle, MilskoGetText(handle, MilskoNbackground)), 0); + MilskoDrawRect(handle, &r, MilskoParseColor(handle, MilskoGetText(handle, MilskoNbackground))); } diff --git a/src/draw.c b/src/draw.c index 162235e..126aa74 100644 --- a/src/draw.c +++ b/src/draw.c @@ -63,7 +63,7 @@ void MilskoDrawRect(MilskoWidget handle, MilskoRect* rect, MilskoLLColor color) void MilskoDrawFrame(MilskoWidget handle, MilskoRect* rect, MilskoLLColor color, int invert) { MilskoPoint p[6]; const int diff = 128; - const int border = 4; + const int border = 2; MilskoLLColor darker = MilskoLLAllocColor(handle->lowlevel, color->red - diff, color->green - diff, color->blue - diff); MilskoLLColor lighter = MilskoLLAllocColor(handle->lowlevel, color->red + diff, color->green + diff, color->blue + diff); diff --git a/src/gdi.c b/src/gdi.c new file mode 100644 index 0000000..af9b01a --- /dev/null +++ b/src/gdi.c @@ -0,0 +1,2 @@ +/* $Id$ */ +#include