Subversion Repositories Kolibri OS

Rev

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

Rev 717 Rev 783
Line 12... Line 12...
12
include '../../../../../proc32.inc'
12
include '../../../../../proc32.inc'
13
include '../../../../../macros.inc'
13
include '../../../../../macros.inc'
14
include '../dll.inc'
14
include '../dll.inc'
Line 15... Line 15...
15
 
15
 
-
 
16
include '../../libio/libio.inc'
Line 16... Line 17...
16
include '../../libio/libio.inc'
17
include '../../libimg/libimg.inc'
Line 17... Line 18...
17
 
18
 
18
;-----------------------------------------------------------------------------
19
;-----------------------------------------------------------------------------
Line 47... Line 48...
47
	or	eax, eax
48
	or	eax, eax
48
	jz	exit
49
	jz	exit
49
	invoke	img.decode, [img_data], [img_data_len]
50
	invoke	img.decode, [img_data], [img_data_len]
50
	or	eax, eax
51
	or	eax, eax
51
	jz	exit
52
	jz	exit
-
 
53
	mov	[image], eax
52
	invoke	img.to_rgb, eax
54
	invoke	img.to_rgb, eax
53
	or	eax, eax
55
	or	eax, eax
54
	jz	exit
56
	jz	exit
55
	mov	[rgb_img], eax
57
	mov	[rgb_img], eax
Line 73... Line 75...
73
	mcall	2
75
	mcall	2
74
	jmp	still
76
	jmp	still
Line 75... Line 77...
75
 
77
 
76
  button:
78
  button:
77
	mcall	17
79
	mcall	17
-
 
80
	shr	eax, 8
-
 
81
 
-
 
82
	; flip horizontally
-
 
83
	cmp	eax, 'flh'
-
 
84
	jne	@f
-
 
85
 
-
 
86
	invoke	img.flip, [image], FLIP_HORIZONTAL
-
 
87
	jmp	redraw_image
-
 
88
 
-
 
89
	; flip vertically
-
 
90
    @@: cmp	eax, 'flv'
-
 
91
	jne	@f
-
 
92
 
-
 
93
	invoke	img.flip, [image], FLIP_VERTICAL
-
 
94
	jmp	redraw_image
-
 
95
 
-
 
96
	; flip both horizontally and vertically
-
 
97
    @@: cmp	eax, 'flb'
-
 
98
	jne	@f
-
 
99
 
-
 
100
	invoke	img.flip, [image], FLIP_BOTH
-
 
101
	jmp	redraw_image
-
 
102
 
-
 
103
	; rotate left
-
 
104
    @@: cmp	eax, 'rtl'
-
 
105
	jne	@f
-
 
106
 
-
 
107
	invoke	img.rotate, [image], ROTATE_90_CCW
-
 
108
	jmp	redraw_image
-
 
109
 
-
 
110
	; rotate right
-
 
111
    @@: cmp	eax, 'rtr'
-
 
112
	jne	@f
-
 
113
 
-
 
114
	invoke	img.rotate, [image], ROTATE_90_CW
-
 
115
	jmp	redraw_image
-
 
116
 
78
	cmp	ah, 1
117
    @@: cmp	eax, 1
Line 79... Line 118...
79
	jne	still
118
	jne	still
80
 
119
 
Line -... Line 120...
-
 
120
  exit:
-
 
121
	mcall	-1
-
 
122
 
-
 
123
  redraw_image:
-
 
124
	stdcall mem.Free, [rgb_img]
-
 
125
	invoke	img.to_rgb, [image]
-
 
126
	or	eax, eax
-
 
127
	jz	exit
81
  exit:
128
	mov	[rgb_img], eax
82
	mcall	-1
129
	jmp	red
83
 
130
 
Line -... Line 131...
-
 
131
draw_window:
84
draw_window:
132
	invoke	gfx.open, TRUE
85
	invoke	gfx.open, TRUE
133
	mov	[ctx], eax
86
	mov	[ctx], eax
134
 
87
 
135
@^
88
	mov	edi, [rgb_img]
136
	mov	edi, [rgb_img]
89
	mov	ebx, 200 * 65536
137
	mov	ebx, 200 * 65536
90
	mov	bx, [edi + 0]
138
	mov	bx, [edi + 0]
91
	add	bx, 9
