Commit cb93d0ac authored by Gargaj's avatar Gargaj Committed by GitHub
Browse files

Merge pull request #36 from plabatut/use-glfw-clipboard-for-x11

Add clipboard support for X11
parents 18583fba db7a1be5
#include <iostream>
#define GLFW_INCLUDE_NONE
#include "GLFW/glfw3.h"
#include <string>
#include <string.h>
namespace Clipboard
{
void Copy( const char * data, int len )
{
std::cerr << __FUNCTION__ << " NOT IMPLEMENTED" << std::endl;
const std::string contents(data, len);
GLFWwindow* window = glfwGetCurrentContext();
glfwSetClipboardString(window, contents.c_str());
}
int GetContentsLength()
{
std::cerr << __FUNCTION__ << " NOT IMPLEMENTED" << std::endl;
return 0;
GLFWwindow* window = glfwGetCurrentContext();
const char* contents = glfwGetClipboardString(window);
return strlen(contents);
}
void GetContents( char * data, int len )
{
std::cerr << __FUNCTION__ << " NOT IMPLEMENTED" << std::endl;
data[0] = 0;
GLFWwindow* window = glfwGetCurrentContext();
const char* contents = glfwGetClipboardString(window);
strncpy(data, contents, len);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment