Subversion Repositories Kolibri OS

Rev

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