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
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

Changes to gl-slideshow.fs.

   215    215   	    0 of  !click  endof
   216    216   	endcase
   217    217       THEN
   218    218       rdrop ;
   219    219   
   220    220   : (reshow) ( -- )
   221    221       0e >y-pos <draw-slide current-slide @ draw-slide draw-slide>
   222         -    1 level# +! BEGIN  prefetch slide-input  level# @ 0= UNTIL ;
          222  +    BEGIN  prefetch slide-input  level# @ 0= UNTIL ;
   223    223   
   224    224   : reshow ( -- ) [IFDEF] android  kbflag @ IF  togglekb  THEN [THEN]
   225         -    slideshow-init (reshow) ;
          225  +    1 level# +! slideshow-init (reshow) ;
   226    226   
   227         -: thumb-input ( -- )
          227  +: up-down ( -- )
   228    228       ekey? IF  ekey case
   229    229   	    k-up    of  [ thumb# dup * negate ]L thumb-slide  endof
   230    230   	    k-down  of  [ thumb# dup *        ]L thumb-slide  endof
          231  +	    #esc    of  -1 level# +!                          endof
   231    232   	endcase
   232         -    THEN
   233         -    >looper ?esc
          233  +    THEN ;
          234  +
          235  +: thumb-input ( -- ) up-down
          236  +    >looper
   234    237       *input >r r@ IF
   235         -	case  r@ action @  r@ action on
   236         -	    1 ( AMOTION_EVENT_ACTION_UP ) of
          238  +	r@ action @
          239  +	case  1 of
   237    240   		short? IF
   238    241   		    thumb# dup click-regions
   239    242   		    thumb# * + current-slide +!
   240         -		    -1 level# +!  (reshow)  1 level# +!
          243  +		    (reshow)  1 level# +!
   241    244   		    0 thumb-slide
   242    245   		THEN
          246  +		r@ action on
   243    247   	    endof
   244         -	    0 of  !click  r@ y0 @ last-y0 !  endof
   245         -	    2 of
          248  +	    abs 1 <> IF
   246    249   		thumb# r@ y0 @ last-y0 motion-y0 ['] +thumb-slide do-motion
   247         -	    endof
   248         -	    last-y0 motion-y0 ['] +thumb-slide drag-motion
          250  +	    ELSE
          251  +		last-y0 motion-y0 ['] +thumb-slide drag-motion
          252  +	    THEN  0
   249    253   	endcase
   250    254       THEN
   251    255       rdrop ;
   252    256   
   253    257   : rethumb ( -- ) [IFDEF] android  kbflag @ IF  togglekb  THEN [THEN] 0e >y-pos
   254         -    slideshow-init 0 thumb-slide
   255         -    1 level# +! BEGIN  prefetch-thumb  thumb-input  level# @ 0= UNTIL ;
          258  +    1 level# +! slideshow-init 0 thumb-slide
          259  +    BEGIN  prefetch-thumb  thumb-input  level# @ 0= UNTIL ;
   256    260   : slide-show ( addr u -- )
   257    261       slidelist $[]slurp-file current-slide off reshow ;
   258    262   : thumb-show ( addr u -- )
   259    263       slidelist $[]slurp-file current-slide off rethumb ;
   260    264   
   261    265   previous previous
   262    266   
   263    267   \ s" slide.lst" slide-show

Changes to gl-terminal.fs.

   250    250   : show-cursor ( -- )  need-show @ 0= ?EXIT
   251    251       rows kbflag @ IF  dup 10 / - 14 -  THEN >r
   252    252       gl-xy @ scroll-y @ dup r@ + within 0= IF
   253    253          gl-xy @ 1+ r@ - 0 max s>f set-scroll
   254    254       THEN  rdrop  need-show off ;
   255    255   
   256    256   [IFUNDEF] win : win app window @ ; [THEN]
   257         -: screen-sync ( -- )  need-sync @ win and IF
          257  +: screen-sync ( -- )  need-sync @ win and level# @ 0<= and IF
   258    258   	show-cursor screen->gl need-sync off  THEN ;
   259    259   
   260    260   : config-changer ( -- )
   261    261       getwh  >screen-orientation
   262    262       need-sync on ;
   263    263   \    ." config changed to: " w ? h ? cr
   264    264   
................................................................................
   291    291   	    1 of  ?toggle  r@ action on  endof
   292    292   	    abs 1 <> IF  r@ y0 @ scrolling  
   293    293   	    ELSE  last-y0 motion-y0 ['] +scroll drag-motion  THEN
   294    294   	    0
   295    295   	endcase
   296    296       THEN  rdrop ;
   297    297   
   298         -:noname ( flag -- flag ) screen-sync
   299         -\    [: touch>event screen-slide ;] is android-touch
   300         -    screen-slide scroll-slide ; IS screen-ops
          298  +:noname ( flag -- flag ) level# @ 0> ?EXIT
          299  +    screen-sync screen-slide scroll-slide ; IS screen-ops
   301    300   
   302    301   ' gl-type ' gl-emit ' gl-cr ' gl-form output: >screen
   303    302   
   304    303   >screen
   305    304   ' gl-atxy IS at-xy
   306    305   ' gl-at-deltaxy IS at-deltaxy
   307    306   ' gl-page IS page

Changes to gles2/android.fs.

   189    189   : ?looper  BEGIN  >looper  app window @ UNTIL ;
   190    190   	    
   191    191   \ : >looper  BEGIN  0 poll_looper 0<  UNTIL looper-to# poll_looper drop ;
   192    192   \ : ?looper  BEGIN >looper app window @ UNTIL ;
   193    193   
   194    194   :noname  0 poll? drop  defers key? ; IS key?
   195    195   Defer screen-ops ' noop IS screen-ops
   196         -:noname  need-show on  BEGIN  >looper key? screen-ops  UNTIL
          196  +:noname
          197  +    need-show on  BEGIN  >looper key? screen-ops  UNTIL
   197    198       defers key dup #cr = key? and IF  key ?dup-IF unkey THEN THEN ;
   198    199   IS key
   199    200   
   200    201   : enum dup Constant 1+ ;
   201    202   0
   202    203   enum APP_CMD_INPUT_CHANGED
   203    204   enum APP_CMD_INIT_WINDOW

Changes to gles2/gl-terminal.fs.

   250    250   : show-cursor ( -- )  need-show @ 0= ?EXIT
   251    251       rows kbflag @ IF  dup 10 / - 14 -  THEN >r
   252    252       gl-xy @ scroll-y @ dup r@ + within 0= IF
   253    253          gl-xy @ 1+ r@ - 0 max s>f set-scroll
   254    254       THEN  rdrop  need-show off ;
   255    255   
   256    256   [IFUNDEF] win : win app window @ ; [THEN]
   257         -: screen-sync ( -- )  need-sync @ win and IF
          257  +: screen-sync ( -- )  need-sync @ win and level# @ 0<= and IF
   258    258   	show-cursor screen->gl need-sync off  THEN ;
   259    259   
   260    260   : config-changer ( -- )
   261    261       getwh  >screen-orientation
   262    262       need-sync on ;
   263    263   \    ." config changed to: " w ? h ? cr
   264    264   
................................................................................
   291    291   	    1 of  ?toggle  r@ action on  endof
   292    292   	    abs 1 <> IF  r@ y0 @ scrolling  
   293    293   	    ELSE  last-y0 motion-y0 ['] +scroll drag-motion  THEN
   294    294   	    0
   295    295   	endcase
   296    296       THEN  rdrop ;
   297    297   
   298         -:noname ( flag -- flag ) screen-sync
   299         -\    [: touch>event screen-slide ;] is android-touch
   300         -    screen-slide scroll-slide ; IS screen-ops
          298  +:noname ( flag -- flag ) level# @ 0> ?EXIT
          299  +    screen-sync screen-slide scroll-slide ; IS screen-ops
   301    300   
   302    301   ' gl-type ' gl-emit ' gl-cr ' gl-form output: >screen
   303    302   
   304    303   >screen
   305    304   ' gl-atxy IS at-xy
   306    305   ' gl-at-deltaxy IS at-deltaxy
   307    306   ' gl-page IS page