Subversion Repositories Kolibri OS

Rev

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

Rev 132 Rev 485
Line 23... Line 23...
23
	   dd	  0x5000	  ; memory for app
23
	   dd	  0x5000	  ; memory for app
24
	   dd	  0x5000	  ; esp
24
	   dd	  0x5000	  ; esp
25
	   dd	  0x0 , 0x0	  ; I_Param , I_Icon
25
	   dd	  0x0 , 0x0	  ; I_Param , I_Icon
Line 26... Line 26...
26
 
26
 
27
include 'lang.inc'
27
include 'lang.inc'
Line 28... Line 28...
28
include 'macros.inc'
28
include '..\..\..\macros.inc'
Line 29... Line 29...
29
 
29
 
30
START:					; start of execution
30
START:					; start of execution
31
 
31
 
32
    mov  eax,53 	       ; open socket
32
    mov  eax,53 	       ; open socket
33
    mov  ebx,0
33
    mov  ebx,0
34
    mov  ecx,0x6000	       ; local port
34
    mov  ecx,0x6000	       ; local port
Line 35... Line 35...
35
    mov  edx,0x6100	       ; remote port
35
    mov  edx,0x6100	       ; remote port
Line 36... Line 36...
36
    mov  esi,dword [remote_ip] ; remote IP
36
    mov  esi,dword [remote_ip] ; remote IP
37
    int  0x40
37
    mcall
38
 
38
 
39
    mov  [socket], eax
39
    mov  [socket], eax
40
 
40
 
41
    mov  eax,53 		    ; send connect code
41
    mov  eax,53 		    ; send connect code
Line -... Line 42...
-
 
42
    mov  ebx,4
42
    mov  ebx,4
43
    mov  ecx,[socket]
Line 43... Line 44...
43
    mov  ecx,[socket]
44
    mov  edx,1
Line 44... Line 45...
44
    mov  edx,1
45
    mov  esi,connect
45
    mov  esi,connect
46
    mcall
46
    int  0x40
47
 
Line 47... Line 48...
47
 
48
red:
48
    call draw_window		; at first, draw the window
49
    call draw_window		; at first, draw the window
49
 
50
 
50
still:
51
still:
51
 
52
 
52
    mov  eax,23 		; wait here for event
53
    mov  eax,23 		; wait here for event
Line 53... Line 54...
53
    mov  ebx,1
54
    mov  ebx,1
54
    int  0x40
-
 
55
 
-
 
56
    cmp  eax,1			; redraw request ?
-
 
57
    jz	 red
-
 
58
    cmp  eax,2			; key in buffer ?
-
 
59
    jz	 key
55
    mcall
60
    cmp  eax,3			; button in buffer ?
56
 
61
    jz	 button
57
    cmp  eax,1			; redraw request ?
62
 
58
    jz	 red
Line 63... Line 59...
63
    jmp  still
59
    cmp  eax,2			; key in buffer ?
64
 
60
    jz	 key
65
red:
61
    cmp  eax,3			; button in buffer ?
Line 66... Line 62...
66
    call draw_window
62
    jz	 button
67
    jmp  still
63
 
68
 
64
    jmp  still
69
key:
65
key:
70
    mov  eax,2
66
    mov  eax,2
71
    int  0x40
67
    mcall
72
    jmp  still
68
    jmp  still
73
 
69
 
74
button:
70
button:
Line 75... Line 71...
75
    mov  eax,17
71
    mov  eax,17
76
    int  0x40
72
    mcall
Line 116... Line 112...
116
  mov  eax,53			  ; SEND CODE TO REMOTE
112
  mov  eax,53			  ; SEND CODE TO REMOTE
117
  mov  ebx,4
113
  mov  ebx,4
118
  mov  ecx,[socket]
114
  mov  ecx,[socket]
119
  mov  edx,1
115
  mov  edx,1
120
  mov  esi,sen_shutdown
116
  mov  esi,sen_shutdown
121
  int  0x40
117
  mcall
Line 122... Line 118...
122
 
118
 
Line 123... Line 119...
123
  jmp  still
119
  jmp  still
Line 124... Line 120...
124
 
120
 
125
send_reboot:
121
send_reboot:
126
 
122
 
127
  mov  eax,53			  ; SEND CODE TO REMOTE
123
  mov  eax,53			  ; SEND CODE TO REMOTE
128
  mov  ebx,4
124
  mov  ebx,4
129
  mov  ecx,[socket]
125
  mov  ecx,[socket]
Line 130... Line 126...
130
  mov  edx,1
126
  mov  edx,1
Line 131... Line 127...
131
  mov  esi,sen_reboot
127
  mov  esi,sen_reboot
Line 132... Line 128...
132
  int  0x40
128
  mcall
133
 
129
 
134
  jmp  still
130
  jmp  still
135
 
131
 
136
send_savefi:
132
send_savefi:
137
 
133
 
Line 138... Line 134...
138
  mov  eax,53			  ; SEND CODE TO REMOTE
134
  mov  eax,53			  ; SEND CODE TO REMOTE
Line 139... Line 135...
139
  mov  ebx,4
135
  mov  ebx,4
Line 140... Line 136...
140
  mov  ecx,[socket]
136
  mov  ecx,[socket]
141
  mov  edx,1
137
  mov  edx,1
142
  mov  esi,sen_savefi
138
  mov  esi,sen_savefi
143
  int  0x40
139
  mcall
144
 
140
 
145
  jmp  still
141
  jmp  still
Line 146... Line 142...
146
 
142
 
Line 147... Line 143...
147
send_savehi:
143
send_savehi:
Line 148... Line 144...
148
 
144
 
149
  mov  eax,53			  ; SEND CODE TO REMOTE
145
  mov  eax,53			  ; SEND CODE TO REMOTE
150
  mov  ebx,4
146
  mov  ebx,4
151
  mov  ecx,[socket]
147
  mov  ecx,[socket]
152
  mov  edx,1
148
  mov  edx,1
153
  mov  esi,sen_savehi
149
  mov  esi,sen_savehi
Line 154... Line 150...
154
  int  0x40
150
  mcall
Line 155... Line 151...
155
 
151
 
Line 156... Line 152...
156
  jmp  still
152
  jmp  still
157
 
153
 
158
send_hotreboot:
154
send_hotreboot:
159
 
155
 
160
  mov  eax,53			  ; SEND CODE TO REMOTE
156
  mov  eax,53			  ; SEND CODE TO REMOTE
161
  mov  ebx,4
157
  mov  ebx,4
Line 162... Line 158...
162
  mov  ecx,[socket]
158
  mov  ecx,[socket]
Line 163... Line 159...
163
  mov  edx,1
159
  mov  edx,1
Line 164... Line 160...
164
  mov  esi,sen_hotreboot
160
  mov  esi,sen_hotreboot
165
  int  0x40
161
  mcall
166
 
162
 
167
  jmp  still
163
  jmp  still
Line 168... Line 164...
168
 
164
 
169
send_exit:
165
send_exit:
Line 170... Line 166...
170
 
166
 
171
  mov  eax,53			  ; SEND CODE TO REMOTE
167
  mov  eax,53			  ; SEND CODE TO REMOTE
172
  mov  ebx,4
168
  mov  ebx,4
173
  mov  ecx,[socket]
169
  mov  ecx,[socket]
Line 174... Line 170...
174
  mov  edx,1
170
  mov  edx,1
175
  mov  esi,sen_exit
171
  mov  esi,sen_exit
Line 176... Line 172...
176
  int  0x40
172
  mcall
177
 
173
 
178
  jmp  still
174
  jmp  still
179
 
175
 
180
  get_data:
176
  get_data:
181
 
177
 
Line 182... Line 178...
182
  mov  eax,53
178
  mov  eax,53
183
  mov  ebx,3
179
  mov  ebx,3
184
  mov  ecx,[socket]
180
  mov  ecx,[socket]
185
  int  0x40
181
  mcall
Line 210... Line 206...
210
 
206
 
Line 211... Line 207...
211
draw_window:
207
draw_window:
212
 
208
 
213
    mov  eax,12 		   ; function 12:tell os about windowdraw
209
    mov  eax,12 		   ; function 12:tell os about windowdraw
Line 214... Line 210...
214
    mov  ebx,1			   ; 1, start of draw
210
    mov  ebx,1			   ; 1, start of draw
215
    int  0x40
211
    mcall
216
 
212
 
217
				   ; DRAW WINDOW
213
				   ; DRAW WINDOW
218
    mov  eax,0			   ; function 0 : define and draw window
214
    mov  eax,0			   ; function 0 : define and draw window
219
    mov  ebx,100*65536+250	   ; [x start] *65536 + [x size]
-
 
220
    mov  ecx,60*65536+280	   ; [y start] *65536 + [y size]
215
    mov  ebx,100*65536+250	   ; [x start] *65536 + [x size]
221
    mov  edx,0x03ffffff 	   ; color of work area RRGGBB
216
    mov  ecx,60*65536+280	   ; [y start] *65536 + [y size]
222
    mov  esi,0x80aabbcc 	   ; color of grab bar  RRGGBB,8->color gl
217
    mov  edx,0x13ffffff 	   ; color of work area RRGGBB
223
    mov  edi,0x00aabbcc 	   ; color of frames    RRGGBB
-
 
224
    int  0x40
-
 
225
 
-
 
226
				   ; WINDOW LABEL
-
 
227
    mov  eax,4			   ; function 4 : write text to window
-
 
228
    mov  ebx,8*65536+8		   ; [x start] *65536 + [y start]
-
 
229
    mov  ecx,0x00ffffff 	   ; color of text RRGGBB
-
 
Line 230... Line 218...
230
    mov  edx,labeltext		   ; pointer to text beginning
218
    mov  edi,title      	   ; WINDOW LABEL
231
    mov  esi,lte-labeltext	   ; text length
219
    mcall
232
    int  0x40
220
 
233
 
221
			
234
    mov  eax,8			   ; CONTROL BUTTONS
222
    mov  eax,8			   ; CONTROL BUTTONS
235
    mov  ebx,25*65536+9
-
 
236
    mov  ecx,113*65536+9
223
    mov  ebx,25*65536+9
237
    mov  edx,2
224
    mov  ecx,113*65536+9
238
    mov  esi,0x667788
225
    mov  edx,2
239
    int  0x40
226
    mov  esi,0x667788
240
    newbut:
227
    newbut:
241
    int  0x40
228
    mcall
Line 242... Line 229...
242
    add  ecx,16*65536
229
    add  ecx,16*65536
-
 
230
    inc  edx
243
    inc  edx
231
    cmp  edx,8
244
    cmp  edx,8
232
    jb	 newbut
245
    jb	 newbut
233
 
246
 
234
    cld
247
    cld
235
    mov  eax,4
248
    mov  ebx,25*65536+50	   ; draw info text with function 4
236
    mov  ebx,25*65536+50	   ; draw info text with function 4
249
    mov  ecx,0x000000
-
 
250
    mov  edx,text
237
    mov  ecx,0x000000
251
    mov  esi,40
238
    mov  edx,text
252
  newline:
239
    mov  esi,40
253
    mov  eax,4
240
  newline:
Line 254... Line 241...
254
    int  0x40
241
    mcall
255
    add  ebx,16
242
    add  ebx,16
256
    add  edx,40
243
    add  edx,40
Line 257... Line 244...
257
    cmp  [edx],byte 'x'
244
    cmp  [edx],byte 'x'
Line 258... Line 245...
258
    jnz  newline
245
    jnz  newline
Line 301... Line 288...
301
    db ' Remote address : 192.168.0.2           '
288
    db ' Remote address : 192.168.0.2           '
302
    db 'Address of server is in end of source   '
289
    db 'Address of server is in end of source   '
303
    db 'x' ; <- END MARKER, DONT DELETE
290
    db 'x' ; <- END MARKER, DONT DELETE
304
end if
291
end if
Line 305... Line 292...
305
 
292
 
306
labeltext:  db	'Remote Control Center(Client)'  ;
293
title  db 'Remote Control Center(Client)',0
Line 307... Line 294...
307
lte:
294
 
Line 308... Line 295...
308
 
295