Check-in [6674bfca65]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:A number of bugfixes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6674bfca65228338df2ab28e07353eb60ee8c375
User & Date: bernd 2014-03-21 00:18:55
Context
2014-03-21
19:39
Linux version updated check-in: f2ee538d66 user: bernd tags: trunk
00:18
A number of bugfixes check-in: 6674bfca65 user: bernd tags: trunk
2014-01-23
16:05
Slideshow finetuning check-in: 293240b31b user: bernd tags: trunk
Changes

Changes to gl-helper.fs.

639
640
641
642
643
644
645

646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671

672
673
674
675
676
677
678
679
680

: ftime ( -- r ) ntime d>f 1e-9 f* ;

0.5e FConstant rel-drag
0.3e FConstant abs-drag
FVariable drag-time
: f!@ ( r1 addr -- r2 ) dup f@ fswap f! ;

: delta-t ( -- r )
    ftime fdup drag-time f!@ f- fdup 1e f> IF  fdrop 0e  THEN ;

FVariable motion-x0
FVariable motion-y0
Variable last-x0  -100 last-x0 !
Variable last-y0  -100 last-y0 !
0.15e FConstant short-click#
0.5e  FConstant long-click#

: delta-tc  ( -- r ) *input downtime 2@ d>f 1e-3 f* ;
: short? ( -- flag )
    delta-tc short-click# f< ;
: long? ( -- flag )
    delta-tc long-click# f> ;
: !click ( -- )  0e motion-x0 f! 0e motion-y0 f! ;
[IFUNDEF] togglekb : togglekb ; [THEN]
: ?toggle ( -- )
    short? motion-y0 f@ f0= and IF  togglekb need-show off  THEN ;

: do-motion { rows cur old motion xt -- }
    old @ -100 = IF
	cur old !
    ELSE
	cur old @ over old ! swap -
	s>f dpy-h @ s>f rows fm/ f/ fdup motion f! xt execute

    THEN ;

: drag-motion { old motion xt -- } delta-t { f: dt }
    motion f@ rel-drag dt f** f*
    fdup f0< fabs abs-drag dt f* f- 0e fmax IF fnegate THEN
    fdup motion f! fdup f0<> IF  xt execute  ELSE  fdrop  THEN
    -100 old ! ;

previous







>
|
|








<




|









|
>









639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656

657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681

: ftime ( -- r ) ntime d>f 1e-9 f* ;

0.5e FConstant rel-drag
0.3e FConstant abs-drag
FVariable drag-time
: f!@ ( r1 addr -- r2 ) dup f@ fswap f! ;
: delta-tc  ( -- r ) *input downtime 2@ d>f 1e-3 f* ;
: delta-t ( -- r ) *input action @ 0< IF  ftime  ELSE  delta-tc  THEN
    fdup drag-time f!@ f- fdup 1e f> IF  fdrop 0e  THEN ;

FVariable motion-x0
FVariable motion-y0
Variable last-x0  -100 last-x0 !
Variable last-y0  -100 last-y0 !
0.15e FConstant short-click#
0.5e  FConstant long-click#


: short? ( -- flag )
    delta-tc short-click# f< ;
: long? ( -- flag )
    delta-tc long-click# f> ;
: !click ( -- )  0e motion-x0 f! 0e motion-y0 f! ftime drag-time f! ;
[IFUNDEF] togglekb : togglekb ; [THEN]
: ?toggle ( -- )
    short? motion-y0 f@ f0= and IF  togglekb need-show off  THEN ;

: do-motion { rows cur old motion xt -- }
    old @ -100 = IF
	cur old !
    ELSE
	cur old @ over old ! swap -
	s>f dpy-h @ s>f rows fm/ f/ fdup f2/ motion f@ f2/ f+ motion f!
	xt execute
    THEN ;

: drag-motion { old motion xt -- } delta-t { f: dt }
    motion f@ rel-drag dt f** f*
    fdup f0< fabs abs-drag dt f* f- 0e fmax IF fnegate THEN
    fdup motion f! fdup f0<> IF  xt execute  ELSE  fdrop  THEN
    -100 old ! ;

previous

Changes to gl-slideshow.fs.

191
192
193
194
195
196
197



198
199
200
201
202
203
204
...
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
...
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267

: +thumb-slide ( delta -- )
    thumb-yr f+ slidelist $[]# thumb# / 1 - s>f fmin
    0e fmax thumb-scroll 2drop ;

: ?esc ( -- )  key? IF  key #esc = IF  -1 level# +!  THEN  THEN ;




: slide-input ( -- )
    >looper ?esc
    *input >r r@ IF
	case  r@ action @  r@ action on
	    1 ( AMOTION_EVENT_ACTION_UP ) of
		short? IF
		    3 3 click-regions
................................................................................
			2dup 1 1 d= IF  2drop  1 +slide .5e fade    LEAVE  THEN
			2drop
		    DONE
		THEN
	    endof
	    0 of  !click  endof
	endcase
    THEN
    rdrop ;

: (reshow) ( -- )
    0e >y-pos <draw-slide current-slide @ draw-slide draw-slide>
    BEGIN  prefetch slide-input  level# @ 0= UNTIL ;

: reshow ( -- ) [IFDEF] android  kbflag @ IF  togglekb  THEN [THEN]
    1 level# +! slideshow-init (reshow) ;

: up-down ( -- )
    ekey? IF  ekey case
	    k-up    of  [ thumb# dup * negate ]L thumb-slide  endof
................................................................................
	    endof
	    abs 1 <> IF
		thumb# r@ y0 @ last-y0 motion-y0 ['] +thumb-slide do-motion
	    ELSE
		last-y0 motion-y0 ['] +thumb-slide drag-motion
	    THEN  0
	endcase
    THEN
    rdrop ;

: rethumb ( -- ) [IFDEF] android  kbflag @ IF  togglekb  THEN [THEN] 0e >y-pos
    1 level# +! slideshow-init 0 thumb-slide
    BEGIN  prefetch-thumb  thumb-input  level# @ 0= UNTIL ;
: slide-show ( addr u -- )
    slidelist $[]slurp-file current-slide off reshow ;
: thumb-show ( addr u -- )
    slidelist $[]slurp-file current-slide off rethumb ;

previous previous

\ s" slide.lst" slide-show







>
>
>







 







|
|


|
|







 







|
|



|








191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270

: +thumb-slide ( delta -- )
    thumb-yr f+ slidelist $[]# thumb# / 1 - s>f fmin
    0e fmax thumb-scroll 2drop ;

: ?esc ( -- )  key? IF  key #esc = IF  -1 level# +!  THEN  THEN ;

: slide-reshow ( -- )
    0e >y-pos <draw-slide current-slide @ draw-slide draw-slide> ;

: slide-input ( -- )
    >looper ?esc
    *input >r r@ IF
	case  r@ action @  r@ action on
	    1 ( AMOTION_EVENT_ACTION_UP ) of
		short? IF
		    3 3 click-regions
................................................................................
			2dup 1 1 d= IF  2drop  1 +slide .5e fade    LEAVE  THEN
			2drop
		    DONE
		THEN
	    endof
	    0 of  !click  endof
	endcase
    THEN  rdrop
    need-sync @ IF  slideshow-init slide-reshow  need-sync off  THEN ;

: (reshow) ( -- )
    slide-reshow
    BEGIN  prefetch slide-input  level# @ 0= UNTIL  need-sync on ;

: reshow ( -- ) [IFDEF] android  kbflag @ IF  togglekb  THEN [THEN]
    1 level# +! slideshow-init (reshow) ;

: up-down ( -- )
    ekey? IF  ekey case
	    k-up    of  [ thumb# dup * negate ]L thumb-slide  endof
................................................................................
	    endof
	    abs 1 <> IF
		thumb# r@ y0 @ last-y0 motion-y0 ['] +thumb-slide do-motion
	    ELSE
		last-y0 motion-y0 ['] +thumb-slide drag-motion
	    THEN  0
	endcase
    THEN  rdrop
    need-sync @ IF  slideshow-init 0 thumb-slide  need-sync off  THEN ;

: rethumb ( -- ) [IFDEF] android  kbflag @ IF  togglekb  THEN [THEN] 0e >y-pos
    1 level# +! slideshow-init 0 thumb-slide
    BEGIN  prefetch-thumb  thumb-input  level# @ 0= UNTIL  need-sync on ;
: slide-show ( addr u -- )
    slidelist $[]slurp-file current-slide off reshow ;
: thumb-show ( addr u -- )
    slidelist $[]slurp-file current-slide off rethumb ;

previous previous

\ s" slide.lst" slide-show

Changes to gl-terminal.fs.

1
2
3
4
5
6


7
8
9
10
11
12
13
...
282
283
284
285
286
287
288
289
290
291


292
293
294
295
296
297
298
...
306
307
308
309
310
311
312

313
314
315
316
317
318
319
320
321
322
\ OpenGL terminal

require ansi.fs \ we may want to support colorize.fs

\ opengl common stuff



require gl-helper.fs

also [IFDEF] android android [THEN]

GL_FRAGMENT_SHADER shader: TerminalShader
#precision
uniform vec3 u_LightPos;        // The position of the light in eye space.
................................................................................
    rows swap last-y0 motion-y0 ['] +scroll do-motion
    long? IF  kbflag @ IF  togglekb  THEN  THEN
    need-show off ;

: screen-slide ( -- )
    *input >r
    r@ IF
	r@ action @ \ dup -1 <> IF  dup . delta-t f. cr  THEN
	case
	    1 of  ?toggle  r@ action on  endof


	    abs 1 <> IF  r@ y0 @ scrolling  
	    ELSE  last-y0 motion-y0 ['] +scroll drag-motion  THEN
	    0
	endcase
    THEN  rdrop ;

:noname ( flag -- flag ) level# @ 0> ?EXIT
................................................................................
' gl-page IS page
' gl-attr! IS attr!
default-out op-vector !

\ initialize

: term-init ( -- )

    >screen-orientation
    create-terminal-program to terminal-program
    terminal-program terminal-init term-load-textures form-chooser
    unit-matrix MVPMatrix set-matrix ;

:noname  defers window-init term-init config-changer ; IS window-init

window-init

previous previous \ remove opengl from search order






>
>







 







|


>
>







 







>










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
\ OpenGL terminal

require ansi.fs \ we may want to support colorize.fs

\ opengl common stuff

\ :noname source type cr stdout flush-file throw ; is before-line

require gl-helper.fs

also [IFDEF] android android [THEN]

GL_FRAGMENT_SHADER shader: TerminalShader
#precision
uniform vec3 u_LightPos;        // The position of the light in eye space.
................................................................................
    rows swap last-y0 motion-y0 ['] +scroll do-motion
    long? IF  kbflag @ IF  togglekb  THEN  THEN
    need-show off ;

: screen-slide ( -- )
    *input >r
    r@ IF
	r@ action @ \ dup -1 <> IF  dup .  THEN
	case
	    1 of  ?toggle  r@ action on  endof
	    3 of           r@ action on  endof \ cancel
	    9 of           r@ action on  endof \ hover
	    abs 1 <> IF  r@ y0 @ scrolling  
	    ELSE  last-y0 motion-y0 ['] +scroll drag-motion  THEN
	    0
	endcase
    THEN  rdrop ;

:noname ( flag -- flag ) level# @ 0> ?EXIT
................................................................................
' gl-page IS page
' gl-attr! IS attr!
default-out op-vector !

\ initialize

: term-init ( -- )
    clazz >o hideProgress o>
    >screen-orientation
    create-terminal-program to terminal-program
    terminal-program terminal-init term-load-textures form-chooser
    unit-matrix MVPMatrix set-matrix ;

:noname  defers window-init term-init config-changer ; IS window-init

window-init

previous previous \ remove opengl from search order

Changes to gles2/android.fs.

259
260
261
262
263
264
265


266

267
268
269
270
271
272
273
	0= IF  getUnicodeChar dup 0>
	    IF    android-unicode
	    ELSE  drop  getKeyCode  android-keycode
	    THEN
	THEN
    THEN o> ;



: touch>event ( event -- ) dup to touch-event >o

    me-getAction *input action !
    getFlags *input flags !
    getMetaState *input metastate !
    getEdgeFlags *input edgeflags !
    0 getPressure f>s *input pressure !
    0 getSize f>s *input size !
    getEventTime getDownTime d- *input downtime 2!







>
>
|
>







259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
	0= IF  getUnicodeChar dup 0>
	    IF    android-unicode
	    ELSE  drop  getKeyCode  android-keycode
	    THEN
	THEN
    THEN o> ;

Variable new-touch

: touch>event ( event -- )  new-touch on
    dup to touch-event >o
    me-getAction *input action !
    getFlags *input flags !
    getMetaState *input metastate !
    getEdgeFlags *input edgeflags !
    0 getPressure f>s *input pressure !
    0 getSize f>s *input size !
    getEventTime getDownTime d- *input downtime 2!

Changes to gles2/gl-helper.fs.

639
640
641
642
643
644
645

646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671

672
673
674
675
676
677
678
679
680

: ftime ( -- r ) ntime d>f 1e-9 f* ;

0.5e FConstant rel-drag
0.3e FConstant abs-drag
FVariable drag-time
: f!@ ( r1 addr -- r2 ) dup f@ fswap f! ;

: delta-t ( -- r )
    ftime fdup drag-time f!@ f- fdup 1e f> IF  fdrop 0e  THEN ;

FVariable motion-x0
FVariable motion-y0
Variable last-x0  -100 last-x0 !
Variable last-y0  -100 last-y0 !
0.15e FConstant short-click#
0.5e  FConstant long-click#

: delta-tc  ( -- r ) *input downtime 2@ d>f 1e-3 f* ;
: short? ( -- flag )
    delta-tc short-click# f< ;
: long? ( -- flag )
    delta-tc long-click# f> ;
: !click ( -- )  0e motion-x0 f! 0e motion-y0 f! ;
[IFUNDEF] togglekb : togglekb ; [THEN]
: ?toggle ( -- )
    short? motion-y0 f@ f0= and IF  togglekb need-show off  THEN ;

: do-motion { rows cur old motion xt -- }
    old @ -100 = IF
	cur old !
    ELSE
	cur old @ over old ! swap -
	s>f dpy-h @ s>f rows fm/ f/ fdup motion f! xt execute

    THEN ;

: drag-motion { old motion xt -- } delta-t { f: dt }
    motion f@ rel-drag dt f** f*
    fdup f0< fabs abs-drag dt f* f- 0e fmax IF fnegate THEN
    fdup motion f! fdup f0<> IF  xt execute  ELSE  fdrop  THEN
    -100 old ! ;

previous







>
|
|








<




|









|
>









639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656

657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681

: ftime ( -- r ) ntime d>f 1e-9 f* ;

0.5e FConstant rel-drag
0.3e FConstant abs-drag
FVariable drag-time
: f!@ ( r1 addr -- r2 ) dup f@ fswap f! ;
: delta-tc  ( -- r ) *input downtime 2@ d>f 1e-3 f* ;
: delta-t ( -- r ) *input action @ 0< IF  ftime  ELSE  delta-tc  THEN
    fdup drag-time f!@ f- fdup 1e f> IF  fdrop 0e  THEN ;

FVariable motion-x0
FVariable motion-y0
Variable last-x0  -100 last-x0 !
Variable last-y0  -100 last-y0 !
0.15e FConstant short-click#
0.5e  FConstant long-click#


: short? ( -- flag )
    delta-tc short-click# f< ;
: long? ( -- flag )
    delta-tc long-click# f> ;
: !click ( -- )  0e motion-x0 f! 0e motion-y0 f! ftime drag-time f! ;
[IFUNDEF] togglekb : togglekb ; [THEN]
: ?toggle ( -- )
    short? motion-y0 f@ f0= and IF  togglekb need-show off  THEN ;

: do-motion { rows cur old motion xt -- }
    old @ -100 = IF
	cur old !
    ELSE
	cur old @ over old ! swap -
	s>f dpy-h @ s>f rows fm/ f/ fdup f2/ motion f@ f2/ f+ motion f!
	xt execute
    THEN ;

: drag-motion { old motion xt -- } delta-t { f: dt }
    motion f@ rel-drag dt f** f*
    fdup f0< fabs abs-drag dt f* f- 0e fmax IF fnegate THEN
    fdup motion f! fdup f0<> IF  xt execute  ELSE  fdrop  THEN
    -100 old ! ;

previous

Changes to gles2/gl-terminal.fs.

1
2
3
4
5
6


7
8
9
10
11
12
13
...
282
283
284
285
286
287
288
289
290
291


292
293
294
295
296
297
298
...
306
307
308
309
310
311
312

313
314
315
316
317
318
319
320
321
322
\ OpenGL terminal

require ansi.fs \ we may want to support colorize.fs

\ opengl common stuff



require gl-helper.fs

also [IFDEF] android android [THEN]

GL_FRAGMENT_SHADER shader: TerminalShader
#precision
uniform vec3 u_LightPos;        // The position of the light in eye space.
................................................................................
    rows swap last-y0 motion-y0 ['] +scroll do-motion
    long? IF  kbflag @ IF  togglekb  THEN  THEN
    need-show off ;

: screen-slide ( -- )
    *input >r
    r@ IF
	r@ action @ \ dup -1 <> IF  dup . delta-t f. cr  THEN
	case
	    1 of  ?toggle  r@ action on  endof


	    abs 1 <> IF  r@ y0 @ scrolling  
	    ELSE  last-y0 motion-y0 ['] +scroll drag-motion  THEN
	    0
	endcase
    THEN  rdrop ;

:noname ( flag -- flag ) level# @ 0> ?EXIT
................................................................................
' gl-page IS page
' gl-attr! IS attr!
default-out op-vector !

\ initialize

: term-init ( -- )

    >screen-orientation
    create-terminal-program to terminal-program
    terminal-program terminal-init term-load-textures form-chooser
    unit-matrix MVPMatrix set-matrix ;

:noname  defers window-init term-init config-changer ; IS window-init

window-init

previous previous \ remove opengl from search order






>
>







 







|


>
>







 







>










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
\ OpenGL terminal

require ansi.fs \ we may want to support colorize.fs

\ opengl common stuff

\ :noname source type cr stdout flush-file throw ; is before-line

require gl-helper.fs

also [IFDEF] android android [THEN]

GL_FRAGMENT_SHADER shader: TerminalShader
#precision
uniform vec3 u_LightPos;        // The position of the light in eye space.
................................................................................
    rows swap last-y0 motion-y0 ['] +scroll do-motion
    long? IF  kbflag @ IF  togglekb  THEN  THEN
    need-show off ;

: screen-slide ( -- )
    *input >r
    r@ IF
	r@ action @ \ dup -1 <> IF  dup .  THEN
	case
	    1 of  ?toggle  r@ action on  endof
	    3 of           r@ action on  endof \ cancel
	    9 of           r@ action on  endof \ hover
	    abs 1 <> IF  r@ y0 @ scrolling  
	    ELSE  last-y0 motion-y0 ['] +scroll drag-motion  THEN
	    0
	endcase
    THEN  rdrop ;

:noname ( flag -- flag ) level# @ 0> ?EXIT
................................................................................
' gl-page IS page
' gl-attr! IS attr!
default-out op-vector !

\ initialize

: term-init ( -- )
    clazz >o hideProgress o>
    >screen-orientation
    create-terminal-program to terminal-program
    terminal-program terminal-init term-load-textures form-chooser
    unit-matrix MVPMatrix set-matrix ;

:noname  defers window-init term-init config-changer ; IS window-init

window-init

previous previous \ remove opengl from search order

Changes to gles2/jni-helper.fs.

16
17
18
19
20
21
22

23
24
25
26
27
28
29
: INPUT_METHOD_SERVICE js" input_method" ;
: POWER_SERVICE        js" power" ;
: LOCATION_SERVICE     js" location" ;
: SENSOR_SERVICE       js" sensor" ;

jni-method: getSystemService getSystemService (Ljava/lang/String;)Ljava/lang/Object;
jni-method: getWindow getWindow ()Landroid/view/Window;


jni-class: android/app/Activity
jni-method: getWindowManager getWindowManager ()Landroid/view/WindowManager;

jni-class: android/view/WindowManager
jni-method: getDefaultDisplay getDefaultDisplay ()Landroid/view/Display;








>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
: INPUT_METHOD_SERVICE js" input_method" ;
: POWER_SERVICE        js" power" ;
: LOCATION_SERVICE     js" location" ;
: SENSOR_SERVICE       js" sensor" ;

jni-method: getSystemService getSystemService (Ljava/lang/String;)Ljava/lang/Object;
jni-method: getWindow getWindow ()Landroid/view/Window;
jni-method: hideProgress hideProgress ()V

jni-class: android/app/Activity
jni-method: getWindowManager getWindowManager ()Landroid/view/WindowManager;

jni-class: android/view/WindowManager
jni-method: getDefaultDisplay getDefaultDisplay ()Landroid/view/Display;

Changes to gles2/jni-media.fs.

100
101
102
103
104
105
106









































107
108
109
110
111
112
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I










































JValue media-sft

previous

: create-sft ( -- )
    media-tex current-tex new-SurfaceTexture to media-sft ;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I

jni-class: android/media/MediaCodec

jni-static: createByCodecName createByCodecName (Ljava/lang/String;)Landroid/media/MediaCodec;
jni-static: createDecoderByType createDecoderByType (Ljava/lang/String;)Landroid/media/MediaCodec;
jni-static: createEncoderByType createEncoderByType (Ljava/lang/String;)Landroid/media/MediaCodec;

jni-method: configure configure (Landroid/media/MediaFormat;Landroid/view/Surface;Landroid/media/MediaCrypto;I)V
jni-method: createInputSurface createInputSurface ()Landroid/view/Surface;
jni-method: dequeueInputBuffer dequeueInputBuffer (J)I
jni-method: dequeueOutputBuffer dequeueOutputBuffer (Landroid/media/MediaCodec$BufferInfo;J)I
jni-method: mc-flush flush ()V
jni-method: getCodecInfo getCodecInfo ()Landroid/media/MediaCodecInfo;
jni-method: getInputBuffers getInputBuffers ()[Ljava/nio/ByteBuffer;
jni-method: mc-getName getName ()Ljava/lang/String;
jni-method: getOutputBuffers getOutputBuffers ()[Ljava/nio/ByteBuffer;
jni-method: getOutputFormat getOutputFormat ()Landroid/media/MediaFormat;
jni-method: queueInputBuffer queueInputBuffer (IIIJI)V
jni-method: mc-release release ()V
jni-method: releaseOutputBuffer releaseOutputBuffer (IZ)V
jni-method: setVideoScalingMode setVideoScalingMode (I)V
jni-method: signalEndOfInputStream signalEndOfInputStream ()V
jni-method: mc-start start ()V
jni-method: mc-stop stop ()V

jni-class: android/media/MediaCodec$BufferInfo

jni-new: new-MediaCodec.BufferInfo ()V

jni-field: mcbi-flags flags I
jni-field: mcbi-offset offset I
jni-field: mcbi-presentationTimeUs presentationTimeUs J
jni-field: mcbi-size size I
jni-method: mcbi-set set (IIJI)V

jni-class: android/media/MediaFormat

jni-static: createAudioFormat createAudioFormat (Ljava/lang/String;II)Landroid/media/MediaFormat;
\ jni-static: createSubtitleFormat createSubtitleFormat (Ljava/lang/String;Ljava/lang/String;)Landroid/media/MediaFormat;
\ only API 19
jni-static: createVideoFormat createVideoFormat (Ljava/lang/String;II)Landroid/media/MediaFormat;

JValue media-sft

previous

: create-sft ( -- )
    media-tex current-tex new-SurfaceTexture to media-sft ;

Changes to gles2/jni-tools.fs.

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
...
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
    vm ['] env >body vmAA vm JavaVM-AttachCurrentThread() drop
    maxargs# floats allocate throw callargs ! ;
: detach ( -- ) \ jni
    \G detach the current thread from the JVM
    vm dup JavaVM-DetachCurrentThread() drop
    callargs @ free throw ;

attach

\ call java

\ characters used: ZBCSIJFDL

-1 floats 0 +field arg-  drop

................................................................................
	0 of  to jstring0  endof
	1 of  to jstring1  endof
	2 of  to jstring2  endof
	3 of  to jstring3  endof
    endcase ;

: $0! ( addr u string -- addr' ) >r
    r@ $! 0 r@ $@ + c! r> $@ drop ;
: cstr" ( -- addr )  parse-name cstring  $0! ;
: cstr1" ( -- addr ) parse-name cstring1 $0! ;
: make-jstring ( c-addr -- jstring-addr )
    env tuck JNIEnv-NewStringUTF() dup to-jstring ;
: js" ( -- addr )  '"' parse cstring $0! make-jstring ;
comp: drop '"' parse cstring $0!
    cstring>sstring 1+ ]] SLiteral drop make-jstring [[ ;







|







 







|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
...
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
    vm ['] env >body vmAA vm JavaVM-AttachCurrentThread() drop
    maxargs# floats allocate throw callargs ! ;
: detach ( -- ) \ jni
    \G detach the current thread from the JVM
    vm dup JavaVM-DetachCurrentThread() drop
    callargs @ free throw ;

attach \ apparently needs attaching again

\ call java

\ characters used: ZBCSIJFDL

-1 floats 0 +field arg-  drop

................................................................................
	0 of  to jstring0  endof
	1 of  to jstring1  endof
	2 of  to jstring2  endof
	3 of  to jstring3  endof
    endcase ;

: $0! ( addr u string -- addr' ) >r
    r@ $! 0 r@ c$+! r> $@ drop ;
: cstr" ( -- addr )  parse-name cstring  $0! ;
: cstr1" ( -- addr ) parse-name cstring1 $0! ;
: make-jstring ( c-addr -- jstring-addr )
    env tuck JNIEnv-NewStringUTF() dup to-jstring ;
: js" ( -- addr )  '"' parse cstring $0! make-jstring ;
comp: drop '"' parse cstring $0!
    cstring>sstring 1+ ]] SLiteral drop make-jstring [[ ;

Changes to gles2/widgets-test.fs.

8
9
10
11
12
13
14
15



16
17
18
19
20

21
22
23
24
25

26
27
28
29
30

31
32
33
34
35

36
37
38
39
40

41
42
43
44
45
46
47
48
49
50
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64


65
66
67
68
69
70
71
..
73
74
75
76
77
78
79
80


81
82
frame new value f2
frame new value f3
frame new value f4
frame new value f5
frame new value f6
text new value f7
text new value f8
f1 >o rdrop



0 x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
32 border ! $FFFFFFFF frame-color !
button2

f2 >o rdrop

dpy-w @ 2/ x ! 0 y ! dpy-w @ 2/ w ! dpy-h @ 19 20 */ d !
32 border ! $FF7FFFFF frame-color !
button3

f3 >o rdrop

0 x ! dpy-h @ 2/ y ! dpy-w @ 2/ w ! dpy-h @ 2/ 2/ d !
16 border ! $FFFF7FFF frame-color !
button1

f4 >o rdrop

0 x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
32 border ! $FF7F7FFF frame-color !
button1

f5 >o rdrop

dpy-w @ 4 / x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
8 border ! $7FFF7FFF frame-color !
button1

f6 >o rdrop

dpy-w @ 4 / x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
16 border ! $7FFFFFFF frame-color !
button2

also freetype-gl
48e FConstant fontsize#
atlas [IFDEF] android  "/system/fonts/DroidSans.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/LiberationSans-Regular.ttf\0" drop 
[THEN]
fontsize# texture_font_new Value font1
................................................................................

atlas [IFDEF] android  "/system/fonts/DroidSansFallback.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/gkai00mp.ttf\0" drop
[THEN]
fontsize# texture_font_new Value font2
previous

f7 >o rdrop
8 x ! dpy-h @ 4 / y ! "Dös isch a Tägscht!" text-string $!
$884400FF text-color !  font1 text-font !

f8 >o rdrop
8 x ! dpy-h @ 5 8 */ y ! "这是一个文本:在德语说" text-string $!
$004488FF text-color !  font2 text-font !



: widgets-draw ( -- )
    f1 >o draw o> f7 >o draw o> f2 >o draw o> f3 >o draw o>
    f8 >o draw o> f4 >o draw o> f5 >o draw o> f6 >o draw o> ;

: widgets-test
    <draw0 draw0>
................................................................................
    <draw2 widgets-draw draw2>
    <draw3 widgets-draw draw3>
    sync ;

also [IFDEF] android android [THEN]

: widgets-demo ( -- )  [IFDEF] hidekb  hidekb [THEN]
    1 level# +!  BEGIN  widgets-test >looper  level# @ 0= UNTIL ;



previous







<
>
>
>
|
|
|

<
>
|
|
|

<
>
|
|
|

<
>
|
|
|

<
>
|
|
|

<
>
|
|
|







 







|
|
|

|
|
|
>
>







 







|
>
>


8
9
10
11
12
13
14

15
16
17
18
19
20
21

22
23
24
25
26

27
28
29
30
31

32
33
34
35
36

37
38
39
40
41

42
43
44
45
46
47
48
49
50
51
52
..
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
..
77
78
79
80
81
82
83
84
85
86
87
88
frame new value f2
frame new value f3
frame new value f4
frame new value f5
frame new value f6
text new value f7
text new value f8



: !f1 ( -- ) f1 >o
    0 x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
    32 border ! $FFFFFFFF frame-color !
    button2 o> ;


: !f2 ( -- ) f2 >o
    dpy-w @ 2/ x ! 0 y ! dpy-w @ 2/ w ! dpy-h @ 19 20 */ d !
    32 border ! $FF7FFFFF frame-color !
    button3 o> ;


: !f3 ( -- ) f3 >o
    0 x ! dpy-h @ 2/ y ! dpy-w @ 2/ w ! dpy-h @ 2/ 2/ d !
    16 border ! $FFFF7FFF frame-color !
    button1 o> ;


: !f4 ( -- ) f4 >o
    0 x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
    32 border ! $FF7F7FFF frame-color !
    button1 o> ;


: !f5 ( -- ) f5 >o
    dpy-w @ 4 / x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
    8 border ! $7FFF7FFF frame-color !
    button1 o> ;


: !f6 ( -- ) f6 >o
    dpy-w @ 4 / x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
    16 border ! $7FFFFFFF frame-color !
    button2 o> ;

also freetype-gl
48e FConstant fontsize#
atlas [IFDEF] android  "/system/fonts/DroidSans.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/LiberationSans-Regular.ttf\0" drop 
[THEN]
fontsize# texture_font_new Value font1
................................................................................

atlas [IFDEF] android  "/system/fonts/DroidSansFallback.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/gkai00mp.ttf\0" drop
[THEN]
fontsize# texture_font_new Value font2
previous

: !f7 ( -- )  f7 >o
    8 x ! dpy-h @ 4 / y ! "Dös isch a Tägscht!" text-string $!
    $884400FF text-color !  font1 text-font ! o> ;

: !f8 ( -- ) f8 >o
    8 x ! dpy-h @ 5 8 */ y ! "这是一个文本:在德语说" text-string $!
    $004488FF text-color !  font2 text-font ! o> ;

: !widgets ( -- ) !f1 !f2 !f3 !f4 !f5 !f6 !f7 !f8 ;

: widgets-draw ( -- )
    f1 >o draw o> f7 >o draw o> f2 >o draw o> f3 >o draw o>
    f8 >o draw o> f4 >o draw o> f5 >o draw o> f6 >o draw o> ;

: widgets-test
    <draw0 draw0>
................................................................................
    <draw2 widgets-draw draw2>
    <draw3 widgets-draw draw3>
    sync ;

also [IFDEF] android android [THEN]

: widgets-demo ( -- )  [IFDEF] hidekb  hidekb [THEN]
    1 level# +!  !widgets  BEGIN  widgets-test >looper
	need-sync @ IF  !widgets  need-sync off  THEN
    level# @ 0= UNTIL  need-sync on ;

previous

Changes to jni-media.fs.

100
101
102
103
104
105
106









































107
108
109
110
111
112
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I










































JValue media-sft

previous

: create-sft ( -- )
    media-tex current-tex new-SurfaceTexture to media-sft ;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I

jni-class: android/media/MediaCodec

jni-static: createByCodecName createByCodecName (Ljava/lang/String;)Landroid/media/MediaCodec;
jni-static: createDecoderByType createDecoderByType (Ljava/lang/String;)Landroid/media/MediaCodec;
jni-static: createEncoderByType createEncoderByType (Ljava/lang/String;)Landroid/media/MediaCodec;

jni-method: configure configure (Landroid/media/MediaFormat;Landroid/view/Surface;Landroid/media/MediaCrypto;I)V
jni-method: createInputSurface createInputSurface ()Landroid/view/Surface;
jni-method: dequeueInputBuffer dequeueInputBuffer (J)I
jni-method: dequeueOutputBuffer dequeueOutputBuffer (Landroid/media/MediaCodec$BufferInfo;J)I
jni-method: mc-flush flush ()V
jni-method: getCodecInfo getCodecInfo ()Landroid/media/MediaCodecInfo;
jni-method: getInputBuffers getInputBuffers ()[Ljava/nio/ByteBuffer;
jni-method: mc-getName getName ()Ljava/lang/String;
jni-method: getOutputBuffers getOutputBuffers ()[Ljava/nio/ByteBuffer;
jni-method: getOutputFormat getOutputFormat ()Landroid/media/MediaFormat;
jni-method: queueInputBuffer queueInputBuffer (IIIJI)V
jni-method: mc-release release ()V
jni-method: releaseOutputBuffer releaseOutputBuffer (IZ)V
jni-method: setVideoScalingMode setVideoScalingMode (I)V
jni-method: signalEndOfInputStream signalEndOfInputStream ()V
jni-method: mc-start start ()V
jni-method: mc-stop stop ()V

jni-class: android/media/MediaCodec$BufferInfo

jni-new: new-MediaCodec.BufferInfo ()V

jni-field: mcbi-flags flags I
jni-field: mcbi-offset offset I
jni-field: mcbi-presentationTimeUs presentationTimeUs J
jni-field: mcbi-size size I
jni-method: mcbi-set set (IIJI)V

jni-class: android/media/MediaFormat

jni-static: createAudioFormat createAudioFormat (Ljava/lang/String;II)Landroid/media/MediaFormat;
\ jni-static: createSubtitleFormat createSubtitleFormat (Ljava/lang/String;Ljava/lang/String;)Landroid/media/MediaFormat;
\ only API 19
jni-static: createVideoFormat createVideoFormat (Ljava/lang/String;II)Landroid/media/MediaFormat;

JValue media-sft

previous

: create-sft ( -- )
    media-tex current-tex new-SurfaceTexture to media-sft ;

Changes to widgets-test.fs.

8
9
10
11
12
13
14
15



16
17
18
19
20

21
22
23
24
25

26
27
28
29
30

31
32
33
34
35

36
37
38
39
40

41
42
43
44
45
46
47
48
49
50
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64


65
66
67
68
69
70
71
..
73
74
75
76
77
78
79
80


81
82
frame new value f2
frame new value f3
frame new value f4
frame new value f5
frame new value f6
text new value f7
text new value f8
f1 >o rdrop



0 x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
32 border ! $FFFFFFFF frame-color !
button2

f2 >o rdrop

dpy-w @ 2/ x ! 0 y ! dpy-w @ 2/ w ! dpy-h @ 19 20 */ d !
32 border ! $FF7FFFFF frame-color !
button3

f3 >o rdrop

0 x ! dpy-h @ 2/ y ! dpy-w @ 2/ w ! dpy-h @ 2/ 2/ d !
16 border ! $FFFF7FFF frame-color !
button1

f4 >o rdrop

0 x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
32 border ! $FF7F7FFF frame-color !
button1

f5 >o rdrop

dpy-w @ 4 / x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
8 border ! $7FFF7FFF frame-color !
button1

f6 >o rdrop

dpy-w @ 4 / x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
16 border ! $7FFFFFFF frame-color !
button2

also freetype-gl
48e FConstant fontsize#
atlas [IFDEF] android  "/system/fonts/DroidSans.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/LiberationSans-Regular.ttf\0" drop 
[THEN]
fontsize# texture_font_new Value font1
................................................................................

atlas [IFDEF] android  "/system/fonts/DroidSansFallback.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/gkai00mp.ttf\0" drop
[THEN]
fontsize# texture_font_new Value font2
previous

f7 >o rdrop
8 x ! dpy-h @ 4 / y ! "Dös isch a Tägscht!" text-string $!
$884400FF text-color !  font1 text-font !

f8 >o rdrop
8 x ! dpy-h @ 5 8 */ y ! "这是一个文本:在德语说" text-string $!
$004488FF text-color !  font2 text-font !



: widgets-draw ( -- )
    f1 >o draw o> f7 >o draw o> f2 >o draw o> f3 >o draw o>
    f8 >o draw o> f4 >o draw o> f5 >o draw o> f6 >o draw o> ;

: widgets-test
    <draw0 draw0>
................................................................................
    <draw2 widgets-draw draw2>
    <draw3 widgets-draw draw3>
    sync ;

also [IFDEF] android android [THEN]

: widgets-demo ( -- )  [IFDEF] hidekb  hidekb [THEN]
    1 level# +!  BEGIN  widgets-test >looper  level# @ 0= UNTIL ;



previous







<
>
>
>
|
|
|

<
>
|
|
|

<
>
|
|
|

<
>
|
|
|

<
>
|
|
|

<
>
|
|
|







 







|
|
|

|
|
|
>
>







 







|
>
>


8
9
10
11
12
13
14

15
16
17
18
19
20
21

22
23
24
25
26

27
28
29
30
31

32
33
34
35
36

37
38
39
40
41

42
43
44
45
46
47
48
49
50
51
52
..
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
..
77
78
79
80
81
82
83
84
85
86
87
88
frame new value f2
frame new value f3
frame new value f4
frame new value f5
frame new value f6
text new value f7
text new value f8



: !f1 ( -- ) f1 >o
    0 x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
    32 border ! $FFFFFFFF frame-color !
    button2 o> ;


: !f2 ( -- ) f2 >o
    dpy-w @ 2/ x ! 0 y ! dpy-w @ 2/ w ! dpy-h @ 19 20 */ d !
    32 border ! $FF7FFFFF frame-color !
    button3 o> ;


: !f3 ( -- ) f3 >o
    0 x ! dpy-h @ 2/ y ! dpy-w @ 2/ w ! dpy-h @ 2/ 2/ d !
    16 border ! $FFFF7FFF frame-color !
    button1 o> ;


: !f4 ( -- ) f4 >o
    0 x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
    32 border ! $FF7F7FFF frame-color !
    button1 o> ;


: !f5 ( -- ) f5 >o
    dpy-w @ 4 / x ! dpy-h @ 3 4 */ y ! dpy-w @ 4 / w ! dpy-h @ 5 / d !
    8 border ! $7FFF7FFF frame-color !
    button1 o> ;


: !f6 ( -- ) f6 >o
    dpy-w @ 4 / x ! 0 y ! dpy-w @ 4 / w ! dpy-h @ 2/ d !
    16 border ! $7FFFFFFF frame-color !
    button2 o> ;

also freetype-gl
48e FConstant fontsize#
atlas [IFDEF] android  "/system/fonts/DroidSans.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/LiberationSans-Regular.ttf\0" drop 
[THEN]
fontsize# texture_font_new Value font1
................................................................................

atlas [IFDEF] android  "/system/fonts/DroidSansFallback.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/gkai00mp.ttf\0" drop
[THEN]
fontsize# texture_font_new Value font2
previous

: !f7 ( -- )  f7 >o
    8 x ! dpy-h @ 4 / y ! "Dös isch a Tägscht!" text-string $!
    $884400FF text-color !  font1 text-font ! o> ;

: !f8 ( -- ) f8 >o
    8 x ! dpy-h @ 5 8 */ y ! "这是一个文本:在德语说" text-string $!
    $004488FF text-color !  font2 text-font ! o> ;

: !widgets ( -- ) !f1 !f2 !f3 !f4 !f5 !f6 !f7 !f8 ;

: widgets-draw ( -- )
    f1 >o draw o> f7 >o draw o> f2 >o draw o> f3 >o draw o>
    f8 >o draw o> f4 >o draw o> f5 >o draw o> f6 >o draw o> ;

: widgets-test
    <draw0 draw0>
................................................................................
    <draw2 widgets-draw draw2>
    <draw3 widgets-draw draw3>
    sync ;

also [IFDEF] android android [THEN]

: widgets-demo ( -- )  [IFDEF] hidekb  hidekb [THEN]
    1 level# +!  !widgets  BEGIN  widgets-test >looper
	need-sync @ IF  !widgets  need-sync off  THEN
    level# @ 0= UNTIL  need-sync on ;

previous