From: John Hodge Date: Sun, 6 Nov 2011 14:13:12 +0000 (+0800) Subject: Usermode/AxWin3 - Cleaning up bugs, adding image loading and text printing X-Git-Tag: rel0.14~140 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=82a4f841eafaff80b7dc258099abd865faaa0467;p=tpg%2Facess2.git Usermode/AxWin3 - Cleaning up bugs, adding image loading and text printing - Fixed a bug in library that caused double-allocation of widget IDs - Added text rendering from AxWin2 - Added image loading from AxWin2 - Moved rendering out into another file --- diff --git a/Usermode/Applications/axwin3_src/AcessLogoSmall.sif b/Usermode/Applications/axwin3_src/AcessLogoSmall.sif new file mode 100644 index 00000000..2064e489 Binary files /dev/null and b/Usermode/Applications/axwin3_src/AcessLogoSmall.sif differ diff --git a/Usermode/Applications/axwin3_src/Interface/main.c b/Usermode/Applications/axwin3_src/Interface/main.c index 22b7f818..4e4833be 100644 --- a/Usermode/Applications/axwin3_src/Interface/main.c +++ b/Usermode/Applications/axwin3_src/Interface/main.c @@ -9,7 +9,7 @@ #include #include -#define SIDEBAR_WIDTH 32 +#define SIDEBAR_WIDTH 36 // === PROTOTYPES === void create_sidebar(void); @@ -43,15 +43,15 @@ void create_sidebar(void) // Create sidebar // TODO: Get screen dimensions somehow - gSidebar = AxWin3_Widget_CreateWindow(NULL, SIDEBAR_WIDTH, 480, 0); + gSidebar = AxWin3_Widget_CreateWindow(NULL, SIDEBAR_WIDTH, 480, ELEFLAG_VERTICAL); AxWin3_MoveWindow(gSidebar, 0, 0); gSidebarRoot = AxWin3_Widget_GetRoot(gSidebar); // - Main menu btn = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemButton"); - AxWin3_Widget_SetSize(btn, SIDEBAR_WIDTH-4); + AxWin3_Widget_SetSize(btn, SIDEBAR_WIDTH); txt = AxWin3_Widget_AddWidget(btn, ELETYPE_IMAGE, 0, "SystemLogo"); - AxWin3_Widget_SetText(txt, "file://./AcessLogo.sif"); + AxWin3_Widget_SetText(txt, "file:///Acess/Apps/AxWin/3.0/AcessLogoSmall.sif"); // - Plain
style spacer ele = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top"); @@ -65,7 +65,8 @@ void create_sidebar(void) AxWin3_Widget_SetSize(ele, 4); // > Version/Time - txt = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String"); + ele = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_BOX, ELEFLAG_VERTICAL|ELEFLAG_NOSTRETCH, "Version/Time"); + txt = AxWin3_Widget_AddWidget(ele, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String"); AxWin3_Widget_SetSize(txt, 20); AxWin3_Widget_SetText(txt, "2.0"); diff --git a/Usermode/Applications/axwin3_src/Makefile b/Usermode/Applications/axwin3_src/Makefile index 59ab3cdf..9a59a5f5 100644 --- a/Usermode/Applications/axwin3_src/Makefile +++ b/Usermode/Applications/axwin3_src/Makefile @@ -1,13 +1,21 @@ +-include ../Makefile.cfg + NAME = AxWin3 DIRS = WM libaxwin3.so_src Interface +FILES = $(addprefix -,AcessLogoSmall.sif) SUBMAKE = $(MAKE) --no-print-directory +.PNONY: all install clean $(FILES) + all: @$(foreach DIR,$(DIRS), echo --- $(NAME)/$(DIR) && $(SUBMAKE) -C $(DIR) $@ &&) true -install: +install: $(FILES) @$(foreach DIR,$(DIRS), echo --- $(NAME)/$(DIR) && $(SUBMAKE) -C $(DIR) $@ &&) true clean: @$(foreach DIR,$(DIRS), $(SUBMAKE) -C $(DIR) $@ &&) true + +$(FILES): -%: + $(xCP) $* $(DISTROOT)/Apps/AxWin/3.0/$* diff --git a/Usermode/Applications/axwin3_src/WM/Makefile b/Usermode/Applications/axwin3_src/WM/Makefile index 62618b64..32e2f78c 100644 --- a/Usermode/Applications/axwin3_src/WM/Makefile +++ b/Usermode/Applications/axwin3_src/WM/Makefile @@ -6,8 +6,8 @@ CPPFLAGS += -I include/ -I ../include/ DIR := Apps/AxWin/3.0 BIN := AxWinWM -OBJ := main.o input.o video.o ipc.o -OBJ += wm.o wm_render.o +OBJ := main.o input.o video.o ipc.o image.o +OBJ += wm.o wm_render.o wm_render_text.o OBJ += renderer_classes.o renderer_passthru.o renderer_background.o OBJ += renderer_widget.o renderer_widget_decorator.o diff --git a/Usermode/Applications/axwin3_src/WM/font_8x16.h b/Usermode/Applications/axwin3_src/WM/font_8x16.h new file mode 100644 index 00000000..b9bad5db --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/font_8x16.h @@ -0,0 +1,265 @@ +/* + * Taken from http://cvs.savannah.gnu.org/viewvc/vgabios/vgafonts.h?root=vgabios&view=markup + * Altered for Acess2 + */ +#define FONT_WIDTH 8 +#define FONT_HEIGHT 16 +static uint8_t VTermFont[256*16]= +{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xdb, 0xdb, 0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, 0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, + 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, + 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, + 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06, 0x3c, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x6c, 0x38, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, 0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, + 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x18, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00, + 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0c, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06, 0x0c, 0x1f, 0x00, 0x00, + 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, + 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, + 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/Usermode/Applications/axwin3_src/WM/image.c b/Usermode/Applications/axwin3_src/WM/image.c new file mode 100644 index 00000000..ef08150b --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/image.c @@ -0,0 +1,136 @@ +/* + * Acess2 GUI (AxWin) Version 3 + * - By John Hodge (thePowersGang) + * + * image.c + * - Image loading + */ +#include +#include +#include +#include +#include +#include "include/image.h" + +// === IMPORTS === +extern tImage *Image_SIF_Parse(void *Buffer, size_t Size); + +// === PROTOTYPES === + int UnBase64(uint8_t *Dest, char *Src, int BufSize); + +// === CODE === +/** + * \brief Open an image from a URI + */ +tImage *Image_Load(const char *URI) +{ + tURI *uri; + int filesize; + char *buf; + tImage *img; + + uri = URI_Parse(URI); + if( !uri ) { + _SysDebug("Image_Load: Unable parse as URI '%s'", URI); + return NULL; + } + + if( strcmp(uri->Proto, "file") == 0 ) + { + FILE *fp; + int tmp; + fp = fopen(uri->Path, "rb"); + if(!fp) { + _SysDebug("Image_Load: Unable to open '%s'", uri->Path); + free(uri); + return NULL; + } + + fseek(fp, 0, SEEK_END); + filesize = ftell(fp); + fseek(fp, 0, SEEK_SET); + buf = malloc( filesize ); + if(!buf) { + _SysDebug("Image_Load: malloc() failed!"); + fclose(fp); + free(uri); + return NULL; + } + + tmp = fread(buf, 1, filesize, fp); + _SysDebug("Image_Load: fread() returned %i",tmp); + fclose(fp); + } + else if( strcmp(uri->Proto, "base64") == 0 ) + { + // 4 bytes of base64 = 3 bytes of binary (base 256) + filesize = strlen( uri->Path ) * 3 / 4; + buf = malloc(filesize); + if(!buf) { + _SysDebug("Image_Load: malloc() failed!"); + free(uri); + return NULL; + } + + filesize = UnBase64((uint8_t*)buf, uri->Path, filesize); + } + else + { + _SysDebug("Image_Load: Unknow protocol '%s'", uri->Proto); + free(uri); + return NULL; + } + + img = Image_SIF_Parse(buf, filesize); + free(buf); + free(uri); + if( !img ) { + _SysDebug("Image_Load: Unable to parse SIF from '%s'\n", URI); + return NULL; + } + + return img; +} + +/** + * \brief Decode a Base64 value + */ +int UnBase64(uint8_t *Dest, char *Src, int BufSize) +{ + uint32_t val; + int i, j; + char *start_src = Src; + + for( i = 0; i+2 < BufSize; i += 3 ) + { + val = 0; + for( j = 0; j < 4; j++, Src ++ ) { + if('A' <= *Src && *Src <= 'Z') + val |= (*Src - 'A') << ((3-j)*6); + else if('a' <= *Src && *Src <= 'z') + val |= (*Src - 'a' + 26) << ((3-j)*6); + else if('0' <= *Src && *Src <= '9') + val |= (*Src - '0' + 52) << ((3-j)*6); + else if(*Src == '+') + val |= 62 << ((3-j)*6); + else if(*Src == '/') + val |= 63 << ((3-j)*6); + else if(!*Src) + break; + else if(*Src != '=') + j --; // Ignore invalid characters + } + Dest[i ] = (val >> 16) & 0xFF; + Dest[i+1] = (val >> 8) & 0xFF; + Dest[i+2] = val & 0xFF; + if(j != 4) break; + } + + // Finish things off + if(i < BufSize) + Dest[i] = (val >> 16) & 0xFF; + if(i+1 < BufSize) + Dest[i+1] = (val >> 8) & 0xFF; + + return Src - start_src; +} diff --git a/Usermode/Applications/axwin3_src/WM/include/image.h b/Usermode/Applications/axwin3_src/WM/include/image.h new file mode 100644 index 00000000..12b29095 --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/include/image.h @@ -0,0 +1,30 @@ +/* + * Acess2 GUI (AxWin) Version 3 + * - By John Hodge (thePowersGang) + * + * image.h + */ +#ifndef _IMAGE_H_ +#define _IMAGE_H_ + +typedef struct sImage tImage; + +struct sImage +{ + short Width; + short Height; + int Format; + uint8_t Data[]; +}; + +enum eImageFormats +{ + IMGFMT_BGRA, + IMGFMT_RGB, + NUM_IMGFMTS +}; + +// === PROTOTYPES === +extern tImage *Image_Load(const char *URI); + +#endif diff --git a/Usermode/Applications/axwin3_src/WM/include/wm.h b/Usermode/Applications/axwin3_src/WM/include/wm.h index d110dcc1..19994ae5 100644 --- a/Usermode/Applications/axwin3_src/WM/include/wm.h +++ b/Usermode/Applications/axwin3_src/WM/include/wm.h @@ -8,7 +8,7 @@ #ifndef _WM_H_ #define _WM_H_ -#include +#include "image.h" // === CONSTANTS === /** @@ -32,6 +32,7 @@ typedef struct sWindow tWindow; typedef struct sWMRenderer tWMRenderer; typedef uint32_t tColour; +typedef struct sFont tFont; // === FUNCTIONS === // --- Management @@ -44,8 +45,10 @@ extern int WM_SendMessage(tWindow *Source, tWindow *Dest, int MessageID, int Len // --- Rendering extern void WM_Render_FillRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour); extern void WM_Render_DrawRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour); -extern void WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, void *Font, tColour Colour, const char *Text); +extern int WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, tColour Colour, const char *Text); +extern void WM_Render_GetTextDims(tFont *Font, const char *Text, int *W, int *H); extern void WM_Render_DrawImage(tWindow *Window, int X, int Y, int W, int H, tImage *Image); - +// NOTE: Should really be elsewhere +extern tColour Video_AlphaBlend(tColour _orig, tColour _new, uint8_t _alpha); #endif diff --git a/Usermode/Applications/axwin3_src/WM/ipc.c b/Usermode/Applications/axwin3_src/WM/ipc.c index 8c957b9f..22482af4 100644 --- a/Usermode/Applications/axwin3_src/WM/ipc.c +++ b/Usermode/Applications/axwin3_src/WM/ipc.c @@ -96,7 +96,7 @@ void IPC_HandleSelect(fd_set *set) msg = staticBuf + identlen; IPC_Handle(&gIPC_Type_Datagram, staticBuf, readlen - identlen, (void*)msg); - _SysDebug("IPC_HandleSelect: UDP handled"); +// _SysDebug("IPC_HandleSelect: UDP handled"); } while(SysGetMessage(NULL, NULL)) @@ -107,7 +107,7 @@ void IPC_HandleSelect(fd_set *set) SysGetMessage(NULL, data); IPC_Handle(&gIPC_Type_SysMessage, &tid, len, (void*)data); - _SysDebug("IPC_HandleSelect: Message handled"); +// _SysDebug("IPC_HandleSelect: Message handled"); } } diff --git a/Usermode/Applications/axwin3_src/WM/renderer_widget.c b/Usermode/Applications/axwin3_src/WM/renderer_widget.c index 505c5e3a..92972d67 100644 --- a/Usermode/Applications/axwin3_src/WM/renderer_widget.c +++ b/Usermode/Applications/axwin3_src/WM/renderer_widget.c @@ -11,6 +11,7 @@ #include #include #include +#include "include/image.h" #define DEFAULT_ELETABLE_SIZE 64 @@ -18,12 +19,20 @@ int Renderer_Widget_Init(void); tWindow *Renderer_Widget_Create(int Flags); void Renderer_Widget_Redraw(tWindow *Window); + void Widget_RenderWidget(tWindow *Window, tElement *Element); - int Renderer_Widget_HandleMessage(tWindow *Target, int Msg, int Len, void *Data); void Widget_UpdateDimensions(tElement *Element); void Widget_UpdatePosition(tElement *Element); +// --- Messages tElement *Widget_GetElementById(tWidgetWin *Info, uint32_t ID); void Widget_NewWidget(tWidgetWin *Info, size_t Len, tWidgetMsg_Create *Msg); +void Widget_SetFlags(tWidgetWin *Info, int Len, tWidgetMsg_SetFlags *Msg); +void Widget_SetSize(tWidgetWin *Info, int Len, tWidgetMsg_SetSize *Msg); +void Widget_SetText(tWidgetWin *Info, int Len, tWidgetMsg_SetText *Msg); + int Renderer_Widget_HandleMessage(tWindow *Target, int Msg, int Len, void *Data); +// --- Type helpers +void Widget_TextBox_UpdateText(tElement *Element, const char *Text); +void Widget_Image_UpdateText(tElement *Element, const char *Text); // === GLOBALS === tWMRenderer gRenderer_Widget = { @@ -32,6 +41,22 @@ tWMRenderer gRenderer_Widget = { .Redraw = Renderer_Widget_Redraw, .HandleMessage = Renderer_Widget_HandleMessage }; + +// --- Element type flags +struct { + void (*Init)(tElement *Ele); + void (*Delete)(tElement *Ele); + void (*UpdateFlags)(tElement *Ele); + void (*UpdateSize)(tElement *Ele); + void (*UpdateText)(tElement *Ele, const char *Text); // This should update Ele->Text +} gaWM_WidgetTypes[NUM_ELETYPES] = { + {NULL, NULL, NULL, NULL, NULL}, // NULL + {NULL, NULL, NULL, NULL, NULL}, // Box + {NULL, NULL, NULL, NULL, Widget_TextBox_UpdateText}, // Text + {NULL, NULL, NULL, NULL, Widget_Image_UpdateText}, // Image + {NULL, NULL, NULL, NULL, NULL} // Button +}; +const int ciWM_NumWidgetTypes = sizeof(gaWM_WidgetTypes)/sizeof(gaWM_WidgetTypes[0]); // === CODE === int Renderer_Widget_Init(void) @@ -47,13 +72,19 @@ tWindow *Renderer_Widget_Create(int Flags) tWidgetWin *info; int eletable_size = DEFAULT_ELETABLE_SIZE; + _SysDebug("Renderer_Widget_Create: (Flags = 0x%x)", Flags); + // TODO: Use `Flags` as default element count? + // - Actaully, it's taken by the root ele flags + // - Use the upper bits? ret = WM_CreateWindowStruct( sizeof(tWidgetWin) + sizeof(tElement*)*eletable_size ); info = ret->RendererInfo; info->TableSize = eletable_size; + info->RootElement.ID = -1; info->RootElement.BackgroundColour = 0xCCCCCC; + info->RootElement.Flags = Flags; return ret; } @@ -110,6 +141,11 @@ void Widget_UpdateDimensions(tElement *Element) nFixed ++; fixedSize += child->FixedWith; } + else if( child->Flags & ELEFLAG_NOSTRETCH ) + { + nFixed ++; + fixedSize += child->MinWith; + } if( child->FixedCross && maxCross < child->FixedCross ) maxCross = child->FixedCross; @@ -117,7 +153,7 @@ void Widget_UpdateDimensions(tElement *Element) maxCross = child->MinCross; nChildren ++; } - + // Get the dynamic with size from the unused space in the element if( nChildren > nFixed ) { if( Element->Flags & ELEFLAG_VERTICAL ) @@ -129,6 +165,9 @@ void Widget_UpdateDimensions(tElement *Element) dynWith /= nChildren - nFixed; } + _SysDebug("%i - nChildren = %i, nFixed = %i, dynWith = %i, fixedSize = %i", + Element->ID, nChildren, nFixed, dynWith, fixedSize); + // Get the cross size if( Element->Flags & ELEFLAG_VERTICAL ) fullCross = Element->CachedW - Element->PaddingL - Element->PaddingR; @@ -154,13 +193,16 @@ void Widget_UpdateDimensions(tElement *Element) cross = fullCross; // --- With Size --- - if( child->FixedWith) + if( child->FixedWith ) with = child->FixedWith; else if( child->Flags & ELEFLAG_NOSTRETCH ) with = child->MinWith; else with = dynWith; - + + + if(with < child->MinWith) with = child->MinWith; + if(cross < child->MinCross) cross = child->MinCross; // Update the dimensions if they have changed if( Element->Flags & ELEFLAG_VERTICAL ) { @@ -196,6 +238,9 @@ void Widget_UpdatePosition(tElement *Element) int x, y; if( Element->Flags & ELEFLAG_NORENDER ) return ; + + _SysDebug("Widget_UpdatePosition: (Element=%p(%i Type=%i Flags=0x%x))", + Element, Element->ID, Element->Type, Element->Flags); // Initialise x = Element->CachedX + Element->PaddingL; @@ -226,6 +271,8 @@ void Widget_UpdatePosition(tElement *Element) - Element->PaddingT - Element->PaddingB; } + _SysDebug(" Widget_UpdatePosition[%i]: newX = %i, newY = %i", Element->ID, newX, newY); + // Check for changes, and don't update if there was no change if( newX != child->CachedX || newY != child->CachedY ) { @@ -245,14 +292,58 @@ void Widget_UpdatePosition(tElement *Element) } } +/** + * \brief Update the minimum dimensions of the element + * \note Called after a child's minimum dimensions have changed + */ +void Widget_UpdateMinDims(tElement *Element) +{ + tElement *child; + + if(!Element) return; + + Element->MinCross = 0; + Element->MinWith = 0; + + for(child = Element->FirstChild; child; child = child->NextSibling) + { + if( Element->Parent && + (Element->Flags & ELEFLAG_VERTICAL) == (Element->Parent->Flags & ELEFLAG_VERTICAL) + ) + { + if(child->FixedCross) + Element->MinCross += child->FixedCross; + else + Element->MinCross += child->MinCross; + if(child->FixedWith) + Element->MinWith += child->FixedWith; + else + Element->MinWith += child->MinWith; + } + else + { + if(child->FixedCross) + Element->MinWith += child->FixedCross; + else + Element->MinWith += child->MinCross; + if(child->FixedWith) + Element->MinCross += child->FixedWith; + else + Element->MinCross += child->MinWith; + } + } + + // Recurse upwards + Widget_UpdateMinDims(Element->Parent); +} + // --- Helpers --- tElement *Widget_GetElementById(tWidgetWin *Info, uint32_t ID) { tElement *ele; - if(ID == -1) - return &Info->RootElement; + if( ID == -1 ) return &Info->RootElement; if( ID < Info->TableSize ) return Info->ElementTable[ID]; @@ -273,6 +364,9 @@ void Widget_NewWidget(tWidgetWin *Info, size_t Len, tWidgetMsg_Create *Msg) if( strnlen(Msg->DebugName, max_debugname_len) == max_debugname_len ) return ; + _SysDebug("Widget_NewWidget (%i %i Type %i Flags 0x%x)", + Msg->Parent, Msg->NewID, Msg->Type, Msg->Flags); + // Create parent = Widget_GetElementById(Info, Msg->Parent); if(!parent) @@ -295,13 +389,16 @@ void Widget_NewWidget(tWidgetWin *Info, size_t Len, tWidgetMsg_Create *Msg) new->PaddingB = 2; new->PaddingL = 2; new->PaddingR = 2; + new->CachedX = -1; + + if( new->Type < ciWM_NumWidgetTypes && gaWM_WidgetTypes[new->Type].Init ) + gaWM_WidgetTypes[new->Type].Init(new); // Add to parent's list if(parent->LastChild) parent->LastChild->NextSibling = new; else parent->FirstChild = new; - new->NextSibling = parent->LastChild; parent->LastChild = new; // Add to info @@ -313,6 +410,26 @@ void Widget_NewWidget(tWidgetWin *Info, size_t Len, tWidgetMsg_Create *Msg) else Info->ElementTable[new->ID % Info->TableSize] = new; } + + Widget_UpdateMinDims(parent); +} + +void Widget_SetFlags(tWidgetWin *Info, int Len, tWidgetMsg_SetFlags *Msg) +{ + tElement *ele; + + if( Len < sizeof(tWidgetMsg_SetFlags) ) + return ; + + _SysDebug("Widget_SetFlags: (%i 0x%x 0x%x)", Msg->WidgetID, Msg->Value, Msg->Mask); + + ele = Widget_GetElementById(Info, Msg->WidgetID); + if(!ele) return; + + Msg->Value &= Msg->Mask; + + ele->Flags &= ~Msg->Mask; + ele->Flags |= Msg->Value; } void Widget_SetSize(tWidgetWin *Info, int Len, tWidgetMsg_SetSize *Msg) @@ -330,7 +447,26 @@ void Widget_SetSize(tWidgetWin *Info, int Len, tWidgetMsg_SetSize *Msg) void Widget_SetText(tWidgetWin *Info, int Len, tWidgetMsg_SetText *Msg) { + tElement *ele; + if( Len < sizeof(tWidgetMsg_SetText) + 1 ) + return ; + if( Msg->Text[Len - sizeof(tWidgetMsg_SetText) - 1] != '\0' ) + return ; + + ele = Widget_GetElementById(Info, Msg->WidgetID); + if(!ele) return ; + + + if( ele->Type < ciWM_NumWidgetTypes && gaWM_WidgetTypes[ele->Type].UpdateText ) + { + gaWM_WidgetTypes[ele->Type].UpdateText( ele, Msg->Text ); + } +// else +// { +// if(ele->Text) free(ele->Text); +// ele->Text = strdup(Msg->Text); +// } } int Renderer_Widget_HandleMessage(tWindow *Target, int Msg, int Len, void *Data) @@ -350,11 +486,21 @@ int Renderer_Widget_HandleMessage(tWindow *Target, int Msg, int Len, void *Data) case MSG_WIDGET_CREATE: Widget_NewWidget(info, Len, Data); return 0; + + case MSG_WIDGET_DELETE: + _SysDebug("TODO: Implement MSG_WIDGET_DELETE"); + return 0; + + // Set Flags + case MSG_WIDGET_SETFLAGS: + Widget_SetFlags(info, Len, Data); + return 0; // Set length case MSG_WIDGET_SETSIZE: Widget_SetSize(info, Len, Data); return 0; + // Set text case MSG_WIDGET_SETTEXT: Widget_SetText(info, Len, Data); @@ -366,3 +512,50 @@ int Renderer_Widget_HandleMessage(tWindow *Target, int Msg, int Len, void *Data) } } +// --- Type Helpers +void Widget_TextBox_UpdateText(tElement *Element, const char *Text) +{ + int w=0, h=0; + + if(Element->Text) free(Element->Text); + Element->Text = strdup(Text); + + WM_Render_GetTextDims(NULL, Element->Text, &w, &h); + if(Element->Parent && (Element->Parent->Flags & ELEFLAG_VERTICAL)) { + Element->MinCross = w; + Element->MinWith = h; + } + else { + Element->MinWith = w; + Element->MinCross = h; + } + + Widget_UpdateMinDims(Element->Parent); +} + +void Widget_Image_UpdateText(tElement *Element, const char *Text) +{ + if(Element->Data) free(Element->Data); + Element->Data = Image_Load( Text ); + if(!Element->Data) { +// Element->Flags &= ~ELEFLAG_FIXEDSIZE; + return ; + } + + Element->CachedW = ((tImage*)Element->Data)->Width; + Element->CachedH = ((tImage*)Element->Data)->Height; + + if(Element->Parent && (Element->Parent->Flags & ELEFLAG_VERTICAL) ) { + Element->MinCross = ((tImage*)Element->Data)->Width; + Element->MinWith = ((tImage*)Element->Data)->Height; + } + else { + Element->MinWith = ((tImage*)Element->Data)->Width; + Element->MinCross = ((tImage*)Element->Data)->Height; + } + + Widget_UpdateMinDims(Element->Parent); + + // NOTE: Doesn't update Element->Text because it's useless +} + diff --git a/Usermode/Applications/axwin3_src/WM/video.c b/Usermode/Applications/axwin3_src/WM/video.c index 3793ce61..f04e95ef 100644 --- a/Usermode/Applications/axwin3_src/WM/video.c +++ b/Usermode/Applications/axwin3_src/WM/video.c @@ -12,6 +12,7 @@ #include "resources/cursor.h" #include #include +#include // === PROTOTYPES === void Video_Setup(void); @@ -125,3 +126,40 @@ void Video_Blit(uint32_t *Source, short DstX, short DstY, short W, short H) } } +tColour Video_AlphaBlend(tColour _orig, tColour _new, uint8_t _alpha) +{ + uint16_t ao,ro,go,bo; + uint16_t an,rn,gn,bn; + if( _alpha == 0 ) return _orig; + if( _alpha == 255 ) return _new; + + ao = (_orig >> 24) & 0xFF; + ro = (_orig >> 16) & 0xFF; + go = (_orig >> 8) & 0xFF; + bo = (_orig >> 0) & 0xFF; + + an = (_new >> 24) & 0xFF; + rn = (_new >> 16) & 0xFF; + gn = (_new >> 8) & 0xFF; + bn = (_new >> 0) & 0xFF; + + if( _alpha == 0x80 ) { + ao = (ao + an) / 2; + ro = (ro + rn) / 2; + go = (go + gn) / 2; + bo = (bo + bn) / 2; + } + else { + ao = ao*(255-_alpha) + an*_alpha; + ro = ro*(255-_alpha) + rn*_alpha; + go = go*(255-_alpha) + gn*_alpha; + bo = bo*(255-_alpha) + bn*_alpha; + ao /= 255*2; + ro /= 255*2; + go /= 255*2; + bo /= 255*2; + } + + return (ao << 24) | (ro << 16) | (go << 8) | bo; +} + diff --git a/Usermode/Applications/axwin3_src/WM/wm_render.c b/Usermode/Applications/axwin3_src/WM/wm_render.c new file mode 100644 index 00000000..7f4a53b3 --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/wm_render.c @@ -0,0 +1,141 @@ +/* + * Acess2 Window Manager v3 + * - By John Hodge (thePowersGang) + * + * wm_render.c + * - Window rendering functions + */ +#include +#include +#include +#include + +// === CODE === +void WM_Render_FillRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour) +{ + uint32_t *dest; + int i; +// _SysDebug("WM_Render_FilledRect(%p, 0x%x...", Window, Colour); +// _SysDebug(" (%i,%i), %ix%i)", X, Y, W, H); + // Clip to window dimensions + if(X < 0) { W += X; X = 0; } + if(Y < 0) { H += Y; Y = 0; } + if(W <= 0 || H <= 0) return; + if(X >= Window->W) return; + if(Y >= Window->H) return; + if(X + W > Window->W) W = Window->W - X; + if(Y + H > Window->H) H = Window->H - Y; +// _SysDebug(" Clipped to (%i,%i), %ix%i", X, Y, W, H); + + if(!Window->RenderBuffer) { + Window->RenderBuffer = malloc(Window->W*Window->H*4); + } + + dest = (uint32_t*)Window->RenderBuffer + Y*Window->W + X; + while( H -- ) + { + for( i = W; i --; ) + *dest++ = Colour; + dest += Window->W - W; + } +} + +void WM_Render_DrawRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour) +{ + WM_Render_FillRect(Window, X, Y, W, 1, Colour); + WM_Render_FillRect(Window, X, Y+H-1, W, 1, Colour); + WM_Render_FillRect(Window, X, Y, 1, H, Colour); + WM_Render_FillRect(Window, X+W-1, Y, 1, H, Colour); +} + +/** + * \brief Draw an image to the screen + * \todo Maybe have support for an offset in the image + */ +void WM_Render_DrawImage(tWindow *Window, int X, int Y, int W, int H, tImage *Image) +{ + int x, y; + uint32_t *dest; + uint8_t *data; + + // Sanity please + if( !Image ) return ; + + // Allocate + if(!Window->RenderBuffer) { + Window->RenderBuffer = malloc(Window->W*Window->H*4); + } + + // Bounds Check + if( X >= Window->W ) return ; + if( Y >= Window->H ) return ; + + // Wrap to image size + if( W > Image->Width ) W = Image->Width; + if( H > Image->Height ) H = Image->Height; + + // Wrap to screen size + if( X + W > Window->W ) W = Window->W - X; + if( Y + H > Window->H ) H = Window->H - Y; + + dest = (uint32_t*)Window->RenderBuffer + Y * Window->W + X; + data = Image->Data; + + // Do the render + switch( Image->Format ) + { + case IMGFMT_BGRA: + for( y = 0; y < H; y ++ ) + { + int r, g, b, a; // New + int or, og, ob; // Original + for( x = 0; x < W; x ++ ) + { + b = data[x*4+0]; g = data[x*4+1]; r = data[x*4+2]; a = data[x*4+3]; + if( a == 0 ) continue; // 100% transparent + ob = dest[x]&0xFF; og = (dest[x] >> 8)&0xFF; or = (dest[x] >> 16)&0xFF; + // Handle Alpha + switch(a) + { + // Transparent: Handled above + // Solid + case 0xFF: break; + // Half + case 0x80: + r = (or + r) / 2; + g = (og + g) / 2; + b = (ob + b) / 2; + break; + // General + default: + r = (or * (255-a) + r * a) / 255; + g = (og * (255-a) + g * a) / 255; + b = (ob * (255-a) + b * a) / 255; + break; + } + dest[x] = b | (g << 8) | (r << 16); + } + data += Image->Width * 4; + dest += Window->W; + } + break; + + // RGB + case IMGFMT_RGB: + for( y = 0; y < H; y ++ ) + { + for( x = 0; x < W; x ++ ) + { + // Blue Green Red + dest[x] = data[x*3+2] | (data[x*3+1] << 8) | (data[x*3+0] << 16); + } + data += W * 3; + dest += Window->W; + } + break; + default: + _SysDebug("ERROR: Unknown image format %i\n", Image->Format); + break; + } +} + diff --git a/Usermode/Applications/axwin3_src/WM/wm_render_text.c b/Usermode/Applications/axwin3_src/WM/wm_render_text.c new file mode 100644 index 00000000..9135ed3d --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/wm_render_text.c @@ -0,0 +1,376 @@ +/* + * Acess2 GUI (AxWin) Version 3 + * - By John Hodge (thePowersGang) + * + * wm_render_text.c + * - WM Text Rendering + */ +#include +#include +#include + +// === TYPES === +typedef struct sGlyph tGlyph; + +struct sGlyph +{ + struct sGlyph *Next; + struct sGlyph *Prev; + + uint32_t Codepoint; + + // Effective dimensions (distance to move 'cursor') + short Width; + short Height; + + // Distance from the current cursor position to render at + short OffsetX; + short OffsetY; + + // True dimensions (size of the bitmap + short TrueWidth; + short TrueHeight; + + // Bitmap Data + uint8_t Bitmap[]; // 8-bit alpha +}; + +struct sFont +{ + struct sFont *Next; + int ReferenceCount; + + tGlyph *AsciiGlyphs[128]; // Glyphs 0-127 + + tGlyph *FirstGlyph; + tGlyph *LastGlyph; + + tGlyph *(*CacheGlyph)(struct sFont *this, uint32_t Codepoint); + +}; + + +// === PROTOTYPES === + int WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, tColour Color, const char *Text); +void WM_Render_GetTextDims(tFont *Font, const char *Text, int *W, int *H); +tGlyph *_GetGlyph(tFont *Font, uint32_t Codepoint); +void _RenderGlyph(tWindow *Window, short X, short Y, tGlyph *Glyph, uint32_t Color); +tGlyph *_SystemFont_CacheGlyph(tFont *Font, uint32_t Codepoint); + int ReadUTF8(const char *Input, uint32_t *Output); + +// === GLOBALS === +tFont gSystemFont = { + .CacheGlyph = _SystemFont_CacheGlyph +}; + +// === CODE === +/** + * \brief Draw text to the screen + */ +int WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, tColour Colour, const char *Text) +{ + int xOfs = 0; + tGlyph *glyph; + uint32_t ch = 0; + + _SysDebug("WM_Render_DrawText: (X=%i,Y=%i,W=%i,H=%i,Font=%p,", X, Y, W, H, Font); + _SysDebug(" Colour=%08x,Text='%s')", Colour, Text); + + if(!Text) return 0; + + // Check the bounds + if(W < 0 || X < 0 || X >= Window->W) return 0; + if(X + W > Window->W) W = Window->W - X; + + if(H < 0 || Y < 0 || Y >= Window->H) return 0; + if(Y + H > Window->H) H = Window->H - Y; + + // Handle NULL font (system default monospace) + if( !Font ) Font = &gSystemFont; + + while( *Text ) + { + // Read character + Text += ReadUTF8(Text, &ch); + + // Find (or load) the glyph + glyph = _GetGlyph(Font, ch); + if( !glyph ) continue ; // If not found, just don't render it + + // End render if it will overflow the provided range + if( xOfs + glyph->TrueWidth > W ) + break; + + _RenderGlyph(Window, X + xOfs, Y, glyph, Colour); + xOfs += glyph->Width; + } + + return xOfs; +} + +void WM_Render_GetTextDims(tFont *Font, const char *Text, int *W, int *H) +{ + int w=0, h=0; + uint32_t ch; + tGlyph *glyph; + if( !Font ) Font = &gSystemFont; + + while( *Text ) + { + Text += ReadUTF8(Text, &ch); + glyph = _GetGlyph(Font, ch); + if( !glyph ) continue; + + w += glyph->Width; + if( h < glyph->Height ) h = glyph->Height; + } + + if(W) *W = w; + if(H) *H = h; +} + +tGlyph *_GetGlyph(tFont *Font, uint32_t Codepoint) +{ + tGlyph *next = NULL, *prev = NULL; + tGlyph *new; + + // Check for ASCII + if( Codepoint < 128 ) + { + if( Font->AsciiGlyphs[Codepoint] == NULL ) { + Font->AsciiGlyphs[Codepoint] = Font->CacheGlyph(Font, Codepoint); + } + + return Font->AsciiGlyphs[Codepoint]; + } + + // If within the range + if( Font->FirstGlyph && Font->FirstGlyph->Codepoint < Codepoint && Codepoint < Font->LastGlyph->Codepoint ) + { + // Find what end is "closest" + if( Codepoint - Font->FirstGlyph->Codepoint < Font->LastGlyph->Codepoint - Codepoint ) + { + // Start from the bottom + for( next = Font->FirstGlyph; + next && next->Codepoint < Codepoint; + prev = next, next = next->Next + ); + + if( next->Codepoint == Codepoint ) + return next; + + } + else + { + // Start at the top + // NOTE: The roles of next and prev are reversed here to allow + // the insert to be able to assume that `prev` is the + // previous entry, and `next` is the next. + for( prev = Font->LastGlyph; + prev && prev->Codepoint > Codepoint; + next = prev, prev = prev->Prev + ); + if( prev->Codepoint == Codepoint ) + return prev; + } + } + else + { + // If below first + if( !Font->FirstGlyph || Font->FirstGlyph->Codepoint > Codepoint ) { + prev = NULL; + next = Font->FirstGlyph; + } + // Above last + else { + prev = Font->LastGlyph; + next = NULL; + } + } + + // Load new + new = Font->CacheGlyph(Font, Codepoint); + if( !new ) return NULL; + + // Add to list + // - Forward link + if( prev ) { + new->Next = prev->Next; + prev->Next = new; + } + else { + new->Next = Font->FirstGlyph; + Font->FirstGlyph = new; + } + + // - Backlink + if( next ) { + new->Prev = next->Prev; + next->Prev = new; + } + else { + new->Prev = Font->LastGlyph; + Font->LastGlyph = new; + } + + // Return + return new; +} + +/** + */ +void _RenderGlyph(tWindow *Window, short X, short Y, tGlyph *Glyph, uint32_t Color) +{ + int xStart = 0, yStart = 0; + int x, y, dst_x; + uint32_t *outBuf; + uint8_t *inBuf; + + X += Glyph->OffsetX; + if( X < 0 ) { // If -ve, skip the first -X pixels + xStart = -X; + X = 0; + } + + Y += Glyph->OffsetY; + if( Y < 0 ) { // If -ve, skip the first -Y lines + yStart = -Y; + Y = 0; + } + +// _SysDebug("X = %i, Y = %i", X, Y); + outBuf = (uint32_t*)Window->RenderBuffer + Y*Window->W + X; + inBuf = Glyph->Bitmap + yStart*Glyph->TrueWidth; + + for( y = yStart; y < Glyph->TrueHeight; y ++ ) + { + for( x = xStart, dst_x = 0; x < Glyph->TrueWidth; x ++, dst_x ++ ) + { + outBuf[dst_x] = Video_AlphaBlend( outBuf[dst_x], Color, inBuf[x] ); + } + outBuf += Window->W; + inBuf += Glyph->TrueWidth; + } +} + +// Load system font (8x16 monospace) +#include "font_8x16.h" + +/* + */ +tGlyph *_SystemFont_CacheGlyph(tFont *Font, uint32_t Codepoint) +{ + int i; + uint8_t index = 0; + tGlyph *ret; + uint8_t *data; + +// _SysDebug("_SystemFont_CacheGlyph: (Font=%p, Codepoint=0x%06x)", Font, Codepoint); + + if( Codepoint < 128 ) { + index = Codepoint; + } + else { + index = '?'; // Unknown glyphs come out as a question mark + } + +// _SysDebug(" index = %i", index); + + ret = malloc( sizeof(tGlyph) + FONT_WIDTH*FONT_HEIGHT ); + if( !ret ) { + _SysDebug("ERROR: malloc(%i) failed", sizeof(tGlyph) + FONT_WIDTH*FONT_HEIGHT); + return NULL; + } + + ret->Codepoint = Codepoint; + + ret->Width = FONT_WIDTH; + ret->Height = FONT_HEIGHT; + + ret->TrueWidth = FONT_WIDTH; + ret->TrueHeight = FONT_HEIGHT; + + ret->OffsetX = 0; + ret->OffsetY = 0; + + data = &VTermFont[index * FONT_HEIGHT]; + + for( i = 0; i < FONT_HEIGHT; i ++ ) + { + ret->Bitmap[ i * 8 + 0 ] = data[i] & (1 << 7) ? 255 : 0; + ret->Bitmap[ i * 8 + 1 ] = data[i] & (1 << 6) ? 255 : 0; + ret->Bitmap[ i * 8 + 2 ] = data[i] & (1 << 5) ? 255 : 0; + ret->Bitmap[ i * 8 + 3 ] = data[i] & (1 << 4) ? 255 : 0; + ret->Bitmap[ i * 8 + 4 ] = data[i] & (1 << 3) ? 255 : 0; + ret->Bitmap[ i * 8 + 5 ] = data[i] & (1 << 2) ? 255 : 0; + ret->Bitmap[ i * 8 + 6 ] = data[i] & (1 << 1) ? 255 : 0; + ret->Bitmap[ i * 8 + 7 ] = data[i] & (1 << 0) ? 255 : 0; + } + + return ret; +} + + +/** + * \fn int ReadUTF8(char *Input, uint32_t *Val) + * \brief Read a UTF-8 character from a string + */ +int ReadUTF8(const char *Input, uint32_t *Val) +{ + const uint8_t *str = (const uint8_t *)Input; + *Val = 0xFFFD; // Assume invalid character + + // ASCII + if( !(*str & 0x80) ) { + *Val = *str; + return 1; + } + + // Middle of a sequence + if( (*str & 0xC0) == 0x80 ) { + return 1; + } + + // Two Byte + if( (*str & 0xE0) == 0xC0 ) { + *Val = (*str & 0x1F) << 6; // Upper 6 Bits + str ++; + if( (*str & 0xC0) != 0x80) return -1; // Validity check + *Val |= (*str & 0x3F); // Lower 6 Bits + return 2; + } + + // Three Byte + if( (*str & 0xF0) == 0xE0 ) { + *Val = (*str & 0x0F) << 12; // Upper 4 Bits + str ++; + if( (*str & 0xC0) != 0x80) return -1; // Validity check + *Val |= (*str & 0x3F) << 6; // Middle 6 Bits + str ++; + if( (*str & 0xC0) != 0x80) return -1; // Validity check + *Val |= (*str & 0x3F); // Lower 6 Bits + return 3; + } + + // Four Byte + if( (*str & 0xF1) == 0xF0 ) { + *Val = (*str & 0x07) << 18; // Upper 3 Bits + str ++; + if( (*str & 0xC0) != 0x80) return -1; // Validity check + *Val |= (*str & 0x3F) << 12; // Middle-upper 6 Bits + str ++; + if( (*str & 0xC0) != 0x80) return -1; // Validity check + *Val |= (*str & 0x3F) << 6; // Middle-lower 6 Bits + str ++; + if( (*str & 0xC0) != 0x80) return -1; // Validity check + *Val |= (*str & 0x3F); // Lower 6 Bits + return 4; + } + + // UTF-8 Doesn't support more than four bytes + return 4; +} + + + + diff --git a/Usermode/Applications/axwin3_src/include/widget_messages.h b/Usermode/Applications/axwin3_src/include/widget_messages.h index fa2013ae..c6c7cdc3 100644 --- a/Usermode/Applications/axwin3_src/include/widget_messages.h +++ b/Usermode/Applications/axwin3_src/include/widget_messages.h @@ -12,6 +12,7 @@ enum { MSG_WIDGET_CREATE = 0x1000, MSG_WIDGET_DELETE, + MSG_WIDGET_SETFLAGS, MSG_WIDGET_SETSIZE, MSG_WIDGET_SETTEXT, MSG_WIDGET_SETCOLOUR @@ -32,6 +33,13 @@ typedef struct uint32_t WidgetID; } tWidgetMsg_Delete; +typedef struct +{ + uint32_t WidgetID; + uint32_t Value; + uint32_t Mask; +} tWidgetMsg_SetFlags; + typedef struct { uint32_t WidgetID; diff --git a/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c b/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c index 0e39a049..6fa8adaf 100644 --- a/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c +++ b/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c @@ -80,18 +80,22 @@ tAxWin3_Widget *AxWin3_Widget_AddWidget(tAxWin3_Widget *Parent, int Type, int Fl info = AxWin3_int_GetDataPtr(Parent->Window); // Assign ID + // BUG BUG BUG - Double Allocations! // TODO: Atomicity for( newID = info->FirstFreeID; newID < info->nElements; newID ++ ) { if( info->Elements[newID] == NULL ) break; } - if( info->nElements == 0 || info->Elements[newID] ) + if( newID == info->nElements ) { info->nElements ++; info->Elements = realloc(info->Elements, sizeof(*info->Elements)*info->nElements); newID = info->nElements - 1; + _SysDebug("Expanded and allocated %i", newID); } + else + _SysDebug("Allocated %i", newID); info->Elements[newID] = (void*)-1; // Create new widget structure @@ -108,6 +112,8 @@ tAxWin3_Widget *AxWin3_Widget_AddWidget(tAxWin3_Widget *Parent, int Type, int Fl tWidgetMsg_Create *msg = (void*)tmp; msg->Parent = Parent->ID; msg->NewID = newID; + msg->Type = Type; + msg->Flags = Flags; msg->DebugName[0] = '\0'; AxWin3_SendMessage(ret->Window, ret->Window, MSG_WIDGET_CREATE, sizeof(tmp), tmp); } @@ -129,6 +135,16 @@ void AxWin3_Widget_DelWidget(tAxWin3_Widget *Widget) free(Widget); } +void AxWin3_Widget_SetFlags(tAxWin3_Widget *Widget, int FlagSet, int FlagMask) +{ + tWidgetMsg_SetFlags msg; + msg.WidgetID = Widget->ID; + msg.Value = FlagSet; + msg.Mask = FlagMask; + + AxWin3_SendMessage(Widget->Window, Widget->Window, MSG_WIDGET_SETFLAGS, sizeof(msg), &msg); +} + void AxWin3_Widget_SetSize(tAxWin3_Widget *Widget, int Size) { tWidgetMsg_SetSize msg; diff --git a/Usermode/include/axwin3/widget.h b/Usermode/include/axwin3/widget.h index 6542664e..ca9b40fd 100644 --- a/Usermode/include/axwin3/widget.h +++ b/Usermode/include/axwin3/widget.h @@ -21,6 +21,7 @@ extern tAxWin3_Widget *AxWin3_Widget_GetRoot(tHWND Window); extern tAxWin3_Widget *AxWin3_Widget_AddWidget(tAxWin3_Widget *Parent, int Type, int Flags, const char *DebugName); extern void AxWin3_Widget_DelWidget(tAxWin3_Widget *Widget); +extern void AxWin3_Widget_SetFlags(tAxWin3_Widget *Widget, int FlagSet, int FlagMask); extern void AxWin3_Widget_SetSize(tAxWin3_Widget *Widget, int Size); extern void AxWin3_Widget_SetText(tAxWin3_Widget *Widget, const char *Text); extern void AxWin3_Widget_SetColour(tAxWin3_Widget *Widget, int Index, tAxWin3_Colour Colour); @@ -29,20 +30,16 @@ enum eElementTypes { ELETYPE_NONE, - ELETYPE_WINDOW, //!< Window root element - ELETYPE_BOX, //!< Content box (invisible in itself) - ELETYPE_TABBAR, //!< Tab Bar - ELETYPE_TOOLBAR, //!< Tool Bar - - ELETYPE_BUTTON, //!< Push Button - ELETYPE_TEXT, //!< Text ELETYPE_IMAGE, //!< Image - + ELETYPE_BUTTON, //!< Push Button ELETYPE_SPACER, //!< Visual Spacer (horizontal / vertical rule) + + ELETYPE_TABBAR, //!< Tab Bar + ELETYPE_TOOLBAR, //!< Tool Bar - MAX_ELETYPES = 0x100 + NUM_ELETYPES }; enum eElementFlags