diff --git a/example.c b/example.c index 73197bc..3db4bb6 100644 --- a/example.c +++ b/example.c @@ -1,6 +1,6 @@ /* $Id$ */ -#include +#include void handler(MwWidget handle, void* user_data, void* call_data){ printf("hello world!\n"); diff --git a/include/Mw/Core.h b/include/Mw/Core.h index 14abbb4..f9bc766 100644 --- a/include/Mw/Core.h +++ b/include/Mw/Core.h @@ -11,19 +11,19 @@ MWDECL MwWidget MwCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height); MWDECL MwWidget MwVaCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, ...); MWDECL MwWidget MwVaListCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, va_list va); -MWDECL void MwDestroyWidget(MwWidget handle); +MWDECL void MwDestroyWidget(MwWidget handle); MWDECL void MwLoop(MwWidget handle); MWDECL void MwStep(MwWidget handle); -MWDECL int MwPending(MwWidget handle); +MWDECL int MwPending(MwWidget handle); -MWDECL void MwSetInteger(MwWidget handle, const char* key, int n); -MWDECL void MwSetText(MwWidget handle, const char* key, const char* value); -MWDECL int MwGetInteger(MwWidget handle, const char* key); +MWDECL void MwSetInteger(MwWidget handle, const char* key, int n); +MWDECL void MwSetText(MwWidget handle, const char* key, const char* value); +MWDECL int MwGetInteger(MwWidget handle, const char* key); MWDECL const char* MwGetText(MwWidget handle, const char* key); -MWDECL void MwSetDefault(MwWidget handle); -MWDECL void MwVaApply(MwWidget handle, ...); -MWDECL void MwVaListApply(MwWidget handle, va_list va); +MWDECL void MwSetDefault(MwWidget handle); +MWDECL void MwVaApply(MwWidget handle, ...); +MWDECL void MwVaListApply(MwWidget handle, va_list va); MWDECL void MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler handler, void* user_data); MWDECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data); diff --git a/include/Mw/GDI.h b/include/Mw/GDI.h index d3b0e9f..28bb4b7 100644 --- a/include/Mw/GDI.h +++ b/include/Mw/GDI.h @@ -4,7 +4,7 @@ #include -typedef struct _MwLL * MwLL, MwLLRec; +typedef struct _MwLL * MwLL, MwLLRec; typedef struct _MwLLColor *MwLLColor, MwLLColorRec; #include diff --git a/include/Mw/LowLevel.h b/include/Mw/LowLevel.h index e460df5..10be0eb 100644 --- a/include/Mw/LowLevel.h +++ b/include/Mw/LowLevel.h @@ -6,7 +6,7 @@ typedef struct _MwLLHandler *MwLLHandler, MwLLHandlerRec; #ifdef _MILSKO -typedef struct _MwLL * MwLL, MwLLRec; +typedef struct _MwLL * MwLL, MwLLRec; typedef struct _MwLLColor *MwLLColor, MwLLColorRec; #else typedef void* MwLL; @@ -38,12 +38,12 @@ MWDECL void MwLLDestroyCommon(MwLL handle); /* driver-specific */ MWDECL MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height); -MWDECL void MwLLDestroy(MwLL handle); +MWDECL void MwLLDestroy(MwLL handle); MWDECL void MwLLPolygon(MwLL handle, MwPoint* points, int points_count, MwLLColor color); MWDECL MwLLColor MwLLAllocColor(MwLL handle, int r, int g, int b); -MWDECL void MwLLFreeColor(MwLLColor color); +MWDECL void MwLLFreeColor(MwLLColor color); MWDECL void MwLLGetXYWH(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h); MWDECL void MwLLSetXY(MwLL handle, int x, int y); @@ -51,7 +51,7 @@ MWDECL void MwLLSetWH(MwLL handle, int w, int h); MWDECL void MwLLSetTitle(MwLL handle, const char* title); -MWDECL int MwLLPending(MwLL handle); +MWDECL int MwLLPending(MwLL handle); MWDECL void MwLLNextEvent(MwLL handle); MWDECL void MwLLSleep(int ms); diff --git a/include/Mw/Mw.h b/include/Mw/Milsko.h similarity index 82% rename from include/Mw/Mw.h rename to include/Mw/Milsko.h index 7866327..2b6eafa 100644 --- a/include/Mw/Mw.h +++ b/include/Mw/Milsko.h @@ -1,6 +1,6 @@ /* $Id$ */ -#ifndef __MW_MW_H__ -#define __MW_MW_H__ +#ifndef __MW_MILSKO_H__ +#define __MW_MILSKO_H__ #include #include diff --git a/include/Mw/TypeDefs.h b/include/Mw/TypeDefs.h index 67252c2..0e149c5 100644 --- a/include/Mw/TypeDefs.h +++ b/include/Mw/TypeDefs.h @@ -4,11 +4,11 @@ #include -typedef struct _MwClass * MwClass, MwClassRec; -typedef struct _MwPoint MwPoint; -typedef struct _MwRect MwRect; -typedef struct _MwIntegerKeyValue MwIntegerKeyValue; -typedef struct _MwTextKeyValue MwTextKeyValue; +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 _MwWidget *MwWidget, MwWidgetRec; @@ -45,8 +45,8 @@ struct _MwIntegerKeyValue { }; struct _MwUserHandlerKeyValue { - char* key; - void* user_data; + char* key; + void* user_data; MwUserHandler value; }; @@ -54,21 +54,21 @@ struct _MwUserHandlerKeyValue { struct _MwWidget { char* name; - MwLL lowlevel; + MwLL lowlevel; MwWidget parent; MwWidget* children; MwClass class; int pressed; - MwIntegerKeyValue* integer; - MwTextKeyValue* text; + MwIntegerKeyValue* integer; + MwTextKeyValue* text; MwUserHandlerKeyValue* handler; }; #endif struct _MwClass { - void* opaque; + void* opaque; MwHandler create; MwHandler destroy; MwHandler draw; diff --git a/include/Mw/X11.h b/include/Mw/X11.h index 75dd92d..8aeb2a2 100644 --- a/include/Mw/X11.h +++ b/include/Mw/X11.h @@ -4,7 +4,7 @@ #include -typedef struct _MwLL * MwLL, MwLLRec; +typedef struct _MwLL * MwLL, MwLLRec; typedef struct _MwLLColor *MwLLColor, MwLLColorRec; #include diff --git a/src/button.c b/src/button.c index a502c2b..d78690e 100644 --- a/src/button.c +++ b/src/button.c @@ -1,5 +1,5 @@ /* $Id$ */ -#include +#include static void create(MwWidget handle) { MwSetDefault(handle); diff --git a/src/core.c b/src/core.c index dc979b0..a6d081b 100644 --- a/src/core.c +++ b/src/core.c @@ -1,5 +1,5 @@ /* $Id$ */ -#include +#include #include "stb_ds.h" @@ -10,14 +10,14 @@ static void lldrawhandler(MwLL handle) { static void lluphandler(MwLL handle) { MwWidget h = (MwWidget)handle->user; - h->pressed = 0; + h->pressed = 0; MwDispatch(h, click); } static void lldownhandler(MwLL handle) { MwWidget h = (MwWidget)handle->user; - h->pressed = 1; + h->pressed = 1; } MwWidget MwCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height) { @@ -53,7 +53,7 @@ MwWidget MwCreateWidget(MwClass class, const char* name, MwWidget parent, int x, MwWidget MwVaCreateWidget(MwClass class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, ...) { MwWidget h; - va_list va; + va_list va; va_start(va, height); h = MwVaListCreateWidget(class, name, parent, x, y, width, height, va); @@ -204,7 +204,7 @@ void MwVaListApply(MwWidget handle, va_list va) { MwSetText(handle, key, t); } else if(key[0] == 'C') { MwUserHandler h = va_arg(va, MwUserHandler); - int ind; + int ind; shput(handle->handler, key, h); ind = shgeti(handle->handler, key); diff --git a/src/default.c b/src/default.c index c2ab803..ab52a81 100644 --- a/src/default.c +++ b/src/default.c @@ -1,4 +1,4 @@ /* $Id$ */ -#include +#include const char* MwDefaultBackground = "#ddd"; diff --git a/src/draw.c b/src/draw.c index a22b356..4ff7007 100644 --- a/src/draw.c +++ b/src/draw.c @@ -1,5 +1,5 @@ /* $Id$ */ -#include +#include static int hex(const char* txt, int len) { int i; @@ -61,9 +61,9 @@ void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color) { } void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) { - MwPoint p[6]; - const int diff = 128; - const int border = 2; + MwPoint p[6]; + const int diff = 128; + const int border = 2; MwLLColor darker = MwLLAllocColor(handle->lowlevel, color->red - diff, color->green - diff, color->blue - diff); MwLLColor lighter = MwLLAllocColor(handle->lowlevel, color->red + diff, color->green + diff, color->blue + diff); diff --git a/src/gdi.c b/src/gdi.c index 4bf7082..5023dfa 100644 --- a/src/gdi.c +++ b/src/gdi.c @@ -1,2 +1,2 @@ /* $Id$ */ -#include +#include diff --git a/src/lowlevel.c b/src/lowlevel.c index 20b5e56..4b3f9ba 100644 --- a/src/lowlevel.c +++ b/src/lowlevel.c @@ -1,5 +1,5 @@ /* $Id$ */ -#include +#include void MwLLCreateCommon(MwLL handle) { handle->handler = malloc(sizeof(*handle->handler)); diff --git a/src/window.c b/src/window.c index 80b947e..806fe28 100644 --- a/src/window.c +++ b/src/window.c @@ -1,5 +1,5 @@ /* $Id$ */ -#include +#include static void create(MwWidget handle) { MwSetDefault(handle); @@ -7,7 +7,7 @@ static void create(MwWidget handle) { static void draw(MwWidget handle) { MwLLColor c = MwParseColor(handle, MwGetText(handle, MwNbackground)); - MwRect r; + MwRect r; r.x = 0; r.y = 0; diff --git a/src/x11.c b/src/x11.c index 8e079d7..592185d 100644 --- a/src/x11.c +++ b/src/x11.c @@ -1,10 +1,10 @@ /* $Id$ */ -#include +#include static unsigned long mask = ExposureMask | StructureNotifyMask | ButtonPressMask | ButtonReleaseMask; MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) { - MwLL r; + MwLL r; Window p; Window root; unsigned int border, depth; @@ -56,7 +56,7 @@ void MwLLPolygon(MwLL handle, MwPoint* points, int points_count, MwLLColor color MwLLColor MwLLAllocColor(MwLL handle, int r, int g, int b) { MwLLColor c = malloc(sizeof(*c)); - XColor xc; + XColor xc; if(r > 255) r = 255; if(g > 255) g = 255;