System panel updated

git-svn-id: svn://kolibrios.org@93 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2006-06-30 12:34:18 +00:00
parent 56d23ae060
commit e44a4705bc

View File

@ -1,16 +1,16 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ; ; ;
; MENUBAR for MenuetOS - Compile with fasm ; ; MENUBAR for KolibriOS - Compile with fasm ;
; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use32 use32
org 0x0 org 0x0
db 'MENUET01' ; 8 byte id db 'MENUET01' ; 8 byte id
dd 0x01 ; required OS version dd 0x01 ; header version
dd START ; program start dd START ; program start
dd I_END ; program image size dd I_END ; program image size
dd 0xB000 ; reguired amount of memory - 64 Kb dd 0xA000 ; reguired amount of memory - 10 Kb
dd 0xA000 ; esp dd 0xA000 ; esp
dd 0x0,0x0 ; param, icon dd 0x0,0x0 ; param, icon
@ -30,115 +30,57 @@ graph_text dd 1
soften_middle dd 1 ; 0 no ; 1 yes soften_middle dd 1 ; 0 no ; 1 yes
icons dd 1 ; 0 defaults ; 1 activate icons dd 1 ; 0 defaults ; 1 activate
dat db 'PANEL DAT'
PANEL_HEIGHT = 18 PANEL_HEIGHT = 18
;mainalive db 1 handle_key:
;correct_display:
; mov eax,15
; mov ebx,3
; int 0x40
; mcall 5, 300
; jmp correct_display
chlangproc:
; mcall 18, 7
; mov [my_process],eax
begin_2:
mcall 40,0b ; 0
begin:
.begin:
mcall 5, eax
begin_3:
mcall 18, 7 mcall 18, 7
mov [active_process],eax mov [active_process],eax
; cmp [mainalive], 0
; je .exit
mcall 66, 3 mcall 2
mov ah,al cmp al, 2
and al,100000b jnz begin_1.ret
cmp al,100000b mov ebx, exec_fileinfo
je change_start_end shr eax, 8
mov al,ah cmp al, 88
and al,10000b jz start_end_application
cmp al,10000b cmp al, 91
je change_start_end jz start_menu_application
mov al,ah cmp al, 92
and al,1000b jz start_menu_application
cmp al,1000b cmp al, 62
je change_key_lang_1 jz kill_active_application
mov al,ah cmp al, 71
and al,100b jz page_list_next
cmp al,100b cmp al, 72
je change_key_lang_1 jz page_list_prev
mov al,ah ; this is hotkey Ctrl+Shift or LShift+RShift
and al,1111b mov ebx, setup_exec
cmp al,11b test ah, 001100b
jne begin jnz change_key_lang
mcall 19, file_sys, syslang mov dword [ebx+8], syslang
call syslang_music mcall 70
; mcall 5, 25 call syslang_music
; mcall 5, 25
begin_1: begin_1:
mov ecx,[active_process] mov ecx,[active_process]
mcall 18, 3 mcall 18, 3
mcall 5, 25 mcall 5, 25
jmp begin .ret:
change_key_lang_1: ret
mov al,ah
and al,11b
cmp al,01b
je change_key_lang
cmp al,10b
jne begin
change_key_lang: change_key_lang:
mcall 19, file_sys, chlang mov dword [ebx+8], chlang
call chlang_music mcall 70
; mcall 5, 25 call chlang_music
jmp begin_1 ; mcall 5, 25
change_start_end: jmp begin_1
mov al,ah
and al,1100b
cmp al,1000b
je start_end
cmp al,100b
jne start_menu
start_end:
; mov ecx,[my_process]
; mcall 18, 3
mcall 18,12
cmp al,1
je scan_codes
cmp ah,255
jne begin
start_end_application: start_end_application:
mcall 19,file_end,0 mov dword [ebx+21], end_name
mcall 70
mcall 5 ,50 mcall 5 ,50
jmp begin jmp begin_1.ret
scan_codes:
cmp ah,88
je start_end_application
jmp begin
start_menu:
mcall 18,12
mov [button_presssed_alt],eax
mov [draw_window_1],1
; mov ecx,eax
; mcall 47,0x40100, ,10 shl 16+5,0
; mov eax,ecx
cmp al,1
je scan_codes2
cmp ah,72 ;232
je start_menu_application
cmp ah,73 ;233
je start_menu_application
cmp ah,0x35 ;b6 ;53
je kill_active_application
cmp ah,0x9
jne begin
jmp begin
kill_active_application: kill_active_application:
mcall 18, 7 mcall 18, 7
@ -147,46 +89,33 @@ start_menu:
; mov eax,area9 ; mov eax,area9
; mov ecx,[eax+4] ; mov ecx,[eax+4]
mcall 18, 2 mcall 18, 2
jmp begin jmp begin_1.ret
start_menu_application: start_menu_application:
mcall 19,filename,0 mov [draw_window_1], 1
call menu_music mov dword [ebx+21], menu_name
mcall 70
call menu_music
mcall 5,50 mcall 5,50
jmp begin jmp begin_1.ret
scan_codes2:
cmp ah,91 page_list_next:
je start_menu_application
cmp ah,92
je start_menu_application
cmp ah,83 ;62
je kill_active_application
cmp ah,71 ;179
jne no_test_179
cmp [page_list],15 cmp [page_list],15
je @f je @f
inc [page_list] inc [page_list]
mov [draw_window_1],1 mov [draw_window_1],1
@@: @@:
jmp begin jmp begin_1.ret
no_test_179: page_list_prev:
cmp ah,72 ;180
jne no_test_180
cmp [page_list],0 cmp [page_list],0
je @f je @f
dec [page_list] dec [page_list]
mov [draw_window_1],1 mov [draw_window_1],1
@@: @@:
jmp begin jmp begin_1.ret
no_test_180:
jmp begin
button_presssed_alt dd 0
active_process dd 0 active_process dd 0
my_process dd 0
calendar_music: calendar_music:
mcall 55, eax, , , calendarmusic mcall 55, eax, , , calendarmusic
@ -230,20 +159,26 @@ calendarmusic: db 0x85,0x37,0x85,0x48,0
START: START:
mov eax, 6 mcall 66,4,0,2 ; LShift+RShift
mov ebx, dat mcall 66, , ,11h ; Ctrl+Shift
mov ecx, 0 mcall 66,,88,110h ; Alt+Ctrl+F12
mov edx, -1 mcall 66,,91,100h ; Alt+LWin
mov esi, I_END mcall 66,,92 ; Alt+RWin
int 0x40 mcall 66,,62 ; Alt+F4
mcall 66,,71 ; Alt+Home
mov eax,40 mcall 66,,72 ; Alt+Up
mov ebx,0101b mcall 18, 8, 1
int 0x40 test eax, eax
jne @f
mcall 18, 8, 2
@@:
mov eax, 70
mov ebx, dat_fileinfo
int 0x40
mov edi,width mov edi,width
mov esi,I_END mov esi,I_END
mov eax,0 xor eax,eax
new_number: new_number:
cmp [esi],byte ';' cmp [esi],byte ';'
je number_ready je number_ready
@ -254,9 +189,8 @@ START:
inc esi inc esi
jmp new_number jmp new_number
number_ready: number_ready:
mov [edi],eax stosd
mov eax,0 xor eax,eax
add edi,4
inc esi inc esi
cmp [esi],byte 'x' cmp [esi],byte 'x'
jne new_number jne new_number
@ -271,10 +205,6 @@ START:
call set_variables call set_variables
mcall 51, 1, chlangproc, 0xB000
; mcall 5, 5
; mcall 51, 1, correct_display, 0xA800
start_after_minimize: start_after_minimize:
call draw_window call draw_window
@ -301,8 +231,8 @@ still:
jz red jz red
cmp eax,3 ; button ? cmp eax,3 ; button ?
jz button jz button
call handle_key
jmp still jmp still
red: ; redraw window red: ; redraw window
@ -364,60 +294,22 @@ still:
jmp still jmp still
noselect: noselect:
mov ebx, exec_fileinfo
cmp ah,byte 2 ; start calendar cmp ah,byte 2 ; start calendar
jnz noid15 ;noclock jnz noid15 ;noclock
mov eax, 19 mov dword [ebx+21], calendar_name
mov ebx, file6 mov eax, 70
xor ecx, ecx int 0x40
int 0x40
call calendar_music call calendar_music
jmp still jmp still
; noclock:
; cmp ah,byte 11 ; start file 1
; jnz nob1
; mov eax,19
; mov ebx,file1
; int 0x40
; jmp still
; nob1:
; cmp ah,byte 12 ; start file 2
; jnz nob2
; mov eax,19
; mov ebx,file2
; int 0x40
; jmp still
; nob2:
; cmp ah,byte 13 ; start file 3
; jnz nob3
; mov eax,19
; mov ebx,file3
; int 0x40
; jmp still
; nob3:
; cmp ah,14 ; start file 4
; jne noid14
; mov eax,19
; mov ebx,file4
; mov ecx,file4_par
; int 0x40
; jmp still
; noid14:
; cmp ah,15 ; start file 5
; jne noid15
; mov eax,19
; mov ebx,file5
; int 0x40
; jmp still
noid15: noid15:
cmp ah,16 cmp ah,16
jne noid16 jne noid16
mcall 19, file_sys, chlang mov ebx, setup_exec
mov dword [ebx+8], chlang
mov eax, 70
int 0x40
call chlang_music call chlang_music
mcall 5, 25 mcall 5, 25
jmp still jmp still
@ -425,7 +317,10 @@ still:
noid16: noid16:
cmp ah,17 cmp ah,17
jne noid17 jne noid17
mcall 19, file_sys, syslang mov ebx, setup_exec
mov dword [ebx+8], syslang
mov eax, 70
int 0x40
call syslang_music call syslang_music
mcall 5, 25 mcall 5, 25
jmp still jmp still
@ -433,7 +328,9 @@ still:
noid17: noid17:
cmp ah,18 cmp ah,18
jne noid18 jne noid18
mcall 19, sysmeter, 0 mov dword [ebx+21], sysmeter_name
mov eax, 70
int 0x40
call sysmeter_music call sysmeter_music
jmp still jmp still
@ -453,11 +350,12 @@ still:
noid19: noid19:
cmp ah,20 ; start system setup cmp ah,20 ; start system setup
jnz noid20 jnz noid20
mov eax, 19 mov ebx, setup_exec
mov ebx, file_sys and dword [ebx+8], 0
xor ecx, ecx mov eax, 70
int 0x40 int 0x40
call setup_music call setup_music
jmp still
noid20: noid20:
cmp ah,21 cmp ah,21
@ -511,10 +409,8 @@ draw_running_applications:
mov ecx,2 mov ecx,2
mov [contrast],0 mov [contrast],0
mov eax,[max_applications] mov eax,[max_applications]
mov ebx,[page_list] mul [page_list]
xor edx,edx test eax,eax
mul ebx
cmp eax,0
je @f je @f
inc eax inc eax
@@: @@:
@ -641,10 +537,8 @@ contrast2:
calculate_applications: calculate_applications:
mov eax,[max_applications] mov eax,[max_applications]
mov ebx,[page_list] mul [page_list]
xor edx,edx test eax,eax
mul ebx
cmp eax,0
je @f je @f
inc eax inc eax
@@: @@:
@ -759,11 +653,11 @@ draw_application_buttons:
menu_handler: menu_handler:
mov eax, 19 mov eax, 70
mov ebx, filename mov ebx, exec_fileinfo
xor ecx, ecx mov dword [ebx+21], menu_name
int 0x40 int 0x40
ret ret
draw_small_right: draw_small_right:
@ -896,10 +790,6 @@ right_button:
call draw_small_right call draw_small_right
mov eax, 23
mov ebx, 30
int 0x40
jmp small_wait jmp small_wait
;------------------------------------------------- ;-------------------------------------------------
@ -918,10 +808,6 @@ left_button:
call draw_small_left call draw_small_left
mov eax, 23
mov ebx, 30
int 0x40
;------------------------------------------------- ;-------------------------------------------------
small_wait: small_wait:
@ -934,6 +820,11 @@ left_button:
call [small_draw] call [small_draw]
jmp small_wait jmp small_wait
no_win: no_win:
cmp eax,2
jne no_key
call handle_key
jmp small_wait
no_key:
mov eax,17 mov eax,17
int 0x40 int 0x40
@ -1339,13 +1230,10 @@ draw_menuet_icon:
mov eax,[wcolor] mov eax,[wcolor]
mov [m_icon+4],eax mov [m_icon+4],eax
mov eax,6 ; load file ; load & display menuet.bmp
mov ebx,m_bmp mov eax, 70
mov ecx,0 mov ebx, m_bmp_fileinfo
mov edx,200000 int 0x40
mov esi,image
mov edi,0
int 0x40
mov eax,40 mov eax,40
mov ebx,0 mov ebx,0
@ -1356,14 +1244,11 @@ draw_menuet_icon:
; movzx ecx,byte [edi] ; movzx ecx,byte [edi]
; shr ecx,5 ; shr ecx,5
mov cl,[edi] cmp byte [edi], 10
cmp cl,10
jb nopix jb nopix
mov cl,[edi+1] cmp byte [edi+1], 10
cmp cl,10
jb nopix jb nopix
mov cl,[edi+2] cmp byte [edi+2], 10
cmp cl,10
jb nopix jb nopix
pusha pusha
@ -1435,12 +1320,9 @@ draw_program_icons:
add ecx,48 add ecx,48
mov [iconf+6],cl mov [iconf+6],cl
mov eax,6 ; load file mov eax, 70
mov ebx,iconf mov ebx, iconf_fileinfo
mov ecx,0 int 0x40
mov edx,200000
mov esi,image
int 0x40
mov eax,0 mov eax,0
mov ebx,32 mov ebx,32
@ -2044,21 +1926,8 @@ button_frames dd 0x0
checks dd -1 checks dd -1
hidetext db 0x11,0x10,0x1e hidetext db 0x11,0x10,0x1e
iconf db 'MBAR_IX BMP'
m_bmp db 'MENUET BMP'
sysmeter db 'SYSMETER '
file_end db 'END '
file_sys db 'SETUP '
filename db 'MENU '
turn_text db '><' turn_text db '><'
;file1 db 'SB '
;file2 db 'TETRIS '
;file3 db 'PIC4 '
;file4 db 'TINYPAD '
;file4_par db 'COPYING.TXT',0
;file5 db 'MFASM '
file6 db 'CALENDAR '
gpl db 'GPL' gpl db 'GPL'
chlang db 'LANG',0 chlang db 'LANG',0
@ -2092,6 +1961,54 @@ pros db ' '
screenxy dd 0x0 screenxy dd 0x0
stcount dd 0x0 stcount dd 0x0
setup_exec:
dd 7
dd 0
.cmdline dd ?
dd 0
dd 0
db '/RD/1/'
file_sys db 'SETUP',0
exec_fileinfo:
dd 7
dd 0
dd 0
dd 0
dd 0
db 0
.name dd ?
end_name db '/RD/1/END',0
menu_name db '/RD/1/MENU',0
calendar_name db '/RD/1/CALENDAR',0
sysmeter_name db '/RD/1/SYSMETER',0
dat_fileinfo:
dd 0
dd 0
dd 0
dd 1024
dd I_END
db '/RD/1/PANEL.DAT',0
m_bmp_fileinfo:
dd 0
dd 0
dd 0
dd 8192
dd image
db '/RD/1/MENUET.BMP',0
iconf_fileinfo:
dd 0
dd 0
dd 0
dd 8192
dd image
db '/RD/1/'
iconf db 'MBAR_IX.BMP',0
I_END: I_END:
screen_size: screen_size: