new constant

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@252 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-10 11:45:27 +00:00
parent 0c28c9d104
commit 0fd866977b
14 changed files with 65 additions and 42 deletions

View File

@@ -20,6 +20,9 @@
<dd>
<a href="#Mw_Constants_h__MwALIGNMENT">MwALIGNMENT</a>
</dd>
<dd>
<a href="#Mw_Constants_h___define_MwDEFAULT_0x0fffffff">#define MwDEFAULT 0x0fffffff</a>
</dd>
<dt>
<a href="#Mw_Core_h">Mw/Core.h</a>
</dt>
@@ -398,6 +401,13 @@
</dd>
</dl>
<hr>
<pre id="Mw_Constants_h___define_MwDEFAULT_0x0fffffff">#<B><FONT COLOR="#5F9EA0">define</FONT></B> <FONT COLOR="#B8860B">MwDEFAULT</FONT> 0x0fffffff</pre>
<dl>
<dd>
Default.
</dd>
</dl>
<hr>
<h2 align="center" id="Mw_Core_h">Mw/Core.h</h2>
<dl>
<dt>

View File

@@ -2,7 +2,7 @@
#include <Mw/Milsko.h>
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);

View File

@@ -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);

View File

@@ -2,7 +2,7 @@
#include <Mw/Milsko.h>
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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -3,7 +3,7 @@
#include <Mw/Milsko.h>
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;

View File

@@ -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);

View File

@@ -33,4 +33,9 @@ enum MwALIGNMENT {
MwALIGNMENT_END,
};
/*!
* %brief Default
*/
#define MwDEFAULT 0x0fffffff
#endif

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -2,12 +2,12 @@
#include <Mw/Milsko.h>
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;
}

View File

@@ -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");