139
	add	bx, 9
-
 
140
	mov	ecx, 200 * 65536
-
 
141
	mov	cx, [edi + 4]
-
 
142
	add	cx, 5 + 21
-
 
143
	mcall	0, , , 0x33FF0000, , s_header
-
 
144
^@
-
 
145
	mcall	0, <100, 640>, <100, 480>, 0x33FFFFFF, , s_header
-
 
146
 
-
 
147
	invoke	gfx.pen.color, [ctx], 0x007F7F7F
-
 
148
	invoke	gfx.line, [ctx], 0, 30, 630, 30
-
 
149
 
-
 
150
	mcall	8, <5 + 25 * 0, 20>, <5, 20>, 'flh', 0x007F7F7F
-
 
151
	mcall	8, <5 + 25 * 1, 20>, <5, 20>, 'flv', 0x007F7F7F
-
 
152
	mcall	8, <5 + 25 * 2, 20>, <5, 20>, 'flb', 0x007F7F7F
-
 
153
 
Line 92... Line 154...
92
	mov	ecx, 200 * 65536
154
	invoke	gfx.line, [ctx], 5 + 25 * 3, 0, 5 + 25 * 3, 30
93
	mov	cx, [edi + 4]
155
 
94
	add	cx, 5 + 21
156
	mcall	8, <10 + 25 * 3, 20>, <5, 20>, 'rtl', 0x007F7F7F
95
	mcall	0, , , 0x33FF0000, , s_header
157
	mcall	8, <10 + 25 * 4, 20>, <5, 20>, 'rtr', 0x007F7F7F
96
 
158
 
97
	mov	ebx, [rgb_img]
159
	mov	ebx, [rgb_img]
Line 98... Line 160...
98
	mov	ecx, [ebx + 0]
160
	mov	ecx, [ebx + 0]
99
	shl	ecx, 16
161
	shl	ecx, 16
Line 100... Line 162...
100
	mov	cx, [ebx + 4]
162
	mov	cx, [ebx + 4]
Line 166... Line 228...
166
	libio  , 'libio.obj'  , \
228
	libio  , 'libio.obj'  , \
167
	libgfx , 'libgfx.obj' , \
229
	libgfx , 'libgfx.obj' , \
168
	libimg , 'libimg.obj'
230
	libimg , 'libimg.obj'
Line 169... Line 231...
169
 
231
 
-
 
232
import	libio			  , \
170
import	libio			  , \
233
	libio.init , 'lib_init'   , \
171
	file.size  , 'file.size'  , \
234
	file.size  , 'file.size'  , \
172
	file.open  , 'file.open'  , \
235
	file.open  , 'file.open'  , \
173
	file.read  , 'file.read'  , \
236
	file.read  , 'file.read'  , \
Line 174... Line 237...
174
	file.close , 'file.close'
237
	file.close , 'file.close'
-
 
238
 
175
 
239
import	libgfx				, \
176
import	libgfx			, \
240
	libgfx.init   , 'lib_init'	, \
-
 
241
	gfx.open      , 'gfx.open'	, \
-
 
242
	gfx.close     , 'gfx.close'	, \
Line 177... Line 243...
177
	gfx.open  , 'gfx.open'	, \
243
	gfx.pen.color , 'gfx.pen.color' , \
-
 
244
	gfx.line      , 'gfx.line'
178
	gfx.close , 'gfx.close'
245
 
179
 
246
import	libimg			   , \
180
import	libimg			  , \
247
	libimg.init , 'lib_init'   , \
-
 
248
	img.is_img  , 'img.is_img' , \
-
 
249
	img.to_rgb  , 'img.to_rgb' , \
Line 181... Line 250...
181
	img.is_img , 'img.is_img' , \
250
	img.decode  , 'img.decode' , \
Line 182... Line 251...
182
	img.to_rgb , 'img.to_rgb' , \
251
	img.flip    , 'img.flip'   , \
Line 183... Line 252...
183
	img.decode , 'img.decode'
252
	img.rotate  , 'img.rotate'
184
 
253
 
185
;-----------------------------------------------------------------------------
254
;-----------------------------------------------------------------------------
186
 
255
 
-
 
256
I_END:
Line 187... Line 257...
187
I_END:
257
 
Line 188... Line 258...
188
 
258
img_data     dd ?