Kernel: fixed work with zero-size windows

launcher, @rb: modified to use function 70

git-svn-id: svn://kolibrios.org@142 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2006-08-29 12:52:52 +00:00
parent 1eba0190d0
commit 7e19914ef4
6 changed files with 100 additions and 70 deletions

View File

@ -816,12 +816,11 @@ terminate: ; terminate application
add eax,[esi+WDATA.box.height]
mov [dlye],eax
mov [esi+WDATA.box.left], 0
mov [esi+WDATA.box.width], 5
mov eax,[0xFE04]
mov [esi+WDATA.box.top],eax
mov [esi+WDATA.box.height], 5
xor eax, eax
mov [esi+WDATA.box.left],eax
mov [esi+WDATA.box.width],eax
mov [esi+WDATA.box.top],eax
mov [esi+WDATA.box.height],eax
mov [esi+WDATA.cl_workarea],eax
mov [esi+WDATA.cl_titlebar],eax
mov [esi+WDATA.cl_frames],eax

View File

@ -191,16 +191,17 @@
* ebx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
* ecx = 0xX0RRGGBB, £¤¥
* RR, GG, BB § ¤ îâ 梥â ⥪áâ 
* X § ¤ ¥â ¨á¯®«ì§ã¥¬ë© èà¨äâ: 0=á¨á⥬­ë© ¬®­®è¨à¨­­ë©,
* X=ABnn (¡¨âë):
* nn § ¤ ¥â ¨á¯®«ì§ã¥¬ë© èà¨äâ: 0=á¨á⥬­ë© ¬®­®è¨à¨­­ë©,
1=á¨á⥬­ë© èà¨äâ ¯¥à¥¬¥­­®© è¨à¨­ë
* A=0 - ¢ë¢®¤¨âì esi ᨬ¢®«®¢, A=1 - ¢ë¢®¤¨âì ASCIIZ-áâபã
* B=1 - § ªà è¨¢ âì ä®­ 梥⮬ edi
* edx = 㪠§ â¥«ì ­  ­ ç «® áâப¨
* esi = ¤«¨­  áâப¨, ¤®«¦­  ¡ëâì ­¥ ¡®«ìè¥ 255
* esi = ¤«ï A=0 ¤«¨­  áâப¨, ¤®«¦­  ¡ëâì ­¥ ¡®«ìè¥ 255;
¤«ï A=1 ¨£­®à¨àã¥âáï
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ‚뢮¤ïâáï «¨¡® ¯¥à¢ë¥ (esi and 0xFF) ᨬ¢®«®¢,
«¨¡® ¢á¥ ᨬ¢®«ë ¤® (­® ­¥ ¢ª«îç ï) § ¢¥àè î饣® ­ã«ï
(¤«ï ASCIIZ-áâப) ¢ § ¢¨á¨¬®á⨠®â ⮣®, çâ® ¯à®¨§®©¤ñâ à ­ìè¥.
* <20>¥à¢ë© á¨á⥬­ë© èà¨äâ áç¨â뢠¥âáï ¯à¨ § £à㧪¥ ¨§ ä ©«  char.mt,
¢â®à®© - ¨§ char2.mt.
* Ž¡  èà¨äâ  ¨¬¥îâ ¢ëá®âã 9 ¯¨ªá¥«¥©, è¨à¨­  ¬®­®è¨à¨­­®£® èà¨äâ 
@ -325,7 +326,7 @@
* +8: word: § à¥§¥à¢¨à®¢ ­®
* +10 = +0xA: 11 ¡ ©â: ¨¬ï ¯à®æ¥áá 
(¨¬ï ᮮ⢥âáâ¢ãî饣® ¨á¯®«­ï¥¬®£® ä ©«  ¢ ä®à¬ â¥ 8+3)
* +21 = +0x15: byte: ¢ëà ¢­¨¢ ­¨¥, íâ®â ¡ ©â ­¥ ¨§¬¥­ï¥âáï
* +21 = +0x15: byte: § à¥§¥à¢¨à®¢ ­®, íâ®â ¡ ©â ­¥ ¨§¬¥­ï¥âáï
* +22 = +0x16: dword:  ¤à¥á ¯à®æ¥áá  ¢ ¯ ¬ïâ¨
* +26 = +0x1A: dword: à §¬¥à ¨á¯®«ì§ã¥¬®© ¯ ¬ï⨠- 1
* +30 = +0x1E: dword: ¨¤¥­â¨ä¨ª â®à (PID/TID)
@ -344,6 +345,17 @@
* 5 = ¯®â®ª ®¦¨¤ ¥â ᮡëâ¨ï
* 9 = § ¯à®è¥­­ë© á«®â ᢮¡®¤¥­, ¢áï ®áâ «ì­ ï ¨­ä®à¬ æ¨ï ®
᫮⥠­¥ ¨¬¥¥â á¬ëá« 
* +52 = +0x34: word: § à¥§¥à¢¨à®¢ ­®, íâ® á«®¢® ­¥ ¨§¬¥­ï¥âáï
* +54 = +0x36: dword: ª®®à¤¨­ â  ­ ç «  ª«¨¥­â᪮© ®¡« áâ¨
¯® ®á¨ x
* +58 = +0x3A: dword: ª®®à¤¨­ â  ­ ç «  ª«¨¥­â᪮© ®¡« áâ¨
¯® ®á¨ y
* +62 = +0x3E: dword: è¨à¨­  ª«¨¥­â᪮© ®¡« áâ¨
* +66 = +0x42: dword: ¢ëá®â  ª«¨¥­â᪮© ®¡« áâ¨
* +70 = +0x46: byte: á®áâ®ï­¨¥ ®ª­  - ¡¨â®¢®¥ ¯®«¥
* ¡¨â 0 (¬ áª  1): ®ª­® ¬ ªá¨¬¨§¨à®¢ ­®
* ¡¨â 1 (¬ áª  2): ®ª­® ¬¨­¨¬¨§¨à®¢ ­® ¢ ¯ ­¥«ì § ¤ ç
* ¡¨â 2 (¬ áª  4): ®ª­® á¢ñà­ãâ® ¢ § £®«®¢®ª
‡ ¬¥ç ­¨ï:
* ‘«®âë ­ã¬¥àãîâáï á 1.
* ‚®§¢à é ¥¬®¥ §­ ç¥­¨¥ ­¥ ¥áâì ®¡é¥¥ ç¨á«® ¯®â®ª®¢, ¯®áª®«ìªã
@ -366,7 +378,8 @@
*  ¤à¥á ¯à®æ¥áá  ¢ ¯ ¬ï⨠ࠢ¥­ 0, à §¬¥à ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨
16 Mb (0x1000000)
* PID=1
* ª®®à¤¨­ âë ¨ à §¬¥àë ®ª­  ãá«®¢­® ¯®« £ îâáï à ¢­ë¬¨ 0
* ª®®à¤¨­ âë ¨ à §¬¥àë ®ª­ , à ¢­® ª ª ¨ ª«¨¥­â᪮© ®¡« áâ¨,
ãá«®¢­® ¯®« £ îâáï à ¢­ë¬¨ 0
* á®áâ®ï­¨¥ á«®â  - ¢á¥£¤  0 (¢ë¯®«­ï¥âáï)
* ¢à¥¬ï ¢ë¯®«­¥­¨ï ᪫ ¤ë¢ ¥âáï ¨§ ¢à¥¬¥­¨, ã室ï饣® ­ 
ᮡá⢥­­® à ¡®âã, ¨ ¢à¥¬¥­¨ ¯à®áâ®ï ¢ ®¦¨¤ ­¨¨ ¯à¥à뢠­¨ï
@ -385,8 +398,9 @@
<20> §­ ç ¥¬ë¥ ­®¢ë¬ ¯®â®ª ¬ ¨¤¥­â¨ä¨ª â®àë ¬®­®â®­­® à áâãâ.
* …᫨ ¯®â®ª ¥é¥ ­¥ ®¯à¥¤¥«¨« ᢮¥ ®ª­® ¢ë§®¢®¬ ä㭪樨 0, â®
¯®«®¦¥­¨¥ ¨ à §¬¥àë í⮣® ®ª­  ¯®« £ îâáï ­ã«ï¬¨.
* Š®®à¤¨­ âë ª«¨¥­â᪮© ®¡« á⨠®ª­  ¡¥àãâáï ®â­®á¨â¥«ì­® ®ª­ .
* ¤ ­­ë© ¬®¬¥­â ¨á¯®«ì§ã¥âáï ⮫쪮 ç áâì ¡ãä¥à  à §¬¥à®¬
52 = 0x34 ¡ ©â . ’¥¬ ­¥ ¬¥­¥¥ ४®¬¥­¤ã¥âáï ¨á¯®«ì§®¢ âì ¡ãä¥à
71 = 0x47 ¡ ©â . ’¥¬ ­¥ ¬¥­¥¥ ४®¬¥­¤ã¥âáï ¨á¯®«ì§®¢ âì ¡ãä¥à
à §¬¥à®¬ 1 Š¡ ¤«ï ¡ã¤ã饩 ᮢ¬¥á⨬®áâ¨, ¢ ¡ã¤ã饬 ¬®£ãâ ¡ëâì
¤®¡ ¢«¥­ë ­¥ª®â®àë¥ ¯®«ï.
@ -2083,7 +2097,12 @@ db 'Kolibri',0
* ¡¨âë 22-31 § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0
* ecx = ç¨á«® (¯à¨ bl=0) ¨«¨ 㪠§ â¥«ì (¯à¨ bl=1)
* edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
* esi = 0xN0RRGGBB, RRGGBB=梥â, N=èà¨äâ (0/1)
* esi = 0xX0RRGGBB:
* RR, GG, BB § ¤ îâ 梥â
* X = ABnn (¡¨âë)
* nn = èà¨äâ (0/1)
* A ¨£­®à¨àã¥âáï
* B=1 - § ªà è¨¢ âì ä®­ 梥⮬ edi
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:

View File

@ -321,7 +321,7 @@ Returned value:
* +8: word: reserved
* +10 = +0xA: 11 bytes: name of the process
(name of corresponding executable file in the format 8+3)
* +21 = +0x15: byte: alignment, this byte preserves
* +21 = +0x15: byte: reserved, this byte is not changed
* +22 = +0x16: dword: address of the process in memory
* +26 = +0x1A: dword: size of used memory - 1
* +30 = +0x1E: dword: identifier (PID/TID)
@ -340,6 +340,15 @@ Returned value:
* 5 = thread waits for event
* 9 = requested slot is free, all other information on the slot
is not meaningful
* +52 = +0x34: word: reserved, this word is not changed
* +54 = +0x36: dword: coordinate of the client area on axis x
* +58 = +0x3A: dword: coordinate of the client area on axis y
* +62 = +0x3E: dword: width of the client area
* +66 = +0x42: dword: height of the client area
* +70 = +0x46: byte: state of the window - bitfield
* bit 0 (mask 1): window is maximized
* bit 1 (mask 2): window is minimized to panel
* bit 2 (mask 4): window is rolled up
Remarks:
* Slots are numbered starting from 1.
* Returned value is not a total number of threads, because there
@ -362,7 +371,8 @@ Remarks:
* address of the process in memory is 0, size of used memory is
16 Mb (0x1000000)
* PID=1
* coordinates and sizes of the window are by convention set to 0
* coordinates and sizes of the window and the client area are by
convention set to 0
* status of the slot is always 0 (running)
* the execution time adds of time leaving on operations itself
and idle time in waiting for interrupt (which can be got by call
@ -381,8 +391,9 @@ Remarks:
* If the thread has not yet defined the window by call to
function 0, the position and the sizes
of its window are considered to be zero.
* Coordinates of the client area are relative to the window.
* At the moment only the part of the buffer by a size
52 = 0x34 bytes is used. Nevertheless it is recommended to use
71 = 0x37 bytes is used. Nevertheless it is recommended to use
1-Kb buffer for the future compatibility, in the future
some fields can be added.

View File

@ -145,6 +145,17 @@ setscreen:
; edx y end
; esi process number
pushad
; \begin{diamond}[29.08.2006]
cmp esi, 1
jz @f
mov edi, esi
shl edi, 5
cmp [edi+window_data+WDATA.box.width], 0
jnz @f
cmp [edi+window_data+WDATA.box.height], 0
jz .ret
@@:
; \end{diamond}[29.08.2006]
mov edi, esi ;;;word [esi*2+0xc400]
shl edi, 8
add edi, 0x80000 ; address of random shaped window area
@ -183,6 +194,7 @@ pushad
sub edi, ecx
dec edx
jnz .new_y
.ret:
popad
ret
.read_byte:

View File

@ -28,7 +28,7 @@ START: ; start of execution
mcall 18,15
mov eax, 58 ; load AUTORUN.DAT
mov eax, 70 ; load AUTORUN.DAT
mov ebx, autorun_dat_info
int 0x40
@ -59,7 +59,7 @@ START: ; start of execution
run_program: ; time to delay in eax
push eax
mcall 58, start_info
mcall 70, start_info
pop ebx
mov eax, 5
@ -77,7 +77,6 @@ START: ; start of execution
mov ecx, 60
mov edi, parameters
xor al, al
rep stosb
popad
@ -112,13 +111,11 @@ START: ; start of execution
xor ebx, ebx
.start:
lodsb
cmp al, '0'
jb .finish
cmp al, '9'
ja .finish
sub al, '0'
imul ebx, 10
add ebx, eax
cmp al, 9
ja .finish
lea ebx,[ebx*4+ebx]
lea ebx,[ebx*2+eax]
inc [position]
jmp .start
.finish:
@ -180,17 +177,17 @@ START: ; start of execution
autorun_dat_info: ; AUTORUN.DAT
.mode dd 0 ; read file
.start_block dd 0 ; block to read
.blocks dd 0x10 ; 16*512 bytes max
dd 0
.blocks dd 16*512 ; 16*512 bytes max
.address dd file_data
.workarea dd work_area
db "/RD/1/AUTORUN.DAT",0
start_info:
.mode dd 16
.mode dd 7
dd 0
.params dd parameters
dd 0
.workarea dd work_area
dd 0
.path: ;      
I_END:
@ -200,5 +197,4 @@ I_END:
number_of_files dd ?
work_area rb 0x4000
file_data rb 16*512

View File

@ -13,10 +13,6 @@ include 'macros.inc'
meos_app_start
code
mov [start_info.mode], 16
mov [start_info.params], 0
mov [start_info.workarea], work_area
mov eax,40 ; ãáâ ­®¢¨¬ ¬ áªã ᮡë⨩
mov ebx,100000b ; ­ á ¨­â¥à¥áã¥â ⮫쪮 ¬ëèì
int 0x40
@ -26,9 +22,6 @@ still: ;
mov eax,10 ; ¦¤ñ¬ ᮡëâ¨ï
int 0x40
cmp eax,6 ; ¬ëèì?
jne still
mov eax,37 ; ª ª¨¥ ­ ¦ âë ª¯®¯ª¨?
mov ebx,2
int 0x40
@ -141,12 +134,13 @@ exit: ;
; §¤¥áì áâ àâã¥â ¯à®æ¥áá ¬¥­î
start_wnd:
mov [menu_opened],1
call draw_window
mov eax,40 ; ãáâ ­®¢¨¬ ¬ áªã ¦¥« ¥¬ëå ᮡë⨩ ¤«ï í⮣® ¯à®æ¥áá 
mov ebx,100101b ; ¬¥­î + ª­®¯ª¨ + ¯¥à¥à¨á®¢ª 
int 0x40
red:
call draw_window
still2: ; £« ¢­ë© 横« ¯à®æ¥áá  ¬¥­î
mov eax,10 ; ¦¤ñ¬ ᮡëâ¨ï
@ -172,32 +166,24 @@ mouse: ;
jmp exit_menu ;   ¥á«¨ ¢áñ-â ª¨ ­ ¦ âë - § ªà®¥¬ ®ª­®
; <20><EFBFBD><EFBFBD>ˆŽœ ŽŠ<C5BD>Ž
red:
call draw_window
jmp still2
; <20>€†€€ Š<>Ž<EFBFBD>Š€
button:
mov eax,17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
int 0x40
cmp ah,10 ; áà ¢­¨¢ ¥¬ á 10
sub ah,10 ; áà ¢­¨¢ ¥¬ á 10
jl nofuncbtns ; ¥á«¨ ¬¥­ìè¥ - § ªà뢠¥¬ ¬¥­î
add ah,-10 ; ¢ëç⥬ ¨§ ¨¤¥­â¨ä¨ª â®à  ª­®¯ª¨ 10
movzx ebx,ah ; ¯®«ã稫¨ ­®¬¥à ¯à®£à ¬¬ë ¢ ᯨ᪥ ¢ ebx
lea esi, [startapps + ebx*4]
lea edi, [start_info.path]
mov esi, [esi]
mov esi, [startapps + ebx*4]
mov edi, start_info.path
cld
@@:
lodsb
stosb
test al, al
jnz @b
mcall 58, start_info
mcall 70, start_info
; mov eax,5 ; ¯®¤®¦¤ñ¬, ¯®ª  ¯à®£à ¬¬  § ¯ãáâ¨âìáï
; mov ebx,1 ;   â® ¥ñ ®ª­® ­¥ ¡ã¤¥â ®âà¨á®¢ ­® (¡ £ ¢ ï¤à¥???)
@ -279,12 +265,23 @@ draw_window:
mov eax, 4 ; § £®«®¢®ª
mov ebx, header_pos ; [x] shl 16 + [y]
mov ecx, [sc.grab_text]; èà¨äâ ¨ 梥â (á¥àë©)
add ecx, -0x333333
or ecx, 0x10000000
; add ecx, -0x333333
push ecx
push ecx
xor edx,edx
.dec_color:
sub byte [esp+edx], 0x33
jae @f
mov byte [esp+edx], 0
@@:
inc edx
jnp .dec_color
pop ecx
mov edx, header ;  ¤à¥á § £®«®¢ª 
mov esi, header.size ; ¤«¨­  § £®«®¢ª  ("M E N U")
int 0x40
add ecx, 0x333333 ; 梥⠡¥«ë©
pop ecx
add ebx, 1 shl 16 ; ᤢ¨­¥¬ ¢¯à ¢® ­  1
int 0x40
@ -348,7 +345,7 @@ DATA
<"/RD/1/JPEGVIEW",0> ,\
<"/RD/1/CPU",0> ,\
<"/RD/1/SPANEL",0> ,\
<"/RD/1/ICONMNGR",0> ,\
<"/RD/1/ICON2",0> ,\
<"/RD/1/VRR",0>
; header: ; § £®«®¢®ª
@ -363,7 +360,7 @@ DATA
; db 'Panel setup '
; db 'Icon manager'
sz header, "MenuetOS"
sz header, "KolibriOS"
lsz text,\
en, 'Background ',\
@ -384,7 +381,14 @@ DATA
ru, '“¯à ¢«¥­¨¥ ¨ª®­ª ¬¨ ',\
ru, '<27> áâனª  ¬®­¨â®à  '
start_info:
.mode dd 7
dd 0
.params dd 0
dd 0
dd 0
db 0
dd start_info.path
; <20>ˆ<E280A6>ˆˆˆˆ<E280A1>Ž<E2809A><E282AC>… „€<E2809E><E282AC>
UDATA
@ -396,23 +400,12 @@ UDATA
menu_opened db ? ; ®âªàëâ® ¬¥­î ¨«¨ ­¥â? (1-¤ , 0-­¥â)
align 32
start_info:
.mode dd ?
dd ?
.params dd ?
dd ?
.workarea dd ?
.path:
rb 256
align 4
start_info.path rb 256
sc system_colors ; á¨á⥬­ë¥ 梥â 
procinfo process_information ; ¨­ä®à¬ æ¨ï ® ¯à®æ¥áá¥
work_area:
rb 0x1000
rb 1024 ; áâíª ¤«ï ®ª­  ¬¥­î - 墠â¨â ¨ 1 Š¡
align 32
stack_wnd: