mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
io/clipboard,app: add WriteOp, ReadOp
Previously, the only way to manipulate the clipboard (read or write) is using the `app.Window`. The new `clipboard.ReadOp` and `clipboard.WriteOp`makes possible to read/write from the widget. Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
@@ -20,6 +20,8 @@ const (
|
||||
TypeArea
|
||||
TypePointerInput
|
||||
TypePass
|
||||
TypeClipboardRead
|
||||
TypeClipboardWrite
|
||||
TypeKeyInput
|
||||
TypeKeyFocus
|
||||
TypeKeySoftKeyboard
|
||||
@@ -43,6 +45,8 @@ const (
|
||||
TypeAreaLen = 1 + 1 + 4*4
|
||||
TypePointerInputLen = 1 + 1 + 1
|
||||
TypePassLen = 1 + 1
|
||||
TypeClipboardReadLen = 1
|
||||
TypeClipboardWriteLen = 1
|
||||
TypeKeyInputLen = 1
|
||||
TypeKeyFocusLen = 1 + 1
|
||||
TypeKeySoftKeyboardLen = 1 + 1
|
||||
@@ -67,6 +71,8 @@ func (t OpType) Size() int {
|
||||
TypeAreaLen,
|
||||
TypePointerInputLen,
|
||||
TypePassLen,
|
||||
TypeClipboardReadLen,
|
||||
TypeClipboardWriteLen,
|
||||
TypeKeyInputLen,
|
||||
TypeKeyFocusLen,
|
||||
TypeKeySoftKeyboardLen,
|
||||
@@ -80,7 +86,7 @@ func (t OpType) Size() int {
|
||||
|
||||
func (t OpType) NumRefs() int {
|
||||
switch t {
|
||||
case TypeKeyInput, TypePointerInput, TypeProfile, TypeCall:
|
||||
case TypeKeyInput, TypePointerInput, TypeProfile, TypeCall, TypeClipboardRead, TypeClipboardWrite:
|
||||
return 1
|
||||
case TypeImage:
|
||||
return 2
|
||||
|
||||
Reference in New Issue
Block a user