Subversion Repositories Kolibri OS

Rev

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

Rev 3545 Rev 3981
Line 53... Line 53...
53
        jnz     .loop
53
        jnz     .loop
54
  .addzero:
54
  .addzero:
55
        xor     al, al
55
        xor     al, al
56
        stosb
56
        stosb
Line 57... Line 57...
57
 
57
 
Line 58... Line 58...
58
        call    draw_windownames        ; redraw it
58
        call    draw_windowtabs         ; redraw it
Line 59... Line 59...
59
 
59
 
Line 76... Line 76...
76
        mov     [text_start], eax
76
        mov     [text_start], eax
Line 77... Line 77...
77
 
77
 
Line -... Line 78...
-
 
78
        ret
78
        ret
79
 
Line 79... Line 80...
79
 
80
 
80
 
81
 
81
window_updated:
82
window_is_updated:
Line 82... Line 83...
82
 
83
 
Line 83... Line 84...
83
        mov     edi, [window_print]
84
        mov     edi, [window_print]
Line -... Line 85...
-
 
85
        test    [edi + window.flags], FLAG_UPDATED
84
        test    [edi + window.flags], FLAG_UPDATED
86
        jnz     .skip
Line 85... Line 87...
85
        jnz     .skip
87
 
Line -... Line 88...
-
 
88
        or      [edi + window.flags], FLAG_UPDATED
-
 
89
 
-
 
90
; now play a sound :)
-
 
91
 
-
 
92
        call    draw_windowtabs         ; highlight updated tabs
-
 
93
  .skip:
-
 
94
 
-
 
95
        ret
-
 
96
 
-
 
97
 
-
 
98
 
-
 
99
window_close:
-
 
100
 
-
 
101
; If current window is a channel, send part command to server
-
 
102
        mov     esi, [window_active]
-
 
103
        cmp     [esi + window.type], WINDOWTYPE_CHANNEL
-
 
104
        jne     .not_channel
-
 
105
 
-
 
106
        lea     esi, [esi + window.name]
-
 
107
        call    cmd_usr_part_channel
-
 
108
  .not_channel:
-
 
109
 
-
 
110
; Remove the window (overwrite current structure with trailing ones)
-
 
111
        mov     edi, [window_active]
-
 
112
        push    [edi + window.data_ptr]         ; remember data ptr so we can free it later
-
 
113
        lea     esi, [edi + sizeof.window]
-
 
114
        mov     ecx, windows + MAX_WINDOWS*sizeof.window
-
 
115
        sub     ecx, esi
-
 
116
        rep     movsb
-
 
117
 
-
 
118
; Completely zero the trailing window block (there will always be one!)
-
 
119
        mov     ecx, sizeof.window
-
 
120
        xor     al, al
-
 
121
        rep     stosb
-
 
122
 
-
 
123
; free the window data block
-
 
124
        pop     ecx
-
 
125
        mcall   68, 13
-
 
126
 
-
 
127
; We closed this window so we need to show another
-
 
128
        mov     edi, [window_active]
-
 
129
        cmp     [edi + window.data_ptr], 0
-
 
130
        jne     @f
-
 
131
        sub     edi, sizeof.window
-
 
132
        mov     [window_active], edi
-
 
133
        mov     [window_print], edi
-
 
134
  @@:
-
 
135
 
-
 
136
; At last, redraw everything
-
 
137
        call    draw_window
-
 
138
 
-
 
139
        ret
-
 
140
 
-
 
141
 
-
 
142
 
-
 
143
 
-
 
144
; open a window with a given name, if it does not exist, create it
-
 
145
; This procedure only affects window_print ptr, not window_active!
-
 
146
;
-
 
147
; esi = ptr to ASCIIZ windowname
-
 
148
window_open:
-
 
149
 
-
 
150
        push    esi
-
 
151
 
-
 
152
        mov     edi, esi
-
 
153
        call    compare_to_nick
-
 
154
        jne     .nochat
-
 
155
 
-
 
156
        mov     esi, servercommand+1
-
 
157
  .nochat:
-
 
158
 
-
 
159
; now search for window in list
-
 
160
        mov     ebx, windows
-
 
161
        mov     [window_print], ebx     ; set first window (server window) as default output window
-
 
162
  .scanloop:
-
 
163
        cmp     [ebx + window.data_ptr], 0
-
 
164
        je      .create_it
-
 
165
        push    esi
-
 
166
        lea     edi, [ebx + window.name]
-
 
167
        mov     ecx, MAX_WINDOWNAME_LEN
-
 
168
        repe    cmpsb
-
 
169
        pop     esi
-
 
170
        cmp     byte[edi-1], 0
-
 
171
        je      .got_it
-
 
172
        add     ebx, sizeof.window
-
 
173
        ; TODO: check buffer limits ?
-
 
174
        jmp     .scanloop
-
 
175
 
-
 
176
; create channel window - search for empty slot
-
 
177
  .create_it:
-
 
178
        mov     ebx, windows
-
 
179
        mov     ecx, MAX_WINDOWS
-
 
180
  .scanloop2:
-
 
181
        cmp     [ebx + window.data_ptr], 0
-
 
182
        je      .free_found
-
 
183
        add     ebx, sizeof.window
-
 
184
        dec     ecx
-
 
185
        jnz     .scanloop2
-
 
186
; Error: no more available windows!
-
 
187
        jmp     .just_skip
-
 
188
 
-
 
189
  .free_found:
-
 
190
        push    ebx
-
 
191
        call    window_create
-
 
192
        pop     ebx
-
 
193
        test    eax, eax
-
 
194
        jz      .just_skip
-
 
195
        mov     [ebx + window.data_ptr], eax
-
 
196
        mov     [ebx + window.type], WINDOWTYPE_CHAT
-
 
197
        mov     [ebx + window.flags], 0
-
 
198
 
-
 
199
        call    window_set_name
-
 
200
        mov     [window_print], ebx
-
 
201
        call    window_refresh
-
 
202
 
-
 
203
        call    draw_windowtabs
-
 
204
        jmp     .just_skip
-
 
205
 
-
 
206
; found it!
-
 
207
  .got_it:
-
 
208
        mov     [window_print], ebx
-
 
209
        call    window_refresh
-
 
210
 
-
 
211
  .just_skip:
-
 
212
        pop     esi
-
 
213
  .skip1:
-
 
214
; skip text
-
 
215
        lodsb
-
 
216
        test    al, al
-
 
217
        jz      .quit
-
 
218
        cmp     al, ' '
-
 
219
        jne     .skip1
-
 
220
        dec     esi
-
 
221
; now skip trailing spaces and semicolons
-
 
222
  .skip2:
-
 
223
        lodsb
-
 
224
        test    al, al
-
 
225
        jz      .quit
86
 
226
        cmp     al, ' '
87
        or      [edi + window.flags], FLAG_UPDATED
227
        je      .skip2
88
 
228
        cmp     al, ':'
89
; now play a sound :)
229
        je      .skip2
90
 
230
        dec     esi