diff --git a/doc/index.html b/doc/index.html
index d3f5fc7..4145313 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -20,6 +20,9 @@
MwALIGNMENT
+
+ #define MwDEFAULT 0x0fffffff
+
Mw/Core.h
@@ -398,6 +401,13 @@
+#define MwDEFAULT 0x0fffffff
+
+-
+ Default.
+
+
+
Mw/Core.h
-
diff --git a/examples/checkbox.c b/examples/checkbox.c
index ef64db4..5d6d6af 100644
--- a/examples/checkbox.c
+++ b/examples/checkbox.c
@@ -2,7 +2,7 @@
#include
int main() {
- MwWidget window = MwVaCreateWidget(MwWindowClass, "test", NULL, 0, 0, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
+ MwWidget window = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
MwNtitle, "checkbox",
NULL);
diff --git a/examples/example.c b/examples/example.c
index 215ee50..a4be2ff 100644
--- a/examples/example.c
+++ b/examples/example.c
@@ -48,7 +48,7 @@ void resize(MwWidget handle, void* user_data, void* call_data) {
int main() {
MwMenu m, m2;
- window = MwVaCreateWidget(MwWindowClass, "main", NULL, 0, 0, 400, 400,
+ window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 400, 400,
MwNtitle, "hello world",
NULL);
menu = MwCreateWidget(MwMenuClass, "menu", window, 0, 0, 0, 0);
diff --git a/examples/image.c b/examples/image.c
index cf4123e..0d8dbc5 100644
--- a/examples/image.c
+++ b/examples/image.c
@@ -2,7 +2,7 @@
#include
int main() {
- MwWidget window = MwVaCreateWidget(MwWindowClass, "window", NULL, 0, 0, 500, 500,
+ MwWidget window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, 500, 500,
MwNtitle, "image image",
NULL);
MwWidget image = MwCreateWidget(MwImageClass, "image", window, 50, 50, 200, 400);
diff --git a/examples/oldglut.c b/examples/oldglut.c
index 85dd844..d6becc4 100644
--- a/examples/oldglut.c
+++ b/examples/oldglut.c
@@ -42,7 +42,7 @@ static void resize(MwWidget handle, void* user, void* client) {
int main() {
MwWidget window;
- window = MwVaCreateWidget(MwWindowClass, "main", NULL, 0, 0, 500, 500,
+ window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 500, 500,
MwNtitle, TITLE,
NULL);
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 50, 50, 400, 400);
diff --git a/examples/rotate.c b/examples/rotate.c
index 49097c1..c12229b 100644
--- a/examples/rotate.c
+++ b/examples/rotate.c
@@ -55,7 +55,7 @@ void resize(MwWidget w, void* user, void* client) {
}
int main() {
- MwWidget window = MwVaCreateWidget(MwWindowClass, "window", NULL, 0, 0, (ww = 500), (wh = 500),
+ MwWidget window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, (ww = 500), (wh = 500),
MwNtitle, "rotate",
NULL);
int i;
diff --git a/examples/scrollbar.c b/examples/scrollbar.c
index d766851..7f8db05 100644
--- a/examples/scrollbar.c
+++ b/examples/scrollbar.c
@@ -3,7 +3,7 @@
#include
int main() {
- MwWidget window = MwVaCreateWidget(MwWindowClass, "main", NULL, 0, 0, 500, 500,
+ MwWidget window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 500, 500,
MwNtitle, "main",
NULL);
int i;
diff --git a/examples/vulkan.c b/examples/vulkan.c
index 1311356..67c120d 100644
--- a/examples/vulkan.c
+++ b/examples/vulkan.c
@@ -642,7 +642,7 @@ int main() {
return 1;
}
- window = MwVaCreateWidget(MwWindowClass, "main", NULL, 0, 0, 400, 450,
+ window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 400, 450,
MwNtitle, "hello world",
NULL);
diff --git a/include/Mw/Constants.h b/include/Mw/Constants.h
index 8c49d75..d6e6f01 100644
--- a/include/Mw/Constants.h
+++ b/include/Mw/Constants.h
@@ -33,4 +33,9 @@ enum MwALIGNMENT {
MwALIGNMENT_END,
};
+/*!
+ * %brief Default
+ */
+#define MwDEFAULT 0x0fffffff
+
#endif
diff --git a/src/backend/gdi.c b/src/backend/gdi.c
index 019e48b..1e49f15 100644
--- a/src/backend/gdi.c
+++ b/src/backend/gdi.c
@@ -111,7 +111,7 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
RegisterClassEx(&wc);
r->copy_buffer = 1;
- r->hWnd = CreateWindow(parent == NULL ? "milsko" : "STATIC", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x, y, width, height, parent == NULL ? NULL : parent->hWnd, 0, wc.hInstance, NULL);
+ r->hWnd = CreateWindow(parent == NULL ? "milsko" : "STATIC", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->hWnd, 0, wc.hInstance, NULL);
r->hInstance = wc.hInstance;
u->ll = r;
diff --git a/src/backend/x11.c b/src/backend/x11.c
index 9ed23ab..7e7e664 100644
--- a/src/backend/x11.c
+++ b/src/backend/x11.c
@@ -27,6 +27,8 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
MwLLCreateCommon(r);
+ if(x == MwDEFAULT) x = 0;
+ if(y == MwDEFAULT) y = 0;
if(width < 1) width = 1;
if(height < 1) height = 1;
@@ -37,19 +39,19 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
r->display = parent->display;
p = parent->window;
}
- r->window = XCreateSimpleWindow(r->display, p, x, y, width, height, 0, 0, WhitePixel(r->display, XDefaultScreen(r->display)));
+ r->window = XCreateSimpleWindow(r->display, p, x, y, width, height, 0, 0, WhitePixel(r->display, XDefaultScreen(r->display)));
XSetLocaleModifiers("");
- if((r->xim = XOpenIM(r->display, 0, 0, 0)) == NULL){
+ if((r->xim = XOpenIM(r->display, 0, 0, 0)) == NULL) {
XSetLocaleModifiers("@im=none");
r->xim = XOpenIM(r->display, 0, 0, 0);
}
r->xic = XCreateIC(r->xim,
- XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- XNClientWindow, r->window,
- XNFocusWindow, r->window,
- NULL);
+ XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNClientWindow, r->window,
+ XNFocusWindow, r->window,
+ NULL);
XSetICFocus(r->xic);
r->copy_buffer = 1;
diff --git a/src/backend/x11.h b/src/backend/x11.h
index c18f1c3..1801436 100644
--- a/src/backend/x11.h
+++ b/src/backend/x11.h
@@ -21,8 +21,8 @@ struct _MwLL {
void* user;
Atom wm_delete;
int copy_buffer;
- XIM xim;
- XIC xic;
+ XIM xim;
+ XIC xic;
unsigned int width;
unsigned int height;
diff --git a/src/widget/numberentry.c b/src/widget/numberentry.c
index c47f9de..3662c4e 100644
--- a/src/widget/numberentry.c
+++ b/src/widget/numberentry.c
@@ -2,12 +2,12 @@
#include
static int create(MwWidget handle) {
- int st;
- MwEntry e;
+ int st;
+ MwEntry e;
if((st = MwEntryClass->create(handle)) != 0) return st;
- e = handle->internal;
+ e = handle->internal;
e->right = 32;
return 0;
@@ -33,7 +33,7 @@ static void key(MwWidget handle, int code) {
ok = 1;
} else if(code == '.' && strchr(str, (int)'.') == NULL) {
ok = 1;
- }else if(code == MwLLKeyBackSpace || code == MwLLKeyLeft || code == MwLLKeyRight){
+ } else if(code == MwLLKeyBackSpace || code == MwLLKeyLeft || code == MwLLKeyRight) {
ok = 1;
}
diff --git a/tools/watcom.pl b/tools/watcom.pl
index fc226f6..826b160 100755
--- a/tools/watcom.pl
+++ b/tools/watcom.pl
@@ -2,31 +2,37 @@
# $Id$
my $target = "nt";
-my @cmd = ();
+my @cmd = ();
push(@cmd, "-I$ENV{WATCOM}/h");
push(@cmd, "-I$ENV{WATCOM}/h/nt");
push(@cmd, "-DSTBI_NO_SIMD");
-foreach my $f (@ARGV){
- if($f eq "-static-libgcc"){
- next;
- }elsif($f =~ /^-Wl,--out-implib,(.+)$/){
- push(@cmd, "-Wl,option implib=$1");
- next;
- }elsif($f =~ /^-W.+$/){
- next;
- }elsif($f =~ /^-L(.+)$/){
- push(@cmd, "-Wl,libpath $1");
- next;
- }elsif($f eq "-lMw"){
- push(@cmd, "-lMw");
- next;
- }elsif($f =~ /^-l(.+)$/){
- push(@cmd, "$1.lib");
- next;
- }elsif($f =~ /^(?:oo)?src\//){
- $target = "nt_dll";
- }
- push(@cmd, $f);
+foreach my $f (@ARGV) {
+ if ($f eq "-static-libgcc") {
+ next;
+ }
+ elsif ($f =~ /^-Wl,--out-implib,(.+)$/) {
+ push(@cmd, "-Wl,option implib=$1");
+ next;
+ }
+ elsif ($f =~ /^-W.+$/) {
+ next;
+ }
+ elsif ($f =~ /^-L(.+)$/) {
+ push(@cmd, "-Wl,libpath $1");
+ next;
+ }
+ elsif ($f eq "-lMw") {
+ push(@cmd, "-lMw");
+ next;
+ }
+ elsif ($f =~ /^-l(.+)$/) {
+ push(@cmd, "$1.lib");
+ next;
+ }
+ elsif ($f =~ /^(?:oo)?src\//) {
+ $target = "nt_dll";
+ }
+ push(@cmd, $f);
}
unshift(@cmd, "-b$target");