Rev 1391 | Rev 1460 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1362 | mikedld | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
1391 | mikedld | 3 | ;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; |
1362 | mikedld | 4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
||
6 | ;; ;; |
||
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
8 | |||
9 | $Revision: 1424 $ |
||
10 | |||
11 | ;============================================================================== |
||
12 | ;///// public functions /////////////////////////////////////////////////////// |
||
13 | ;============================================================================== |
||
14 | |||
1391 | mikedld | 15 | window.BORDER_SIZE = 5 |
16 | |||
17 | macro FuncTable name, table_name, [label] |
||
1362 | mikedld | 18 | { |
19 | common |
||
20 | align 4 |
||
1391 | mikedld | 21 | \label name#.#table_name dword |
1362 | mikedld | 22 | forward |
23 | dd name#.#label |
||
24 | common |
||
1391 | mikedld | 25 | name#.sizeof.#table_name = $ - name#.#table_name |
1362 | mikedld | 26 | } |
27 | |||
28 | uglobal |
||
1391 | mikedld | 29 | common_colours rd 32 |
30 | draw_limits RECT |
||
1362 | mikedld | 31 | endg |
32 | |||
33 | align 4 |
||
34 | ;------------------------------------------------------------------------------ |
||
1391 | mikedld | 35 | syscall_draw_window: ;///// system function 0 ///////////////////////////////// |
36 | ;------------------------------------------------------------------------------ |
||
37 | ;? |
||
38 | ;------------------------------------------------------------------------------ |
||
39 | mov eax, edx |
||
40 | shr eax, 24 |
||
41 | and al, 0x0f |
||
42 | cmp al, 5 |
||
43 | jae .exit |
||
44 | |||
45 | push eax |
||
46 | inc [mouse_pause] |
||
47 | call [_display.disable_mouse] |
||
48 | call window._.sys_set_window |
||
49 | call [_display.disable_mouse] |
||
50 | pop eax |
||
51 | |||
52 | or al, al |
||
53 | jnz @f |
||
54 | |||
55 | ; type I - original style |
||
56 | call drawwindow_I |
||
57 | jmp window._.draw_window_caption.2 |
||
58 | |||
59 | @@: dec al |
||
60 | jnz @f |
||
61 | |||
62 | ; type II - only reserve area, no draw |
||
63 | call sys_window_mouse |
||
64 | dec [mouse_pause] |
||
65 | call [draw_pointer] |
||
66 | jmp .exit |
||
67 | |||
68 | @@: dec al |
||
69 | jnz @f |
||
70 | |||
71 | ; type III - new style |
||
72 | call drawwindow_III |
||
73 | jmp window._.draw_window_caption.2 |
||
74 | |||
75 | ; type IV & V - skinned window (resizable & not) |
||
76 | @@: mov eax, [TASK_COUNT] |
||
77 | movzx eax, word[WIN_POS + eax * 2] |
||
78 | cmp eax, [CURRENT_TASK] |
||
79 | setz al |
||
80 | movzx eax, al |
||
81 | push eax |
||
82 | call drawwindow_IV |
||
83 | jmp window._.draw_window_caption.2 |
||
84 | |||
85 | .exit: |
||
86 | ret |
||
87 | |||
88 | align 4 |
||
89 | ;------------------------------------------------------------------------------ |
||
1362 | mikedld | 90 | syscall_display_settings: ;///// system function 48 /////////////////////////// |
91 | ;------------------------------------------------------------------------------ |
||
92 | ;; Redraw screen: |
||
93 | ;< ebx = 0 |
||
94 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
95 | ;; Set button style: |
||
96 | ;< ebx = 1 |
||
97 | ;< ecx = 0 (flat) or 1 (with gradient) |
||
98 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
99 | ;; Set system color palette: |
||
100 | ;< ebx = 2 |
||
101 | ;< ecx = pointer to color table |
||
102 | ;< edx = size of color table |
||
103 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
104 | ;; Get system color palette: |
||
105 | ;< ebx = 3 |
||
106 | ;< ecx = pointer to color table buffer |
||
107 | ;< edx = size of color table buffer |
||
108 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
109 | ;; Get skinned caption height: |
||
110 | ;< ebx = 4 |
||
111 | ;> eax = height in pixels |
||
112 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
113 | ;; Get screen working area: |
||
114 | ;< ebx = 5 |
||
115 | ;> eax = pack[16(left), 16(right)] |
||
116 | ;> ebx = pack[16(top), 16(bottom)] |
||
117 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
118 | ;; Set screen working area: |
||
119 | ;< ebx = 6 |
||
120 | ;< ecx = pack[16(left), 16(right)] |
||
121 | ;< edx = pack[16(top), 16(bottom)] |
||
122 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
123 | ;; Get skin margins: |
||
124 | ;< ebx = 7 |
||
125 | ;> eax = pack[16(left), 16(right)] |
||
126 | ;> ebx = pack[16(top), 16(bottom)] |
||
127 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
128 | ;; Set skin: |
||
129 | ;< ebx = 8 |
||
130 | ;< ecx = pointer to FileInfoBlock struct |
||
131 | ;> eax = FS error code |
||
132 | ;------------------------------------------------------------------------------ |
||
133 | cmp ebx, .sizeof.ftable / 4 |
||
134 | ja @f |
||
135 | jmp [.ftable + ebx * 4] |
||
136 | @@: ret |
||
137 | |||
138 | |||
139 | align 4 |
||
140 | syscall_display_settings.00: |
||
141 | xor eax, eax |
||
142 | inc ebx |
||
143 | cmp [windowtypechanged], ebx |
||
144 | jne .exit |
||
145 | mov [windowtypechanged], eax |
||
146 | |||
147 | jmp syscall_display_settings._.redraw_whole_screen |
||
148 | |||
149 | .exit: |
||
150 | ret |
||
151 | |||
152 | align 4 |
||
153 | syscall_display_settings.01: |
||
154 | and ecx, 1 |
||
155 | cmp ecx, [buttontype] |
||
156 | je .exit |
||
157 | mov [buttontype], ecx |
||
158 | mov [windowtypechanged], ebx |
||
159 | |||
160 | .exit: |
||
161 | ret |
||
162 | |||
163 | align 4 |
||
164 | syscall_display_settings.02: |
||
165 | dec ebx |
||
166 | mov esi, ecx |
||
167 | and edx, 127 |
||
168 | mov edi, common_colours |
||
169 | mov ecx, edx |
||
170 | rep movsb |
||
171 | mov [windowtypechanged], ebx |
||
172 | ret |
||
173 | |||
174 | align 4 |
||
175 | syscall_display_settings.03: |
||
176 | mov edi, ecx |
||
177 | and edx, 127 |
||
178 | mov esi, common_colours |
||
179 | mov ecx, edx |
||
180 | rep movsb |
||
181 | ret |
||
182 | |||
183 | align 4 |
||
184 | syscall_display_settings.04: |
||
185 | mov eax, [_skinh] |
||
186 | mov [esp + 32], eax |
||
187 | ret |
||
188 | |||
189 | align 4 |
||
190 | syscall_display_settings.05: |
||
191 | mov eax, [screen_workarea.left - 2] |
||
192 | mov ax, word[screen_workarea.right] |
||
193 | mov [esp + 32], eax |
||
194 | mov eax, [screen_workarea.top - 2] |
||
195 | mov ax, word[screen_workarea.bottom] |
||
196 | mov [esp + 20], eax |
||
197 | ret |
||
198 | |||
199 | align 4 |
||
200 | syscall_display_settings.06: |
||
201 | xor esi, esi |
||
202 | |||
203 | mov edi, [Screen_Max_X] |
||
204 | mov eax, ecx |
||
205 | movsx ebx, ax |
||
206 | sar eax, 16 |
||
207 | cmp eax, ebx |
||
208 | jge .check_horizontal |
||
209 | inc esi |
||
210 | or eax, eax |
||
211 | jge @f |
||
212 | xor eax, eax |
||
213 | @@: mov [screen_workarea.left], eax |
||
214 | cmp ebx, edi |
||
215 | jle @f |
||
216 | mov ebx, edi |
||
217 | @@: mov [screen_workarea.right], ebx |
||
218 | |||
219 | .check_horizontal: |
||
220 | mov edi, [Screen_Max_Y] |
||
221 | mov eax, edx |
||
222 | movsx ebx, ax |
||
223 | sar eax, 16 |
||
224 | cmp eax, ebx |
||
225 | jge .check_if_redraw_needed |
||
226 | inc esi |
||
227 | or eax, eax |
||
228 | jge @f |
||
229 | xor eax, eax |
||
230 | @@: mov [screen_workarea.top], eax |
||
231 | cmp ebx, edi |
||
232 | jle @f |
||
233 | mov ebx, edi |
||
234 | @@: mov [screen_workarea.bottom], ebx |
||
235 | |||
236 | .check_if_redraw_needed: |
||
237 | or esi, esi |
||
238 | jz .exit |
||
239 | |||
240 | call repos_windows |
||
241 | jmp syscall_display_settings._.calculate_whole_screen |
||
242 | |||
243 | .exit: |
||
244 | ret |
||
245 | |||
246 | align 4 |
||
247 | syscall_display_settings.07: |
||
248 | mov eax, [_skinmargins + 0] |
||
249 | mov [esp + 32], eax |
||
250 | mov eax, [_skinmargins + 4] |
||
251 | mov [esp + 20], eax |
||
252 | ret |
||
253 | |||
254 | align 4 |
||
255 | syscall_display_settings.08: |
||
256 | mov ebx, ecx |
||
257 | call read_skin_file |
||
258 | mov [esp + 32], eax |
||
259 | test eax, eax |
||
260 | jnz .exit |
||
261 |