Skip to content

Conversation

@kiennq
Copy link

@kiennq kiennq commented Jun 13, 2018

Add 4 new interface function for clipboard package:

  1. func ReadAllWithFormat(cf uintptr) (string, error)

  2. func WriteAllWithFormat(text string, cf uintptr) error

  3. func ClearClipboard() error

  4. func getClipboardFormat(_ string)

With those, we can set and get multiple data type from clipboard.
One example is in Windows, we can set HTML clipboard and text clipboard simultaneously, application can choose to render which data depends on its needs. The newly add utility goclip is using the new interface to implement copy and paste multiple clipboard data type too.

Please refer to this https://msdn.microsoft.com/en-us/library/windows/desktop/ms649015(v=vs.85).aspx

Copy link
Owner

@atotto atotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR.

Please fix package path.

We must consider linux and darwin platform..

"flag"
"fmt"
"github.com/kiennq/clipboard"
"io/ioutil"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use github.com/atotto/clipboard

@@ -1,14 +1,12 @@
package clipboard_test
package clipboard
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use clipboard_test


func TestCopyAndPaste(t *testing.T) {
expected := "日本語"
expected := "日本語\n"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants