UI fixes
parent
58c0337d10
commit
b87d1b1973
|
@ -21,12 +21,6 @@
|
|||
- yield in a loop starves i/o
|
||||
- "localhost" 50 <client> won't fail
|
||||
|
||||
+ objective C/cocoa:
|
||||
|
||||
- super message sends
|
||||
super-> [foo]...
|
||||
- core foundation should use unicode strings
|
||||
|
||||
+ ui/help:
|
||||
|
||||
- speed up ideas:
|
||||
|
@ -39,7 +33,6 @@
|
|||
- hang with multiple windows
|
||||
- incremental layout flicker
|
||||
- expired aliens in view hash
|
||||
- unregister notifications and the view in dealloc
|
||||
- changelog in the UI
|
||||
- make the UI look better, something like this:
|
||||
http://twb.ath.cx/~twb/darcs/OBSOLETE/factor/final.html
|
||||
|
@ -57,6 +50,7 @@
|
|||
|
||||
+ compiler/ffi:
|
||||
|
||||
- core foundation should use unicode strings
|
||||
- improve callback efficiency
|
||||
- alien>utf16-string, utf16-string>alien words
|
||||
- float intrinsics
|
||||
|
|
|
@ -39,6 +39,10 @@ objc-NSNotificationCenter objc-NSObject objc-NSView threads ;
|
|||
>r >r >r >r NSNotificationCenter [defaultCenter] r> r>
|
||||
sel_registerName r> r> [addObserver:selector:name:object:] ;
|
||||
|
||||
: remove-observer ( observer -- )
|
||||
>r NSNotificationCenter [defaultCenter] r>
|
||||
[removeObserver:] ;
|
||||
|
||||
: finish-launching ( -- )
|
||||
NSApplication [sharedApplication] [finishLaunching] ;
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
! Copyright (C) 2006 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
IN: objc-FactorView
|
||||
DEFER: FactorView
|
||||
|
||||
USING: arrays cocoa errors freetype gadgets gadgets-launchpad
|
||||
gadgets-layouts gadgets-listener gadgets-panes hashtables kernel
|
||||
lists math namespaces objc objc-NSApplication objc-NSEvent
|
||||
|
@ -8,9 +11,6 @@ sequences threads ;
|
|||
|
||||
! Cocoa backend for Factor UI
|
||||
|
||||
IN: objc-FactorView
|
||||
DEFER: FactorView
|
||||
|
||||
IN: gadgets-cocoa
|
||||
|
||||
! Hash mapping aliens to gadgets
|
||||
|
@ -18,12 +18,6 @@ SYMBOL: views
|
|||
|
||||
H{ } clone views set-global
|
||||
|
||||
: register-view ( world -- )
|
||||
dup world-handle views get set-hash ;
|
||||
|
||||
: unregister-view ( world -- )
|
||||
world-handle views get remove-hash ;
|
||||
|
||||
: view ( handle -- world ) views get hash ;
|
||||
|
||||
: mouse-location ( view event -- loc )
|
||||
|
@ -140,19 +134,30 @@ H{ } clone views set-global
|
|||
[ 2drop 1 ]
|
||||
}
|
||||
|
||||
{ "init" "id" { "id" "SEL" }
|
||||
[
|
||||
drop
|
||||
SUPER-> [init]
|
||||
dup "updateFactorGadgetSize:" add-resize-observer
|
||||
]
|
||||
}
|
||||
|
||||
{ "dealloc" "void" { "id" "SEL" }
|
||||
[
|
||||
drop
|
||||
dup view dup remove-notify free-fonts
|
||||
dup view close-world
|
||||
dup views get remove-hash
|
||||
dup remove-observer
|
||||
SUPER-> [dealloc]
|
||||
]
|
||||
}
|
||||
} { } define-objc-class
|
||||
|
||||
: register-view ( world -- )
|
||||
dup world-handle views get set-hash ;
|
||||
|
||||
: <FactorView> ( gadget -- view )
|
||||
FactorView over rect-dim <GLView>
|
||||
dup "updateFactorGadgetSize:" add-resize-observer
|
||||
[ over set-world-handle dup add-notify register-view ] keep ;
|
||||
|
||||
: <FactorWindow> ( gadget title -- window )
|
||||
|
|
|
@ -88,7 +88,7 @@ V{ } clone hand-buttons set-global
|
|||
#! Show a message in the status bar.
|
||||
world-status [ set-label-text* ] [ drop ] if* ;
|
||||
|
||||
: update-help ( -- string )
|
||||
: update-help ( -- )
|
||||
#! Update mouse-over help message.
|
||||
hand-gadget get-global parents [ relevant-help ] keep
|
||||
dup empty? [ 2drop ] [ peek show-message ] if ;
|
||||
|
@ -107,11 +107,6 @@ V{ } clone hand-buttons set-global
|
|||
#! Called when a gadget is removed or added.
|
||||
hand-loc get-global swap move-hand ;
|
||||
|
||||
: layout-done ( gadget -- )
|
||||
find-world [
|
||||
dup update-hand world-handle repaint-handle
|
||||
] when* ;
|
||||
|
||||
: layout-queued ( -- )
|
||||
invalid dup queue-empty?
|
||||
[ drop ] [ deque dup layout layout-done layout-queued ] if ;
|
||||
[ drop ] [ deque dup layout repaint layout-queued ] if ;
|
||||
|
|
Loading…
Reference in New Issue