Subversion Repositories Kolibri OS

Rev

Rev 3545 | Rev 4060 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3545 Rev 3981
Line -... Line 1...
-
 
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
2
;;                                                                 ;;
-
 
3
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved.    ;;
-
 
4
;; Distributed under terms of the GNU General Public License       ;;
-
 
5
;;                                                                 ;;
-
 
6
;;                                                                 ;;
-
 
7
;;         GNU GENERAL PUBLIC LICENSE                              ;;
-
 
8
;;          Version 2, June 1991                                   ;;
-
 
9
;;                                                                 ;;
-
 
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
11
 
-
 
12
 
1
draw_window:
13
draw_window:
Line 2... Line 14...
2
 
14
 
Line 3... Line 15...
3
        pusha
15
        pusha
Line 45... Line 57...
45
        mcall   38                              ; draw line
57
        mcall   38                              ; draw line
Line 46... Line 58...
46
 
58
 
47
        mov     ecx, TOP_Y SHL 16 + TOP_Y
59
        mov     ecx, TOP_Y SHL 16 + TOP_Y
Line 48... Line 60...
48
        mcall
60
        mcall
49
 
61
 
50
        mov     edi, [window_open]
62
        mov     edi, [window_active]
Line 51... Line 63...
51
        cmp     [edi + window.type], WINDOWTYPE_CHANNEL
63
        cmp     [edi + window.type], WINDOWTYPE_CHANNEL
52
        jne     .not_channel
64
        jne     .not_channel
Line 79... Line 91...
79
 
91
 
80
        push    dword edit1
92
        push    dword edit1
Line 81... Line 93...
81
        call    [edit_box_draw]
93
        call    [edit_box_draw]
82
 
-
 
83
; tabs
94
 
Line 84... Line 95...
84
 
95
; tabs
85
        call    draw_windownames
96
        call    draw_windowtabs
Line 86... Line 97...
86
 
97
 
Line 87... Line 98...
87
        popa
98
        popa
Line 88... Line 99...
88
        ret
99
        ret
89
 
100
 
90
 
101
 
Line 91... Line 102...
91
 
102
 
92
redraw_channel_list:
103
redraw_channel_list:
Line 136... Line 147...
136
 
147
 
Line 137... Line 148...
137
 
148
 
138
print_channel_list:
-
 
Line 139... Line 149...
139
 
149
print_channel_list:
140
        pusha
150
 
141
; Now, draw the usernames themselves
151
        pusha
142
 
152
 
143
; first, draw an invisible button
153
; first, draw an invisible button
144
        mov     ebx, [xsize]
154
        mov     ebx, [xsize]
145
        sub     ebx, USERLIST_X + SCROLLBAR_WIDTH
155
        sub     ebx, USERLIST_X + SCROLLBAR_WIDTH
146
        shl     ebx, 16
156
        shl     ebx, 16
147
        push    ebx
157
        push    ebx
148
        mov     bx, USERLIST_X
158
        mov     bx, USERLIST_X
149
        mov     ecx, [ysize]
159
        mov     ecx, [ysize]
Line 150... Line 160...
150
        add     ecx, TEXT_Y shl 16 - (TEXT_Y + 15)        ;;;;;   + 10???
160
        add     ecx, TEXT_Y shl 16 - (TEXT_Y + 15)        ;;;;;   + 10???
151
        push    ecx ebx
161
        push    ecx ebx
152
        mov     edx, 50 + 1 shl 29 + 1 shl 30
162
        mov     edx, WINDOW_BTN_LIST + 1 shl 29 + 1 shl 30
153
        mcall   8
163
        mcall   8
Line 154... Line 164...
154
 
164
 
155
; now draw rectangle to clear the names
165
; draw rectangle to clear previously printed names
156
        pop     ebx ecx
166
        pop     ebx ecx
157
        mov     edx, [colors.work]
167
        mov     edx, [colors.work]
158
        mcall   13
168
        mcall   13
159
 
169
 
160
; now draw the names according with scrollbar position and window size
170
; now draw the names according to the scrollbar position and window size
161
        mov     eax, [scroll1.position]
171
        mov     eax, [scroll1.position]
162
        xor     edx, edx
172
        xor     edx, edx
163
        mov     ecx, MAX_NICK_LEN
