idk what i did

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@446 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-21 17:30:41 +00:00
parent d263f6abb1
commit 1dbe11aca0
49 changed files with 97 additions and 1715 deletions

View File

@@ -1,13 +1,11 @@
# $Id$
CC = bcc32 -c
CXX = bcc32 -c -P
LD = bcc32
CFLAGS = -Iinclude -D_MILSKO -DUSE_GDI -DUSE_STB_IMAGE -DSTBI_NO_SIMD
CXXFLAGS = -Iinclude
LDFLAGS = -tWD
.SUFFIXES: .obj .c .cc
all: src\Mw.dll oosrc\MwOO.dll
.SUFFIXES: .obj .c
all: src\Mw.dll
clean:
del /f /q src\core.obj
del /f /q src\string.obj
@@ -56,33 +54,11 @@ clean:
del /f /q src\widget\listbox.obj
del /f /q src\widget\numberentry.obj
del /f /q src\backend\gdi.obj
del /f /q oosrc\base.obj
del /f /q oosrc\widget\button.obj
del /f /q oosrc\widget\frame.obj
del /f /q oosrc\widget\image.obj
del /f /q oosrc\widget\menu.obj
del /f /q oosrc\widget\opengl.obj
del /f /q oosrc\widget\scrollbar.obj
del /f /q oosrc\widget\submenu.obj
del /f /q oosrc\widget\window.obj
del /f /q oosrc\widget\checkbox.obj
del /f /q oosrc\widget\viewport.obj
del /f /q oosrc\widget\listbox.obj
del /f /q oosrc\widget\label.obj
del /f /q oosrc\widget\entry.obj
del /f /q oosrc\widget\numberentry.obj
del /f /q src\Mw.dll
del /f /q oosrc\MwOO.dll
src\Mw.dll: src\core.obj src\string.obj src\draw.obj src\default.obj src\lowlevel.obj src\error.obj src\unicode.obj src\font.obj src\color.obj src\directory.obj src\messagebox.obj src\boldfont.obj src\filechooser.obj external\ds.obj external\image.obj src\icon\info.obj src\icon\note.obj src\icon\warning.obj src\icon\error.obj src\icon\news.obj src\icon\question.obj src\icon\directory.obj src\icon\file.obj src\icon\back.obj src\icon\forward.obj src\icon\up.obj src\icon\computer.obj src\icon\search.obj src\cursor\default.obj src\cursor\cross.obj src\cursor\text.obj src\cursor\hidden.obj src\widget\button.obj src\widget\frame.obj src\widget\opengl.obj src\widget\window.obj src\widget\menu.obj src\widget\entry.obj src\widget\submenu.obj src\widget\viewport.obj src\widget\image.obj src\widget\scrollbar.obj src\widget\checkbox.obj src\widget\label.obj src\widget\listbox.obj src\widget\numberentry.obj src\backend\gdi.obj
$(LD) $(LDFLAGS) -e$@ src\core.obj src\string.obj src\draw.obj src\default.obj src\lowlevel.obj src\error.obj src\unicode.obj src\font.obj src\color.obj src\directory.obj src\messagebox.obj src\boldfont.obj src\filechooser.obj external\ds.obj external\image.obj src\icon\info.obj src\icon\note.obj src\icon\warning.obj src\icon\error.obj src\icon\news.obj src\icon\question.obj src\icon\directory.obj src\icon\file.obj src\icon\back.obj src\icon\forward.obj src\icon\up.obj src\icon\computer.obj src\icon\search.obj src\cursor\default.obj src\cursor\cross.obj src\cursor\text.obj src\cursor\hidden.obj src\widget\button.obj src\widget\frame.obj src\widget\opengl.obj src\widget\window.obj src\widget\menu.obj src\widget\entry.obj src\widget\submenu.obj src\widget\viewport.obj src\widget\image.obj src\widget\scrollbar.obj src\widget\checkbox.obj src\widget\label.obj src\widget\listbox.obj src\widget\numberentry.obj src\backend\gdi.obj -lopengl32.lib -lgdi32.lib -luser32.lib
implib src\Mw.lib src\Mw.dll
oosrc\MwOO.dll: oosrc\base.obj oosrc\widget\button.obj oosrc\widget\frame.obj oosrc\widget\image.obj oosrc\widget\menu.obj oosrc\widget\opengl.obj oosrc\widget\scrollbar.obj oosrc\widget\submenu.obj oosrc\widget\window.obj oosrc\widget\checkbox.obj oosrc\widget\viewport.obj oosrc\widget\listbox.obj oosrc\widget\label.obj oosrc\widget\entry.obj oosrc\widget\numberentry.obj
$(LD) $(LDFLAGS) -e$@ oosrc\base.obj oosrc\widget\button.obj oosrc\widget\frame.obj oosrc\widget\image.obj oosrc\widget\menu.obj oosrc\widget\opengl.obj oosrc\widget\scrollbar.obj oosrc\widget\submenu.obj oosrc\widget\window.obj oosrc\widget\checkbox.obj oosrc\widget\viewport.obj oosrc\widget\listbox.obj oosrc\widget\label.obj oosrc\widget\entry.obj oosrc\widget\numberentry.obj -lsrc\Mw.lib
implib oosrc\MwOO.lib oosrc\MwOO.dll
.c.obj:
$(CC) $(CFLAGS) -o$@ $<
.cc.obj:
$(CXX) $(CXXFLAGS) -o$@ $<

View File

