Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
Irrlicht
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
Commits
adc9e882
Commit
adc9e882
authored
Nov 07, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix on linux
compile, input char, clipboard
parent
d38e1fdf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
22 deletions
+23
-22
CMakeLists.txt
CMakeLists.txt
+7
-5
include/IOSOperator.h
include/IOSOperator.h
+1
-2
src/CGUIEditBox.cpp
src/CGUIEditBox.cpp
+2
-4
src/CIrrDeviceLinux.cpp
src/CIrrDeviceLinux.cpp
+8
-4
src/COSOperator.cpp
src/COSOperator.cpp
+4
-5
src/COSOperator.h
src/COSOperator.h
+1
-2
No files found.
CMakeLists.txt
View file @
adc9e882
...
@@ -156,7 +156,7 @@ set (INCLUDE_FILES_GUI
...
@@ -156,7 +156,7 @@ set (INCLUDE_FILES_GUI
"include/EMessageBoxFlags.h"
"include/EMessageBoxFlags.h"
"include/ICursorControl.h"
"include/ICursorControl.h"
"include/IGUIButton.h"
"include/IGUIButton.h"
"include/IGUICheck
b
ox.h"
"include/IGUICheck
B
ox.h"
"include/IGUIComboBox.h"
"include/IGUIComboBox.h"
"include/IGUIContextMenu.h"
"include/IGUIContextMenu.h"
"include/IGUIEditBox.h"
"include/IGUIEditBox.h"
...
@@ -827,7 +827,7 @@ set (SRC_FILES_GUI
...
@@ -827,7 +827,7 @@ set (SRC_FILES_GUI
"src/BuiltInFont.h"
"src/BuiltInFont.h"
"src/CDefaultGUIElementFactory.h"
"src/CDefaultGUIElementFactory.h"
"src/CGUIButton.h"
"src/CGUIButton.h"
"src/CGUICheck
b
ox.h"
"src/CGUICheck
B
ox.h"
"src/CGUIColorSelectDialog.h"
"src/CGUIColorSelectDialog.h"
"src/CGUIComboBox.h"
"src/CGUIComboBox.h"
"src/CGUIContextMenu.h"
"src/CGUIContextMenu.h"
...
@@ -855,7 +855,7 @@ set (SRC_FILES_GUI
...
@@ -855,7 +855,7 @@ set (SRC_FILES_GUI
"src/CGUIWindow.h"
"src/CGUIWindow.h"
"src/CDefaultGUIElementFactory.cpp"
"src/CDefaultGUIElementFactory.cpp"
"src/CGUIButton.cpp"
"src/CGUIButton.cpp"
"src/CGUICheck
b
ox.cpp"
"src/CGUICheck
B
ox.cpp"
"src/CGUIColorSelectDialog.cpp"
"src/CGUIColorSelectDialog.cpp"
"src/CGUIComboBox.cpp"
"src/CGUIComboBox.cpp"
"src/CGUIContextMenu.cpp"
"src/CGUIContextMenu.cpp"
...
@@ -898,12 +898,14 @@ include_directories ( include src/zlib src/jpeglib src/libpng )
...
@@ -898,12 +898,14 @@ include_directories ( include src/zlib src/jpeglib src/libpng )
add_definitions
(
"-D_IRR_STATIC_LIB_"
)
add_definitions
(
"-D_IRR_STATIC_LIB_"
)
if
(
CMAKE_C_COMPILER MATCHES
"cc"
)
add_definitions
(
"-U__STRICT_ANSI__"
)
endif
()
if
(
WIN32
)
if
(
WIN32
)
include_directories
(
$ENV{DXSDK_DIR}/include
)
include_directories
(
$ENV{DXSDK_DIR}/include
)
if
(
MSVC
)
if
(
MSVC
)
add_definitions
(
"-DIRRLICHT_FAST_MATH"
)
add_definitions
(
"-DIRRLICHT_FAST_MATH"
)
elseif
(
MINGW
)
add_definitions
(
"-U__STRICT_ANSI__"
)
endif
()
endif
()
endif
()
endif
()
...
...
include/IOSOperator.h
View file @
adc9e882
...
@@ -29,8 +29,7 @@ public:
...
@@ -29,8 +29,7 @@ public:
virtual
void
copyToClipboard
(
const
wchar_t
*
text
)
const
=
0
;
virtual
void
copyToClipboard
(
const
wchar_t
*
text
)
const
=
0
;
//! Get text from the clipboard
//! Get text from the clipboard
/** \return Returns 0 if no string is in there. */
virtual
const
core
::
stringw
getTextFromClipboard
()
const
=
0
;
virtual
const
wchar_t
*
getTextFromClipboard
()
const
=
0
;
//! Get the processor speed in megahertz
//! Get the processor speed in megahertz
/** \param MHz The integer variable to store the speed in.
/** \param MHz The integer variable to store the speed in.
...
...
src/CGUIEditBox.cpp
View file @
adc9e882
...
@@ -326,11 +326,9 @@ bool CGUIEditBox::processKey(const SEvent& event)
...
@@ -326,11 +326,9 @@ bool CGUIEditBox::processKey(const SEvent& event)
const
s32
realmend
=
MarkBegin
<
MarkEnd
?
MarkEnd
:
MarkBegin
;
const
s32
realmend
=
MarkBegin
<
MarkEnd
?
MarkEnd
:
MarkBegin
;
// add new character
// add new character
const
wchar_t
*
p
=
Operator
->
getTextFromClipboard
();
const
irr
::
core
::
stringw
wide
p
=
Operator
->
getTextFromClipboard
();
if
(
p
)
if
(
!
widep
.
empty
()
)
{
{
irr
::
core
::
stringw
widep
(
p
);
if
(
MarkBegin
==
MarkEnd
)
if
(
MarkBegin
==
MarkEnd
)
{
{
// insert text
// insert text
...
...
src/CIrrDeviceLinux.cpp
View file @
adc9e882
...
@@ -1042,9 +1042,13 @@ bool CIrrDeviceLinux::run()
...
@@ -1042,9 +1042,13 @@ bool CIrrDeviceLinux::run()
char
buf
[
8
]
=
{
0
};
char
buf
[
8
]
=
{
0
};
XLookupString
(
&
event
.
xkey
,
buf
,
sizeof
(
buf
),
&
mp
.
X11Key
,
NULL
);
XLookupString
(
&
event
.
xkey
,
buf
,
sizeof
(
buf
),
&
mp
.
X11Key
,
NULL
);
irrevent
.
EventType
=
irr
::
EET_CHAR_INPUT_EVENT
;
if
(
event
.
type
==
KeyPress
irrevent
.
CharInput
.
Char
=
irr
::
core
::
stringw
(
buf
).
c_str
();
&&
!
(
buf
[
0
]
<
32
||
buf
[
0
]
>
126
&&
buf
[
0
]
<
160
))
postEventFromUser
(
irrevent
);
{
irrevent
.
EventType
=
irr
::
EET_CHAR_INPUT_EVENT
;
irrevent
.
CharInput
.
Char
=
irr
::
core
::
stringw
(
buf
).
c_str
()[
0
];
postEventFromUser
(
irrevent
);
}
irrevent
.
EventType
=
irr
::
EET_KEY_INPUT_EVENT
;
irrevent
.
EventType
=
irr
::
EET_KEY_INPUT_EVENT
;
irrevent
.
KeyInput
.
PressedDown
=
(
event
.
type
==
KeyPress
);
irrevent
.
KeyInput
.
PressedDown
=
(
event
.
type
==
KeyPress
);
...
@@ -1877,7 +1881,7 @@ const c8* CIrrDeviceLinux::getTextFromClipboard() const
...
@@ -1877,7 +1881,7 @@ const c8* CIrrDeviceLinux::getTextFromClipboard() const
Clipboard
=
""
;
Clipboard
=
""
;
if
(
ownerWindow
!=
None
)
if
(
ownerWindow
!=
None
)
{
{
XConvertSelection
(
display
,
X_ATOM_CLIPBOARD
,
X
A
_STRING
,
XA_PRIMARY
,
ownerWindow
,
CurrentTime
);
XConvertSelection
(
display
,
X_ATOM_CLIPBOARD
,
X
_ATOM_UTF8
_STRING
,
XA_PRIMARY
,
ownerWindow
,
CurrentTime
);
XFlush
(
display
);
XFlush
(
display
);
// check for data
// check for data
...
...
src/COSOperator.cpp
View file @
adc9e882
...
@@ -92,14 +92,13 @@ void COSOperator::copyToClipboard(const wchar_t* text) const
...
@@ -92,14 +92,13 @@ void COSOperator::copyToClipboard(const wchar_t* text) const
//! gets text from the clipboard
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
const
core
::
stringw
COSOperator
::
getTextFromClipboard
()
const
const
wchar_t
*
COSOperator
::
getTextFromClipboard
()
const
{
{
#if defined(_IRR_XBOX_PLATFORM_)
#if defined(_IRR_XBOX_PLATFORM_)
return
0
;
return
0
;
#elif defined(_IRR_WINDOWS_API_)
#elif defined(_IRR_WINDOWS_API_)
if
(
!
OpenClipboard
(
NULL
))
if
(
!
OpenClipboard
(
NULL
))
return
0
;
return
L""
;
wchar_t
*
buffer
=
0
;
wchar_t
*
buffer
=
0
;
...
@@ -110,11 +109,11 @@ const wchar_t* COSOperator::getTextFromClipboard() const
...
@@ -110,11 +109,11 @@ const wchar_t* COSOperator::getTextFromClipboard() const
return
buffer
;
return
buffer
;
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
return
irr
::
core
::
stringw
(
OSXCopyFromClipboard
())
.
c_str
()
;
return
irr
::
core
::
stringw
(
OSXCopyFromClipboard
());
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if
(
IrrDeviceLinux
)
if
(
IrrDeviceLinux
)
return
irr
::
core
::
stringw
(
IrrDeviceLinux
->
getTextFromClipboard
())
.
c_str
()
;
return
irr
::
core
::
stringw
(
IrrDeviceLinux
->
getTextFromClipboard
());
return
0
;
return
0
;
#else
#else
...
...
src/COSOperator.h
View file @
adc9e882
...
@@ -30,8 +30,7 @@ public:
...
@@ -30,8 +30,7 @@ public:
virtual
void
copyToClipboard
(
const
wchar_t
*
text
)
const
;
virtual
void
copyToClipboard
(
const
wchar_t
*
text
)
const
;
//! gets text from the clipboard
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
virtual
const
core
::
stringw
getTextFromClipboard
()
const
;
virtual
const
wchar_t
*
getTextFromClipboard
()
const
;
//! gets the processor speed in megahertz
//! gets the processor speed in megahertz
//! \param Mhz:
//! \param Mhz:
...
...
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