Subversion Repositories Kolibri OS

Rev

Rev 6098 | Rev 7889 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6098 Rev 7300
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2004-2018. All rights reserved.    ;;
4
;; Distributed under terms of the GNU General Public License       ;;
4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5
;;                                                                 ;;
6
;;   Written by hidnplayr@kolibrios.org                            ;;
6
;;   Written by hidnplayr@kolibrios.org                            ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;         GNU GENERAL PUBLIC LICENSE                              ;;
8
;;         GNU GENERAL PUBLIC LICENSE                              ;;
9
;;          Version 2, June 1991                                   ;;
9
;;          Version 2, June 1991                                   ;;
10
;;                                                                 ;;
10
;;                                                                 ;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
 
12
 
13
 
13
 
14
draw_window:    ; Completely redraw the window, recalculate all coordinates and sizes
14
draw_window:    ; Completely redraw the window, recalculate all coordinates and sizes
15
 
15
 
16
        pusha
16
        pusha
17
 
17
 
18
        mcall   9, thread_info, -1                      ; get information about this thread
18
        mcall   9, thread_info, -1                      ; get information about this thread
19
        mov     eax, [thread_info.box.width]            ; window xsize
19
        mov     eax, [thread_info.box.width]            ; window xsize
20
        mov     ebx, [thread_info.box.height]           ; ysize
20
        mov     ebx, [thread_info.box.height]           ; ysize
21
        mov     edx, [thread_info.client_box.width]     ; work area xsize
21
        mov     edx, [thread_info.client_box.width]     ; work area xsize
22
        mov     esi, [thread_info.client_box.height]    ; ysize
22
        mov     esi, [thread_info.client_box.height]    ; ysize
23
        sub     eax, edx
23
        sub     eax, edx
24
        sub     ebx, esi
24
        sub     ebx, esi
25
 
25
 
26
        cmp     edx, WIN_MIN_X
26
        cmp     edx, WIN_MIN_X
27
        jae     .x_ok
27
        jae     .x_ok
28
        mov     edx, WIN_MIN_X
28
        mov     edx, WIN_MIN_X
29
  .x_ok:
29
  .x_ok:
30
        mov     [xsize], edx
30
        mov     [xsize], edx
31
        add     edx, eax
31
        add     edx, eax
32
 
32
 
33
        cmp     esi, WIN_MIN_Y
33
        cmp     esi, WIN_MIN_Y
34
        jae     .y_ok
34
        jae     .y_ok
35
        mov     esi, WIN_MIN_Y
35
        mov     esi, WIN_MIN_Y
36
  .y_ok:
36
  .y_ok:
37
        mov     [ysize], esi
37
        mov     [ysize], esi
38
        add     esi, ebx
38
        add     esi, ebx
39
        mcall   67, -1, -1                              ; set the new sizes
39
        mcall   67, -1, -1                              ; set the new sizes
40
 
40
 
41
        popa
41
        popa
42
 
42
 
43
  .dont_resize:
43
  .dont_resize:
44
 
44
 
45
        pusha
45
        pusha
46
 
46
 
47
        mcall   12, 1
47
        mcall   12, 1
48
        xor     eax, eax                                ; draw window
48
        xor     eax, eax                                ; draw window
49
        mov     ebx, WIN_MIN_X+10
49
        mov     ebx, WIN_MIN_X+10
50
        mov     ecx, WIN_MIN_Y+30
50
        mov     ecx, WIN_MIN_Y+30
51
        mov     edx, [colors.work]
51
        mov     edx, [colors.work]
52
        add     edx, 0x33000000
52
        add     edx, 0x33000000
53
        mov     edi, str_programname
53
        mov     edi, str_programname
54
        mcall
54
        mcall
55
                        
55
                        
56
        test    [thread_info.wnd_state], 100b           ; skip if window is rolled up
56
        test    [thread_info.wnd_state], 100b           ; skip if window is rolled up
57
        jne     .exit
57
        jne     .exit
-
 
58
 
-
 
59
        cmp     [window_active], 0
-
 
60
        je      .no_window
58
 
61
 
59
; calculate available space for textbox and coordinates for scrollbars
62
; calculate available space for textbox and coordinates for scrollbars
60
        mov     eax, [ysize]
63
        mov     eax, [ysize]
61
        sub     eax, TOP_Y + INPUTBOX_HEIGHT - 1
64
        sub     eax, TOP_Y + INPUTBOX_HEIGHT - 1
62
        mov     [scroll2.y_size], ax
65
        mov     [scroll2.y_size], ax
63
        mov     [scroll1.y_size], ax
66
        mov     [scroll1.y_size], ax
64
        sub     eax, 4
67
        sub     eax, 4
65
        xor     edx, edx
68
        xor     edx, edx
66
        mov     ecx, FONT_HEIGHT
69
        mov     ecx, FONT_HEIGHT
67
        div     ecx
70
        div     ecx
68
        mov     [textbox_height], eax
71
        mov     [textbox_height], eax
69
        mov     [scroll2.cur_area], eax
72
        mov     [scroll2.cur_area], eax
70
        mov     [scroll1.cur_area], eax
73
        mov     [scroll1.cur_area], eax
71
 
74
 
72
        mov     eax, [xsize]
75
        mov     eax, [xsize]
73
        sub     eax, SCROLLBAR_WIDTH
76
        sub     eax, SCROLLBAR_WIDTH
74
        mov     [scroll1.x_pos], ax
77
        mov     [scroll1.x_pos], ax
75
        mov     edi, [window_active]
78
        mov     edi, [window_active]
76
        cmp     [edi + window.type], WINDOWTYPE_CHANNEL
79
        cmp     [edi + window.type], WINDOWTYPE_CHANNEL
77
        jne     @f
80
        jne     @f
78
        sub     eax, USERLIST_WIDTH + SCROLLBAR_WIDTH + 2
81
        sub     eax, USERLIST_WIDTH + SCROLLBAR_WIDTH + 2
79
  @@:
82
  @@:
80
        mov     [scroll2.x_pos], ax
83
        mov     [scroll2.x_pos], ax
81
        sub     eax, 10
84
        sub     eax, 10
82
        xor     edx, edx
85
        xor     edx, edx
83
        mov     ecx, FONT_WIDTH
86
        mov     ecx, FONT_WIDTH
84
        div     ecx
87
        div     ecx
85
        mov     [textbox_width], eax
88
        mov     [textbox_width], eax
86
 
89
 
87
; recalculate text line breaks (because height/width might have changed..)
90
; recalculate text line breaks (because height/width might have changed..)
88
; meanwhile, recalculate line number of current line
91
; meanwhile, recalculate line number of current line
89
        mov     esi, [edi + window.text_print]
92
        mov     esi, [edi + window.text_print]
90
        mov     al, byte[esi]
93
        mov     al, byte[esi]
91
        push    eax
94
        push    eax
92
        mov     byte[esi], 0
95
        mov     byte[esi], 0
93
        push    esi
96
        push    esi
94
 
97
 
95
        mov     esi, [edi + window.text_start]
98
        mov     esi, [edi + window.text_start]
96
        call    text_insert_newlines
99
        call    text_insert_newlines
97
        mov     [edi + window.text_lines], edx
100
        mov     [edi + window.text_lines], edx
98
        mov     [edi + window.text_scanned], esi
101
        mov     [edi + window.text_scanned], esi
99
        mov     [edi + window.text_line_print], edx
102
        mov     [edi + window.text_line_print], edx
100
 
103
 
101
        pop     esi
104
        pop     esi
102
        pop     eax
105
        pop     eax
103
        mov     byte[esi], al
106
        mov     byte[esi], al
104
 
107
 
105
; and redraw the textbox (and scrollbar if needed)
108
; and redraw the textbox (and scrollbar if needed)
106
        mov     [scroll2.all_redraw], 1
109
        mov     [scroll2.all_redraw], 1
107
        call    draw_channel_text
110
        call    draw_channel_text
108
 
111
 
109
; Draw userlist if active window is a channel
112
; Draw userlist if active window is a channel
110
        mov     edi, [window_active]
113
        mov     edi, [window_active]
111
        cmp     [edi + window.type], WINDOWTYPE_CHANNEL
114
        cmp     [edi + window.type], WINDOWTYPE_CHANNEL
112
        jne     .not_channel
115
        jne     .not_channel
113
 
116
 
114
        mov     [scroll1.all_redraw], 1
117
        mov     [scroll1.all_redraw], 1
115
        call    draw_user_list
118
        call    draw_user_list
116
 
119
 
117
; draw a vertical separator line when there is no scrollbar
120
; draw a vertical separator line when there is no scrollbar
118
        cmp     [scroll2.all_redraw], 1
121
        cmp     [scroll2.all_redraw], 1
119
        jne     .not_channel
122
        jne     .not_channel
120
 
123
 
121
        mov     ebx, [xsize]
124
        mov     ebx, [xsize]
122
        sub     ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH + 3
125
        sub     ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH + 3
123
        push    bx
126
        push    bx
124
        shl     ebx, 16
127
        shl     ebx, 16
125
        pop     bx
128
        pop     bx
126
        mov     ecx, [ysize]
129
        mov     ecx, [ysize]
127
        add     ecx, TOP_Y shl 16 - (INPUTBOX_HEIGHT)
130
        add     ecx, TOP_Y shl 16 - (INPUTBOX_HEIGHT)
128
        mov     edx, [colors.work_graph]
131
        mov     edx, [colors.work_graph]
129
        mcall   38
132
        mcall   38
130
  .not_channel:
133
  .not_channel:
-
 
134
  .no_window:
131
 
135
 
132
; draw editbox
136
; draw editbox
133
        mov     eax, [ysize]
137
        mov     eax, [ysize]
134
        sub     eax, INPUTBOX_HEIGHT
138
        sub     eax, INPUTBOX_HEIGHT
135
        mov     [edit1.top], eax
139
        mov     [edit1.top], eax
136
 
140
 
137
        mov     eax, [xsize]
141
        mov     eax, [xsize]
138
        mov     [edit1.width], eax
142
        mov     [edit1.width], eax
139
 
143
 
140
        invoke  edit_box_draw, edit1
144
        invoke  edit_box_draw, edit1
141
 
145
 
142
; draw tabs
146
; draw tabs
143
        call    draw_window_tabs
147
        call    draw_window_tabs
144
                
148
                
145
  .exit:
149
  .exit:
146
        mcall   12, 2
150
        mcall   12, 2
147
        popa
151
        popa
148
        ret
152
        ret
149
 
153
 
150
 
154
 
151
 
155
 
152
draw_user_list:
156
draw_user_list:
153
 
157
 
154
        pusha
158
        pusha
155
 
159
 
156
        ; Do we need a scrollbar?
160
        ; Do we need a scrollbar?
157
        mov     ebx, [window_active]
161
        mov     ebx, [window_active]
158
        mov     eax, [ebx + window.users]
162
        mov     eax, [ebx + window.users]
159
        mov     [scroll1.max_area], eax
163
        mov     [scroll1.max_area], eax
160
        cmp     [scroll1.cur_area], eax
164
        cmp     [scroll1.cur_area], eax
161
        jae     .noscroll
165
        jae     .noscroll
162
 
166
 
163
        ; Is the current position greater then the max position?
167
        ; Is the current position greater then the max position?
164
        cmp     eax, [scroll1.position]
168
        cmp     eax, [scroll1.position]
165
        ja      @f
169
        ja      @f
166
        mov     [scroll1.position], eax
170
        mov     [scroll1.position], eax
167
  @@:
171
  @@:
168
        ; OK, draw the scrollbar
172
        ; OK, draw the scrollbar
169
        invoke  scrollbar_draw, scroll1
173
        invoke  scrollbar_draw, scroll1
170
 
174
 
171
        ; dont redraw scrollbar completely next time,
175
        ; dont redraw scrollbar completely next time,
172
        ; unless draw_window asks us to by setting [scroll1.all_redraw] back to 1
176
        ; unless draw_window asks us to by setting [scroll1.all_redraw] back to 1
173
        mov     [scroll1.all_redraw], 0
177
        mov     [scroll1.all_redraw], 0
174
        jmp     .scroll_done
178
        jmp     .scroll_done
175
 
179
 
176
  .noscroll:
180
  .noscroll:
177
        mov     [scroll1.position], 0
181
        mov     [scroll1.position], 0
178
  .scroll_done:
182
  .scroll_done:
179
 
183
 
180
        ; draw an invisible button, where the usernames will go
184
        ; draw an invisible button, where the usernames will go
181
        mov     ebx, [xsize]
185
        mov     ebx, [xsize]
182
        sub     ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH
186
        sub     ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH
183
        shl     ebx, 16
187
        shl     ebx, 16
184
        push    ebx
188
        push    ebx
185
        mov     bx, USERLIST_WIDTH
189
        mov     bx, USERLIST_WIDTH
186
        mov     ecx, [ysize]
190
        mov     ecx, [ysize]
187
        add     ecx, TEXT_Y shl 16 - (TEXT_Y + 16)
191
        add     ecx, TEXT_Y shl 16 - (TEXT_Y + 16)
188
        push    ecx ebx
192
        push    ecx ebx
189
        mov     edx, WINDOW_BTN_LIST + 1 shl 29 + 1 shl 30
193
        mov     edx, WINDOW_BTN_LIST + 1 shl 29 + 1 shl 30
190
        mcall   8
194
        mcall   8
191
 
195
 
192
        ; draw a filled rectangle to clear previously printed names
196
        ; draw a filled rectangle to clear previously printed names
193
        pop     ebx ecx
197
        pop     ebx ecx
194
        mov     edx, [colors.work]
198
        mov     edx, [colors.work]
195
        mcall   13
199
        mcall   13
196
 
200
 
197
; now, draw the names according to the scrollbar position and window size
201
; now, draw the names according to the scrollbar position and window size
198
        mov     eax, [scroll1.position]
202
        mov     eax, [scroll1.position]
199
        xor     edx, edx
203
        xor     edx, edx
200
        mov     ecx, MAX_NICK_LEN
204
        mov     ecx, MAX_NICK_LEN
201
        mul     ecx
205
        mul     ecx
202
        mov     edx, eax
206
        mov     edx, eax
203
        mov     eax, [window_active]
207
        mov     eax, [window_active]
204
        mov     ebp, [eax + window.selected]
208
        mov     ebp, [eax + window.selected]
205
        add     edx, [eax + window.data_ptr]
209
        add     edx, [eax + window.data_ptr]
206
        sub     ebp, [scroll1.position]
210
        sub     ebp, [scroll1.position]
207
        add     edx, window_data.names
211
        add     edx, window_data.names
208
 
212
 
209
        pop     ebx
213
        pop     ebx
210
        mov     bx, TEXT_Y
214
        mov     bx, TEXT_Y
211
        mov     ecx, [colors.work_text]
215
        mov     ecx, [colors.work_text]
212
        or      ecx, 0x90000000                 ; 8x16 font, zero terminated string
216
        or      ecx, 0x90000000                 ; 8x16 font, zero terminated string
213
        mov     eax, 4                          ; draw text
217
        mov     eax, 4                          ; draw text
214
 
218
 
215
        mov     edi, [textbox_height]           ; how many names will fit on screen
219
        mov     edi, [textbox_height]           ; how many names will fit on screen
216
  .loop:
220
  .loop:
217
        cmp     byte[edx], 0                    ; end of list?
221
        cmp     byte[edx], 0                    ; end of list?
218
        je      .done
222
        je      .done
219
 
223
 
220
        dec     ebp                             ; is this name selected?
224
        dec     ebp                             ; is this name selected?
221
        jnz     .nothighlight
225
        jnz     .nothighlight
222
                                                ; yes, highlight it
226
                                                ; yes, highlight it
223
        pusha
227
        pusha
224
        mov     cx, bx
228
        mov     cx, bx
225
        mov     bx, USERLIST_WIDTH
229
        mov     bx, USERLIST_WIDTH
226
        shl     ecx, 16
230
        shl     ecx, 16
227
        mov     cx, FONT_HEIGHT
231
        mov     cx, FONT_HEIGHT
228
        mov     edx, 0x00000055                 ; blue!
232
        mov     edx, 0x00000055                 ; blue!
229
        mcall   13
233
        mcall   13
230
        popa
234
        popa
231
 
235
 
232
        mov     ecx, 0x9000ffff                 ; cyan!
236
        mov     ecx, 0x9000ffff                 ; cyan!
233
        mcall
237
        mcall
234
 
238
 
235
        mov     ecx, [colors.work_text]
239
        mov     ecx, [colors.work_text]
236
        or      ecx, 0x90000000                 ; 8x16 font, zero terminated string
240
        or      ecx, 0x90000000                 ; 8x16 font, zero terminated string
237
        jmp     .next
241
        jmp     .next
238
 
242
 
239
  .nothighlight:
243
  .nothighlight:
240
        mcall
244
        mcall
241
 
245
 
242
  .next:
246
  .next:
243
        add     edx, MAX_NICK_LEN
247
        add     edx, MAX_NICK_LEN
244
        add     ebx, FONT_HEIGHT
248
        add     ebx, FONT_HEIGHT
245
        dec     edi
249
        dec     edi
246
        jnz     .loop
250
        jnz     .loop
247
 
251
 
248
  .done:
252
  .done:
249
        popa
253
        popa
250
 
254
 
251
        ret
255
        ret
252
 
256
 
253
 
257
 
254
draw_window_tabs:
258
draw_window_tabs:
255
 
259
 
256
; Draw horizontal line
260
; Draw horizontal line
257
 
261
 
258
        mov     ebx, [xsize]
262
        mov     ebx, [xsize]
259
        mov     edx, [colors.work_graph]
263
        mov     edx, [colors.work_graph]
260
        mov     ecx, TOP_Y SHL 16 + TOP_Y
264
        mov     ecx, TOP_Y SHL 16 + TOP_Y
261
        mcall   38
265
        mcall   38
262
 
266
 
263
; Create the buttons
267
; Create the buttons
264
 
268
 
265
        mov     eax, 8
269
        mov     eax, 8
266
        mov     ebx, TAB_WIDTH
270
        mov     ebx, TAB_WIDTH
267
        mov     ecx, TOP_SPACE shl 16 + TAB_HEIGHT
271
        mov     ecx, TOP_SPACE shl 16 + TAB_HEIGHT
268
        mov     edx, WINDOW_BTN_START
272
        mov     edx, WINDOW_BTN_START
269
        mov     edi, windows
273
        mov     edi, windows
270
  .more_btn:
274
  .more_btn:
271
        mov     esi, [colors.work_button]
275
        mov     esi, [colors.work_button]
272
        cmp     [window_active], edi
276
        cmp     [window_active], edi
273
        jne     @f
277
        jne     @f
274
        not     esi
278
        not     esi
275
        and     esi, 0x00ffffff
279
        and     esi, 0x00ffffff
276
      @@:
280
      @@:
277
        mcall
281
        mcall
278
        inc     edx
282
        inc     edx
279
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
283
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
280
        add     edi, sizeof.window
284
        add     edi, sizeof.window
281
        cmp     [edi + window.data_ptr], 0
285
        cmp     [edi + window.data_ptr], 0
282
        jne     .more_btn
286
        jne     .more_btn
283
 
287
 
284
; Draw the close window button
288
; Draw the close window button
285
        mov     edi, [window_active]
289
        mov     edi, [window_active]
286
        cmp     [edi + window.type], WINDOWTYPE_SERVER  ; dont let the user close server window
290
        cmp     [edi + window.type], WINDOWTYPE_SERVER  ; dont let the user close server window
287
        je      @f
291
        je      @f
288
 
292
 
289
;        mov     eax, 8
293
;        mov     eax, 8
290
        mov     ebx, [xsize]
294
        mov     ebx, [xsize]
291
        sub     ebx, SCROLLBAR_WIDTH
295
        sub     ebx, SCROLLBAR_WIDTH
292
        shl     ebx, 16
296
        shl     ebx, 16
293
        mov     bx, SCROLLBAR_WIDTH
297
        mov     bx, SCROLLBAR_WIDTH
294
        mov     ecx, TOP_SPACE shl 16 + TAB_HEIGHT - 1
298
        mov     ecx, TOP_SPACE shl 16 + TAB_HEIGHT - 1
295
        mov     edx, WINDOW_BTN_CLOSE
299
        mov     edx, WINDOW_BTN_CLOSE
296
        mov     esi, 0x00aa0000         ; red !
300
        mov     esi, 0x00aa0000         ; red !
297
        mcall
301
        mcall
298
  @@:
302
  @@:
299
 
303
 
300
; Draw the windownames onto the buttons
304
; Draw the windownames onto the buttons
301
 
305
 
302
        mov     eax, 4
306
        mov     eax, 4
303
        mov     ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
307
        mov     ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
304
        mov     esi, MAX_WINDOWS
308
        mov     esi, MAX_WINDOWS
305
        mov     edi, windows
309
        mov     edi, windows
306
  .more:
310
  .more:
307
        mov     ecx, [colors.work_button_text]
311
        mov     ecx, [colors.work_button_text]
308
        test    [edi + window.flags], FLAG_UPDATED
312
        test    [edi + window.flags], FLAG_UPDATED
309
        jz      @f
313
        jz      @f
310
        mov     ecx, 0x00aa0000         ; RED!
314
        mov     ecx, 0x00aa0000         ; RED!
311
  @@:
315
  @@:
312
        or      ecx, 0x80000000         ; ASCIIZ string
316
        or      ecx, 0x80000000         ; ASCIIZ string
313
        lea     edx, [edi + window.name]
317
        lea     edx, [edi + window.name]
314
        mcall
318
        mcall
315
        add     edi, sizeof.window      ; get ptr to next window
319
        add     edi, sizeof.window      ; get ptr to next window
316
        cmp     [edi + window.data_ptr], 0
320
        cmp     [edi + window.data_ptr], 0
317
        je      .enough
321
        je      .enough
318
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
322
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
319
        dec     esi
323
        dec     esi
320
        jnz     .more
324
        jnz     .more
321
  .enough:
325
  .enough:
322
 
326
 
323
        ret
327
        ret
324
 
328
 
325
 
329
 
326
 
330
 
327
highlight_updated_tabs:
331
highlight_updated_tabs:
328
        mov     eax, 4
332
        mov     eax, 4
329
        mov     ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
333
        mov     ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
330
        mov     ecx, 0x80aa0000
334
        mov     ecx, 0x80aa0000
331
        mov     esi, MAX_WINDOWS
335
        mov     esi, MAX_WINDOWS
332
        mov     edi, windows
336
        mov     edi, windows
333
  .more_:
337
  .more_:
334
        test    [edi + window.flags], FLAG_UPDATED
338
        test    [edi + window.flags], FLAG_UPDATED
335
        jz      .next
339
        jz      .next
336
        lea     edx, [edi + window.name]
340
        lea     edx, [edi + window.name]
337
        mcall
341
        mcall
338
  .next:
342
  .next:
339
        add     edi, sizeof.window      ; get ptr to next window
343
        add     edi, sizeof.window      ; get ptr to next window
340
        cmp     [edi + window.data_ptr], 0
344
        cmp     [edi + window.data_ptr], 0
341
        je      .enough_
345
        je      .enough_
342
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
346
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
343
        dec     esi
347
        dec     esi
344
        jnz     .more_
348
        jnz     .more_
345
  .enough_:
349
  .enough_:
346
 
350
 
347
        ret
351
        ret