@@ -9,7 +9,6 @@ endif
USE_STB_IMAGE = 1
CC = $(GCC)gcc
CXX = $(GCC)g++
CFLAGS = -Wall -Wextra -Wno-implicit-fallthrough -Wno-sign-compare -Iinclude
LDFLAGS =
@@ -38,13 +37,6 @@ L_OBJS += src/widget/window.o src/widget/button.o src/widget/frame.o src/widget/
L_OBJS += src/cursor/hidden.o src/cursor/default.o src/cursor/cross.o src/cursor/text.o
L_OBJS += src/icon/question.o src/icon/warning.o src/icon/note.o src/icon/info.o src/icon/news.o src/icon/error.o src/icon/file.o src/icon/directory.o src/icon/back.o src/icon/forward.o src/icon/up.o src/icon/computer.o src/icon/search.o
OOL_CXXFLAGS = $(DEPINC) $(CFLAGS) -std=c++98 -fPIC
OOL_LDFLAGS = $(LDFLAGS) -L src
OOL_LIBS = $(LIBS) -lMw
OOL_OBJS = oosrc/base.o
include oosrc/deps.mk
E_CFLAGS = $(CFLAGS)
E_LDFLAGS = $(LDFLAGS) -Lsrc
E_LIBS = $(LIBS) -lMw
@@ -113,7 +105,6 @@ endif
ifeq ($(WINDOWS),1)
L_CFLAGS += -DUSE_GDI
L_LDFLAGS += -Wl,--out-implib,src/libMw.a -static-libgcc
OOL_LDFLAGS += -Wl,--out-implib,oosrc/libMwOO.a -static-libgcc
L_OBJS += src/backend/gdi.o
L_LIBS += -lgdi32
@@ -145,47 +136,40 @@ EXAMPLES = examples/basic/example$(EXEC) examples/basic/rotate$(EXEC) examples/b
ifeq ($(OPENGL),1)
L_OBJS += src/widget/opengl.o
OOL_OBJS += oosrc/widget/opengl.o
EXAMPLES += examples/gldemos/clock$(EXEC) examples/gldemos/triangle$(EXEC) examples/gldemos/gears$(EXEC) examples/gldemos/boing$(EXEC) examples/gldemos/cube$(EXEC) examples/gldemos/tripaint$(EXEC)
endif
ifeq ($(VULKAN),1)
L_OBJS += src/widget/vulkan.o
OOL_OBJS += oosrc/widget/vulkan.o
EXAMPLES += examples/vkdemos/vulkan$(EXEC)
endif
.PHONY: all install format clean lib oolib examples
.PHONY: all install format clean lib examples
all: lib examples
lib: src/$(LIB)Mw$(SO)
oolib: oosrc/$(LIB)MwOO$(SO)
examples: $(EXAMPLES)
install: lib oolib
install: lib
mkdir -p $(PREFIX)/lib
mkdir -p $(PREFIX)/bin
mkdir -p $(PREFIX)/include
mkdir -p $(PREFIX)/share/doc/milsko
for i in src oosrc; do \
for i in src; do \
cp $$i/*.so $(PREFIX)/lib/ ; \
cp $$i/*.a $(PREFIX)/lib/ ; \
cp $$i/*.dll $(PREFIX)/bin/ ; \
done ; true
cp -rf include/Mw $(PREFIX)/include/
cp -rf include/MwOO $(PREFIX)/include/
cp -rf doc/* $(PREFIX)/share/doc/milsko/
format:
clang-format --verbose -i `find oosrc src include examples tools "(" -name "*.c" -or -name "*.h" ")" -and -not -name "stb_*.h"`
clang-format --verbose -i `find src include examples tools "(" -name "*.c" -or -name "*.h" ")" -and -not -name "stb_*.h"`
perltidy -b -bext='/' --paren-tightness=2 `find tools -name "*.pl"`
src/$(LIB)Mw$(SO): $(L_OBJS)
$(CC) $(L_LDFLAGS) $(SHARED) -o $@ $^ $(L_LIBS)
oosrc/$(LIB)MwOO$(SO): $(OOL_OBJS) src/$(LIB)Mw$(SO)
$(CC) $(OOL_LDFLAGS) $(SHARED) -o $@ $(OOL_OBJS) $(OOL_LIBS)
examples/gldemos/%$(EXEC): examples/gldemos/%.o src/$(LIB)Mw$(SO)
$(CC) $(E_LDFLAGS) -o $@ $< $(E_LIBS) $(GL)
@@ -195,9 +179,6 @@ examples/%$(EXEC): examples/%.o src/$(LIB)Mw$(SO)
src/%.o: src/%.c
$(CC) $(L_CFLAGS) -c -o $@ $<
oosrc/%.o: oosrc/%.cc
$(CXX) $(OOL_CXXFLAGS) -fno-exceptions -fno-rtti -c -o $@ $<
external/%.o: external/%.c
$(CC) $(L_CFLAGS) -Wno-unused-value -Wno-unused-parameter -c -o $@ $<

View File

@@ -1,13 +1,11 @@
# $Id$
CC = cl /TC /c /nologo
CXX = cl /TP /c /nologo
LD = link /nologo
CFLAGS = /Iinclude /D_MILSKO /DUSE_GDI /DUSE_STB_IMAGE /DSTBI_NO_SIMD
CXXFLAGS = /Iinclude
LDFLAGS = /DLL
.SUFFIXES: .obj .c .cc
all: src\Mw.dll oosrc\MwOO.dll
.SUFFIXES: .obj .c
all: src\Mw.dll
clean:
del /f /q src\core.obj
del /f /q src\string.obj
@@ -56,33 +54,11 @@ clean:
del /f /q src\widget\listbox.obj
del /f /q src\widget\numberentry.obj
del /f /q src\backend\gdi.obj
del /f /q oosrc\base.obj
del /f /q oosrc\widget\button.obj
del /f /q oosrc\widget\frame.obj
del /f /q oosrc\widget\image.obj
del /f /q oosrc\widget\menu.obj
del /f /q oosrc\widget\opengl.obj
del /f /q oosrc\widget\scrollbar.obj
del /f /q oosrc\widget\submenu.obj
del /f /q oosrc\widget\window.obj
del /f /q oosrc\widget\checkbox.obj
del /f /q oosrc\widget\viewport.obj
del /f /q oosrc\widget\listbox.obj
del /f /q oosrc\widget\label.obj
del /f /q oosrc\widget\entry.obj
del /f /q oosrc\widget\numberentry.obj
del /f /q src\Mw.dll
del /f /q oosrc\MwOO.dll
src\Mw.dll: src\core.obj src\string.obj src\draw.obj src\default.obj src\lowlevel.obj src\error.obj src\unicode.obj src\font.obj src\color.obj src\directory.obj src\messagebox.obj src\boldfont.obj src\filechooser.obj external\ds.obj external\image.obj src\icon\info.obj src\icon\note.obj src\icon\warning.obj src\icon\error.obj src\icon\news.obj src\icon\question.obj src\icon\directory.obj src\icon\file.obj src\icon\back.obj src\icon\forward.obj src\icon\up.obj src\icon\computer.obj src\icon\search.obj src\cursor\default.obj src\cursor\cross.obj src\cursor\text.obj src\cursor\hidden.obj src\widget\button.obj src\widget\frame.obj src\widget\opengl.obj src\widget\window.obj src\widget\menu.obj src\widget\entry.obj src\widget\submenu.obj src\widget\viewport.obj src\widget\image.obj src\widget\scrollbar.obj src\widget\checkbox.obj src\widget\label.obj src\widget\listbox.obj src\widget\numberentry.obj src\backend\gdi.obj
$(LD) $(LDFLAGS) /OUT:$@ src\core.obj src\string.obj src\draw.obj src\default.obj src\lowlevel.obj src\error.obj src\unicode.obj src\font.obj src\color.obj src\directory.obj src\messagebox.obj src\boldfont.obj src\filechooser.obj external\ds.obj external\image.obj src\icon\info.obj src\icon\note.obj src\icon\warning.obj src\icon\error.obj src\icon\news.obj src\icon\question.obj src\icon\directory.obj src\icon\file.obj src\icon\back.obj src\icon\forward.obj src\icon\up.obj src\icon\computer.obj src\icon\search.obj src\cursor\default.obj src\cursor\cross.obj src\cursor\text.obj src\cursor\hidden.obj src\widget\button.obj src\widget\frame.obj src\widget\opengl.obj src\widget\window.obj src\widget\menu.obj src\widget\entry.obj src\widget\submenu.obj src\widget\viewport.obj src\widget\image.obj src\widget\scrollbar.obj src\widget\checkbox.obj src\widget\label.obj src\widget\listbox.obj src\widget\numberentry.obj src\backend\gdi.obj opengl32.lib gdi32.lib user32.lib
oosrc\MwOO.dll: oosrc\base.obj oosrc\widget\button.obj oosrc\widget\frame.obj oosrc\widget\image.obj oosrc\widget\menu.obj oosrc\widget\opengl.obj oosrc\widget\scrollbar.obj oosrc\widget\submenu.obj oosrc\widget\window.obj oosrc\widget\checkbox.obj oosrc\widget\viewport.obj oosrc\widget\listbox.obj oosrc\widget\label.obj oosrc\widget\entry.obj oosrc\widget\numberentry.obj
$(LD) $(LDFLAGS) /OUT:$@ oosrc\base.obj oosrc\widget\button.obj oosrc\widget\frame.obj oosrc\widget\image.obj oosrc\widget\menu.obj oosrc\widget\opengl.obj oosrc\widget\scrollbar.obj oosrc\widget\submenu.obj oosrc\widget\window.obj oosrc\widget\checkbox.obj oosrc\widget\viewport.obj oosrc\widget\listbox.obj oosrc\widget\label.obj oosrc\widget\entry.obj oosrc\widget\numberentry.obj src\Mw.lib
.c.obj:
$(CC) $(CFLAGS) /Fo$@ $<
.cc.obj:
$(CXX) $(CXXFLAGS) /Fo$@ $<

View File

@@ -1,12 +1,10 @@
# $Id$
CC = wcc386 -bt=nt -q
CXX = wpp386 -bt=nt -q
LD = wlink option quiet
CFLAGS = -i=include -d_MILSKO -dUSE_GDI -dUSE_STB_IMAGE -dSTBI_NO_SIMD
CXXFLAGS = -i=include
LDFLAGS = system nt_dll
all: src/Mw.dll oosrc/MwOO.dll
all: src/Mw.dll
clean: .SYMBOLIC
%erase src/core.obj
%erase src/string.obj
@@ -55,32 +53,12 @@ clean: .SYMBOLIC
%erase src/widget/listbox.obj
%erase src/widget/numberentry.obj
%erase src/backend/gdi.obj
%erase oosrc/base.obj
%erase oosrc/widget/button.obj
%erase oosrc/widget/frame.obj
%erase oosrc/widget/image.obj
%erase oosrc/widget/menu.obj
%erase oosrc/widget/opengl.obj
%erase oosrc/widget/scrollbar.obj
%erase oosrc/widget/submenu.obj
%erase oosrc/widget/window.obj
%erase oosrc/widget/checkbox.obj
%erase oosrc/widget/viewport.obj
%erase oosrc/widget/listbox.obj
%erase oosrc/widget/label.obj
%erase oosrc/widget/entry.obj
%erase oosrc/widget/numberentry.obj
%erase src/Mw.dll
%erase oosrc/MwOO.dll
src/Mw.dll: src/core.obj src/string.obj src/draw.obj src/default.obj src/lowlevel.obj src/error.obj src/unicode.obj src/font.obj src/color.obj src/directory.obj src/messagebox.obj src/boldfont.obj src/filechooser.obj external/ds.obj external/image.obj src/icon/info.obj src/icon/note.obj src/icon/warning.obj src/icon/error.obj src/icon/news.obj src/icon/question.obj src/icon/directory.obj src/icon/file.obj src/icon/back.obj src/icon/forward.obj src/icon/up.obj src/icon/computer.obj src/icon/search.obj src/cursor/default.obj src/cursor/cross.obj src/cursor/text.obj src/cursor/hidden.obj src/widget/button.obj src/widget/frame.obj src/widget/opengl.obj src/widget/window.obj src/widget/menu.obj src/widget/entry.obj src/widget/submenu.obj src/widget/viewport.obj src/widget/image.obj src/widget/scrollbar.obj src/widget/checkbox.obj src/widget/label.obj src/widget/listbox.obj src/widget/numberentry.obj src/backend/gdi.obj
$(LD) $(LDFLAGS) option implib=src/Mw.lib name $@ file src/core.obj file src/string.obj file src/draw.obj file src/default.obj file src/lowlevel.obj file src/error.obj file src/unicode.obj file src/font.obj file src/color.obj file src/directory.obj file src/messagebox.obj file src/boldfont.obj file src/filechooser.obj file external/ds.obj file external/image.obj file src/icon/info.obj file src/icon/note.obj file src/icon/warning.obj file src/icon/error.obj file src/icon/news.obj file src/icon/question.obj file src/icon/directory.obj file src/icon/file.obj file src/icon/back.obj file src/icon/forward.obj file src/icon/up.obj file src/icon/computer.obj file src/icon/search.obj file src/cursor/default.obj file src/cursor/cross.obj file src/cursor/text.obj file src/cursor/hidden.obj file src/widget/button.obj file src/widget/frame.obj file src/widget/opengl.obj file src/widget/window.obj file src/widget/menu.obj file src/widget/entry.obj file src/widget/submenu.obj file src/widget/viewport.obj file src/widget/image.obj file src/widget/scrollbar.obj file src/widget/checkbox.obj file src/widget/label.obj file src/widget/listbox.obj file src/widget/numberentry.obj file src/backend/gdi.obj library clib3r.lib library opengl32.lib library gdi32.lib library user32.lib
oosrc/MwOO.dll: oosrc/base.obj oosrc/widget/button.obj oosrc/widget/frame.obj oosrc/widget/image.obj oosrc/widget/menu.obj oosrc/widget/opengl.obj oosrc/widget/scrollbar.obj oosrc/widget/submenu.obj oosrc/widget/window.obj oosrc/widget/checkbox.obj oosrc/widget/viewport.obj oosrc/widget/listbox.obj oosrc/widget/label.obj oosrc/widget/entry.obj oosrc/widget/numberentry.obj
$(LD) $(LDFLAGS) option implib=oosrc/MwOO.lib name $@ file oosrc/base.obj file oosrc/widget/button.obj file oosrc/widget/frame.obj file oosrc/widget/image.obj file oosrc/widget/menu.obj file oosrc/widget/opengl.obj file oosrc/widget/scrollbar.obj file oosrc/widget/submenu.obj file oosrc/widget/window.obj file oosrc/widget/checkbox.obj file oosrc/widget/viewport.obj file oosrc/widget/listbox.obj file oosrc/widget/label.obj file oosrc/widget/entry.obj file oosrc/widget/numberentry.obj library clib3r.lib library src/Mw.lib
src/core.obj: src/core.c
$(CC) $(CFLAGS) -fo=$@ $<
@@ -176,33 +154,3 @@ src/widget/numberentry.obj: src/widget/numberentry.c
$(CC) $(CFLAGS) -fo=$@ $<
src/backend/gdi.obj: src/backend/gdi.c
$(CC) $(CFLAGS) -fo=$@ $<
oosrc/base.obj: oosrc/base.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/button.obj: oosrc/widget/button.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/frame.obj: oosrc/widget/frame.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/image.obj: oosrc/widget/image.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/menu.obj: oosrc/widget/menu.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/opengl.obj: oosrc/widget/opengl.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/scrollbar.obj: oosrc/widget/scrollbar.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/submenu.obj: oosrc/widget/submenu.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/window.obj: oosrc/widget/window.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/checkbox.obj: oosrc/widget/checkbox.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/viewport.obj: oosrc/widget/viewport.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/listbox.obj: oosrc/widget/listbox.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/label.obj: oosrc/widget/label.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/entry.obj: oosrc/widget/entry.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<
oosrc/widget/numberentry.obj: oosrc/widget/numberentry.cc
$(CXX) $(CXXFLAGS) -fo=$@ $<

View File

@@ -443,12 +443,6 @@
<dd>
<a href="#Mw_Widget_ListBox_h__MwListBoxInsertMultiple">MwListBoxInsertMultiple</a>
</dd>
<dd>
<a href="#Mw_Widget_ListBox_h__MwListBoxVaInsert">MwListBoxVaInsert</a>
</dd>
<dd>
<a href="#Mw_Widget_ListBox_h__MwListBoxVaInsertMultiple">MwListBoxVaInsertMultiple</a>
</dd>
<dd>
<a href="#Mw_Widget_ListBox_h__MwListBoxDelete">MwListBoxDelete</a>
</dd>
@@ -2878,7 +2872,7 @@
</dd>
</dl>
<hr>
<pre id="Mw_Widget_ListBox_h__MwListBoxInsert">MWDECL <B><FONT COLOR="#228B22">void</FONT></B> <B><FONT COLOR="#0000FF">MwListBoxInsert</FONT></B> (
<pre id="Mw_Widget_ListBox_h__MwListBoxInsert">MwInline <B><FONT COLOR="#228B22">void</FONT></B> <B><FONT COLOR="#0000FF">MwListBoxInsert</FONT></B> (
MwWidget handle,
<B><FONT COLOR="#228B22">int</FONT></B> index,
MwLLPixmap pixmap,
@@ -2914,7 +2908,7 @@
</dd>
</dl>
<hr>
<pre id="Mw_Widget_ListBox_h__MwListBoxInsertMultiple">MWDECL <B><FONT COLOR="#228B22">void</FONT></B> <B><FONT COLOR="#0000FF">MwListBoxInsertMultiple</FONT></B> (
<pre id="Mw_Widget_ListBox_h__MwListBoxInsertMultiple">MwInline <B><FONT COLOR="#228B22">void</FONT></B> <B><FONT COLOR="#0000FF">MwListBoxInsertMultiple</FONT></B> (
MwWidget handle,
<B><FONT COLOR="#228B22">int</FONT></B> index,
<B><FONT COLOR="#228B22">int</FONT></B> count,
@@ -2957,85 +2951,6 @@
</dd>
</dl>
<hr>
<pre id="Mw_Widget_ListBox_h__MwListBoxVaInsert">MWDECL <B><FONT COLOR="#228B22">void</FONT></B> <B><FONT COLOR="#0000FF">MwListBoxVaInsert</FONT></B> (
MwWidget handle,
<B><FONT COLOR="#228B22">int</FONT></B> index,
MwLLPixmap pixmap,
va_list va
);</pre>
<dl>
<dd>
Inserts item on the listbox.
</dd>
<dt>
Parameter <code>handle</code>
</dt>
<dd>
Widget.
</dd>
<dt>
Parameter <code>index</code>
</dt>
<dd>
Index.
</dd>
<dt>
Parameter <code>pixmap</code>
</dt>
<dd>
Pixmap.
</dd>
<dt>
Parameter <code>va</code>
</dt>
<dd>
Text.
</dd>
</dl>
<hr>
<pre id="Mw_Widget_ListBox_h__MwListBoxVaInsertMultiple">MWDECL <B><FONT COLOR="#228B22">void</FONT></B> <B><FONT COLOR="#0000FF">MwListBoxVaInsertMultiple</FONT></B> (
MwWidget handle,
<B><FONT COLOR="#228B22">int</FONT></B> index,
<B><FONT COLOR="#228B22">int</FONT></B> count,
MwLLPixmap* pixmap,
va_list va
);</pre>
<dl>
<dd>
Inserts multiple items on the listbox.
</dd>
<dt>
Parameter <code>handle</code>
</dt>
<dd>
Widget.
</dd>
<dt>
Parameter <code>index</code>
</dt>
<dd>
Index.
</dd>
<dt>
Parameter <code>count</code>
</dt>
<dd>
Count.
</dd>
<dt>
Parameter <code>pixmap</code>
</dt>
<dd>
Pixmap.
</dd>
<dt>
Parameter <code>va</code>
</dt>
<dd>
Text.
</dd>
</dl>
<hr>
<pre id="Mw_Widget_ListBox_h__MwListBoxDelete">MwInline <B><FONT COLOR="#228B22">void</FONT></B> <B><FONT COLOR="#0000FF">MwListBoxDelete</FONT></B> (
MwWidget handle,
<B><FONT COLOR="#228B22">int</FONT></B> index

View File

@@ -2,7 +2,6 @@
/*!
* %file Mw/Widget/Button.h
* %brief Button widget
* %prop MwNpixmap MwNtext
*/
#ifndef __MW_WIDGET_BUTTON_H__
#define __MW_WIDGET_BUTTON_H__

