Merge branch 'master' of git://factorcode.org/git/factor
commit
fb8eeb6065
|
@ -1465,7 +1465,7 @@ V{
|
|||
|
||||
[ ] [ { 1 2 3 } test-linear-scan-on-cfg ] unit-test
|
||||
|
||||
[ { 1 } ] [ 1 get instructions>> first tagged-values>> ] unit-test
|
||||
[ { { 0 1 } } ] [ 1 get instructions>> first tagged-values>> ] unit-test
|
||||
|
||||
V{
|
||||
T{ ##peek f 0 D 0 }
|
||||
|
@ -1487,4 +1487,4 @@ V{
|
|||
|
||||
[ ] [ { 1 2 3 } test-linear-scan-on-cfg ] unit-test
|
||||
|
||||
[ { 1 } ] [ 1 get instructions>> first tagged-values>> ] unit-test
|
||||
[ { { 0 1 } } ] [ 1 get instructions>> first tagged-values>> ] unit-test
|
||||
|
|
|
@ -88,7 +88,7 @@ HELP: stream-throws
|
|||
{ stream-eofs stream-throws } related-words
|
||||
|
||||
ARTICLE: "io.streams.limited" "Limited input streams"
|
||||
"The " { $vocab-link "io.streams.limited" } " vocabulary wraps a stream to behave as if it had only a limited number of bytes, either throwing an error or returning " { $link f } " upon reaching the end." $nl
|
||||
"The " { $vocab-link "io.streams.limited" } " vocabulary wraps a stream to behave as if it had only a limited number of bytes, either throwing an error or returning " { $link f } " upon reaching the end. Limiting a non-seekable stream keeps a byte count and triggers the end-of-stream behavior when this byte count has been reached. However, limiting a seekable stream creates a window of bytes that supports seeking and re-reading of bytes in that window." $nl
|
||||
"Wrap a stream in a limited stream:"
|
||||
{ $subsections limit }
|
||||
"Wrap the current " { $link input-stream } " in a limited stream:"
|
||||
|
|
|
@ -69,8 +69,8 @@ C: <button-pen> button-pen
|
|||
|
||||
: button-pen ( button pen -- button pen )
|
||||
over find-button {
|
||||
{ [ dup { [ pressed?>> ] [ selected?>> ] } 1&& ]
|
||||
[ drop pressed-selected>>
|
||||
{ [ dup { [ pressed?>> ] [ selected?>> ] } 1&& ] [
|
||||
drop pressed-selected>>
|
||||
] }
|
||||
{ [ dup pressed?>> ] [ drop pressed>> ] }
|
||||
{ [ dup selected?>> ] [ drop selected>> ] }
|
||||
|
|
|
@ -112,7 +112,7 @@ M: editor ungraft*
|
|||
} cond ;
|
||||
|
||||
: clicked-loc ( editor -- loc )
|
||||
[ hand-rel ] [ point>loc ] bi ;
|
||||
[ hand-rel ] keep point>loc ;
|
||||
|
||||
: click-loc ( editor model -- )
|
||||
[ clicked-loc ] dip set-model ;
|
||||
|
@ -130,7 +130,7 @@ M: editor ungraft*
|
|||
[ loc>x ] [ [ first ] dip line>y ceiling ] 2bi 2array ;
|
||||
|
||||
: caret-loc ( editor -- loc )
|
||||
[ editor-caret ] [ loc>point ] bi ;
|
||||
[ editor-caret ] keep loc>point ;
|
||||
|
||||
: caret-dim ( editor -- dim )
|
||||
[ 0 ] dip line-height 2array ;
|
||||
|
@ -139,7 +139,7 @@ M: editor ungraft*
|
|||
dup graft-state>> second [
|
||||
[
|
||||
[ caret-loc ] [ caret-dim { 2 1 } v+ ] bi <rect>
|
||||
] [ scroll>rect ] bi
|
||||
] keep scroll>rect
|
||||
] [ drop ] if ;
|
||||
|
||||
: draw-caret? ( editor -- ? )
|
||||
|
@ -212,7 +212,7 @@ M: editor cap-height font>> font-metrics cap-height>> ;
|
|||
[ nip relayout ] 2tri ;
|
||||
|
||||
: caret/mark-changed ( editor -- )
|
||||
[ restart-blinking ] [ scroll>caret ] bi ;
|
||||
[ restart-blinking ] keep scroll>caret ;
|
||||
|
||||
M: editor model-changed
|
||||
{
|
||||
|
|
|
@ -115,7 +115,7 @@ M: gadget gadget-text-separator
|
|||
gadget-text-separator '[ _ % ] [ gadget-text* ] interleave ;
|
||||
|
||||
M: gadget gadget-text*
|
||||
[ children>> ] [ gadget-seq-text ] bi ;
|
||||
[ children>> ] keep gadget-seq-text ;
|
||||
|
||||
M: array gadget-text*
|
||||
[ gadget-text* ] each ;
|
||||
|
@ -183,7 +183,7 @@ GENERIC: pref-dim* ( gadget -- dim )
|
|||
|
||||
: pref-dim ( gadget -- dim )
|
||||
dup pref-dim>> [ ] [
|
||||
[ pref-dim* ] [ dup layout-state>> ] bi
|
||||
[ pref-dim* ] [ ] [ layout-state>> ] tri
|
||||
[ drop ] [ dupd (>>pref-dim) ] if
|
||||
] ?if ;
|
||||
|
||||
|
@ -388,7 +388,7 @@ M: gadget request-focus-on parent>> request-focus-on ;
|
|||
M: f request-focus-on 2drop ;
|
||||
|
||||
: request-focus ( gadget -- )
|
||||
[ focusable-child ] [ request-focus-on ] bi ;
|
||||
[ focusable-child ] keep request-focus-on ;
|
||||
|
||||
: focus-path ( gadget -- seq )
|
||||
[ focus>> ] follow ;
|
||||
|
|
|
@ -30,6 +30,7 @@ const char *default_image_path()
|
|||
char *new_path = new char[PATH_MAX + SUFFIX_LEN + 1];
|
||||
memcpy(new_path,path,len + 1);
|
||||
memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1);
|
||||
free(const_cast<char *>(path));
|
||||
return new_path;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace factor
|
||||
{
|
||||
|
||||
/* Snarfed from SBCL linux-so.c. You must delete[] the result yourself. */
|
||||
/* Snarfed from SBCL linux-so.c. You must free() the result yourself. */
|
||||
const char *vm_executable_path()
|
||||
{
|
||||
char *path = new char[PATH_MAX + 1];
|
||||
|
@ -17,7 +17,10 @@ const char *vm_executable_path()
|
|||
else
|
||||
{
|
||||
path[size] = '\0';
|
||||
return safe_strdup(path);
|
||||
|
||||
const char *ret = safe_strdup(path);
|
||||
delete[] path;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue