fix usages of cond/case
							parent
							
								
									f61d5a52d1
								
							
						
					
					
						commit
						1e01d73e61
					
				| 
						 | 
				
			
			@ -55,7 +55,7 @@ C: <button-paint> button-paint
 | 
			
		|||
        { [ dup button-pressed? ] [ drop button-paint-pressed ] }
 | 
			
		||||
        { [ dup button-selected? ] [ drop button-paint-selected ] }
 | 
			
		||||
        { [ dup button-rollover? ] [ drop button-paint-rollover ] }
 | 
			
		||||
        { [ t ] [ drop button-paint-plain ] }
 | 
			
		||||
        [ drop button-paint-plain ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
M: button-paint draw-interior
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -378,7 +378,7 @@ SYMBOL: in-layout?
 | 
			
		|||
    {
 | 
			
		||||
        { [ 2dup eq? ] [ 2drop t ] }
 | 
			
		||||
        { [ dup not ] [ 2drop f ] }
 | 
			
		||||
        { [ t ] [ gadget-parent child? ] }
 | 
			
		||||
        [ gadget-parent child? ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
GENERIC: focusable-child* ( gadget -- child/t )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -88,7 +88,7 @@ C: <pane-stream> pane-stream
 | 
			
		|||
    dup gadget-children {
 | 
			
		||||
        { [ dup empty? ] [ 2drop "" <label> ] }
 | 
			
		||||
        { [ dup length 1 = ] [ nip first ] }
 | 
			
		||||
        { [ t ] [ drop ] }
 | 
			
		||||
        [ drop ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
: smash-pane ( pane -- gadget ) pane-output smash-line ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -119,7 +119,7 @@ scroller H{
 | 
			
		|||
        { [ dup t eq? ] [ drop (scroll>bottom) ] }
 | 
			
		||||
        { [ dup rect? ] [ swap (scroll>rect) ] }
 | 
			
		||||
        { [ dup ] [ swap (scroll>gadget) ] }
 | 
			
		||||
        { [ t ] [ drop dup scroller-value swap scroll ] }
 | 
			
		||||
        [ drop dup scroller-value swap scroll ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
M: scroller layout*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -191,7 +191,7 @@ SYMBOL: drag-timer
 | 
			
		|||
        { [ multi-click-button?   not ] [ f ] }
 | 
			
		||||
        { [ multi-click-position? not ] [ f ] }
 | 
			
		||||
        { [ multi-click-position? not ] [ f ] }
 | 
			
		||||
        { [ t ] [ t ] }
 | 
			
		||||
        [ t ]
 | 
			
		||||
    } cond nip ;
 | 
			
		||||
 | 
			
		||||
: update-click# ( button -- )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,7 +80,7 @@ DEFER: draw-gadget
 | 
			
		|||
    {
 | 
			
		||||
        { [ dup gadget-visible? not ] [ drop ] }
 | 
			
		||||
        { [ dup gadget-clipped? not ] [ (draw-gadget) ] }
 | 
			
		||||
        { [ t ] [ [ (draw-gadget) ] with-clipping ] }
 | 
			
		||||
        [ [ (draw-gadget) ] with-clipping ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
! Pen paint properties
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -145,17 +145,17 @@ M: interactor stream-read-partial
 | 
			
		|||
    tuck try-parse {
 | 
			
		||||
        { [ dup quotation? ] [ nip t ] }
 | 
			
		||||
        { [ dup not ] [ drop "\n" swap user-input f f ] }
 | 
			
		||||
        { [ t ] [ handle-parse-error f f ] }
 | 
			
		||||
        [ handle-parse-error f f ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
M: interactor stream-read-quot
 | 
			
		||||
    [ interactor-yield ] keep {
 | 
			
		||||
        { [ over not ] [ drop ] }
 | 
			
		||||
        { [ over callable? ] [ drop ] }
 | 
			
		||||
        { [ t ] [
 | 
			
		||||
        [
 | 
			
		||||
            [ handle-interactive ] keep swap
 | 
			
		||||
            [ interactor-finish ] [ nip stream-read-quot ] if
 | 
			
		||||
        ] }
 | 
			
		||||
        ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
M: interactor pref-dim*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -119,7 +119,7 @@ M: tuple-dispatch-engine-word word-completion-string
 | 
			
		|||
    {
 | 
			
		||||
        { [ dup not ] [ 2drop ] }
 | 
			
		||||
        { [ 2dup memq? ] [ 2drop ] }
 | 
			
		||||
        { [ t ] [ push ] }
 | 
			
		||||
        [ push ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
: insert-word ( word -- )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -81,7 +81,7 @@ walker-gadget "toolbar" f {
 | 
			
		|||
    {
 | 
			
		||||
        { [ dup walker-gadget? not ] [ 2drop f ] }
 | 
			
		||||
        { [ dup walker-gadget-closing? ] [ 2drop f ] }
 | 
			
		||||
        { [ t ] [ walker-gadget-thread eq? ] }
 | 
			
		||||
        [ walker-gadget-thread eq? ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
: find-walker-window ( thread -- world/f )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,7 +70,7 @@ DEFER: (gadget-subtree)
 | 
			
		|||
        { [ pick empty? ] [ rot drop traverse-to-path ] }
 | 
			
		||||
        { [ over empty? ] [ nip traverse-from-path ] }
 | 
			
		||||
        { [ pick first pick first = ] [ traverse-child ] }
 | 
			
		||||
        { [ t ] [ traverse-middle ] }
 | 
			
		||||
        [ traverse-middle ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
: gadget-subtree ( frompath topath gadget -- seq )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -381,11 +381,11 @@ SYMBOL: trace-messages?
 | 
			
		|||
        { [ windows get empty? ] [ drop ] }
 | 
			
		||||
        { [ dup peek-message? ] [ ui-wait event-loop ] }
 | 
			
		||||
        { [ dup MSG-message WM_QUIT = ] [ drop ] }
 | 
			
		||||
        { [ t ] [
 | 
			
		||||
        [
 | 
			
		||||
            dup TranslateMessage drop
 | 
			
		||||
            dup DispatchMessage drop
 | 
			
		||||
            event-loop
 | 
			
		||||
        ] }
 | 
			
		||||
        ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
: register-wndclassex ( -- class )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -133,7 +133,7 @@ M: world selection-notify-event
 | 
			
		|||
    {
 | 
			
		||||
        { [ dup XA_PRIMARY = ] [ drop selection get ] }
 | 
			
		||||
        { [ dup XA_CLIPBOARD = ] [ drop clipboard get ] }
 | 
			
		||||
        { [ t ] [ drop <clipboard> ] }
 | 
			
		||||
        [ drop <clipboard> ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
: encode-clipboard ( string type -- bytes )
 | 
			
		||||
| 
						 | 
				
			
			@ -156,7 +156,7 @@ M: world selection-request-event
 | 
			
		|||
        { [ dup supported-type? ] [ drop dup set-selection-prop send-notify-success ] }
 | 
			
		||||
        { [ dup "TARGETS" x-atom = ] [ drop dup set-targets-prop send-notify-success ] }
 | 
			
		||||
        { [ dup "TIMESTAMP" x-atom = ] [ drop dup set-timestamp-prop send-notify-success ] }
 | 
			
		||||
        { [ t ] [ drop send-notify-failure ] }
 | 
			
		||||
        [ drop send-notify-failure ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
M: x11-ui-backend (close-window) ( handle -- )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue