+struct shell_data {
+ struct agl_shell *shell;
+ struct agl_shell_desktop *shell_desktop;
+};
+
+static void
+agl_shell_desktop_application(void *data,
+ struct agl_shell_desktop *agl_shell_desktop,
+ const char *app_id)
+{
+ HomescreenHandler *homescreenHandler = static_cast<HomescreenHandler *>(data);
+
+ if (homescreenHandler)
+ homescreenHandler->addAppToStack(app_id);
+}
+
+static void
+agl_shell_desktop_state_app(void *data,
+ struct agl_shell_desktop *agl_shell_desktop,
+ const char *app_id,
+ const char *app_data,
+ uint32_t state,
+ uint32_t role)
+{
+ HomescreenHandler *homescreenHandler = static_cast<HomescreenHandler *>(data);
+
+ if (homescreenHandler && state == AGL_SHELL_DESKTOP_APP_STATE_DESTROYED)
+ homescreenHandler->appTerminated(app_id);
+}
+
+static const struct agl_shell_desktop_listener shell_desktop_listener = {
+ agl_shell_desktop_application,
+ agl_shell_desktop_state_app
+};
+