From: Eduardo Cavazos Date: Mon, 22 Dec 2008 23:20:35 +0000 (-0600) Subject: Remove unmaintained/tiling X-Git-Tag: 0.94~1877^2~285^2~1 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=62e1accad5bc84264d22425567503c04a40ea465 Remove unmaintained/tiling --- diff --git a/unmaintained/tiling/tiling.factor b/unmaintained/tiling/tiling.factor deleted file mode 100644 index cf6ea7f48e..0000000000 --- a/unmaintained/tiling/tiling.factor +++ /dev/null @@ -1,153 +0,0 @@ - -USING: kernel sequences math math.order - ui.gadgets ui.gadgets.tracks ui.gestures - bake.fry accessors ; - -IN: ui.gadgets.tiling - -TUPLE: tiling < track gadgets tiles first focused ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: init-tiling ( tiling -- tiling ) - init-track - { 1 0 } >>orientation - V{ } clone >>gadgets - 2 >>tiles - 0 >>first - 0 >>focused ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: ( -- gadget ) tiling new init-tiling ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: bounded-subseq ( seq a b -- seq ) - [ 0 max ] dip - pick length [ min ] curry bi@ - rot - subseq ; - -: tiling-gadgets-to-map ( tiling -- gadgets ) - [ gadgets>> ] - [ first>> ] - [ [ first>> ] [ tiles>> ] bi + ] - tri - bounded-subseq ; - -: tiling-map-gadgets ( tiling -- tiling ) - dup clear-track - dup tiling-gadgets-to-map [ 1 track-add ] each ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: tiling-add ( tiling gadget -- tiling ) - over gadgets>> push - tiling-map-gadgets ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: first-gadget ( tiling -- index ) drop 0 ; - -: last-gadget ( tiling -- index ) gadgets>> length 1 - ; - -: first-viewable ( tiling -- index ) first>> ; - -: last-viewable ( tiling -- index ) [ first>> ] [ tiles>> ] bi + 1 - ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: make-focused-mapped ( tiling -- tiling ) - - dup [ focused>> ] [ first>> ] bi < - [ dup first>> 1 - >>first ] - [ ] - if - - dup [ last-viewable ] [ focused>> ] bi < - [ dup first>> 1 + >>first ] - [ ] - if ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: check-focused-bounds ( tiling -- tiling ) - dup focused>> 0 max over gadgets>> length 1 - min >>focused ; - -: focus-prev ( tiling -- tiling ) - dup focused>> 1 - >>focused - check-focused-bounds - make-focused-mapped - tiling-map-gadgets - dup request-focus ; - -: focus-next ( tiling -- tiling ) - dup focused>> 1 + >>focused - check-focused-bounds - make-focused-mapped - tiling-map-gadgets - dup request-focus ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: exchanged! ( seq a b -- ) - [ 0 max ] bi@ - pick length 1 - '[ _ min ] bi@ - rot exchange ; - -: move-prev ( tiling -- tiling ) - dup [ gadgets>> ] [ focused>> 1 - ] [ focused>> ] tri exchanged! - focus-prev ; - -: move-next ( tiling -- tiling ) - dup [ gadgets>> ] [ focused>> ] [ focused>> 1 + ] tri exchanged! - focus-next ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: add-tile ( tiling -- tiling ) - dup tiles>> 1 + >>tiles - tiling-map-gadgets ; - -: del-tile ( tiling -- tiling ) - dup tiles>> 1 - 1 max >>tiles - tiling-map-gadgets ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -M: tiling focusable-child* ( tiling -- child/t ) - [ focused>> ] [ gadgets>> ] bi nth ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -TUPLE: tiling-shelf < tiling ; -TUPLE: tiling-pile < tiling ; - -: ( -- gadget ) - tiling-shelf new init-tiling { 1 0 } >>orientation ; - -: ( -- gadget ) - tiling-pile new init-tiling { 0 1 } >>orientation ; - -tiling-shelf - H{ - { T{ key-down f { A+ } "LEFT" } [ focus-prev drop ] } - { T{ key-down f { A+ } "RIGHT" } [ focus-next drop ] } - { T{ key-down f { S+ A+ } "LEFT" } [ move-prev drop ] } - { T{ key-down f { S+ A+ } "RIGHT" } [ move-next drop ] } - { T{ key-down f { C+ } "[" } [ del-tile drop ] } - { T{ key-down f { C+ } "]" } [ add-tile drop ] } - } -set-gestures - -tiling-pile - H{ - { T{ key-down f { A+ } "UP" } [ focus-prev drop ] } - { T{ key-down f { A+ } "DOWN" } [ focus-next drop ] } - { T{ key-down f { S+ A+ } "UP" } [ move-prev drop ] } - { T{ key-down f { S+ A+ } "DOWN" } [ move-next drop ] } - { T{ key-down f { C+ } "[" } [ del-tile drop ] } - { T{ key-down f { C+ } "]" } [ add-tile drop ] } - } -set-gestures