Check-in [293240b31b]
Not logged in

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

Overview
Comment:Slideshow finetuning
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 293240b31bcb3758e88b2068e53da5bfd65acd2b
User & Date: bernd 2014-01-23 16:05:54.340
Context
2014-03-21
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
15:35
Fixed scrolling check-in: ff69bb0126 user: bernd tags: trunk
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to gl-slideshow.fs.
215
216
217
218
219
220
221
222

223
224
225

226
227

228
229
230

231
232
233




234
235
236


237
238
239
240

241
242

243
244
245

246
247
248



249
250
251
252
253
254
255


256
257
258
259
260
261
262
215
216
217
218
219
220
221

222
223
224

225
226

227
228
229
230
231
232


233
234
235
236
237


238
239
240
241
242

243
244
245
246
247


248
249


250
251
252
253
254
255
256
257


258
259
260
261
262
263
264
265
266







-
+


-
+

-
+



+

-
-
+
+
+
+

-
-
+
+



-
+


+

-
-
+

-
-
+
+
+





-
-
+
+







	    0 of  !click  endof
	endcase
    THEN
    rdrop ;

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

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

: thumb-input ( -- )
: up-down ( -- )
    ekey? IF  ekey case
	    k-up    of  [ thumb# dup * negate ]L thumb-slide  endof
	    k-down  of  [ thumb# dup *        ]L thumb-slide  endof
	    #esc    of  -1 level# +!                          endof
	endcase
    THEN
    >looper ?esc
    THEN ;

: thumb-input ( -- ) up-down
    >looper
    *input >r r@ IF
	case  r@ action @  r@ action on
	    1 ( AMOTION_EVENT_ACTION_UP ) of
	r@ action @
	case  1 of
		short? IF
		    thumb# dup click-regions
		    thumb# * + current-slide +!
		    -1 level# +!  (reshow)  1 level# +!
		    (reshow)  1 level# +!
		    0 thumb-slide
		THEN
		r@ action on
	    endof
	    0 of  !click  r@ y0 @ last-y0 !  endof
	    2 of
	    abs 1 <> IF
		thumb# r@ y0 @ last-y0 motion-y0 ['] +thumb-slide do-motion
	    endof
	    last-y0 motion-y0 ['] +thumb-slide drag-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
    slideshow-init 0 thumb-slide
    1 level# +! BEGIN  prefetch-thumb  thumb-input  level# @ 0= UNTIL ;
    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

Changes to gl-terminal.fs.
250
251
252
253
254
255
256
257

258
259
260
261
262
263
264
250
251
252
253
254
255
256

257
258
259
260
261
262
263
264







-
+







: show-cursor ( -- )  need-show @ 0= ?EXIT
    rows kbflag @ IF  dup 10 / - 14 -  THEN >r
    gl-xy @ scroll-y @ dup r@ + within 0= IF
       gl-xy @ 1+ r@ - 0 max s>f set-scroll
    THEN  rdrop  need-show off ;

[IFUNDEF] win : win app window @ ; [THEN]
: screen-sync ( -- )  need-sync @ win and IF
: screen-sync ( -- )  need-sync @ win and level# @ 0<= and IF
	show-cursor screen->gl need-sync off  THEN ;

: config-changer ( -- )
    getwh  >screen-orientation
    need-sync on ;
\    ." config changed to: " w ? h ? cr

291
292
293
294
295
296
297
298

299
300

301
302
303
304
305
306
307
291
292
293
294
295
296
297

298


299
300
301
302
303
304
305
306







-
+
-
-
+







	    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 ) screen-sync
:noname ( flag -- flag ) level# @ 0> ?EXIT
\    [: touch>event screen-slide ;] is android-touch
    screen-slide scroll-slide ; IS screen-ops
    screen-sync screen-slide scroll-slide ; IS screen-ops

' gl-type ' gl-emit ' gl-cr ' gl-form output: >screen

>screen
' gl-atxy IS at-xy
' gl-at-deltaxy IS at-deltaxy
' gl-page IS page
Changes to gles2/android.fs.
189
190
191
192
193
194
195

196

197
198
199
200
201
202
203
189
190
191
192
193
194
195
196

197
198
199
200
201
202
203
204







+
-
+







: ?looper  BEGIN  >looper  app window @ UNTIL ;
	    
\ : >looper  BEGIN  0 poll_looper 0<  UNTIL looper-to# poll_looper drop ;
\ : ?looper  BEGIN >looper app window @ UNTIL ;

:noname  0 poll? drop  defers key? ; IS key?
Defer screen-ops ' noop IS screen-ops
:noname
:noname  need-show on  BEGIN  >looper key? screen-ops  UNTIL
    need-show on  BEGIN  >looper key? screen-ops  UNTIL
    defers key dup #cr = key? and IF  key ?dup-IF unkey THEN THEN ;
IS key

: enum dup Constant 1+ ;
0
enum APP_CMD_INPUT_CHANGED
enum APP_CMD_INIT_WINDOW
Changes to gles2/gl-terminal.fs.
250
251
252
253
254
255
256
257

258
259
260
261
262
263
264
250
251
252
253
254
255
256

257
258
259
260
261
262
263
264







-
+







: show-cursor ( -- )  need-show @ 0= ?EXIT
    rows kbflag @ IF  dup 10 / - 14 -  THEN >r
    gl-xy @ scroll-y @ dup r@ + within 0= IF
       gl-xy @ 1+ r@ - 0 max s>f set-scroll
    THEN  rdrop  need-show off ;

[IFUNDEF] win : win app window @ ; [THEN]
: screen-sync ( -- )  need-sync @ win and IF
: screen-sync ( -- )  need-sync @ win and level# @ 0<= and IF
	show-cursor screen->gl need-sync off  THEN ;

: config-changer ( -- )
    getwh  >screen-orientation
    need-sync on ;
\    ." config changed to: " w ? h ? cr

291
292
293
294
295
296
297
298

299
300

301
302
303
304
305
306
307
291
292
293
294
295
296
297

298


299
300
301
302
303
304
305
306







-
+
-
-
+







	    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 ) screen-sync
:noname ( flag -- flag ) level# @ 0> ?EXIT
\    [: touch>event screen-slide ;] is android-touch
    screen-slide scroll-slide ; IS screen-ops
    screen-sync screen-slide scroll-slide ; IS screen-ops

' gl-type ' gl-emit ' gl-cr ' gl-form output: >screen

>screen
' gl-atxy IS at-xy
' gl-at-deltaxy IS at-deltaxy
' gl-page IS page