mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 22:47:50 +00:00
parent
28e782dda5
commit
9bd3d2aa5c
@ -48,7 +48,6 @@ class QNitpickerPlatformWindow : public QObject, public QPlatformWindow
|
||||
bool _framebuffer_changed;
|
||||
bool _geometry_changed;
|
||||
Framebuffer::Mode _current_mode;
|
||||
Genode::Entrypoint &_signal_ep;
|
||||
Nitpicker::Session::View_handle _view_handle;
|
||||
Input::Session_client _input_session;
|
||||
Genode::Attached_dataspace _ev_buf;
|
||||
@ -83,8 +82,8 @@ class QNitpickerPlatformWindow : public QObject, public QPlatformWindow
|
||||
void _key_event(Input::Keycode, Codepoint, Mapped_key::Event);
|
||||
void _mouse_button_event(Input::Keycode, bool press);
|
||||
|
||||
Genode::Signal_handler<QNitpickerPlatformWindow> _input_signal_handler;
|
||||
Genode::Signal_handler<QNitpickerPlatformWindow> _mode_changed_signal_handler;
|
||||
Genode::Io_signal_handler<QNitpickerPlatformWindow> _input_signal_handler;
|
||||
Genode::Io_signal_handler<QNitpickerPlatformWindow> _mode_changed_signal_handler;
|
||||
|
||||
QVector<QWindowSystemInterface::TouchPoint> _touch_points { 16 };
|
||||
QTouchDevice *_touch_device;
|
||||
@ -97,20 +96,12 @@ class QNitpickerPlatformWindow : public QObject, public QPlatformWindow
|
||||
|
||||
QString _sanitize_label(QString label);
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
void _handle_input();
|
||||
void _handle_mode_changed();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
void _input();
|
||||
void _mode_changed();
|
||||
|
||||
public:
|
||||
|
||||
QNitpickerPlatformWindow(Genode::Env &env, QWindow *window,
|
||||
Genode::Entrypoint &signal_ep,
|
||||
int screen_width, int screen_height);
|
||||
|
||||
~QNitpickerPlatformWindow();
|
||||
|
@ -40,11 +40,7 @@ QPlatformIntegration *QNitpickerIntegrationPlugin::create(const QString& system,
|
||||
Q_UNUSED(paramList);
|
||||
if (system.toLower() == "nitpicker") {
|
||||
assert(_env != nullptr);
|
||||
Genode::Entrypoint *signal_ep =
|
||||
new Genode::Entrypoint(*_env, 2*1024*sizeof(Genode::addr_t),
|
||||
"QPA signal handler",
|
||||
Genode::Affinity::Location());
|
||||
return new QNitpickerIntegration(*_env, *signal_ep);
|
||||
return new QNitpickerIntegration(*_env);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -27,8 +27,8 @@ QT_BEGIN_NAMESPACE
|
||||
static constexpr bool verbose = false;
|
||||
|
||||
|
||||
QGenodeClipboard::QGenodeClipboard(Genode::Env &env, Genode::Entrypoint &sig_ep)
|
||||
: _clipboard_signal_handler(sig_ep, *this, &QGenodeClipboard::_handle_clipboard)
|
||||
QGenodeClipboard::QGenodeClipboard(Genode::Env &env)
|
||||
: _clipboard_signal_handler(env.ep(), *this, &QGenodeClipboard::_handle_clipboard)
|
||||
{
|
||||
try {
|
||||
|
||||
|
@ -33,7 +33,7 @@ class QGenodeClipboard : public QPlatformClipboard
|
||||
private:
|
||||
|
||||
Genode::Attached_rom_dataspace *_clipboard_ds = nullptr;
|
||||
Genode::Signal_handler<QGenodeClipboard> _clipboard_signal_handler;
|
||||
Genode::Io_signal_handler<QGenodeClipboard> _clipboard_signal_handler;
|
||||
|
||||
Genode::Reporter *_clipboard_reporter = nullptr;
|
||||
|
||||
@ -45,7 +45,7 @@ class QGenodeClipboard : public QPlatformClipboard
|
||||
|
||||
public:
|
||||
|
||||
QGenodeClipboard(Genode::Env &env, Genode::Entrypoint &sig_ep);
|
||||
QGenodeClipboard(Genode::Env &env);
|
||||
~QGenodeClipboard();
|
||||
QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
|
||||
void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
|
||||
|
@ -29,10 +29,8 @@ QT_BEGIN_NAMESPACE
|
||||
static const bool verbose = false;
|
||||
|
||||
|
||||
QNitpickerIntegration::QNitpickerIntegration(Genode::Env &env,
|
||||
Genode::Entrypoint &signal_ep)
|
||||
QNitpickerIntegration::QNitpickerIntegration(Genode::Env &env)
|
||||
: _env(env),
|
||||
_signal_ep(signal_ep),
|
||||
_nitpicker_screen(new QNitpickerScreen(env)) { }
|
||||
|
||||
|
||||
@ -52,7 +50,6 @@ QPlatformWindow *QNitpickerIntegration::createPlatformWindow(QWindow *window) co
|
||||
|
||||
QRect screen_geometry = _nitpicker_screen->geometry();
|
||||
return new QNitpickerPlatformWindow(_env, window,
|
||||
_signal_ep,
|
||||
screen_geometry.width(),
|
||||
screen_geometry.height());
|
||||
}
|
||||
@ -95,7 +92,7 @@ QPlatformFontDatabase *QNitpickerIntegration::fontDatabase() const
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
QPlatformClipboard *QNitpickerIntegration::clipboard() const
|
||||
{
|
||||
static QGenodeClipboard cb(_env, _signal_ep);
|
||||
static QGenodeClipboard cb(_env);
|
||||
return &cb;
|
||||
}
|
||||
#endif
|
||||
|
@ -30,24 +30,12 @@ class QNitpickerIntegration : public QPlatformIntegration
|
||||
private:
|
||||
|
||||
Genode::Env &_env;
|
||||
|
||||
Genode::Entrypoint &_signal_ep;
|
||||
|
||||
QNitpickerScreen *_nitpicker_screen;
|
||||
|
||||
/*
|
||||
* A reference to the signal receiver gets passed to newly created
|
||||
* objects, for example in 'createPlatformWindow()'. Since this is
|
||||
* a const member function, the signal receiver cannot be a member
|
||||
* variable of QNitpickerIntegration.
|
||||
*/
|
||||
static Genode::Signal_receiver &_signal_receiver();
|
||||
QScopedPointer<QPlatformInputContext> m_inputContext;
|
||||
QScopedPointer<QPlatformInputContext> m_inputContext;
|
||||
|
||||
public:
|
||||
|
||||
QNitpickerIntegration(Genode::Env &env,
|
||||
Genode::Entrypoint &signal_ep);
|
||||
QNitpickerIntegration(Genode::Env &env);
|
||||
|
||||
void initialize() Q_DECL_OVERRIDE;
|
||||
bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
|
||||
|
@ -493,7 +493,6 @@ QString QNitpickerPlatformWindow::_sanitize_label(QString label)
|
||||
|
||||
|
||||
QNitpickerPlatformWindow::QNitpickerPlatformWindow(Genode::Env &env, QWindow *window,
|
||||
Genode::Entrypoint &signal_ep,
|
||||
int screen_width, int screen_height)
|
||||
: QPlatformWindow(window),
|
||||
_env(env),
|
||||
@ -503,17 +502,16 @@ QNitpickerPlatformWindow::QNitpickerPlatformWindow(Genode::Env &env, QWindow *wi
|
||||
_framebuffer(0),
|
||||
_framebuffer_changed(false),
|
||||
_geometry_changed(false),
|
||||
_signal_ep(signal_ep),
|
||||
_view_handle(_create_view()),
|
||||
_input_session(env.rm(), _nitpicker_session.input_session()),
|
||||
_ev_buf(env.rm(), _input_session.dataspace()),
|
||||
_resize_handle(!window->flags().testFlag(Qt::Popup)),
|
||||
_decoration(!window->flags().testFlag(Qt::Popup)),
|
||||
_egl_surface(EGL_NO_SURFACE),
|
||||
_input_signal_handler(_signal_ep, *this,
|
||||
&QNitpickerPlatformWindow::_input),
|
||||
_mode_changed_signal_handler(_signal_ep, *this,
|
||||
&QNitpickerPlatformWindow::_mode_changed),
|
||||
_input_signal_handler(_env.ep(), *this,
|
||||
&QNitpickerPlatformWindow::_handle_input),
|
||||
_mode_changed_signal_handler(_env.ep(), *this,
|
||||
&QNitpickerPlatformWindow::_handle_mode_changed),
|
||||
_touch_device(_init_touch_device())
|
||||
{
|
||||
if (qnpw_verbose)
|
||||
@ -535,14 +533,6 @@ QNitpickerPlatformWindow::QNitpickerPlatformWindow(Genode::Env &env, QWindow *wi
|
||||
_nitpicker_session.enqueue<Command::To_front>(_view_handle);
|
||||
_nitpicker_session.execute();
|
||||
}
|
||||
|
||||
connect(this, SIGNAL(_input()),
|
||||
this, SLOT(_handle_input()),
|
||||
Qt::QueuedConnection);
|
||||
|
||||
connect(this, SIGNAL(_mode_changed()),
|
||||
this, SLOT(_handle_mode_changed()),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
QNitpickerPlatformWindow::~QNitpickerPlatformWindow()
|
||||
|
Loading…
Reference in New Issue
Block a user