Subversion Repositories Kolibri OS

Rev

Rev 1728 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1728 Rev 7648
Line 3... Line 3...
3
;
3
;
4
; Written by Nikita Lesnikov (nlo_one@mail.ru)
4
; Written by Nikita Lesnikov (nlo_one@mail.ru)
5
;
5
;
6
; Position of "eyes" is fixed. To close "eyes" just click on them.
6
; Position of "eyes" is fixed. To close "eyes" just click on them.
7
;
7
;
8
; NOTE: quite big timeout is used to disable blinking when redrawing.
-
 
9
; If "eyes" blink on your system, enlarge the TIMEOUT. If not, you can
-
 
10
; decrease it due to more realistic movement.
-
 
11
;
-
 
Line 12... Line 8...
12
 
8
 
Line 13... Line 9...
13
TIMEOUT equ 5
9
TIMEOUT equ 3
Line 14... Line 10...
14
 
10
 
Line 37... Line 33...
37
 
33
 
Line 38... Line 34...
38
still:
34
still:
Line 39... Line 35...
39
 
35
 
40
call draw_eyes                   ; draw those funny "eyes"
-
 
41
 
-
 
Line 42... Line 36...
42
mov eax,23                       ; wait for event with timeout
36
call draw_eyes                   ; draw those funny "eyes"
43
mov ebx,TIMEOUT
37
 
44
mcall
38
mcall 23,TIMEOUT                 ; wait for event with timeout
45
 
39
 
Line 57... Line 51...
57
jmp still                        ; loop
51
jmp still                        ; loop
Line 58... Line 52...
58
 
52
 
Line 59... Line 53...
59
; EVENTS
53
; EVENTS
60
 
54
 
61
key:
-
 
62
mov eax,2        ; just read and ignore
55
key:
Line 63... Line 56...
63
mcall
56
mcall 2          ; just read and ignore
64
jmp still
57
jmp still
65
 
-
 
66
button:          ; analyze button
58
 
Line 67... Line 59...
67
mov eax,-1       ; this is button 1 - we have only one button :-)
59
button:          ; analyze button
Line 68... Line 60...
68
mcall
60
mcall -1         ; exit
Line 98... Line 90...
98
redraw_ok:
90
redraw_ok:
99
mov [mouse],eax
91
mov [mouse],eax
Line 100... Line 92...
100
 
92
 
Line 101... Line -...
101
redraw_overlap:              ; label for redraw event (without checkmouse)
-
 
102
 
-
 
103
mov eax,12
93
redraw_overlap:              ; label for redraw event (without checkmouse)
Line 104... Line 94...
104
mov ebx,1
94
 
105
mcall
95
mcall 12,1
106
 
96
 
107
xor eax,eax                  ; define window
97
xor eax,eax                  ; define window
108
mov ebx,[win_ebx]
98
mov ebx,[win_ebx]
109
mov ecx,[win_ecx]
99
mov ecx,[win_ecx]
110
xor edx,edx
100
mov edx,0x11000000           ; do not draw window, just define its area
Line 111... Line 101...
111
xor esi,esi
101
xor esi,esi
112
xor edi,edi
-
 
113
mcall
-
 
114
 
-
 
115
mov eax,8                    ; define closebutton
-
 
Line 116... Line -...
116
mov ebx,60
-
 
117
mov ecx,45
102
xor edi,edi
118
mov edx,1
103
mcall
119
mcall
-
 
120
 
-
 
Line 121... Line 104...
121
mov eax,7
104
 
122
mov ebx,skindata
105
mcall 8,60,45,1+0x40000000 ; define closebutton
123
mov ecx,60*65536+30
106
 
124
mov edx,15
107
mov ebx,skindata
125
mcall
108
mcall 7,,60*65536+30,15
Line 126... Line -...
126
 
-
 
127
mov eax,15
-
 
128
mov ebx,30
109
 
Line 129... Line 110...
129
call draw_eye_point
110
mov eax,15
Line 130... Line 111...
130
add eax,30
111
mov ebx,30
131
call draw_eye_point
112
call draw_eye_point