Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi clipboard format support for Windows #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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