return;
qInfo() << "app_id: " << app_id;
+}
- if (strcmp(app_id, "onescreenapp") == 0)
- emit ev_handler->signalOnReplyShowWindow(app_id);
+static void
+application_state_event(void *data, struct agl_shell_desktop *agl_shell_desktop,
+ const char *app_id, const char *app_data, uint32_t app_state, uint32_t app_role)
+{
+ /* unused */
+ (void) data;
+ (void) app_id;
+ (void) app_data;
+ (void) app_role;
+ (void) app_state;
+ (void) agl_shell_desktop;
}
static const struct agl_shell_desktop_listener agl_shell_desk_listener = {
application_id_event,
+ application_state_event,
};
static struct agl_shell_desktop *
if (shell_desktop)
agl_shell_desktop_add_listener(shell_desktop, &agl_shell_desk_listener, this);
+
+ m_launcher = new Launcher(DEFAULT_AFM_UNIX_SOCK, nullptr);
+ if (m_launcher->setup_pws_connection() != 0)
+ HMI_DEBUG("onscreen", "EventHandler::init failed to set-up connection to afm-system-daemon");
+
#if 0
myThis = this;
mp_wm = new QLibWindowmanager();
{
if (shell_desktop) {
struct wl_output *output = getWlOutput(qApp->screens().first());
- agl_shell_desktop_activate_app(shell_desktop, id.toStdString().c_str(), output);
+ agl_shell_desktop_activate_app(shell_desktop,
+ id.toStdString().c_str(),
+ json.toStdString().c_str(),
+ output);
}
qInfo() << "data from json: " << json.toStdString().c_str();
mp_hs->hideWindow(id.toStdString().c_str());
#endif
}
+
+int
+EventHandler::start(const QString &app_id)
+{
+ int pid = -1;
+
+ if (m_launcher && m_launcher->connection_is_set())
+ pid = m_launcher->start(app_id);
+
+ return pid;
+}
+
+bool
+EventHandler::is_running(const QString &app_id)
+{
+ if (m_launcher && m_launcher->connection_is_set())
+ return m_launcher->is_running(app_id);
+
+ return false;
+}
+
+void
+EventHandler::set_window_popup(const QString &app_id, int x, int y)
+{
+ struct wl_output *output = getWlOutput(qApp->screens().first());
+
+ if (shell_desktop)
+ agl_shell_desktop_set_app_property(shell_desktop,
+ app_id.toStdString().c_str(),
+ AGL_SHELL_DESKTOP_APP_ROLE_POPUP, x, y, output);
+}