Merge git://factorcode.org/git/factor

release
Doug Coleman 2007-11-24 21:17:51 -06:00
commit 6e6ef7f9a8
5 changed files with 23 additions and 23 deletions

View File

@ -19,7 +19,7 @@ SYMBOL: stop-after-last-window?
: event-loop ( -- ) : event-loop ( -- )
event-loop? [ event-loop? [
[ [
[ NSApp do-events ui-step ] ui-try [ NSApp do-events ui-step 10 sleep ] ui-try
] with-autorelease-pool event-loop ] with-autorelease-pool event-loop
] when ; ] when ;

View File

@ -2,11 +2,10 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: classes continuations help help.topics kernel models USING: classes continuations help help.topics kernel models
sequences ui ui.backend ui.tools.debugger ui.gadgets sequences ui ui.backend ui.tools.debugger ui.gadgets
ui.gadgets.books ui.gadgets.buttons ui.gadgets.books ui.gadgets.buttons ui.gadgets.labelled
ui.gadgets.labelled ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks
ui.gadgets.tracks ui.gadgets.worlds ui.gadgets.presentations ui.gadgets.worlds ui.gadgets.presentations ui.gadgets.status-bar
ui.gadgets.status-bar ui.commands ui.gestures assocs arrays ui.commands ui.gestures assocs arrays namespaces ;
namespaces ;
IN: ui.tools.workspace IN: ui.tools.workspace
TUPLE: workspace book listener popup ; TUPLE: workspace book listener popup ;

View File

@ -65,18 +65,6 @@ M: world ungraft*
dup world-handle (close-window) dup world-handle (close-window)
reset-world ; reset-world ;
: open-world-window ( world -- )
dup pref-dim over set-gadget-dim dup relayout graft ;
: open-window ( gadget title -- )
>r [ 1 track, ] { 0 1 } make-track r>
f <world> open-world-window ;
HOOK: close-window ui-backend ( gadget -- )
M: object close-window
find-world [ ungraft ] when* ;
: find-window ( quot -- world ) : find-window ( quot -- world )
windows get values windows get values
[ gadget-child swap call ] curry* find-last nip ; inline [ gadget-child swap call ] curry* find-last nip ; inline
@ -148,9 +136,20 @@ SYMBOL: ui-hook
notify-queued notify-queued
layout-queued layout-queued
redraw-worlds redraw-worlds
10 sleep
] assert-depth ; ] assert-depth ;
: open-world-window ( world -- )
dup pref-dim over set-gadget-dim dup relayout graft ui-step ;
: open-window ( gadget title -- )
>r [ 1 track, ] { 0 1 } make-track r>
f <world> open-world-window ;
HOOK: close-window ui-backend ( gadget -- )
M: object close-window
find-world [ ungraft ] when* ;
: start-ui ( -- ) : start-ui ( -- )
init-timers init-timers
restore-windows? [ restore-windows? [

View File

@ -94,8 +94,7 @@ SYMBOL: mouse-captured
3drop window draw-world ; 3drop window draw-world ;
: handle-wm-size ( hWnd uMsg wParam lParam -- ) : handle-wm-size ( hWnd uMsg wParam lParam -- )
[ lo-word ] keep hi-word make-RECT get-RECT-dimensions 2array [ lo-word ] keep hi-word make-RECT get-RECT-dimensions 2array 2nip
2nip
dup { 0 0 } = [ 2drop ] [ swap window set-gadget-dim ui-step ] if ; dup { 0 0 } = [ 2drop ] [ swap window set-gadget-dim ui-step ] if ;
: wm-keydown-codes ( -- key ) : wm-keydown-codes ( -- key )
@ -348,7 +347,10 @@ M: windows-ui-backend (close-window)
: event-loop ( msg -- ) : event-loop ( msg -- )
{ {
{ [ windows get empty? ] [ drop ] } { [ windows get empty? ] [ drop ] }
{ [ dup peek-message? ] [ >r [ ui-step ] ui-try r> event-loop ] } { [ dup peek-message? ] [
>r [ ui-step 10 sleep ] ui-try
r> event-loop
] }
{ [ dup MSG-message WM_QUIT = ] [ drop ] } { [ dup MSG-message WM_QUIT = ] [ drop ] }
{ [ t ] [ { [ t ] [
dup TranslateMessage drop dup TranslateMessage drop

View File

@ -178,7 +178,7 @@ M: world client-event
next-event dup next-event dup
None XFilterEvent zero? [ drop wait-event ] unless None XFilterEvent zero? [ drop wait-event ] unless
] [ ] [
ui-step wait-event ui-step 10 sleep wait-event
] if ; ] if ;
: do-events ( -- ) : do-events ( -- )