From 9550c0192423e80090ade5cbd6cd43d0c3912263 Mon Sep 17 00:00:00 2001 From: heavyiron Date: Sat, 19 Oct 2013 10:24:30 +0000 Subject: [PATCH] End: unmovable window, fixed documentation. git-svn-id: svn://kolibrios.org@4051 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/docs/sysfuncr.txt | 4 +-- kernel/trunk/docs/sysfuncs.txt | 4 +-- programs/system/end/light/end.asm | 46 +++++++++++++++++++++---------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/kernel/trunk/docs/sysfuncr.txt b/kernel/trunk/docs/sysfuncr.txt index 0897da331e..c78d4a1269 100644 --- a/kernel/trunk/docs/sysfuncr.txt +++ b/kernel/trunk/docs/sysfuncr.txt @@ -34,7 +34,7 @@ вызов функции с такими Y игнорируется * RR, GG, BB = соответственно красная, зеленая, синяя составляющие цвета рабочей области окна - (игнорируется для стиля Y=2) + (игнорируется для стиля Y=1) * X = DCBA (биты) * A = 1 - у окна есть заголовок; для стилей Y=3,4 адрес строки заголовка задаётся в edi, для прочих стилей @@ -47,7 +47,7 @@ игнорируются для стилей Y=1,3: * esi = 0xXYRRGGBB - цвет заголовка * RR, GG, BB определяют сам цвет - * Y=0 - обычное окно, Y=1 - неперемещаемое окно + * Y=0 - обычное окно, Y=1 - неперемещаемое окно (работает для всех стилей окон) * X определяет градиент заголовка: X=0 - нет градиента, X=8 - обычный градиент, для окон типа II X=4 - негативный градиент diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index dc21ac312c..ac91390557 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -33,7 +33,7 @@ Parameters: * other possible values (from 5 up to 15) are reserved, function call with such Y is ignored * RR, GG, BB = accordingly red, green, blue components of a color - of the working area of the window (are ignored for style Y=2) + of the working area of the window (are ignored for style Y=1) * X = DCBA (bits) * A = 1 - window has caption; for styles Y=3,4 caption string must be passed in edi, for other styles use @@ -46,7 +46,7 @@ Parameters: of a type I and II, and ignored for styles Y=1,3: * esi = 0xXYRRGGBB - color of the header * RR, GG, BB define color - * Y=0 - usual window, Y=1 - unmovable window + * Y=0 - usual window, Y=1 - unmovable window (works for all window styles) * X defines a gradient of header: X=0 - no gradient, X=8 - usual gradient, for windows of a type II X=4 - negative gradient diff --git a/programs/system/end/light/end.asm b/programs/system/end/light/end.asm index e131a5a034..71a4aad7e7 100644 --- a/programs/system/end/light/end.asm +++ b/programs/system/end/light/end.asm @@ -4,50 +4,62 @@ ; include "lang.inc" include "..\..\..\macros.inc" +; note that 'mov al,xx' is shorter than 'mov eax,xx' +; and if we know that high 24 bits of eax are zero, we can use 1st form +; the same about ebx,ecx,edx meos_app_start code draw_window: - mcall 12,1 + mov al,12 + mcall ,1 - mcall 14 ;eax=14 - get screen max x & max y + mov al,14 + mcall ;eax=14 - get screen max x & max y movzx ecx,ax shr eax,17 shl eax,16 lea ebx,[eax-110 shl 16+222] shr ecx,1 shl ecx,16 - lea ecx,[ecx-70 shl 16+137] + lea ecx,[ecx-65 shl 16+137] - mcall 0, , ,0x01ffffff ;define and draw window + xor eax,eax + mcall , , ,0x019098b0,0x01000000 ;define and draw window - mcall 13, 223 , 138 ,0x9098b0 + mov al,13 + mcall ,<0,223> ,<0,275> mcall ,<1,221>,<1,136>,0xffffff mcall ,<2,220>,<2,135>,0xe4dfe1 mcall ,<16,189>,<97,23>,0x9098b0 - mcall 8,<16,90> ,<20,27>,4,0x990022 ;eax=8 - draw buttons + mov al,8 + mcall ,<16,90> ,<20,27>,4,0x990022 ;eax=8 - draw buttons mcall ,<113,90>, ,2,0xaa7700 mcall , ,<54,27>,1,0x777777 mcall ,<16,90> , ,3,0x007700 mcall ,<17,186>,<98,20>,5,0xe4dfe1 - mcall 4,<28,105>,0x80000000,label4 ;eax=4 - write text + mov al,4 + mcall ,<28,105>,0x80000000,label4 ;eax=4 - write text mcall ,<35,24> ,0x80ffffff,label2 mcall ,<34,58> , ,label3 mcall ,<47,37> , ,label5 mcall ,<43,71> , ,label6 - mcall 12,2 + mov al,12 + mcall ,2 still: - mcall 10 ;wait here for event + mov al,10 + mcall ;wait here for event dec eax jz draw_window dec eax jnz button - mcall 2 ;eax=2 - get key code + mov al,2 + mcall ;eax=2 - get key code mov al,ah cmp al,13 jz restart @@ -62,7 +74,8 @@ still: jmp still button: - mcall 17 ;eax=17 - get pressed button id + mov al,17 + mcall ;eax=17 - get pressed button id xchg al,ah dec eax jz close_1 @@ -72,6 +85,8 @@ button: jz restart dec eax jnz run_rdsave +; dec eax ; we have only one button left, this is close button +; jnz still power_off: push 2 @@ -83,13 +98,16 @@ restart_kernel: push 4 mcall_and_close: pop ecx - mcall 18,9 + mov al,18 + mcall ,9 close_1: - mcall -1 + or eax,-1 + mcall run_rdsave: - mcall 70,rdsave + mov al,70 + mcall ,rdsave jmp still data