View File

@@ -2,7 +2,6 @@
/*!
* %file Mw/Widget/CheckBox.h
* %brief CheckBox widget
* %prop MwNchecked
*/
#ifndef __MW_WIDGET_CHECKBOX_H__
#define __MW_WIDGET_CHECKBOX_H__

View File

@@ -2,7 +2,6 @@
/*!
* %file Mw/Widget/Entry.h
* %brief Entry widget
* %prop MwNtext
*/
#ifndef __MW_WIDGET_ENTRY_H__
#define __MW_WIDGET_ENTRY_H__

View File

@@ -2,7 +2,6 @@
/*!
* %file Mw/Widget/Image.h
* %brief Image widget
* %prop MwNpixmap
*/
#ifndef __MW_WIDGET_IMAGE_H__
#define __MW_WIDGET_IMAGE_H__

View File

@@ -2,7 +2,6 @@
/*!
* %file Mw/Widget/Label.h
* %brief Label widget
* %prop MwNtext MwNalignment MwNbold
*/
#ifndef __MW_WIDGET_LABEL_H__
#define __MW_WIDGET_LABEL_H__

View File

@@ -2,7 +2,6 @@
/*!
* %file Mw/Widget/ListBox.h
* %brief ListBox widget
* %prop MwNleftPadding
*/
#ifndef __MW_WIDGET_LISTBOX_H__
#define __MW_WIDGET_LISTBOX_H__
@@ -27,7 +26,12 @@ MWDECL MwClass MwListBoxClass;
* %param pixmap Pixmap
* %param ... Text
*/
MWDECL void MwListBoxInsert(MwWidget handle, int index, MwLLPixmap pixmap, ...); /* VA_HINT:pixmap */
MwInline void MwListBoxInsert(MwWidget handle, int index, MwLLPixmap pixmap, ...) {
va_list va;
va_start(va, pixmap);
MwVaWidgetExecute(handle, "mwListBoxInsert", NULL, index, pixmap, &va);
va_end(va);
}
/*!
* %brief Inserts multiple items on the listbox
@@ -37,26 +41,12 @@ MWDECL void MwListBoxInsert(MwWidget handle, int index, MwLLPixmap pixmap, ...);
* %param pixmap Pixmap
* %param ... Text
*/
MWDECL void MwListBoxInsertMultiple(MwWidget handle, int index, int count, MwLLPixmap* pixmap, ...); /* VA_HINT:pixmap */
/*!
* %brief Inserts item on the listbox
* %param handle Widget
* %param index Index
* %param pixmap Pixmap
* %param va Text
*/
MWDECL void MwListBoxVaInsert(MwWidget handle, int index, MwLLPixmap pixmap, va_list va);
/*!
* %brief Inserts multiple items on the listbox
* %param handle Widget
* %param index Index
* %param count Count
* %param pixmap Pixmap
* %param va Text
*/
MWDECL void MwListBoxVaInsertMultiple(MwWidget handle, int index, int count, MwLLPixmap* pixmap, va_list va);
MwInline void MwListBoxInsertMultiple(MwWidget handle, int index, int count, MwLLPixmap* pixmap, ...) {
va_list va;
va_start(va, pixmap);
MwVaWidgetExecute(handle, "mwListBoxInsertMultiple", NULL, index, count, pixmap, &va);
va_end(va);
}
/*!
* %brief Deletes item from the listbox

View File

@@ -1,43 +0,0 @@
/* $Id$ */
#ifndef __MWOO_BASE_H__
#define __MWOO_BASE_H__
#include <Mw/Milsko.h>
#define MwOODeclare(name, parent_class) \
public: \
name(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : parent_class(widget_name, parent, x, y, w, h) {}
namespace MwOO {
class Base {
protected:
MwWidget widget;
private:
int can_be_gc;
void SetHandler(void);
public:
MwOO::Base MessageBox(const char* title, const char* text, unsigned int flags);
MwOO::Base MessageBoxGetChild(int num);
void Loop(void);
void SetX(int value);
void SetY(int value);
void SetWidth(int value);
void SetHeight(int value);
int GetX(void);
int GetY(void);
int GetWidth(void);
int GetHeight(void);
/* BEGIN AUTOGENERATE */
/* END AUTOGENERATE */
Base(void);
Base(MwClass widget_class, const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
Base(MwWidget widget, int gc = 0);
~Base(void);
};
} // namespace MwOO
#endif

View File

@@ -1,22 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_BUTTON_H__
#define __MWOO_WIDGET_BUTTON_H__
#include <MwOO/Base.h>
namespace MwOO {
class Button : public MwOO::Base {
public:
Button(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void SetPixmap(void* value);
void* GetPixmap(void);
void SetText(const char* value);
const char* GetText(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,20 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_CHECKBOX_H__
#define __MWOO_WIDGET_CHECKBOX_H__
#include <MwOO/Base.h>
namespace MwOO {
class CheckBox : public MwOO::Base {
public:
CheckBox(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void SetChecked(int value);
int GetChecked(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,20 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_ENTRY_H__
#define __MWOO_WIDGET_ENTRY_H__
#include <MwOO/Base.h>
namespace MwOO {
class Entry : public MwOO::Base {
public:
Entry(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void SetText(const char* value);
const char* GetText(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,18 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_FRAME_H__
#define __MWOO_WIDGET_FRAME_H__
#include <MwOO/Base.h>
namespace MwOO {
class Frame : public MwOO::Base {
public:
Frame(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,20 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_IMAGE_H__
#define __MWOO_WIDGET_IMAGE_H__
#include <MwOO/Base.h>
namespace MwOO {
class Image : public MwOO::Base {
public:
Image(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void SetPixmap(void* value);
void* GetPixmap(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,24 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_LABEL_H__
#define __MWOO_WIDGET_LABEL_H__
#include <MwOO/Base.h>
namespace MwOO {
class Label : public MwOO::Base {
public:
Label(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void SetText(const char* value);
const char* GetText(void);
void SetAlignment(int value);
int GetAlignment(void);
void SetBold(int value);
int GetBold(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,28 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_LISTBOX_H__
#define __MWOO_WIDGET_LISTBOX_H__
#include <MwOO/Base.h>
namespace MwOO {
class ListBox : public MwOO::Base {
public:
ListBox(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void Insert(int index, MwLLPixmap pixmap, ...);
void InsertMultiple(int index, int count, MwLLPixmap* pixmap, ...);
void VaInsert(int index, MwLLPixmap pixmap, va_list va);
void VaInsertMultiple(int index, int count, MwLLPixmap* pixmap, va_list va);
void Delete(int index);
const char* Get(int index);
void SetWidth(int index, int width);
void Reset(void);
void SetLeftPadding(int value);
int GetLeftPadding(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,19 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_MENU_H__
#define __MWOO_WIDGET_MENU_H__
#include <MwOO/Base.h>
namespace MwOO {
class Menu : public MwOO::Base {
public:
Menu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
MwMenu Add(MwMenu menu, const char* name);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,20 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_NUMBERENTRY_H__
#define __MWOO_WIDGET_NUMBERENTRY_H__
#include <MwOO/Base.h>
namespace MwOO {
class NumberEntry : public MwOO::Base {
public:
NumberEntry(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void SetText(const char* value);
const char* GetText(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,21 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_OPENGL_H__
#define __MWOO_WIDGET_OPENGL_H__
#include <MwOO/Base.h>
namespace MwOO {
class OpenGL : public MwOO::Base {
public:
OpenGL(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void MakeCurrent(void);
void* GetProcAddress(const char* name);
void SwapBuffer(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,29 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_SCROLLBAR_H__
#define __MWOO_WIDGET_SCROLLBAR_H__
#include <MwOO/Base.h>
namespace MwOO {
class ScrollBar : public MwOO::Base {
public:
ScrollBar(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
int GetVisibleLength(void);
void SetAreaShown(int value);
int GetAreaShown(void);
void SetValue(int value);
int GetValue(void);
void SetMinValue(int value);
int GetMinValue(void);
void SetMaxValue(int value);
int GetMaxValue(void);
void SetOrientation(int value);
int GetOrientation(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,19 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_SUBMENU_H__
#define __MWOO_WIDGET_SUBMENU_H__
#include <MwOO/Base.h>
namespace MwOO {
class SubMenu : public MwOO::Base {
public:
SubMenu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void Appear(MwMenu menu, MwPoint* point);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,20 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_VIEWPORT_H__
#define __MWOO_WIDGET_VIEWPORT_H__
#include <MwOO/Base.h>
namespace MwOO {
class Viewport : public MwOO::Base {
public:
Viewport(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
MwOO::Base GetViewport(void);
void SetSize(int w, int h);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,23 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_VULKAN_H__
#define __MWOO_WIDGET_VULKAN_H__
#include <MwOO/Base.h>
namespace MwOO {
class Vulkan : public MwOO::Base {
public:
Vulkan(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void EnableExtension(void);
void EnableLayer(void);
void Configure(void);
void* GetField(MwVulkanField field, MwErrorEnum* out);
VkBool32 Supported(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -1,27 +0,0 @@
/* $Id$ */
#ifndef __MWOO_WIDGET_WINDOW_H__
#define __MWOO_WIDGET_WINDOW_H__
#include <MwOO/Base.h>
namespace MwOO {
class Window : public MwOO::Base {
public:
Window(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
void MakeBorderless(int toggle);
void SetTitle(const char* value);
const char* GetTitle(void);
void SetMain(int value);
int GetMain(void);
void SetIconPixmap(void* value);
void* GetIconPixmap(void);
void SetSizeHints(void* value);
void* GetSizeHints(void);
void SetBackground(const char* value);
const char* GetBackground(void);
void SetForeground(const char* value);
const char* GetForeground(void);
};
} // namespace MwOO
#endif

View File

@@ -66,7 +66,7 @@
</attributes>
<constants>
</constants>
<header name="core">
<header name="Core">
<function name="MwCreateWidget">
<return>
<widget />
@@ -246,10 +246,40 @@
</arguments>
</function>
</header>
<header name="Error">
<function name="MwGetLastError">
<return>
<string />
</return>
</function>
</header>
<widget name="Button">
<attributes>
<attribute name="pixmap" />
<attribute name="text" />
</attributes>
</widget>
<widget name="CheckBox">
<attributes>
<attribute name="checked" />
</attributes>
</widget>
<widget name="Entry">
<attributes>
<attribute name="text" />
</attributes>
</widget>
<widget name="Frame" />
<widget name="Image">
<attributes>
<attribute name="pixmap" />
</attributes>
</widget>
<widget name="Label">
<attributes>
<attribute name="text" />
<attribute name="alignment" />
<attribute name="bold" />
</attributes>
</widget>
</milsko>

View File

@@ -1,79 +0,0 @@
/* $Id$ */
#include <MwOO/Base.h>
MwOO::Base::Base(MwClass widget_class, const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h){
this->widget = MwCreateWidget(widget_class, widget_name, parent == NULL ? NULL : parent->widget, x, y, w, h);
this->can_be_gc = 1;
if(this->widget != NULL){
this->SetHandler();
}
}
MwOO::Base::Base(MwWidget widget, int gc){
this->widget = widget;
this->can_be_gc = gc;
this->SetHandler();
}
MwOO::Base::Base(void){
this->widget = NULL;
this->can_be_gc = 0;
}
MwOO::Base::~Base(void){
if(this->can_be_gc) MwDestroyWidget(this->widget);
}
MwOO::Base MwOO::Base::MessageBox(const char* title, const char* text, unsigned int flags){
MwWidget widget = MwMessageBox(this->widget, title, text, flags);
return MwOO::Base(widget, 1);
}
MwOO::Base MwOO::Base::MessageBoxGetChild(int num){
MwWidget widget = MwMessageBoxGetChild(this->widget, num);
return MwOO::Base(widget);
}
void MwOO::Base::Loop(void){
MwLoop(this->widget);
}
void MwOO::Base::SetX(int value){
MwSetInteger(this->widget, MwNx, value);
}
void MwOO::Base::SetY(int value){
MwSetInteger(this->widget, MwNy, value);
}
void MwOO::Base::SetWidth(int value){
MwSetInteger(this->widget, MwNwidth, value);
}
void MwOO::Base::SetHeight(int value){
MwSetInteger(this->widget, MwNheight, value);
}
int MwOO::Base::GetX(void){
return MwGetInteger(this->widget, MwNx);
}
int MwOO::Base::GetY(void){
return MwGetInteger(this->widget, MwNy);
}
int MwOO::Base::GetWidth(void){
return MwGetInteger(this->widget, MwNwidth);
}
int MwOO::Base::GetHeight(void){
return MwGetInteger(this->widget, MwNheight);
}
/* BEGIN AUTOGENERATE */
void MwOO::Base::SetHandler(void){
}
/* END AUTOGENERATE */

View File

@@ -1,2 +0,0 @@
# $Id$
OOL_OBJS += oosrc/widget/button.o oosrc/widget/frame.o oosrc/widget/image.o oosrc/widget/menu.o oosrc/widget/scrollbar.o oosrc/widget/submenu.o oosrc/widget/window.o oosrc/widget/checkbox.o oosrc/widget/label.o oosrc/widget/entry.o oosrc/widget/viewport.o oosrc/widget/numberentry.o oosrc/widget/listbox.o

View File

@@ -1,39 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Button.h>
#include <Mw/Widget/Button.h>
MwOO::Button::Button(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwButtonClass, widget_name, parent, x, y, w, h){
}
void MwOO::Button::SetPixmap(void* value){
MwSetVoid(this->widget, MwNpixmap, value);
}
void* MwOO::Button::GetPixmap(void){
return MwGetVoid(this->widget, MwNpixmap);
}
void MwOO::Button::SetText(const char* value){
MwSetText(this->widget, MwNtext, value);
}
const char* MwOO::Button::GetText(void){
return MwGetText(this->widget, MwNtext);
}
void MwOO::Button::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Button::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Button::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Button::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,31 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/CheckBox.h>
#include <Mw/Widget/CheckBox.h>
MwOO::CheckBox::CheckBox(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwCheckBoxClass, widget_name, parent, x, y, w, h){
}
void MwOO::CheckBox::SetChecked(int value){
MwSetInteger(this->widget, MwNchecked, value);
}
int MwOO::CheckBox::GetChecked(void){
return MwGetInteger(this->widget, MwNchecked);
}
void MwOO::CheckBox::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::CheckBox::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::CheckBox::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::CheckBox::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,31 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Entry.h>
#include <Mw/Widget/Entry.h>
MwOO::Entry::Entry(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwEntryClass, widget_name, parent, x, y, w, h){
}
void MwOO::Entry::SetText(const char* value){
MwSetText(this->widget, MwNtext, value);
}
const char* MwOO::Entry::GetText(void){
return MwGetText(this->widget, MwNtext);
}
void MwOO::Entry::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Entry::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Entry::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Entry::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,23 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Frame.h>
#include <Mw/Widget/Frame.h>
MwOO::Frame::Frame(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwFrameClass, widget_name, parent, x, y, w, h){
}
void MwOO::Frame::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Frame::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Frame::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Frame::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,31 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Image.h>
#include <Mw/Widget/Image.h>
MwOO::Image::Image(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwImageClass, widget_name, parent, x, y, w, h){
}
void MwOO::Image::SetPixmap(void* value){
MwSetVoid(this->widget, MwNpixmap, value);
}
void* MwOO::Image::GetPixmap(void){
return MwGetVoid(this->widget, MwNpixmap);
}
void MwOO::Image::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Image::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Image::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Image::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,47 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Label.h>
#include <Mw/Widget/Label.h>
MwOO::Label::Label(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwLabelClass, widget_name, parent, x, y, w, h){
}
void MwOO::Label::SetText(const char* value){
MwSetText(this->widget, MwNtext, value);
}
const char* MwOO::Label::GetText(void){
return MwGetText(this->widget, MwNtext);
}
void MwOO::Label::SetAlignment(int value){
MwSetInteger(this->widget, MwNalignment, value);
}
int MwOO::Label::GetAlignment(void){
return MwGetInteger(this->widget, MwNalignment);
}
void MwOO::Label::SetBold(int value){
MwSetInteger(this->widget, MwNbold, value);
}
int MwOO::Label::GetBold(void){
return MwGetInteger(this->widget, MwNbold);
}
void MwOO::Label::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Label::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Label::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Label::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,71 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/ListBox.h>
#include <Mw/Widget/ListBox.h>
MwOO::ListBox::ListBox(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwListBoxClass, widget_name, parent, x, y, w, h){
}
void MwOO::ListBox::Insert(int index, MwLLPixmap pixmap, ...){
va_list va;
va_start(va, pixmap);
MwListBoxVaInsert(this->widget, index, pixmap, va);
va_end(va);
}
void MwOO::ListBox::InsertMultiple(int index, int count, MwLLPixmap* pixmap, ...){
va_list va;
va_start(va, pixmap);
MwListBoxVaInsertMultiple(this->widget, index, count, pixmap, va);
va_end(va);
}
void MwOO::ListBox::VaInsert(int index, MwLLPixmap pixmap, va_list va){
MwListBoxVaInsert(this->widget, index, pixmap, va);
}
void MwOO::ListBox::VaInsertMultiple(int index, int count, MwLLPixmap* pixmap, va_list va){
MwListBoxVaInsertMultiple(this->widget, index, count, pixmap, va);
}
void MwOO::ListBox::Delete(int index){
MwListBoxDelete(this->widget, index);
}
const char* MwOO::ListBox::Get(int index){
const char* ret;
ret = MwListBoxGet(this->widget, index);
return ret;
}
void MwOO::ListBox::SetWidth(int index, int width){
MwListBoxSetWidth(this->widget, index, width);
}
void MwOO::ListBox::Reset(void){
MwListBoxReset(this->widget);
}
void MwOO::ListBox::SetLeftPadding(int value){
MwSetInteger(this->widget, MwNleftPadding, value);
}
int MwOO::ListBox::GetLeftPadding(void){
return MwGetInteger(this->widget, MwNleftPadding);
}
void MwOO::ListBox::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::ListBox::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::ListBox::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::ListBox::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,29 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Menu.h>
#include <Mw/Widget/Menu.h>
MwOO::Menu::Menu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwMenuClass, widget_name, parent, x, y, w, h){
}
MwMenu MwOO::Menu::Add(MwMenu menu, const char* name){
MwMenu ret;
ret = MwMenuAdd(this->widget, menu, name);
return ret;
}
void MwOO::Menu::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Menu::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Menu::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Menu::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,31 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/NumberEntry.h>
#include <Mw/Widget/NumberEntry.h>
MwOO::NumberEntry::NumberEntry(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwNumberEntryClass, widget_name, parent, x, y, w, h){
}
void MwOO::NumberEntry::SetText(const char* value){
MwSetText(this->widget, MwNtext, value);
}
const char* MwOO::NumberEntry::GetText(void){
return MwGetText(this->widget, MwNtext);
}
void MwOO::NumberEntry::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::NumberEntry::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::NumberEntry::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::NumberEntry::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,37 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/OpenGL.h>
#include <Mw/Widget/OpenGL.h>
MwOO::OpenGL::OpenGL(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwOpenGLClass, widget_name, parent, x, y, w, h){
}
void MwOO::OpenGL::MakeCurrent(void){
MwOpenGLMakeCurrent(this->widget);
}
void* MwOO::OpenGL::GetProcAddress(const char* name){
void* ret;
ret = MwOpenGLGetProcAddress(this->widget, name);
return ret;
}
void MwOO::OpenGL::SwapBuffer(void){
MwOpenGLSwapBuffer(this->widget);
}
void MwOO::OpenGL::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::OpenGL::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::OpenGL::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::OpenGL::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,69 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/ScrollBar.h>
#include <Mw/Widget/ScrollBar.h>
MwOO::ScrollBar::ScrollBar(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwScrollBarClass, widget_name, parent, x, y, w, h){
}
int MwOO::ScrollBar::GetVisibleLength(void){
int ret;
ret = MwScrollBarGetVisibleLength(this->widget);
return ret;
}
void MwOO::ScrollBar::SetAreaShown(int value){
MwSetInteger(this->widget, MwNareaShown, value);
}
int MwOO::ScrollBar::GetAreaShown(void){
return MwGetInteger(this->widget, MwNareaShown);
}
void MwOO::ScrollBar::SetValue(int value){
MwSetInteger(this->widget, MwNvalue, value);
}
int MwOO::ScrollBar::GetValue(void){
return MwGetInteger(this->widget, MwNvalue);
}
void MwOO::ScrollBar::SetMinValue(int value){
MwSetInteger(this->widget, MwNminValue, value);
}
int MwOO::ScrollBar::GetMinValue(void){
return MwGetInteger(this->widget, MwNminValue);
}
void MwOO::ScrollBar::SetMaxValue(int value){
MwSetInteger(this->widget, MwNmaxValue, value);
}
int MwOO::ScrollBar::GetMaxValue(void){
return MwGetInteger(this->widget, MwNmaxValue);
}
void MwOO::ScrollBar::SetOrientation(int value){
MwSetInteger(this->widget, MwNorientation, value);
}
int MwOO::ScrollBar::GetOrientation(void){
return MwGetInteger(this->widget, MwNorientation);
}
void MwOO::ScrollBar::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::ScrollBar::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::ScrollBar::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::ScrollBar::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,27 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/SubMenu.h>
#include <Mw/Widget/SubMenu.h>
MwOO::SubMenu::SubMenu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwSubMenuClass, widget_name, parent, x, y, w, h){
}
void MwOO::SubMenu::Appear(MwMenu menu, MwPoint* point){
MwSubMenuAppear(this->widget, menu, point);
}
void MwOO::SubMenu::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::SubMenu::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::SubMenu::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::SubMenu::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,33 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Viewport.h>
#include <Mw/Widget/Viewport.h>
MwOO::Viewport::Viewport(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwViewportClass, widget_name, parent, x, y, w, h){
}
MwOO::Base MwOO::Viewport::GetViewport(void){
MwOO::Base ret;
ret = MwOO::Base(MwViewportGetViewport(this->widget));
return ret;
}
void MwOO::Viewport::SetSize(int w, int h){
MwViewportSetSize(this->widget, w, h);
}
void MwOO::Viewport::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Viewport::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Viewport::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Viewport::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,47 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Vulkan.h>
#include <Mw/Widget/Vulkan.h>
MwOO::Vulkan::Vulkan(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwVulkanClass, widget_name, parent, x, y, w, h){
}
void MwOO::Vulkan::EnableExtension(void){
MwVulkanEnableExtension(this->widget);
}
void MwOO::Vulkan::EnableLayer(void){
MwVulkanEnableLayer(this->widget);
}
void MwOO::Vulkan::Configure(void){
MwVulkanConfigure(this->widget);
}
void* MwOO::Vulkan::GetField(MwVulkanField field, MwErrorEnum* out){
void* ret;
ret = MwVulkanGetField(this->widget, field, out);
return ret;
}
VkBool32 MwOO::Vulkan::Supported(void){
VkBool32 ret;
ret = MwVulkanSupported(this->widget);
return ret;
}
void MwOO::Vulkan::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Vulkan::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Vulkan::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Vulkan::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -1,59 +0,0 @@
/* $Id$ */
#include <MwOO/Widget/Window.h>
#include <Mw/Widget/Window.h>
MwOO::Window::Window(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwWindowClass, widget_name, parent, x, y, w, h){
}
void MwOO::Window::MakeBorderless(int toggle){
MwWindowMakeBorderless(this->widget, toggle);
}
void MwOO::Window::SetTitle(const char* value){
MwSetText(this->widget, MwNtitle, value);
}
const char* MwOO::Window::GetTitle(void){
return MwGetText(this->widget, MwNtitle);
}
void MwOO::Window::SetMain(int value){
MwSetInteger(this->widget, MwNmain, value);
}
int MwOO::Window::GetMain(void){
return MwGetInteger(this->widget, MwNmain);
}
void MwOO::Window::SetIconPixmap(void* value){
MwSetVoid(this->widget, MwNiconPixmap, value);
}
void* MwOO::Window::GetIconPixmap(void){
return MwGetVoid(this->widget, MwNiconPixmap);
}
void MwOO::Window::SetSizeHints(void* value){
MwSetVoid(this->widget, MwNsizeHints, value);
}
void* MwOO::Window::GetSizeHints(void){
return MwGetVoid(this->widget, MwNsizeHints);
}
void MwOO::Window::SetBackground(const char* value){
MwSetText(this->widget, MwNbackground, value);
}
const char* MwOO::Window::GetBackground(void){
return MwGetText(this->widget, MwNbackground);
}
void MwOO::Window::SetForeground(const char* value){
MwSetText(this->widget, MwNforeground, value);
}
const char* MwOO::Window::GetForeground(void){
return MwGetText(this->widget, MwNforeground);
}

View File

@@ -312,7 +312,7 @@ static void prop_change(MwWidget handle, const char* prop) {
}
}
void MwListBoxVaInsert(MwWidget handle, int index, MwLLPixmap pixmap, va_list va) {
static void mwListBoxInsertImpl(MwWidget handle, int index, MwLLPixmap pixmap, va_list va) {
MwListBox lb = handle->internal;
MwListBoxEntry entry;
char* name;
@@ -334,7 +334,7 @@ void MwListBoxVaInsert(MwWidget handle, int index, MwLLPixmap pixmap, va_list va
}
}
void MwListBoxVaInsertMultiple(MwWidget handle, int index, int count, MwLLPixmap* pixmap, va_list va) {
static void mwListBoxInsertMultipleImpl(MwWidget handle, int index, int count, MwLLPixmap* pixmap, va_list va) {
int i;
MwListBox lb = handle->internal;
int old;
@@ -416,20 +416,6 @@ static void mwListBoxResetImpl(MwWidget handle) {
MwForceRender(lb->frame);
}
void MwListBoxInsertMultiple(MwWidget handle, int index, int count, MwLLPixmap* pixmap, ...) {
va_list va;
va_start(va, pixmap);
MwListBoxVaInsertMultiple(handle, index, count, pixmap, va);
va_end(va);
}
void MwListBoxInsert(MwWidget handle, int index, MwLLPixmap pixmap, ...) {
va_list va;
va_start(va, pixmap);
MwListBoxVaInsert(handle, index, pixmap, va);
va_end(va);
}
static const char* mwListBoxGetImpl(MwWidget handle, int index) {
MwListBox lb = handle->internal;
@@ -469,6 +455,23 @@ static void func_handler(MwWidget handle, const char* name, void* out, va_list v
int width = va_arg(va, int);
mwListBoxSetWidthImpl(handle, index, width);
}
if(strcmp(name, "mwListBoxInsert") == 0) {
int index = va_arg(va, int);
MwLLPixmap pixmap = va_arg(va, MwLLPixmap);
va_list* pva = va_arg(va, va_list*);
va_list va;
memcpy(&va, pva, sizeof(va));
mwListBoxInsertImpl(handle, index, pixmap, va);
}
if(strcmp(name, "mwListBoxInsertMultiple") == 0) {
int index = va_arg(va, int);
int count = va_arg(va, int);
MwLLPixmap* pixmap = va_arg(va, MwLLPixmap*);
va_list* pva = va_arg(va, va_list*);
va_list va;
memcpy(&va, pva, sizeof(va));
mwListBoxInsertMultipleImpl(handle, index, count, pixmap, va);
}
}
MwClassRec MwListBoxClassRec = {

View File

@@ -2,21 +2,17 @@
# $Id$
my @cfiles = ();
my @cxxfiles = ();
sub scan {
opendir(DIR, $_[0]);
my @files = readdir(DIR);
foreach my $f (@files) {
if ($f =~ /^vulkan\.cc?$/) {
if ($f =~ /^vulkan\.c$/) {
next;
}
if ($f =~ /\.c$/) {
push(@cfiles, $_[0] . "/" . $f);
}
elsif ($f =~ /\.cc$/) {
push(@cxxfiles, $_[0] . "/" . $f);
}
}
closedir(DIR);
}
@@ -25,19 +21,7 @@ sub cobjs {
my $r = "";
foreach my $f (@cfiles) {
my $b = $f;
$b =~ s/\.cc?$/.obj/;
$b =~ s/\//$_[0]/g;
$r = $r . " " . $_[1] . $b;
}
return $r;
}
sub cxxobjs {
my $r = "";
foreach my $f (@cxxfiles) {
my $b = $f;
$b =~ s/\.cc?$/.obj/;
$b =~ s/\.c$/.obj/;
$b =~ s/\//$_[0]/g;
$r = $r . " " . $_[1] . $b;
@@ -49,7 +33,6 @@ sub generate {
my ($output, $type) = @_;
my $cc = "";
my $cxx = "";
my $link = "";
my $suffix = 1;
@@ -65,13 +48,10 @@ sub generate {
my $needlibs = "";
my $lib = "";
my $c_dllout = "";
my $cxx_dllout = "";
my $c_dllafter = "";
my $cxx_dllafter = "";
if ($type eq "Borland") {
$cc = "bcc32 -c";
$cxx = "bcc32 -c -P";
$link = "bcc32";
$out = "-o";
$dllout = "-e";
@@ -81,11 +61,9 @@ sub generate {
$lib = "-l";
$c_dllafter = "implib src${dir}Mw.lib src${dir}Mw.dll";
$cxx_dllafter = "implib oosrc${dir}MwOO.lib oosrc${dir}MwOO.dll";
}
elsif ($type eq "MSVC") {
$cc = "cl /TC /c /nologo";
$cxx = "cl /TP /c /nologo";
$link = "link /nologo";
$out = "/Fo";
$dllout = "/OUT:";
@@ -95,7 +73,6 @@ sub generate {
}
elsif ($type eq "Watcom") {
$cc = "wcc386 -bt=nt -q";
$cxx = "wpp386 -bt=nt -q";
$link = "wlink option quiet";
$out = "-fo=";
$dllout = "name ";
@@ -111,41 +88,37 @@ sub generate {
$prefobj = "file ";
$needlibs = "${lib}clib3r.lib";
$c_dllout = "option implib=src${dir}Mw.lib";
$cxx_dllout = "option implib=oosrc${dir}MwOO.lib";
}
open(OUT, ">", $output);
print(OUT "# \$Id\$\n");
print(OUT "CC = $cc\n");
print(OUT "CXX = $cxx\n");
print(OUT "LD = $link\n");
print(OUT "\n");
print(OUT
"CFLAGS = ${inc}include ${def}_MILSKO ${def}USE_GDI ${def}USE_STB_IMAGE ${def}STBI_NO_SIMD\n"
);
print(OUT "CXXFLAGS = ${inc}include\n");
print(OUT "LDFLAGS = $dll");
print(OUT "\n");
if ($suffix) {
print(OUT ".SUFFIXES: .obj .c .cc\n");
print(OUT ".SUFFIXES: .obj .c\n");
}
print(OUT "all: src${dir}Mw.dll oosrc${dir}MwOO.dll\n");
print(OUT "all: src${dir}Mw.dll\n");
print(OUT "clean: $symbolic\n");
foreach my $f (@cfiles) {
my $b = $f;
$b =~ s/\.cc?$/.obj/;
$b =~ s/\.c$/.obj/;
$b =~ s/\//$dir/g;
print(OUT " $del $b\n");
}
foreach my $f (@cxxfiles) {
my $b = $f;
$b =~ s/\.cc?$/.obj/;
$b =~ s/\.c$/.obj/;
$b =~ s/\//$dir/g;
print(OUT " $del $b\n");
}
print(OUT " $del src${dir}Mw.dll\n");
print(OUT " $del oosrc${dir}MwOO.dll\n");
print(OUT "\n");
print(OUT "src${dir}Mw.dll: " . cobjs($dir) . "\n");
print( OUT " \$(LD) \$(LDFLAGS) $c_dllout $dllout\$@ "
@@ -153,33 +126,19 @@ sub generate {
. " $needlibs ${lib}opengl32.lib ${lib}gdi32.lib ${lib}user32.lib\n");
print(OUT " $c_dllafter\n");
print(OUT "\n");
print(OUT "oosrc${dir}MwOO.dll: " . cxxobjs($dir) . "\n");
print( OUT " \$(LD) \$(LDFLAGS) $cxx_dllout $dllout\$@ "
. cxxobjs($dir, $prefobj)
. " $needlibs ${lib}src${dir}Mw.lib\n");
print(OUT " $cxx_dllafter\n");
print(OUT "\n");
if ($suffix) {
print(OUT ".c.obj:\n");
print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n");
print(OUT ".cc.obj:\n");
print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n");
}
else {
print(OUT "\n");
foreach my $f (@cfiles) {
my $o = $f;
$o =~ s/\.cc?$/.obj/;
$o =~ s/\.c$/.obj/;
print(OUT "$o: $f\n");
print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n");
}
foreach my $f (@cxxfiles) {
my $o = $f;
$o =~ s/\.cc?$/.obj/;
print(OUT "$o: $f\n");
print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n");
}
}
close(OUT);
}
@@ -191,9 +150,6 @@ scan("src/cursor");
scan("src/widget");
push(@cfiles, "src/backend/gdi.c");
scan("oosrc");
scan("oosrc/widget");
generate("BorMakefile", "Borland");
generate("NTMakefile", "MSVC");
generate("WatMakefile", "Watcom");

View File

@@ -1,328 +0,0 @@
#!/usr/bin/env perl
# $Id$
my $objs = "";
my $decl = "";
my @calls = ();
my %ints = ();
my %texts = ();
my %voids = ();
open(IN, "<", "include/Mw/StringDefs.h");
while (my $hl = <IN>) {
$hl =~ s/\r?\n$//;
if ($hl =~ /^#define[ \t]+([^ ]+)[ \t]+"C(.+)"$/) {
my $name = "On" . uc(substr($2, 0, 1)) . substr($2, 1);
my @c = ($1, $name);
$decl = $decl . " virtual void " . $name . "(void*){};\n";
push(@calls, [@c]);
}
elsif ($hl =~ /^#define[ \t]+([^ ]+)[ \t]+"I(.+)"$/) {
$ints{$1} = uc(substr($2, 0, 1)) . substr($2, 1);
}
elsif ($hl =~ /^#define[ \t]+([^ ]+)[ \t]+"S(.+)"$/) {
$texts{$1} = uc(substr($2, 0, 1)) . substr($2, 1);
}
elsif ($hl =~ /^#define[ \t]+([^ ]+)[ \t]+"V(.+)"$/) {
$voids{$1} = uc(substr($2, 0, 1)) . substr($2, 1);
}
}
close(IN);
opendir(DIR, "include/Mw/Widget");
my @files = readdir(DIR);
foreach my $f (@files) {
if ($f eq '.' || $f eq '..') {
next;
}
$f =~ /^(.+)\.h$/;
my $name = $1;
my @props = ();
my @methods = ();
my @omethods = ();
my @comments = ();
my @names = ();
my @args = ();
open(IN, "include/Mw/Widget/$f");
while (my $l = <IN>) {
$l =~ s/\r?\n$//g;
if ($l =~ /%prop[ \t]+(.+)$/) {
@props = split(/[ \t]+/, $1);
}
elsif ($l =~
/^(?:MWDECL|MwInline)[ \t]+(.+)[ \t]+Mw${name}([^ \t]+)[ \t]*\([^,\)]+(?:,(.*))?\)(?:;|[ \t]+\{)(?: \/\*(.+))?$/
)
{
my $arg = $3;
my $ret = $1;
my $nam = $2;
my $com = $4;
$arg =~ s/^[ \t]+//;
$arg =~ s/[ \t]+$//;
if (!$arg) {
$arg = "void";
}
push(@methods, "$ret $nam($arg)");
push(@omethods, "$ret MwOO::${name}::$nam($arg)");
push(@names, $nam);
push(@comments, $com);
my @al = split(/[ \t]*,[ \t]*/, $arg);
my $i = 0;
foreach my $dummy (@al) {
$al[$i] =~ s/^.+[ \t]+([^ \t]+)$/\1/g;
$i++;
}
push(@args, join(", ", @al));
}
}
close(IN);
push(@props, "MwNbackground");
push(@props, "MwNforeground");
open(OUT, ">", "include/MwOO/Widget/$f");
print(OUT "/* \$Id\$ */\n");
print(OUT "#ifndef __MWOO_WIDGET_" . uc($name) . "_H__\n");
print(OUT "#define __MWOO_WIDGET_" . uc($name) . "_H__\n");
print(OUT "\n");
print(OUT "#include <MwOO/Base.h>\n");
print(OUT "\n");
print(OUT "namespace MwOO {\n");
print(OUT " class ${name} : public MwOO::Base {\n");
print(OUT " public:\n");
print(OUT
" ${name}(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);\n"
);
foreach my $m (@methods) {
if ($m =~ /^MwWidget[ \t]+/) {
my $l = $m;
$l =~ s/^MwWidget([ \t]+)/MwOO::Base\1/g;
print(OUT " $l;\n");
}
else {
print(OUT " $m;\n");
}
}
foreach my $prop (@props) {
my $type = "";
my %hash = ();
if (defined($ints{$prop})) {
$type = "int";
%hash = %ints;
}
elsif (defined($texts{$prop})) {
$type = "const char*";
%hash = %texts;
}
elsif (defined($voids{$prop})) {
$type = "void*";
%hash = %voids;
}
if (length($type) > 0) {
print(OUT " void Set" . $hash{$prop} . "($type value);\n");
print(OUT " $type Get" . $hash{$prop} . "(void);\n");
}
}
print(OUT " };\n");
print(OUT "}\n");
print(OUT "\n");
print(OUT "#endif\n");
close(OUT);
open(OUT, ">", "oosrc/widget/" . lc($name) . ".cc");
print(OUT "/* \$Id\$ */\n");
print(OUT "#include <MwOO/Widget/$name.h>\n");
print(OUT "#include <Mw/Widget/$name.h>\n");
print(OUT "\n");
print(OUT
"MwOO::${name}::${name}(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(Mw${name}Class, widget_name, parent, x, y, w, h){\n"
);
print(OUT "}\n");
print(OUT "\n");
my $i = 0;
foreach my $m (@omethods) {
my $end = "";
my $suffix = "";
if ($m =~ /^MwWidget[ \t]+/) {
my $l = $m;
$l =~ s/^MwWidget([ \t]+)/MwOO::Base\1/;
print(OUT "$l\{\n");
}
else {
print(OUT "$m\{\n");
}
if ($args[$i] =~ /\.\.\./) {
print(OUT " va_list va;\n");
}
if (!($m =~ /^void[ \t]+/)) {
my $rettype = $m;
$rettype =~ s/^MwWidget([ \t]+)/MwOO::Base\1/;
$rettype =~ s/ MwOO::.+\)$//;
print(OUT " $rettype ret;\n");
}
if ($args[$i] =~ /\.\.\./) {
my $p = $comments[$i];
$p =~ /VA_HINT:([^ ]+)/;
print(OUT " va_start(va, $1);\n");
$suffix = "Va";
}
if ($m =~ /^void[ \t]+/) {
print(OUT " Mw${name}$suffix" . $names[$i]);
}
elsif ($m =~ /^MwWidget[ \t]+/) {
print(OUT " ret = MwOO::Base(Mw${name}$suffix" . $names[$i]);
$end = ")";
}
else {
print(OUT " ret = Mw${name}$suffix" . $names[$i]);
}
if ($args[$i] eq "void") {
print(OUT "(this->widget)$end;\n");
}
else {
my $p = $args[$i];
$p =~ s/\.\.\./va/;
print(OUT "(this->widget, " . $p . ")$end;\n");
}
if ($args[$i] =~ /\.\.\./) {
print(OUT " va_end(va);\n");
}
if (!($m =~ /^void[ \t]+/)) {
print(OUT " return ret;\n");
}
print(OUT "}\n\n");
$i++;
}
foreach my $prop (@props) {
my $type = "";
my $typename = "";
my %hash = ();
if (defined($ints{$prop})) {
$type = "int";
$typename = "Integer";
%hash = %ints;
}
elsif (defined($texts{$prop})) {
$type = "const char*";
$typename = "Text";
%hash = %texts;
}
elsif (defined($voids{$prop})) {
$type = "void*";
$typename = "Void";
%hash = %voids;
}
if (length($type) > 0) {
print( OUT "void MwOO::${name}::Set"
. $hash{$prop}
. "($type value){\n");
print(OUT " MwSet$typename(this->widget, $prop, value);\n");
print(OUT "}\n");
print(OUT "\n");
print(OUT "$type MwOO::${name}::Get" . $hash{$prop} . "(void){\n");
print(OUT " return MwGet$typename(this->widget, $prop);\n");
print(OUT "}\n");
print(OUT "\n");
}
}
close(OUT);
if (!($name eq 'Vulkan' || $name eq 'OpenGL')) {
$objs = $objs . " oosrc/widget/" . lc($name) . ".o";
}
}
closedir(DIR);
open(OUT, ">", "oosrc/deps.mk");
print(OUT "# \$Id\$\n");
print(OUT "OOL_OBJS +=$objs\n");
close(OUT);
my $base_h = "";
my $skip = 0;
open(IN, "<", "include/MwOO/Base.h");
while (my $l = <IN>) {
$l =~ s/\r?\n$//;
if ($l =~ /BEGIN AUTOGENERATE/) {
$base_h = $base_h . "/* BEGIN AUTOGENERATE */\n";
$skip = 1;
$base_h = $base_h . $decl . "\n";
}
elsif ($l =~ /END AUTOGENERATE/) {
$base_h = $base_h . "/* END AUTOGENERATE */\n";
$skip = 0;
}
elsif (!$skip) {
$base_h = $base_h . $l . "\n";
}
}
close(IN);
open(OUT, ">", "include/MwOO/Base.h");
print(OUT "$base_h");
close(OUT);
my $base_c = "";
my $skip = 0;
open(IN, "<", "oosrc/base.cc");
while (my $l = <IN>) {
$l =~ s/\r?\n$//;
if ($l =~ /BEGIN AUTOGENERATE/) {
$base_c = $base_c . "/* BEGIN AUTOGENERATE */\n";
$skip = 1;
foreach my $call (@calls) {
my @c = @{$call};
$base_c =
$base_c
. "static void __"
. $c[1]
. "(MwWidget widget, void* user, void* call){\n";
$base_c = $base_c . " MwOO::Base* c = (MwOO::Base*)user;\n";
$base_c = $base_c . " (void)widget;";
$base_c = $base_c . " c->" . $c[1] . "(call);\n";
$base_c = $base_c . "}\n";
}
$base_c = $base_c . "\n";
$base_c = $base_c . "void MwOO::Base::SetHandler(void){\n";
foreach my $call (@calls) {
my @c = @{$call};
$base_c =
$base_c
. " MwAddUserHandler(this->widget, "
. $c[0] . ", __"
. $c[1]
. ", this);\n";
}
$base_c = $base_c . "}\n";
}
elsif ($l =~ /END AUTOGENERATE/) {
$base_c = $base_c . "/* END AUTOGENERATE */\n";
$skip = 0;
}
elsif (!$skip) {
$base_c = $base_c . $l . "\n";
}
}
close(IN);
open(OUT, ">", "oosrc/base.cc");
print(OUT "$base_c");
close(OUT);

View File

@@ -6,6 +6,5 @@ if which gmake >/dev/null 2>&1; then
fi
./tools/doc.pl
./tools/icon.sh
./tools/genoo.pl
./tools/genmk.pl
$MAKE format