This commit is contained in:
Drew DeVault 2016-01-29 10:08:37 +00:00
commit 53dea65cd0
11 changed files with 130 additions and 68 deletions

View file

@ -77,6 +77,9 @@ struct sway_container {
bool is_focused;
bool sticky; // floating view always visible on its output
// Custom arrange function
void (*arrange)(struct sway_container *, double width, double height);
// Attributes that mostly views have.
char *name;
char *class;

View file

@ -5,40 +5,43 @@
#include <wlc/wlc-wayland.h>
#include "wayland-desktop-shell-server-protocol.h"
#include "list.h"
#include "container.h"
struct background_config {
wlc_handle output;
wlc_resource surface;
// we need the wl_resource of the surface in the destructor
struct wl_resource *wl_surface_res;
wlc_handle output;
wlc_handle handle;
wlc_resource surface;
// we need the wl_resource of the surface in the destructor
struct wl_resource *wl_surface_res;
};
struct panel_config {
// wayland resource used in callbacks, is used to track this panel
struct wl_resource *wl_resource;
wlc_handle output;
wlc_resource surface;
// we need the wl_resource of the surface in the destructor
struct wl_resource *wl_surface_res;
enum desktop_shell_panel_position panel_position;
// wayland resource used in callbacks, is used to track this panel
struct wl_resource *wl_resource;
wlc_handle output;
wlc_resource surface;
// we need the wl_resource of the surface in the destructor
struct wl_resource *wl_surface_res;
enum desktop_shell_panel_position panel_position;
};
struct desktop_shell_state {
list_t *backgrounds;
list_t *panels;
list_t *lock_surfaces;
bool is_locked;
struct wlc_size panel_size;
list_t *backgrounds;
list_t *panels;
list_t *lock_surfaces;
bool is_locked;
struct wlc_size panel_size;
};
struct swaylock_state {
bool active;
wlc_handle output;
wlc_resource surface;
bool active;
wlc_handle output;
wlc_resource surface;
};
extern struct desktop_shell_state desktop_shell;
void register_extensions(void);
void arrange_background_view(swayc_t *view, double width, double height);
#endif

View file

@ -16,4 +16,6 @@ void get_absolute_position(swayc_t *container, struct wlc_point *point);
// given wlc_point.
void get_absolute_center_position(swayc_t *container, struct wlc_point *point);
struct output_config *config_for_output(wlc_handle output);
#endif