Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2619 | mario79 | 1 | ;------------------------------------------------------------------------------ |
2 | align 4 |
||
3 | draw_running_applications: |
||
4 | pusha |
||
5 | |||
6 | cmp [run_appl],dword 0 |
||
7 | je .exit |
||
8 | |||
9 | call calculate_applications |
||
10 | |||
11 | cmp edi,[running_applications] |
||
12 | jne .noret |
||
13 | popa |
||
14 | ret |
||
15 | ;-------------------------------------- |
||
16 | align 4 |
||
17 | .noret: |
||
18 | call draw_window |
||
19 | mov [running_applications],edi |
||
20 | call redraw_window_tabs |
||
21 | ;-------------------------------------- |
||
22 | align 4 |
||
23 | .exit: |
||
24 | popa |
||
25 | ret |
||
26 | ;------------------------------------------------------------------------------ |
||
27 | align 4 |
||
28 | need_window_tab: |
||
29 | ; in: ebx->process info |
||
30 | ; out: ZF set <=> do not draw |
||
31 | cmp byte [ebx+10], '@' |
||
32 | jz .nodraw |
||
33 | ; do not draw undefined (zero-sized) windows |
||
34 | cmp dword [ebx+42], 0 |
||
35 | jnz @f |
||
36 | cmp dword [ebx+46], 0 |
||
37 | jz .nodraw |
||
38 | ;-------------------------------------- |
||
39 | align 4 |
||
40 | @@: |
||
41 | ; do not draw OpenDialog windows |
||
42 | push edi |
||
43 | mov edi, dword [ebx+10] |
||
44 | or edi, 0x20202020 |
||
45 | cmp edi, 'open' |
||
46 | jne @f |
||
47 | |||
48 | mov edi, dword [ebx+14] |
||
49 | or edi, 0x20202020 |
||
50 | cmp dword [ebx+14], 'dial' |
||
51 | jne @f |
||
52 | |||
53 | pop edi |
||
54 | jmp .nodraw |
||
55 | ;-------------------------------------- |
||
56 | align 4 |
||
57 | @@: |
||
58 | pop edi |
||
59 | cmp dword [ebx+10], 'ICON' |
||
60 | jnz @f |
||
61 | |||
62 | cmp [ebx+42], dword 51 |
||
63 | jnz @f |
||
64 | |||
65 | cmp [ebx+46], dword 51 |
||
66 | jz .nodraw |
||
67 | ;-------------------------------------- |
||
68 | align 4 |
||
69 | @@: |
||
70 | cmp [ebx+10], dword ' ' |
||
71 | ;-------------------------------------- |
||
72 | align 4 |
||
73 | .nodraw: |
||
74 | ret |
||
75 | ;------------------------------------------------------------------------------ |
||
76 | align 4 |
||
77 | calculate_applications: |
||
78 | mov eax,[max_applications] |
||
79 | mul [page_list] |
||
80 | test eax,eax |
||
81 | je @f |
||
82 | |||
83 | inc eax |
||
84 | ;-------------------------------------- |
||
85 | align 4 |
||
86 | @@: |
||
87 | mov [draw_start_position],eax |
||
88 | |||
89 | mov edi,app_list |
||
90 | mov ecx,20 ; show max 20 application ???!!! |
||
91 | mov eax,-1 |
||
92 | cld |
||
93 | rep stosd |
||
94 | |||
95 | mov edi,0 |
||
96 | mov ecx,2 |
||
97 | ;-------------------------------------- |
||
98 | align 4 |
||
99 | cnewpr: |
||
100 | mcall 9,procinfo_window_tabs |
||
101 | |||
102 | call need_window_tab |
||
103 | jz cnorpl |
||
104 | |||
105 | sub [draw_start_position], 1 |
||
106 | jg cnorpl |
||
107 | |||
108 | mov [app_list+edi*4],ecx |
||
109 | inc edi |
||
110 | ;-------------------------------------- |
||
111 | align 4 |
||
112 | cnorpl: |
||
113 | inc ecx |
||
114 | cmp eax,ecx |
||
115 | jge cnewpr |
||
116 | |||
117 | mov [app_tab_count], edi |
||
118 | ret |
||
119 | ;------------------------------------------------------------------------------ |
||
120 | align 4 |
||
121 | redraw_window_tabs: |
||
122 | xor edi, edi |
||
123 | mov [contrast], 0 |
||
124 | |||
125 | push ebp |
||
126 | mcall 18,7 |
||
127 | mov ebp,eax |
||
128 | |||
129 | call calculate_offset_X |
||
130 | ;-------------------------------------- |
||
131 | align 4 |
||
132 | .loop: |
||
133 | mov ecx,[app_list+edi*4] |
||
134 | cmp ecx,-1 |
||
135 | jz .done |
||
136 | |||
137 | mov [active_slot_number],ecx |
||
138 | mcall 9,procinfo_window_tabs |
||
139 | |||
140 | |||
141 | imul ebx, edi, TAB_SIZE |
||
142 | add ebx,[offset_X] |
||
143 | add ebx,2 |
||
144 | shl ebx,16 |
||
145 | add ebx,TAB_SIZE-2 ;54 |
||
146 | |||
147 | push edi |
||
148 | mov edx,[system_colours.work_button] |
||
149 | xor edi,edi |
||
150 | |||
151 | cmp ebp,[active_slot_number] ;ecx ; ecx=active slot number |
||
152 | jnz @f |
||
153 | |||
154 | mov edx,[wcolor] |
||
155 | inc edi |
||
156 | ;-------------------------------------- |
||
157 | align 4 |
||
158 | @@: |
||
159 | mov esi,[current_alt_tab_app] |
||
160 | cmp esi,-1 |
||
161 | jz @f |
||
162 | |||
163 | cmp ecx,[alt_tab_list+esi*8] |
||
164 | jnz @f |
||
165 | |||
2630 | mario79 | 166 | mov edx,[AltTab_color] ;0xFF8000 ; current select for ALT+Tab |
2619 | mario79 | 167 | ;-------------------------------------- |
168 | align 4 |
||
169 | @@: |
||
2630 | mario79 | 170 | call calculate_button_y_coordinate_and_size |
171 | |||
2619 | mario79 | 172 | mov esi,[wcolor] |
173 | call draw_appl_button |
||
174 | pop edi |
||
175 | ;------------------------------------------------------------------------------ |
||
2626 | mario79 | 176 | add ebx,4 shl 16 |
2619 | mario79 | 177 | mov bx,cx ;[height] |
178 | shr bx,1 |
||
179 | sub bx,4 |
||
180 | shr ecx,16 |
||
181 | add bx,cx |
||
182 | |||
183 | mov edx, procinfo_window_tabs+10 |
||
184 | mcall 4,,[system_colours.work_button_text],,11 |
||
185 | ;-------------------------------------- |
||
186 | align 4 |
||
187 | .nodraw: |
||
188 | inc edi |
||
189 | cmp edi, [max_applications] |
||
190 | jb .loop |
||
2626 | mario79 | 191 | |
192 | mov ecx,[app_list+edi*4] |
||
193 | cmp ecx,-1 |
||
194 | jz .done |
||
195 | |||
196 | xor eax,eax |
||
197 | cmp [page_list],eax |
||
198 | jne @f |
||
199 | |||
200 | inc eax |
||
201 | cmp [page_list_enable],eax |
||
202 | je @f |
||
203 | |||
204 | mov [page_list_enable],eax |
||
205 | mov [redraw_window_flag],eax |
||
2619 | mario79 | 206 | ;-------------------------------------- |
207 | align 4 |
||
2626 | mario79 | 208 | @@: |
209 | pop ebp |
||
210 | ret |
||
211 | ;-------------------------------------- |
||
212 | align 4 |
||
2619 | mario79 | 213 | .done: |
2626 | mario79 | 214 | xor eax,eax |
215 | cmp [page_list],eax |
||
216 | jne @f |
||
217 | |||
218 | cmp [page_list_enable],eax |
||
219 | je @f |
||
220 | |||
221 | mov [page_list_enable],eax |
||
222 | inc eax |
||
223 | mov [redraw_window_flag],eax |
||
224 | ;-------------------------------------- |
||
225 | align 4 |
||
226 | @@: |
||
2619 | mario79 | 227 | pop ebp |
228 | ret |
||
229 | ;------------------------------------------------------------------------------=> |