From f9f3d069711433176d6e0770e3629204469096ea Mon Sep 17 00:00:00 2001 From: "Mihail Semenyako (mike.dld)" Date: Wed, 11 Oct 2006 21:43:21 +0000 Subject: [PATCH] Update to DESKTOP, now displays windows of all four types git-svn-id: svn://kolibrios.org@179 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/desktop/trunk/desktop.asm | 246 ++++++++++++++++++---- 1 file changed, 205 insertions(+), 41 deletions(-) diff --git a/programs/system/desktop/trunk/desktop.asm b/programs/system/desktop/trunk/desktop.asm index 4b8a48e3b..0fcdc51d2 100644 --- a/programs/system/desktop/trunk/desktop.asm +++ b/programs/system/desktop/trunk/desktop.asm @@ -16,10 +16,10 @@ dd I_END ; file size dd 28000h ; memory dd 10000h ; stack pointer (0x10000+ - work area for os) - dd 0;,0 ; parameters, reserved + dd 0,0 ; parameters, reserved - include 'lang.inc' - include 'macros.inc' + include 'lang.inc' + include 'macros.inc' ;****************************************************************************** @@ -81,6 +81,10 @@ START: ; start of execution mov [skin_info.workarea],0x10000 call load_skin_file +; mov esi, default_dtp +; mov edi, fname +; mov ecx, default_dtp.size +; rep movsb red: call draw_window ; at first, draw the window @@ -188,10 +192,14 @@ still: shr eax,8 sub eax,31 shl eax,2 - add eax,color_table mov ebx,[color] - mov [eax],ebx - call draw_colours + mov [eax+color_table],ebx + cmp dword[0x18000+SKIN_HEADER.ident],'SKIN' + jne @f + mov edi,[0x18000+SKIN_HEADER.params] + mov dword[edi+0x18000+SKIN_PARAMS.dtp.data+eax],ebx + call draw_skin +@@: call draw_colours jmp still no_new_colour: @@ -276,6 +284,8 @@ load_file: mov [read_info.workarea] ,0x10000 mcall 58, read_info +; call draw_colours + popad ret @@ -491,39 +501,152 @@ find_bitmap: @@: add edi,8 jmp .lp1 +dec_edx: + sub dl,4 + jnc @f + xor dl,dl + @@: sub dh,4 + jnc @f + xor dh,dh + @@: rol edx,16 + sub dl,4 + jnc @f + xor dl,dl + @@: rol edx,16 + ret + +area: + .x = 345 + .y = 20 + .width = 206 + .height = 191 + +wnd1: + .x = area.x+49 + .y = area.y+5 + .width = 150 + .height = 90 +wnd2: + .x = area.x+35 + .y = area.y+35 + .width = 150 + .height = 90 +wnd3: + .x = area.x+21 + .y = area.y+65 + .width = 150 + .height = 90 +wnd4: + .x = area.x+7 + .y = area.y+95 + .width = 150 + .height = 90 + +virtual at edi+SKIN_PARAMS.dtp.data + dtp system_colors +end virtual + draw_skin: - mcall 13,<345,206>,<20,191>,0x00FFFFFF + mcall 13,,,0x00FFFFFF + mov ebp,0x18000 mov edi,[ebp+SKIN_HEADER.params] add edi,ebp - mpack ebx,345+45,150 - mpack ecx,20+10,140 + mpack ebx,wnd1.x,wnd1.width + mpack ecx,wnd1.y,wnd1.height + mov edx,[dtp.frame] + call draw_framerect + mcall 13,,,dword[dtp.work] + + mov eax,38 + mpack ebx,wnd1.x+1,wnd1.x+wnd1.width-2 + mpack ecx,wnd1.y+1,wnd1.y+1 + mov edx,[dtp.grab] + mov esi,20 + @@: mcall + call dec_edx + add ecx,0x00010001 + dec esi + jnz @b + + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mcall 4,,dword[dtp.grab_text],caption_text,caption_text.size + + mcall 8,,,0,[dtp.grab_button] + mcall 4,,dword[dtp.grab_button_text],close_text,close_text.size + +;---------------------------------------------------------------------- + + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mpack ebx,wnd2.x,wnd2.width + mpack ecx,wnd2.y,wnd2.height + mov edx,[dtp.frame] + shr edx,1 + and edx,0x007F7F7F + call draw_framerect + mpack ebx,wnd2.x+4,wnd2.width-8 + mpack ecx,wnd2.y+4,wnd2.height-8 + call draw_framerect + mcall 13,,,[dtp.frame] + add ecx,(wnd2.height-5)*65536 + mcall + mcall ,, + add ebx,(wnd2.width-5)*65536 + mcall + mcall ,,,dword[dtp.work] + + mov eax,38 + mpack ebx,wnd2.x+4,wnd2.x+wnd2.width-5 + mpack ecx,wnd2.y+4,wnd2.y+4 + mov edx,[dtp.grab] + mov esi,16 + @@: mcall + call dec_edx + add ecx,0x00010001 + dec esi + jnz @b + + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mcall 4,,dword[dtp.grab_text],caption_text,caption_text.size + + mcall 8,,,0,[dtp.grab_button] + mcall 4,,dword[dtp.grab_button_text],close_text,close_text.size + +;---------------------------------------------------------------------- + + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mpack ebx,wnd3.x,wnd3.width + mpack ecx,wnd3.y,wnd3.height mov edx,[edi+SKIN_PARAMS.colors_1.outer] call draw_framerect - mpack ebx,345+45+4,150-8 - mpack ecx,20+10+4,140-8 + mpack ebx,wnd3.x+4,wnd3.width-8 + mpack ecx,wnd3.y+4,wnd3.height-8 mov edx,[edi+SKIN_PARAMS.colors_1.inner] call draw_framerect - mcall 13,<345+45+1,148>,<20+10+1,3>,[edi+SKIN_PARAMS.colors_1.frame] - add ecx,135*65536 + mcall 13,,,[edi+SKIN_PARAMS.colors_1.frame] + add ecx,(wnd3.height-5)*65536 mcall - mcall ,<345+45+1,3>,<20+10+1,138> - add ebx,145*65536 + mcall ,, + add ebx,(wnd3.width-5)*65536 mcall - mcall ,<345+45+5,140>,<20+10+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work] + mcall ,,,dword[dtp.work] mov eax,0x00000001 ; left, inactive call find_bitmap - mcall 7,,,<345+45,20+10> + mcall 7,,, pushd [ebx-8] mov eax,0x00000003 ; base, inactive call find_bitmap pop edx - mov esi,345+45+150-1 + mov esi,wnd3.x+wnd3.width-1 sub esi,edx shl edx,16 - add edx,(345+45)*65536+20+10 + add edx,wnd3.x*65536+wnd3.y mcall 7 @@: rol edx,16 add dx,[ebx-8] @@ -540,7 +663,7 @@ draw_skin: shr edx,16 neg edx shl edx,16 - add edx,(345+45+150)*65536+20+10 + add edx,(wnd3.x+wnd3.width)*65536+wnd3.y mcall 7 mov ebp,0x18000 @@ -553,41 +676,41 @@ draw_skin: add ax,[edi+SKIN_PARAMS.margin.top] add ax,-4 push eax - lea ebx,[eax+(345+45)*65536+20+10] - mcall 4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size + lea ebx,[eax+wnd3.x*65536+wnd3.y] + mcall 4,,dword[dtp.grab_text],caption_text,caption_text.size ;--------------------------------------------------------- mov edi,[ebp+SKIN_HEADER.params] add edi,ebp - mpack ebx,345+10,150 - mpack ecx,20+40,140 + mpack ebx,wnd4.x,wnd4.width + mpack ecx,wnd4.y,wnd4.height mov edx,[edi+SKIN_PARAMS.colors.outer] call draw_framerect - mpack ebx,345+10+4,150-8 - mpack ecx,20+40+4,140-8 + mpack ebx,wnd4.x+4,wnd4.width-8 + mpack ecx,wnd4.y+4,wnd4.height-8 mov edx,[edi+SKIN_PARAMS.colors.inner] call draw_framerect - mcall 13,<345+10+1,148>,<20+40+1,3>,[edi+SKIN_PARAMS.colors.frame] - add ecx,135*65536 + mcall 13,,,[edi+SKIN_PARAMS.colors.frame] + add ecx,(wnd4.height-5)*65536 mcall - mcall ,<345+10+1,3>,<20+40+1,138> - add ebx,145*65536 + mcall ,, + add ebx,(wnd4.width-5)*65536 mcall - mcall ,<345+10+5,140>,<20+40+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work] + mcall ,,,dword[dtp.work] mov eax,0x00010001 ; left, inactive call find_bitmap - mcall 7,,,<345+10,20+40> + mcall 7,,, pushd [ebx-8] mov eax,0x00010003 ; base, inactive call find_bitmap pop edx - mov esi,345+10+150-1 + mov esi,wnd4.x+wnd4.width-1 sub esi,edx shl edx,16 - add edx,(345+10)*65536+20+40 + add edx,wnd4.x*65536+wnd4.y mcall 7 @@: rol edx,16 add dx,[ebx-8] @@ -604,15 +727,15 @@ draw_skin: shr edx,16 neg edx shl edx,16 - add edx,(345+10+150)*65536+20+40 + add edx,(wnd4.x+wnd4.width)*65536+wnd4.y mcall 7 mov ebp,0x18000 mov edi,[ebp+SKIN_HEADER.params] add edi,ebp pop eax - lea ebx,[eax+(345+10)*65536+20+40] - mcall 4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size + lea ebx,[eax+wnd4.x*65536+wnd4.y] + mcall 4,,dword[dtp.grab_text],caption_text,caption_text.size ;---------------------------------------------------------------------- @@ -624,14 +747,37 @@ draw_skin: mov bx,[edi+SKIN_BUTTONS.width] mov ecx,dword[edi+SKIN_BUTTONS.top-2] mov cx,[edi+SKIN_BUTTONS.height] - add ebx,(345+10+150)*65536 - add ecx,(20+40)*65536 + add ebx,(wnd4.x+wnd4.width)*65536 + add ecx,wnd4.y*65536 dec ebx dec ecx mcall 8,,,0x40000000 add edi,12 jmp .lp1 - .lp2: ret + .lp2: + + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mpack ebx,wnd4.x+10,wnd4.y+10 + add bx,word[edi+SKIN_PARAMS.skin_height] + mcall 4,,[dtp.work_text],window_text,window_text.size + + mov ecx,[edi+SKIN_PARAMS.skin_height] + shl ecx,16 + add ecx,(wnd4.y+8)*65536+10 + mcall 13,,,[dtp.work_graph] + + add ecx,25*65536+8 + mcall 8,,,0,[dtp.work_button] + + shr ecx,16 + mov bx,cx + add ebx,0x00060006 + mcall 4,,[dtp.work_button_text],button_text,button_text.size + + ret ; ********************************************* ; ******* WINDOW DEFINITIONS AND DRAW ******** @@ -717,9 +863,12 @@ end if int 0x40 ; mov eax,8 ; 3D +; mov ebx,15*65536+35 +; mov ecx,(30+18*12)*65536+14 mov ebx,(340-t1.size*6-13)*65536+(5*2+6*4) inc edx int 0x40 + ; mov eax,8 ; FLAT add ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w inc edx @@ -752,6 +901,11 @@ end if mov esi,t2.size int 0x40 +; mov eax, 4 +; mov ebx, 277*65536+(30+18*12+4) +; mov edx, t2 +; mov esi, t2.size +; int 0x40 mov eax,38 ; R G B COLOR GLIDES mov ebx,266*65536+285 @@ -866,10 +1020,20 @@ lsz t2,\ ru, ' ',\ en, ' LOAD APPLY ',\ -lsz test_text,\ +lsz caption_text,\ ru, '',\ en, 'Caption' +sz close_text,'x' + +lsz window_text,\ + ru, ' ',\ + en, 'Window text' + +lsz button_text,\ + ru, ' ',\ + en, 'Button text' + lsz labelt,\ ru, ' ',\ en, 'DESKTOP COLOURS - DEFINE COLOR AND CLICK ON TARGET'