diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 8002133597..704fdfe067 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,6 +1,17 @@ + 0.85: +- listener toolbar is too wide - font corruption now that books don't add/remove their children +- doc sweep +- tool help button in every tool's toolbar +- keyboard help: hide commands whose gestures are shadowed +- the editor should fill up the interior of the scroller completely +- words: + - S+left: reload + - S+right: inspect +- links: + - same deal + - pane output in UI should use less memory - signal 4 on datastack underflow on mac intel?? - buffer-ptr should be an alien @@ -22,25 +33,15 @@ space - we have trouble drawing rectangles - ui browser: show currently selected vocab & words -- the editor should fill up the interior of the scroller completely -- doc sweep -- tool help -- keyboard help: hide commands whose gestures are shadowed -- how do we refer to command shortcuts in the docs? + ui: +- how do we refer to command shortcuts in the docs? +- page up/down: each tool has a distinglished scroller - reliably clonable gadgets - figure out if we need both set-model and set-model* -- help tool: edit, reload buttons -- words: - - S+left: reload - - S+right: inspect -- links: - - same deal - if i do 10000 [ . ] each and then clear, the listener window is slow -- dataflow UI needs various improvements: - full-height nodes should really be full height +- full-height nodes should really be full height - draw-world: bail out if world is 0x0 - better help result ranking - page scrolling should be timer-based too diff --git a/doc/handbook/alien.facts b/doc/handbook/alien.facts index 303baa6336..e45cb97d85 100644 --- a/doc/handbook/alien.facts +++ b/doc/handbook/alien.facts @@ -115,8 +115,6 @@ ARTICLE: "c-types-strings" "C string types" { { $snippet "char*" } "8-bit per character null-terminated ASCII" } { { $snippet "ushort*" } "16-bit per character null-terminated UTF16" } } -"Passing an instance of " { $link c-ptr } " to a C function expecting a C string will simply pass in the address of the " { $link c-ptr } "." -$terpri "Passing a Factor string to a C function expecting a C string allocates a byte array in the Factor heap; the string is then converted to the requested format and a raw pointer is passed to the function. If the conversion fails, for example if the string contains null bytes or characters with values higher than 255, a " { $link c-string-error. } " is thrown." $terpri "C functions must not retain such pointers to heap-allocated strings after returning, since byte arrays in the Factor heap can be moved by the garbage collector. To allocate a string which will not move, use " { $link } " and then " { $link free } "." diff --git a/library/compiler/alien/aliens.factor b/library/compiler/alien/aliens.factor index 998d0c7d89..d39402e3ea 100644 --- a/library/compiler/alien/aliens.factor +++ b/library/compiler/alien/aliens.factor @@ -6,7 +6,7 @@ sequences ; : ( address -- alien ) f ; inline -UNION: c-ptr byte-array alien ; +UNION: c-ptr byte-array alien POSTPONE: f ; M: alien equal? over alien? [ diff --git a/library/ui/commands.factor b/library/ui/commands.factor index 399d71aa65..096daf7254 100644 --- a/library/ui/commands.factor +++ b/library/ui/commands.factor @@ -59,23 +59,6 @@ M: object gesture>string drop f ; : all-commands ( gadget -- seq ) delegates [ class commands ] map concat ; -: resend-button-down ( gesture world -- ) - hand-loc get-global swap send-button-down ; - -: resend-button-up ( gesture world -- ) - hand-loc get-global swap send-button-up ; - -world H{ - { T{ key-down f { C+ } "x" } [ T{ cut-action } send-action ] } - { T{ key-down f { C+ } "c" } [ T{ copy-action } send-action ] } - { T{ key-down f { C+ } "v" } [ T{ paste-action } send-action ] } - { T{ key-down f { C+ } "a" } [ T{ select-all-action } send-action ] } - { T{ button-down f { C+ } 1 } [ T{ button-down f f 3 } swap resend-button-down ] } - { T{ button-down f { A+ } 1 } [ T{ button-down f f 2 } swap resend-button-down ] } - { T{ button-up f { C+ } 1 } [ T{ button-up f f 3 } swap resend-button-up ] } - { T{ button-up f { A+ } 1 } [ T{ button-up f f 2 } swap resend-button-up ] } -} set-gestures - SYMBOL: +name+ SYMBOL: +button+ SYMBOL: +group+ diff --git a/library/ui/gestures.factor b/library/ui/gestures.factor index 2d5fdbd949..a0c8651d92 100644 --- a/library/ui/gestures.factor +++ b/library/ui/gestures.factor @@ -174,3 +174,20 @@ V{ } clone hand-buttons set-global : send-action ( world gesture -- ) swap world-focus handle-gesture drop ; + +: resend-button-down ( gesture world -- ) + hand-loc get-global swap send-button-down ; + +: resend-button-up ( gesture world -- ) + hand-loc get-global swap send-button-up ; + +world H{ + { T{ key-down f { C+ } "x" } [ T{ cut-action } send-action ] } + { T{ key-down f { C+ } "c" } [ T{ copy-action } send-action ] } + { T{ key-down f { C+ } "v" } [ T{ paste-action } send-action ] } + { T{ key-down f { C+ } "a" } [ T{ select-all-action } send-action ] } + { T{ button-down f { C+ } 1 } [ T{ button-down f f 3 } swap resend-button-down ] } + { T{ button-down f { A+ } 1 } [ T{ button-down f f 2 } swap resend-button-down ] } + { T{ button-up f { C+ } 1 } [ T{ button-up f f 3 } swap resend-button-up ] } + { T{ button-up f { A+ } 1 } [ T{ button-up f f 2 } swap resend-button-up ] } +} set-gestures