Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5868 → Rev 5862

/programs/system/notify3/notify.asm
6,7 → 6,6
include "../../macros.inc"
include "../../proc32.inc"
include "../../dll.inc"
; include "../../debug.inc"
 
macro cmpe a, b, c {
cmp a, b
35,21 → 34,7
 
@entry:
 
;; GET PID OF ACTIVE
 
mcall 18, 7
 
mov ecx, eax
mcall 9, buffer
 
m2m dword[prev_pid], dword[buffer + 30]
 
;; ALWAYS TOP
 
mcall 18, 25, 2, -1, 1
 
;; CHECK FOR PARAMS
 
cmpne [@params], byte 0, parse
mov eax, @params
mov ebx, sz_std
136,19 → 121,31
;; PARAMS
 
.params:
mov dl, [eax]
 
cmpe dl, 0, .params.end
cmpe dl, "d", .set_atcl
cmpe dl, "t", .set_title
 
cmpe [eax], byte 0, .params.end
cmpe [eax], byte "d", .set_atcl
cmpe [eax], byte "t", .set_title
mov ebx, 1
mov ecx, sz_icons
@@:
cmpe dl, [ecx], .set_icon
cmpe [eax], byte "A", .set_icon
inc ebx
inc ecx
cmpne [ecx], byte 0, @b
cmpe [eax], byte "E", .set_icon
inc ebx
cmpe [eax], byte "W", .set_icon
inc ebx
cmpe [eax], byte "O", .set_icon
inc ebx
cmpe [eax], byte "N", .set_icon
inc ebx
cmpe [eax], byte "I", .set_icon
inc ebx
cmpe [eax], byte "F", .set_icon
inc ebx
cmpe [eax], byte "C", .set_icon
inc ebx
cmpe [eax], byte "M", .set_icon
inc ebx
cmpe [eax], byte "D", .set_icon
inc ebx
cmpe [eax], byte "S", .set_icon
 
jmp .next_char
 
320,16 → 317,6
 
;----------------------------
 
call init_window
 
mcall 18, 21, [prev_pid]
mov ecx, eax
mcall 18, 3
 
jmp redraw
 
;----------------------------
 
update:
mcall 23, 10
cmpe al, EV_REDRAW, redraw
373,7 → 360,11
;----------------------------
 
draw_window:
call init_window
dec dword [window.width]
dec dword [window.height]
mcall 0, <[window.x], [window.width]>, <[window.y], [window.height]>, 0x61000000
inc dword [window.width]
inc dword [window.height]
 
and ebx, 0xFFFF
and ecx, 0xFFFF
384,7 → 375,6
mov eax, 13
mov ebx, [window.width]
mov edx, 0x222222
 
cmpe [first_draw], byte 1, .draw_full
mov [first_draw], byte 1
mov esi, [window.height]
397,7 → 387,6
mcall 5, 1
pop ebx eax
cmpne esi, 0, @b
 
.draw_full:
mcall
 
557,20 → 546,8
@@:
 
ret
 
;----------------------------
 
init_window:
dec dword [window.width]
dec dword [window.height]
mcall 0, <[window.x], [window.width]>, <[window.y], [window.height]>, 0x61000000
inc dword [window.width]
inc dword [window.height]
 
ret
 
;----------------------------
 
@imports:
library img, "libimg.obj"
import img, img.init, "lib_init", \
580,14 → 557,11
 
;----------------------------
 
sz_icons db "AEWONIFCMDS", 0
sz_ifile db "/sys/notify3.png", 0
sz_shname db "notify-mem-v01", 0
sz_std db "'NOTIFY 3\n", \
"d - disable auto-closing\n", \
"t - title\n", \
" \n", \
"ICONS:\n", \
"A - application\n", \
"E - error\n", \
"W - warning\n", \
643,7 → 617,6
fi rb 26
buffer rb 1024
first_draw rb 1
prev_pid rd 1
 
;=====================================================================
rb 2048