Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
examples/ | H | 03-May-2022 | - | |||
tests/ | H | 03-May-2022 | - | |||
.appveyor.yml | H A D | 16-Jul-2018 | 893 | |||
.travis.yml | H A D | 16-Jul-2018 | 1.2 KiB | |||
README.md | H A D | 16-Jul-2018 | 1.4 KiB | |||
clip.cpp | H A D | 16-Jul-2018 | 3.1 KiB | |||
clip.h | H A D | 16-Jul-2018 | 5.3 KiB | |||
clip_lock_impl.h | H A D | 16-Jul-2018 | 760 | |||
clip_none.cpp | H A D | 16-Jul-2018 | 1.6 KiB | |||
clip_osx.mm | H A D | 16-Jul-2018 | 9.8 KiB | |||
clip_win.cpp | H A D | 16-Jul-2018 | 16.2 KiB | |||
clip_x11.cpp | H A D | 16-Jul-2018 | 30.1 KiB | |||
clip_x11_png.h | H A D | 16-Jul-2018 | 6 KiB | |||
image.cpp | H A D | 16-Jul-2018 | 1.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