From 22c0257dbe11cea9cac659c93b1de222e893fc53 Mon Sep 17 00:00:00 2001 From: slava Date: Sat, 1 Apr 2006 01:16:03 +0000 Subject: [PATCH] Clear out expired aliens in Cocoa UI startup --- TODO.FACTOR.txt | 6 +++--- library/cocoa/ui.factor | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 959ae4d4ff..6930251b8f 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,17 +1,15 @@ should fix in 0.82: +- 3 >n fep - amd64 %box-struct - get factor running on mac intel - when generating a 32-bit image on a 64-bit system, large numbers which should be bignums become fixnums - httpd fep -- expired aliens in view hash - clicks sent twice - speed up ideas: - only do clipping for certain gadgets - use glRect -- remove , , set-char*-nth, set-ushort*-nth since they - have incorrect semantics - cocoa: global menu bar with useful commands + portability: @@ -58,6 +56,8 @@ should fix in 0.82: - core foundation should use unicode strings - alien>utf16-string, utf16-string>alien words - can only be called with an alien? +- remove , , set-char*-nth, set-ushort*-nth since they + have incorrect semantics - improve callback efficiency - float intrinsics - complex float type diff --git a/library/cocoa/ui.factor b/library/cocoa/ui.factor index fb0ba981e2..0dc64f8d63 100644 --- a/library/cocoa/ui.factor +++ b/library/cocoa/ui.factor @@ -3,11 +3,11 @@ 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 -objc-NSObject objc-NSOpenGLContext objc-NSOpenGLView objc-NSView -objc-NSWindow sequences threads ; +USING: alien arrays cocoa errors freetype gadgets +gadgets-launchpad gadgets-layouts gadgets-listener gadgets-panes +hashtables kernel lists math namespaces objc objc-NSApplication +objc-NSEvent objc-NSObject objc-NSOpenGLContext +objc-NSOpenGLView objc-NSView objc-NSWindow sequences threads ; ! Cocoa backend for Factor UI @@ -18,6 +18,9 @@ SYMBOL: views H{ } clone views set-global +: purge-expired ( hash -- hash ) + [ drop expired? not ] hash-subset ; + : view ( handle -- world ) views get hash ; : mouse-location ( view event -- loc ) @@ -189,6 +192,7 @@ IN: shells [ [ init-ui + purge-expired launchpad-window listener-window finish-launching