{"id":13440998,"url":"https://github.com/dacap/clip","last_synced_at":"2025-05-15T09:05:19.635Z","repository":{"id":35589597,"uuid":"39862406","full_name":"dacap/clip","owner":"dacap","description":"Cross-platform C++ library to copy/paste clipboard content","archived":false,"fork":false,"pushed_at":"2025-04-01T11:54:21.000Z","size":162,"stargazers_count":648,"open_issues_count":15,"forks_count":93,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-07T04:08:37.697Z","etag":null,"topics":["clipboard","clipboard-formats","cpp","linux","macos","nspasteboard","pasteboard","windows","x11"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dacap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-28T23:18:51.000Z","updated_at":"2025-04-04T08:10:00.000Z","dependencies_parsed_at":"2024-03-05T23:30:28.451Z","dependency_job_id":"627501fa-fbf1-4ba2-a423-cc6b27b8649f","html_url":"https://github.com/dacap/clip","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dacap%2Fclip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dacap%2Fclip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dacap%2Fclip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dacap%2Fclip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dacap","download_url":"https://codeload.github.com/dacap/clip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248890896,"owners_count":21178528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clipboard","clipboard-formats","cpp","linux","macos","nspasteboard","pasteboard","windows","x11"],"created_at":"2024-07-31T03:01:28.692Z","updated_at":"2025-04-14T13:49:24.066Z","avatar_url":"https://github.com/dacap.png","language":"C++","readme":"# Clip Library\n*Copyright (c) 2015-2024 David Capello*\n\n[![build](https://github.com/dacap/clip/workflows/build/badge.svg)](https://github.com/dacap/clip/actions?query=workflow%3Abuild)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt)\n\nLibrary to copy/retrieve content to/from the clipboard/pasteboard.\n\n## Features\n\nAvailable features on Windows, macOS, and Linux (X11):\n\n* Copy/paste UTF-8 text.\n* Copy/paste user-defined data.\n* Copy/paste RGB/RGBA images. This library use non-premultiplied alpha RGB values.\n\n## Example\n\n```cpp\n#include \"clip.h\"\n#include \u003ciostream\u003e\n\nint main() {\n  clip::set_text(\"Hello World\");\n\n  std::string value;\n  clip::get_text(value);\n  std::cout \u003c\u003c value \u003c\u003c \"\\n\";\n}\n```\n\n## User-defined clipboard formats\n\n```cpp\n#include \"clip.h\"\n\nint main() {\n  clip::format my_format =\n    clip::register_format(\"com.appname.FormatName\");\n\n  int value = 32;\n  std::string str = \"Alternative text for value 32\";\n\n  clip::lock l;\n  l.clear();\n  l.set_data(clip::text_format(), str.c_str(), str.size());\n  l.set_data(my_format, (const char*)\u0026value, sizeof(int));\n}\n```\n\n## Platform specific details\n\n* If two versions of your application (32-bit and 64-bit) can run at\n  at the same time, remember to avoid storing data types that could\n  change depending on the platform (e.g. `size_t`) in your custom\n  format data.\n* **Windows**:\n  - [Limited number of clipboard formats on Windows](https://web.archive.org/web/20250126161802/https://devblogs.microsoft.com/oldnewthing/20080430-00/?p=22523)\n* **Linux**:\n  - To be able to copy/paste on Linux you need `libx11-dev`/`libX11-devel` package.\n  - To copy/paste images you will need `libpng-dev`/`libpng-devel` package.\n\n## Compilation Flags\n\n* `CLIP_ENABLE_IMAGE`: Enables the support to\n  [copy](examples/put_image.cpp)/[paste](examples/show_image.cpp) images.\n* `CLIP_ENABLE_LIST_FORMATS` (only for Windows): Enables the\n  `clip::lock::list_formats()` API function and the\n  [list_clip_formats](examples/list_clip_formats.cpp) example.\n* `CLIP_EXAMPLES`: Compile [examples](examples/).\n* `CLIP_TESTS`: Compile [tests](tests/).\n* `CLIP_INSTALL`: Generate installation rules for CMake.\n* `CLIP_X11_WITH_PNG` (only for Linux/X11): Enables support to\n  copy/paste images using the `libpng` library on Linux.\n\n## Who is using this library?\n\n[Check the wiki](https://github.com/dacap/clip/wiki#who-is-using-clip)\nto know what projects are using the `clip` library.\n","funding_links":[],"categories":["C++","Misc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdacap%2Fclip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdacap%2Fclip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdacap%2Fclip/lists"}