Clipboard paste now works with Cocoa
parent
d9f076c73f
commit
f71eeed3e3
|
@ -21,6 +21,7 @@
|
||||||
- get factor running on mac intel
|
- get factor running on mac intel
|
||||||
- constant branch folding
|
- constant branch folding
|
||||||
- cocoa: starting the UI with +foo switches opens them as files
|
- cocoa: starting the UI with +foo switches opens them as files
|
||||||
|
- pasting from clipboard on x11
|
||||||
|
|
||||||
+ refactor style stack code so that nested styles are handled at a lower-level
|
+ refactor style stack code so that nested styles are handled at a lower-level
|
||||||
- in HTML, we can nest div tags, etc
|
- in HTML, we can nest div tags, etc
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2006 Slava Pestov.
|
! Copyright (C) 2006 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
IN: cocoa
|
IN: cocoa
|
||||||
USING: arrays gadgets kernel objc objc-classes sequences ;
|
USING: arrays gadgets kernel namespaces objc objc-classes
|
||||||
|
sequences ;
|
||||||
|
|
||||||
: NSStringPboardType "NSStringPboardType" ;
|
: NSStringPboardType "NSStringPboardType" ;
|
||||||
|
|
||||||
|
@ -27,3 +28,7 @@ M: pasteboard clipboard-contents ( pb -- str )
|
||||||
|
|
||||||
M: pasteboard set-clipboard-contents ( str pb -- )
|
M: pasteboard set-clipboard-contents ( str pb -- )
|
||||||
pasteboard-handle set-pasteboard-string ;
|
pasteboard-handle set-pasteboard-string ;
|
||||||
|
|
||||||
|
: init-clipboard ( -- )
|
||||||
|
NSPasteboard -> generalPasteboard <pasteboard>
|
||||||
|
clipboard set-global ;
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespaces objc sequences errors freetype ;
|
||||||
reset-callbacks
|
reset-callbacks
|
||||||
install-app-delegate
|
install-app-delegate
|
||||||
register-services
|
register-services
|
||||||
|
init-clipboard
|
||||||
default-main-menu ;
|
default-main-menu ;
|
||||||
|
|
||||||
: rect>NSRect
|
: rect>NSRect
|
||||||
|
|
|
@ -85,8 +85,8 @@ opengl sequences ;
|
||||||
[ -> deltaY 0 > ] 2keep mouse-location
|
[ -> deltaY 0 > ] 2keep mouse-location
|
||||||
rot window send-wheel ;
|
rot window send-wheel ;
|
||||||
|
|
||||||
: send-action ( view event class -- f )
|
: send-action ( view event gesture -- junk )
|
||||||
>r drop window r> handle-action f ;
|
-rot drop window world-focus handle-gesture drop f ;
|
||||||
|
|
||||||
: add-resize-observer ( observer object -- )
|
: add-resize-observer ( observer object -- )
|
||||||
>r "updateFactorGadgetSize:"
|
>r "updateFactorGadgetSize:"
|
||||||
|
@ -163,15 +163,15 @@ opengl sequences ;
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "cut:" "id" { "id" "SEL" "id" }
|
{ "cut:" "id" { "id" "SEL" "id" }
|
||||||
[ nip <cut-action> send-action ]
|
[ nip T{ cut-action } send-action ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "copy:" "id" { "id" "SEL" "id" }
|
{ "copy:" "id" { "id" "SEL" "id" }
|
||||||
[ nip <copy-action> send-action ]
|
[ nip T{ copy-action } send-action ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "paste:" "id" { "id" "SEL" "id" }
|
{ "paste:" "id" { "id" "SEL" "id" }
|
||||||
[ nip <paste-action> send-action ]
|
[ nip T{ paste-action } send-action ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "updateFactorGadgetSize:" "void" { "id" "SEL" "id" }
|
{ "updateFactorGadgetSize:" "void" { "id" "SEL" "id" }
|
||||||
|
|
|
@ -49,7 +49,7 @@ TUPLE: slider-changed ;
|
||||||
] [
|
] [
|
||||||
[ set-slider-value ] keep
|
[ set-slider-value ] keep
|
||||||
dup slider-elevator relayout-1
|
dup slider-elevator relayout-1
|
||||||
<slider-changed> handle-action
|
T{ slider-changed } swap handle-gesture drop
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
TUPLE: thumb ;
|
TUPLE: thumb ;
|
||||||
|
|
Loading…
Reference in New Issue