Switch to 7.0 screen property names
The names of some screen properties have changed in 7.0. For 6.6, map the 7.0 names to 6.6 names. Change-Id: Iaf9d297fdd6a0329a84150f2b9a27665d89cc1ec Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This commit is contained in:
parent
71e195f6ef
commit
8a2401bd45
@ -43,6 +43,17 @@
|
|||||||
|
|
||||||
#include <screen/screen.h>
|
#include <screen/screen.h>
|
||||||
|
|
||||||
|
// For pre-7.0 SDPs, map some screen property names to the old
|
||||||
|
// names.
|
||||||
|
#include <sys/neutrino.h>
|
||||||
|
#if _NTO_VERSION < 700
|
||||||
|
const int SCREEN_PROPERTY_FLAGS = SCREEN_PROPERTY_KEY_FLAGS;
|
||||||
|
const int SCREEN_PROPERTY_FOCUS = SCREEN_PROPERTY_KEYBOARD_FOCUS;
|
||||||
|
const int SCREEN_PROPERTY_MODIFIERS = SCREEN_PROPERTY_KEY_MODIFIERS;
|
||||||
|
const int SCREEN_PROPERTY_SCAN = SCREEN_PROPERTY_KEY_SCAN;
|
||||||
|
const int SCREEN_PROPERTY_SYM = SCREEN_PROPERTY_KEY_SYM;
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QQnxWindow;
|
class QQnxWindow;
|
||||||
|
@ -233,20 +233,20 @@ void QQnxScreenEventHandler::handleKeyboardEvent(screen_event_t event)
|
|||||||
{
|
{
|
||||||
// get flags of key event
|
// get flags of key event
|
||||||
int flags;
|
int flags;
|
||||||
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_FLAGS, &flags),
|
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_FLAGS, &flags),
|
||||||
"Failed to query event flags");
|
"Failed to query event flags");
|
||||||
|
|
||||||
// get key code
|
// get key code
|
||||||
int sym;
|
int sym;
|
||||||
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_SYM, &sym),
|
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_SYM, &sym),
|
||||||
"Failed to query event sym");
|
"Failed to query event sym");
|
||||||
|
|
||||||
int modifiers;
|
int modifiers;
|
||||||
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_MODIFIERS, &modifiers),
|
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_MODIFIERS, &modifiers),
|
||||||
"Failed to query event modifieres");
|
"Failed to query event modifieres");
|
||||||
|
|
||||||
int scan;
|
int scan;
|
||||||
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_SCAN, &scan),
|
Q_SCREEN_CHECKERROR(screen_get_event_property_iv(event, SCREEN_PROPERTY_SCAN, &scan),
|
||||||
"Failed to query event scan");
|
"Failed to query event scan");
|
||||||
|
|
||||||
int cap;
|
int cap;
|
||||||
@ -593,7 +593,7 @@ void QQnxScreenEventHandler::handlePropertyEvent(screen_event_t event)
|
|||||||
qFatal("QQnx: failed to query window property, errno=%d", errno);
|
qFatal("QQnx: failed to query window property, errno=%d", errno);
|
||||||
|
|
||||||
switch (property) {
|
switch (property) {
|
||||||
case SCREEN_PROPERTY_KEYBOARD_FOCUS:
|
case SCREEN_PROPERTY_FOCUS:
|
||||||
handleKeyboardFocusPropertyEvent(window);
|
handleKeyboardFocusPropertyEvent(window);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -606,7 +606,7 @@ void QQnxScreenEventHandler::handleKeyboardFocusPropertyEvent(screen_window_t wi
|
|||||||
{
|
{
|
||||||
errno = 0;
|
errno = 0;
|
||||||
int focus = 0;
|
int focus = 0;
|
||||||
if (window && screen_get_window_property_iv(window, SCREEN_PROPERTY_KEYBOARD_FOCUS, &focus) != 0)
|
if (window && screen_get_window_property_iv(window, SCREEN_PROPERTY_FOCUS, &focus) != 0)
|
||||||
qFatal("QQnx: failed to query keyboard focus property, errno=%d", errno);
|
qFatal("QQnx: failed to query keyboard focus property, errno=%d", errno);
|
||||||
|
|
||||||
QWindow *focusWindow = QQnxIntegration::window(window);
|
QWindow *focusWindow = QQnxIntegration::window(window);
|
||||||
|
@ -581,7 +581,7 @@ void QQnxWindow::setFocus(screen_window_t newFocusWindow)
|
|||||||
screen_get_window_property_pv(nativeHandle(), SCREEN_PROPERTY_GROUP,
|
screen_get_window_property_pv(nativeHandle(), SCREEN_PROPERTY_GROUP,
|
||||||
reinterpret_cast<void**>(&screenGroup));
|
reinterpret_cast<void**>(&screenGroup));
|
||||||
if (screenGroup) {
|
if (screenGroup) {
|
||||||
screen_set_group_property_pv(screenGroup, SCREEN_PROPERTY_KEYBOARD_FOCUS,
|
screen_set_group_property_pv(screenGroup, SCREEN_PROPERTY_FOCUS,
|
||||||
reinterpret_cast<void**>(&newFocusWindow));
|
reinterpret_cast<void**>(&newFocusWindow));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user