173
        mov     ecx, MAX_NICK_LEN
164
        mul     ecx
174
        mul     ecx
Line 267... Line 277...
267
        add     ebx, 10                 ; height distance between lines
277
        add     ebx, 10                 ; height distance between lines
Line 268... Line 278...
268
 
278
 
269
        pop     ecx
279
        pop     ecx
Line -... Line 280...
-
 
280
        loop    .dct
-
 
281
 
-
 
282
        mov     eax, [window_active]
270
        loop    .dct
283
        and     [eax + window.flags], not FLAG_UPDATED  ; clear the 'window is updated' flag
271
 
284
 
Line 272... Line 285...
272
        popa
285
        popa
-
 
286
        ret
-
 
287
 
Line 273... Line 288...
273
        ret
288
 
274
 
289
 
275
 
290
draw_windowtabs:
276
 
291
 
277
draw_windownames:
292
; Create the buttons
278
 
293
 
279
        mov     eax, 8
294
        mov     eax, 8
280
        mov     ebx, 5 shl 16 + 120
295
        mov     ebx, 5 shl 16 + 120
281
        mov     ecx, 12 shl 16 + 12
296
        mov     ecx, 12 shl 16 + 12
282
        mov     edx, WINDOW_BTN_START
297
        mov     edx, WINDOW_BTN_START
283
        mov     edi, windows
298
        mov     edi, windows
284
  .more_btn:
299
  .more_btn:
285
        mov     esi, [colors.work_button]
300
        mov     esi, [colors.work_button]
Line 293... Line 308...
293
        add     ebx, 125 shl 16
308
        add     ebx, 125 shl 16
294
        add     edi, sizeof.window
309
        add     edi, sizeof.window
295
        cmp     [edi + window.data_ptr], 0
310
        cmp     [edi + window.data_ptr], 0
296
        jne     .more_btn
311
        jne     .more_btn
Line -... Line 312...
-
 
312
 
-
 
313
; Draw the windownames onto the buttons
297
 
314
 
298
        mov     eax, 4
315
        mov     eax, 4
299
        mov     ebx, 10 shl 16 + 15
-
 
300
        mov     ecx, [colors.work_button_text]
-
 
301
        or      ecx, 0x80000000         ; ASCIIZ string
-
 
302
        lea     edx, [windows + window.name]
316
        mov     ebx, 10 shl 16 + 15
-
 
317
        mov     esi, MAX_WINDOWS
303
        mov     esi, MAX_WINDOWS
318
        mov     edi, windows
-
 
319
  .more:
-
 
320
        mov     ecx, [colors.work_button_text]
-
 
321
        test    [edi + window.flags], FLAG_UPDATED
-
 
322
        jz      @f
-
 
323
        mov     ecx, 0x00aa0000 ; RED!
-
 
324
  @@:
-
 
325
        or      ecx, 0x80000000         ; ASCIIZ string
304
  .more:
326
        lea     edx, [edi + window.name]
305
        mcall
327
        mcall
306
        add     edx, sizeof.window
328
        add     edi, sizeof.window      ; get ptr to next window
307
        cmp     byte[edx], 0
329
        cmp     [edi + window.data_ptr], 0
308
        je      .enough
330
        je      .enough
309
        add     ebx, 125 shl 16
331
        add     ebx, 125 shl 16
310
        dec     esi
332
        dec     esi
311
        jnz     .more
333
        jnz     .more
Line -... Line 334...
-
 
334
  .enough:
-
 
335
 
-
 
336
; Draw the close window button
-
 
337
 
-
 
338
        mov     edi, [window_active]
-
 
339
        cmp     [edi + window.type], WINDOWTYPE_SERVER  ; dont let the user close server window
-
 
340
        je      @f
-
 
341
 
-
 
342
        mov     eax, 8
-
 
343
        mov     ebx, [xsize]
-
 
344
        sub     ebx, 12
-
 
345
        shl     ebx, 16
-
 
346
        mov     bx, 12
-
 
347
        mov     ecx, 6 shl 16 + 12
-
 
348
        mov     edx, WINDOW_BTN_CLOSE
-
 
349
;        mov     esi, [colors.work_button]
-
 
350
        mov     esi, 0x00aa0000         ; red !
-
 
351
        mcall
-
 
352
 
312
  .enough:
353
  @@: