Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
Irrlicht New
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Irrlicht New
Commits
65663132
Commit
65663132
authored
Nov 27, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build on linux, but the clipboard don't work
parent
1663df62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
source/Irrlicht/COSOperator.cpp
source/Irrlicht/COSOperator.cpp
+17
-4
No files found.
source/Irrlicht/COSOperator.cpp
View file @
65663132
...
...
@@ -56,7 +56,8 @@ const core::stringc& COSOperator::getOperatingSystemVersion() const
//! copies text to the clipboard
void
COSOperator
::
copyToClipboard
(
const
c16
*
text
)
const
{
if
(
wcslen
(
text
)
==
0
)
size_t
len
=
wcslen
(
text
);
if
(
len
==
0
)
return
;
// Windows version
...
...
@@ -70,7 +71,7 @@ void COSOperator::copyToClipboard(const c16* text) const
HGLOBAL
clipbuffer
;
wchar_t
*
buffer
;
clipbuffer
=
GlobalAlloc
(
GMEM_DDESHARE
,
sizeof
(
wchar_t
)
*
(
wcslen
(
text
)
+
1
));
clipbuffer
=
GlobalAlloc
(
GMEM_DDESHARE
,
sizeof
(
wchar_t
)
*
(
len
+
1
));
buffer
=
(
wchar_t
*
)
GlobalLock
(
clipbuffer
);
wcscpy
(
buffer
,
text
);
...
...
@@ -86,7 +87,12 @@ void COSOperator::copyToClipboard(const c16* text) const
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if
(
IrrDeviceLinux
)
IrrDeviceLinux
->
copyToClipboard
(
text
);
{
char
ctext
[
len
*
2
+
1
];
size_t
lenNew
=
wcstombs
(
ctext
,
text
,
len
*
2
);
ctext
[
lenNew
]
=
0
;
IrrDeviceLinux
->
copyToClipboard
(
ctext
);
}
#else
#endif
...
...
@@ -116,7 +122,14 @@ const c16* COSOperator::getTextFromClipboard() const
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if
(
IrrDeviceLinux
)
return
IrrDeviceLinux
->
getTextFromClipboard
();
{
const
c8
*
p
=
IrrDeviceLinux
->
getTextFromClipboard
();
size_t
lenOld
=
strlen
(
p
);
wchar_t
*
ws
=
new
wchar_t
[
lenOld
+
1
];
size_t
lenNew
=
mbstowcs
(
ws
,
p
,
lenOld
);
ws
[
lenNew
]
=
0
;
return
ws
;
}
return
0
;
#else
...
...
Write
Preview
Markdown
is supported
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