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