Skip to content
forked from dacap/clip

Cross-platform C++ library to copy/paste clipboard content

License

Notifications You must be signed in to change notification settings

stspdotname/clip

 
 

Repository files navigation

Clip Library

Copyright (C) 2015-2018 David Capello

Build Status Build status MIT Licensed

Library to copy/retrieve content to/from the clipboard/pasteboard.

Features

Available features on Windows, macOS, and Linux (X11):

  • Copy/paste UTF-8 text.
  • Copy/paste user-defined data.
  • Copy/paste RGB/RGBA images. This library use non-premultiplied alpha RGB values.

Example

#include "clip.h"
#include <iostream>

int main() {
  clip::set_text("Hello World");

  std::string value;
  clip::get_text(value);
  std::cout << value << "\n";
}

User-defined clipboard formats

#include "clip.h"

int main() {
  clip::format my_format =
    clip::register_format("com.appname.FormatName");

  int value = 32;

  clip::lock l;
  l.clear();
  l.set_data(clip::text_format(), "Alternative text for value 32");
  l.set_data(my_format, &value, sizeof(int));
}

Platform specific details

Who is using this library?

clip is being used in the following applications:

About

Cross-platform C++ library to copy/paste clipboard content

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 85.3%
  • Objective-C++ 11.8%
  • CMake 2.9%