#include <stdbool.h>
#include "config.h"
-#include <libweston-6/compositor-drm.h>
-#include <libweston-6/compositor.h>
-#include <libweston-6/windowed-output-api.h>
-#include <libweston-6/libweston-desktop.h>
+#include <libweston/backend-drm.h>
+#include <libweston/libweston.h>
+#include <libweston/windowed-output-api.h>
+#include <libweston-desktop/libweston-desktop.h>
#include "agl-shell-server-protocol.h"
-#define ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
+struct ivi_compositor;
+
+struct desktop_client {
+ struct wl_resource *resource;
+ struct ivi_compositor *ivi;
+ struct wl_list link; /* ivi_compositor::desktop_clients */
+};
struct ivi_compositor {
struct weston_compositor *compositor;
const struct weston_drm_output_api *drm_api;
struct wl_global *agl_shell;
+ struct wl_global *agl_shell_desktop;
struct {
- int activate_apps_by_default; /* switches once xdg top level has been 'created' */
+ bool activate_apps_by_default; /* switches once xdg top level has been 'created' */
} quirks;
struct {
bool ready;
} shell_client;
+ struct wl_list desktop_clients; /* desktop_client::link */
+
struct wl_list outputs; /* ivi_output.link */
struct wl_list surfaces; /* ivi_surface.link */
struct weston_desktop *desktop;
+ struct ivi_policy *policy;
struct wl_list pending_surfaces;
+ struct wl_list popup_pending_apps;
struct weston_layer hidden;
struct weston_layer background;
struct weston_layer normal;
struct weston_layer panel;
+ struct weston_layer popup;
struct weston_layer fullscreen;
};
struct weston_geometry area;
struct ivi_surface *active;
+ struct ivi_surface *previous_active;
/* Temporary: only used during configuration */
size_t add_len;
IVI_SURFACE_ROLE_DESKTOP,
IVI_SURFACE_ROLE_BACKGROUND,
IVI_SURFACE_ROLE_PANEL,
+ IVI_SURFACE_ROLE_POPUP,
+};
+
+struct pending_popup {
+ struct ivi_output *ioutput;
+ char *app_id;
+ int x; int y;
+
+ struct wl_list link; /** ivi_compositor::popup_pending_surfaces */
};
struct ivi_desktop_surface {
struct ivi_output *output;
};
+struct ivi_popup_surface {
+ struct ivi_output *output;
+ int x;
+ int y;
+};
+
struct ivi_panel_surface {
struct ivi_output *output;
enum agl_shell_edge edge;
int32_t x, y;
int32_t width, height;
} pending;
+ bool activated_by_default;
enum ivi_surface_role role;
union {
struct ivi_desktop_surface desktop;
struct ivi_background_surface bg;
struct ivi_panel_surface panel;
+ struct ivi_popup_surface popup;
};
};
void
ivi_set_desktop_surface(struct ivi_surface *surface);
+/*
+ * removes the pending popup one
+ */
+bool
+ivi_check_pending_desktop_surface_popup(struct ivi_surface *surface);
+
+void
+ivi_set_desktop_surface_popup(struct ivi_surface *surface);
+
void
ivi_reflow_outputs(struct ivi_compositor *ivi);
int32_t x, int32_t y,
int32_t width, int32_t height);
+struct ivi_surface *
+ivi_find_app(struct ivi_compositor *ivi, const char *app_id);
+
void
ivi_layout_commit(struct ivi_compositor *ivi);
void
ivi_layout_panel_committed(struct ivi_surface *surface);
+void
+ivi_layout_popup_committed(struct ivi_surface *surface);
+
+void
+ivi_layout_deactivate(struct ivi_compositor *ivi, const char *app_id);
+
#endif