Commit db7a1be5 authored by Patrick Labatut's avatar Patrick Labatut
Browse files

Implement X11 clipboard using GLFW functions.

parent 18583fba
#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