Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
Bonzomatic
Commits
db7a1be5
Commit
db7a1be5
authored
May 01, 2017
by
Patrick Labatut
Browse files
Implement X11 clipboard using GLFW functions.
parent
18583fba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/platform_x11/Clipboard.cpp
View file @
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
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment