Rev 2446 | Rev 2455 | 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: 2453 $ |
||
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 | call window._.sys_set_window |
||
47 | pop eax |
||
48 | |||
49 | or al, al |
||
50 | jnz @f |
||
51 | |||
52 | ; type I - original style |
||
53 | call drawwindow_I |
||
54 | jmp window._.draw_window_caption.2 |
||
2436 | mario79 | 55 | ;-------------------------------------- |
56 | align 4 |
||
57 | @@: |
||
2288 | clevermous | 58 | dec al |
1391 | mikedld | 59 | jnz @f |
60 | |||
61 | ; type II - only reserve area, no draw |
||
2436 | mario79 | 62 | ; call sys_window_mouse |
2453 | mario79 | 63 | ; call [draw_pointer] |
64 | call __sys_draw_pointer |
||
1391 | mikedld | 65 | jmp .exit |
2436 | mario79 | 66 | ;-------------------------------------- |
67 | align 4 |
||
68 | @@: |
||
2288 | clevermous | 69 | dec al |
1391 | mikedld | 70 | jnz @f |
71 | |||
72 | ; type III - new style |
||
73 | call drawwindow_III |
||
74 | jmp window._.draw_window_caption.2 |
||
75 | |||
76 | ; type IV & V - skinned window (resizable & not) |
||
2436 | mario79 | 77 | ;-------------------------------------- |
78 | align 4 |
||
79 | @@: |
||
2288 | clevermous | 80 | mov eax, [TASK_COUNT] |
1391 | mikedld | 81 | movzx eax, word[WIN_POS + eax * 2] |
82 | cmp eax, [CURRENT_TASK] |
||
83 | setz al |
||
84 | movzx eax, al |
||
85 | push eax |
||
86 | call drawwindow_IV |
||
87 | jmp window._.draw_window_caption.2 |
||
2436 | mario79 | 88 | ;-------------------------------------- |
89 | align 4 |
||
90 | .exit: |
||
1391 | mikedld | 91 | ret |
2436 | mario79 | 92 | ;------------------------------------------------------------------------------ |
1391 | mikedld | 93 | align 4 |
94 | ;------------------------------------------------------------------------------ |
||
1362 | mikedld | 95 | syscall_display_settings: ;///// system function 48 /////////////////////////// |
96 | ;------------------------------------------------------------------------------ |
||
97 | ;; Redraw screen: |
||
98 | ;< ebx = 0 |
||
99 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
100 | ;; Set button style: |
||
101 | ;< ebx = 1 |
||
102 | ;< ecx = 0 (flat) or 1 (with gradient) |
||
103 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
104 | ;; Set system color palette: |
||
105 | ;< ebx = 2 |
||
106 | ;< ecx = pointer to color table |
||
107 | ;< edx = size of color table |
||
108 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
109 | ;; Get system color palette: |
||
110 | ;< ebx = 3 |
||
111 | ;< ecx = pointer to color table buffer |
||
112 | ;< edx = size of color table buffer |
||
113 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
114 | ;; Get skinned caption height: |
||
115 | ;< ebx = 4 |
||
116 | ;> eax = height in pixels |
||
117 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
118 | ;; Get screen working area: |
||
119 | ;< ebx = 5 |
||
120 | ;> eax = pack[16(left), 16(right)] |
||
121 | ;> ebx = pack[16(top), 16(bottom)] |
||
122 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
123 | ;; Set screen working area: |
||
124 | ;< ebx = 6 |
||
125 | ;< ecx = pack[16(left), 16(right)] |
||
126 | ;< edx = pack[16(top), 16(bottom)] |
||
127 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
128 | ;; Get skin margins: |
||
129 | ;< ebx = 7 |
||
130 | ;> eax = pack[16(left), 16(right)] |
||
131 | ;> ebx = pack[16(top), 16(bottom)] |
||
132 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
133 | ;; Set skin: |
||
134 | ;< ebx = 8 |
||
135 | ;< ecx = pointer to FileInfoBlock struct |
||
136 | ;> eax = FS error code |
||
137 | ;------------------------------------------------------------------------------ |
||
138 | cmp ebx, .sizeof.ftable / 4 |
||
139 | ja @f |
||
140 | jmp [.ftable + ebx * 4] |
||
2436 | mario79 | 141 | ;-------------------------------------- |
142 | align 4 |
||
143 | @@: |
||
2288 | clevermous | 144 | ret |
2436 | mario79 | 145 | ;------------------------------------------------------------------------------ |
1362 | mikedld | 146 | align 4 |
147 | syscall_display_settings.00: |
||
148 | xor eax, eax |
||
149 | inc ebx |
||
150 | cmp [windowtypechanged], ebx |
||
151 | jne .exit |
||
152 | mov [windowtypechanged], eax |
||
153 | |||
154 | jmp syscall_display_settings._.redraw_whole_screen |
||
2436 | mario79 | 155 | ;-------------------------------------- |
156 | align 4 |
||
157 | .exit: |
||
1362 | mikedld | 158 | ret |
2436 | mario79 | 159 | ;------------------------------------------------------------------------------ |
1362 | mikedld | 160 | align 4 |
161 | syscall_display_settings.01: |
||
162 | and ecx, 1 |
||
163 | cmp ecx, [buttontype] |
||
164 | je .exit |
||
165 | mov [buttontype], ecx |
||
166 | mov [windowtypechanged], ebx |
||
2436 | mario79 | 167 | ;-------------------------------------- |
168 | align 4 |
||
1362 | mikedld | 169 | .exit: |
170 | ret |
||
2436 | mario79 | 171 | ;------------------------------------------------------------------------------ |
1362 | mikedld | 172 | align 4 |
173 | syscall_display_settings.02: |
||
174 | dec ebx |
||
175 | mov esi, ecx |
||
176 | and edx, 127 |
||
177 | mov edi, common_colours |
||
178 | mov ecx, edx |
||
2288 | clevermous | 179 | rep movsb |
1362 | mikedld | 180 | mov [windowtypechanged], ebx |
181 | ret |
||
2436 | mario79 | 182 | ;------------------------------------------------------------------------------ |
1362 | mikedld | 183 | align 4 |
184 | syscall_display_settings.03: |
||
185 | mov edi, ecx |
||
186 | and edx, 127 |
||
187 | mov esi, common_colours |
||
188 | mov ecx, edx |
||
2288 | clevermous | 189 | rep movsb |
1362 | mikedld | 190 | ret |
2436 | mario79 | 191 | ;------------------------------------------------------------------------------ |
1362 | mikedld | 192 | align 4 |
193 | syscall_display_settings.04: |
||
194 | mov eax, [_skinh] |
||
195 | mov [esp + 32], eax |
||
196 | ret |
||
2436 | mario79 | 197 | ;------------------------------------------------------------------------------ |
1362 | mikedld | 198 | align 4 |
199 | syscall_display_settings.05: |
||
200 | mov eax, [screen_workarea.left - 2] |
||
201 | mov ax, word[screen_workarea.right] |
||
202 | mov [esp + 32], eax |
||
203 | mov eax, [screen_workarea.top - 2] |
||
204 | mov ax, word[screen_workarea.bottom] |
||
205 | mov [esp + 20], eax |
||
206 | ret |
||
2436 | mario79 | 207 | ;------------------------------------------------------------------------------ |
1362 | mikedld | 208 | align 4 |
209 | syscall_display_settings.06: |
||
210 | xor esi, esi |
||
211 | |||
212 | mov edi, [Screen_Max_X] |
||
213 | mov eax, ecx |
||
214 | movsx ebx, ax |
||
215 | sar eax, 16 |
||
216 | cmp eax, ebx |
||
217 | jge .check_horizontal |
||
218 | inc esi |
||
219 | or eax, eax |
||
220 | jge @f |
||
221 | xor eax, eax |
||
2436 | mario79 | 222 | ;-------------------------------------- |
223 | align 4 |
||
224 | @@: |
||