• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H03-May-2022-

tests/H03-May-2022-

.appveyor.ymlH A D16-Jul-2018893

.travis.ymlH A D16-Jul-20181.2 KiB

README.mdH A D16-Jul-20181.4 KiB

clip.cppH A D16-Jul-20183.1 KiB

clip.hH A D16-Jul-20185.3 KiB

clip_lock_impl.hH A D16-Jul-2018760

clip_none.cppH A D16-Jul-20181.6 KiB

clip_osx.mmH A D16-Jul-20189.8 KiB

clip_win.cppH A D16-Jul-201816.2 KiB

clip_x11.cppH A D16-Jul-201830.1 KiB

clip_x11_png.hH A D16-Jul-20186 KiB

image.cppH A D16-Jul-20181.5 KiB

README.md

1# Clip Library
2*Copyright (C) 2015-2018 David Capello*
3
4[![Build Status](https://travis-ci.org/dacap/clip.svg)](https://travis-ci.org/dacap/clip)
5[![Build status](https://ci.appveyor.com/api/projects/status/iyory4t5oop7ssrs?svg=true)](https://ci.appveyor.com/project/dacap/clip)
6[![MIT Licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt)
7
8Library to copy/retrieve content to/from the clipboard/pasteboard.
9
10## Features
11
12Available features on Windows, macOS, and Linux (X11):
13
14* Copy/paste UTF-8 text.
15* Copy/paste user-defined data.
16* Copy/paste RGB/RGBA images. This library use non-premultiplied alpha RGB values.
17
18## Example
19
20```cpp
21#include "clip.h"
22#include <iostream>
23
24int main() {
25  clip::set_text("Hello World");
26
27  std::string value;
28  clip::get_text(value);
29  std::cout << value << "\n";
30}
31```
32
33## User-defined clipboard formats
34
35```cpp
36#include "clip.h"
37
38int main() {
39  clip::format my_format =
40    clip::register_format("com.appname.FormatName");
41
42  int value = 32;
43
44  clip::lock l;
45  l.clear();
46  l.set_data(clip::text_format(), "Alternative text for value 32");
47  l.set_data(my_format, &value, sizeof(int));
48}
49```
50
51* [Limited number of clipboard formats on Windows](http://blogs.msdn.com/b/oldnewthing/archive/2015/03/19/10601208.aspx)
52
53## Who is using this library?
54
55`clip` is being used in the following applications:
56
57* [Aseprite](https://github.com/aseprite/aseprite)
58