mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-31 06:30:52 +00:00
msvc
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@216 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
27
NTMakefile
Normal file
27
NTMakefile
Normal file
@@ -0,0 +1,27 @@
|
||||
# $Id$
|
||||
CC = cl
|
||||
LD = link
|
||||
|
||||
OBJS = src\boldfont.obj src\core.obj src\default.obj src\draw.obj src\error.obj src\font.obj src\lowlevel.obj src\widget\button.obj src\widget\checkbox.obj src\widget\frame.obj src\widget\image.obj src\widget\label.obj src\widget\menu.obj src\widget\opengl.obj src\widget\scrollbar.obj src\widget\submenu.obj src\widget\window.obj src\external\ds.obj src\external\image.obj src\cursor\cross.obj src\cursor\default.obj src\backend\gdi.obj
|
||||
OOOBJS = oosrc\base.obj oosrc\widget\button.obj oosrc\widget\checkbox.obj oosrc\widget\frame.obj oosrc\widget\image.obj oosrc\widget\label.obj oosrc\widget\menu.obj oosrc\widget\opengl.obj oosrc\widget\scrollbar.obj oosrc\widget\submenu.obj oosrc\widget\window.obj
|
||||
CFLAGS = /nologo /DSTBI_NO_SIMD /D_MILSKO /DUSE_GDI /DUSE_STB_IMAGE /Iinclude
|
||||
CXXFLAGS = /nologo /Iinclude
|
||||
LDFLAGS = /nologo /DLL /LIBPATH:src /LIBPATH:oosrc
|
||||
|
||||
all: src\Mw.dll oosrc\MwOO.dll
|
||||
|
||||
.SUFFIXES: .cc .c .obj
|
||||
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) /TC /c /Fo$@ $<
|
||||
|
||||
.cc.obj:
|
||||
$(CC) $(CXXFLAGS) /TP /c /Fo$@ $<
|
||||
|
||||
src\Mw.dll: $(OBJS)
|
||||
$(LD) $(LDFLAGS) /OUT:src\Mw.dll $(OBJS) gdi32.lib user32.lib
|
||||
oosrc\MwOO.dll: $(OOOBJS)
|
||||
$(LD) $(LDFLAGS) /OUT:oosrc\MwOO.dll $(OOOBJS) Mw.lib
|
||||
|
||||
clean:
|
||||
del /q $(OBJS) $(OOOBJS) src\Mw.dll src\Mw.lib src\Mw.exp oosrc\MwOO.dll oosrc\MwOO.lib oosrc\MwOO.exp
|
||||
@@ -22,6 +22,10 @@
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265
|
||||
#endif
|
||||
|
||||
#if defined(_MILSKO) && defined(_WIN32)
|
||||
#define MWDECL extern __declspec(dllexport)
|
||||
#elif defined(_WIN32)
|
||||
|
||||
@@ -108,9 +108,9 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
|
||||
if(parent == NULL) {
|
||||
u->old = NULL;
|
||||
} else {
|
||||
u->old = (WNDPROC)SetWindowLongPtr(r->hWnd, GWLP_WNDPROC, (LONG_PTR)wndproc);
|
||||
u->old = (WNDPROC)SetWindowLongPtr(r->hWnd, GWLP_WNDPROC, (LPARAM)wndproc);
|
||||
}
|
||||
SetWindowLongPtr(r->hWnd, GWLP_USERDATA, (LONG_PTR)u);
|
||||
SetWindowLongPtr(r->hWnd, GWLP_USERDATA, (LPARAM)u);
|
||||
|
||||
if(parent == NULL) {
|
||||
RECT rc;
|
||||
@@ -135,7 +135,7 @@ void MwLLDestroy(MwLL handle) {
|
||||
MwLLDestroyCommon(handle);
|
||||
|
||||
/* for safety */
|
||||
SetWindowLongPtr(handle->hWnd, GWLP_USERDATA, (LONG_PTR)NULL);
|
||||
SetWindowLongPtr(handle->hWnd, GWLP_USERDATA, (LPARAM)NULL);
|
||||
DestroyWindow(handle->hWnd);
|
||||
|
||||
free(handle);
|
||||
@@ -361,7 +361,7 @@ void MwLLSetCursor(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||
|
||||
cursor = CreateCursor(GetModuleHandle(NULL), xs, ys, MwCursorDataHeight, MwCursorDataHeight, dmask, dimage);
|
||||
|
||||
SetClassLongPtr(handle->hWnd, GCLP_HCURSOR, (LONG_PTR)cursor);
|
||||
SetClassLongPtr(handle->hWnd, GCLP_HCURSOR, (LPARAM)cursor);
|
||||
SetCursor(cursor);
|
||||
|
||||
DestroyCursor(cursor);
|
||||
@@ -372,7 +372,7 @@ void MwLLSetCursor(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||
|
||||
void MwLLDetach(MwLL handle, MwPoint* point) {
|
||||
RECT rc, rc2;
|
||||
LONG_PTR style = GetWindowLongPtr(handle->hWnd, GWL_STYLE);
|
||||
LPARAM style = GetWindowLongPtr(handle->hWnd, GWL_STYLE);
|
||||
|
||||
style |= WS_OVERLAPPEDWINDOW;
|
||||
|
||||
|
||||
@@ -7,7 +7,17 @@
|
||||
#include <Mw/LowLevel.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef GWLP_USERDATA
|
||||
#define GWLP_USERDATA GWL_USERDATA
|
||||
#define GWLP_WNDPROC GWL_WNDPROC
|
||||
#define GCLP_HICON GCL_HICON
|
||||
#define GCLP_HCURSOR GCL_HCURSOR
|
||||
#define SetWindowLongPtr SetWindowLong
|
||||
#define GetWindowLongPtr GetWindowLong
|
||||
#define SetClassLongPtr SetClassLong
|
||||
#define GetClassLongPtr GetClassLong
|
||||
#endif
|
||||
|
||||
struct _MwLL {
|
||||
HINSTANCE hInstance;
|
||||
HWND hWnd;
|
||||
|
||||
@@ -17,7 +17,7 @@ void setLastError(const char* fmt, ...) {
|
||||
memset(out, 0, MAX_ERROR_LEN);
|
||||
|
||||
va_start(va, fmt);
|
||||
vsnprintf(out, MAX_ERROR_LEN, fmt, va);
|
||||
vsprintf(out, fmt, va);
|
||||
va_end(va);
|
||||
|
||||
memcpy(error, out, MAX_ERROR_LEN);
|
||||
|
||||
@@ -176,8 +176,8 @@ void MwSubMenuAppear(MwWidget handle, MwMenu menu, MwPoint* point) {
|
||||
MwLLDetach(handle->lowlevel, point);
|
||||
|
||||
#ifdef _WIN32
|
||||
SetWindowLongPtr(handle->lowlevel->hWnd, GWL_STYLE, (LONG_PTR)0);
|
||||
SetWindowLongPtr(handle->lowlevel->hWnd, GWL_EXSTYLE, (LONG_PTR)WS_EX_TOOLWINDOW);
|
||||
SetWindowLongPtr(handle->lowlevel->hWnd, GWL_STYLE, (LPARAM)0);
|
||||
SetWindowLongPtr(handle->lowlevel->hWnd, GWL_EXSTYLE, (LPARAM)WS_EX_TOOLWINDOW);
|
||||
#endif
|
||||
|
||||
MwLLShow(handle->lowlevel, 1);
|
||||
|
||||
54
tools/genmsvc.pl
Normal file
54
tools/genmsvc.pl
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env perl
|
||||
# $Id$
|
||||
|
||||
sub scan {
|
||||
opendir(DIR, $_[0]);
|
||||
my @files = readdir(DIR);
|
||||
foreach my $f (@files){
|
||||
if(!($f =~ /^vulkan\.cc?$/) && ($f =~ /\.cc?$/)){
|
||||
$f =~ s/\.cc?$/.obj/g;
|
||||
my $p = $_[0] . "/" . $f;
|
||||
$p =~ s/\//\\/g;
|
||||
print(OUT " $p");
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
open(OUT, ">", "NTMakefile");
|
||||
print(OUT "# \$Id\$\n");
|
||||
print(OUT "CC = cl\n");
|
||||
print(OUT "LD = link\n");
|
||||
print(OUT "\n");
|
||||
print(OUT "OBJS =");
|
||||
scan("src");
|
||||
scan("src/widget");
|
||||
scan("src/external");
|
||||
scan("src/cursor");
|
||||
print(OUT " src\\backend\\gdi.obj\n");
|
||||
print(OUT "OOOBJS =");
|
||||
scan("oosrc");
|
||||
scan("oosrc/widget");
|
||||
print(OUT "\n");
|
||||
print(OUT "CFLAGS = /nologo /DSTBI_NO_SIMD /D_MILSKO /DUSE_GDI /DUSE_STB_IMAGE /Iinclude\n");
|
||||
print(OUT "CXXFLAGS = /nologo /Iinclude\n");
|
||||
print(OUT "LDFLAGS = /nologo /DLL /LIBPATH:src /LIBPATH:oosrc\n");
|
||||
print(OUT "\n");
|
||||
print(OUT "all: src\\Mw.dll oosrc\\MwOO.dll\n");
|
||||
print(OUT "\n");
|
||||
print(OUT ".SUFFIXES: .cc .c .obj\n");
|
||||
print(OUT "\n");
|
||||
print(OUT ".c.obj:\n");
|
||||
print(OUT "\t\$(CC) \$(CFLAGS) /TC /c /Fo\$@ \$<\n");
|
||||
print(OUT "\n");
|
||||
print(OUT ".cc.obj:\n");
|
||||
print(OUT "\t\$(CC) \$(CXXFLAGS) /TP /c /Fo\$@ \$<\n");
|
||||
print(OUT "\n");
|
||||
print(OUT "src\\Mw.dll: \$(OBJS)\n");
|
||||
print(OUT "\t\$(LD) \$(LDFLAGS) /OUT:src\\Mw.dll \$(OBJS) gdi32.lib user32.lib\n");
|
||||
print(OUT "oosrc\\MwOO.dll: \$(OOOBJS)\n");
|
||||
print(OUT "\t\$(LD) \$(LDFLAGS) /OUT:oosrc\\MwOO.dll \$(OOOBJS) Mw.lib\n");
|
||||
print(OUT "\n");
|
||||
print(OUT "clean:\n");
|
||||
print(OUT "\tdel /q \$(OBJS) \$(OOOBJS) src\\Mw.dll src\\Mw.lib src\\Mw.exp oosrc\\MwOO.dll oosrc\\MwOO.lib oosrc\\MwOO.exp\n");
|
||||
close(OUT);
|
||||
Reference in New Issue
Block a user