aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/wm/wm.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/wm/wm.h')
-rw-r--r--sys/cmd/wm/wm.h123
1 files changed, 114 insertions, 9 deletions
diff --git a/sys/cmd/wm/wm.h b/sys/cmd/wm/wm.h
index b9731e9..e1d3670 100644
--- a/sys/cmd/wm/wm.h
+++ b/sys/cmd/wm/wm.h
@@ -10,15 +10,28 @@
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_compositor.h>
+#include <wlr/types/wlr_data_control_v1.h>
#include <wlr/types/wlr_data_device.h>
+#include <wlr/types/wlr_export_dmabuf_v1.h>
+#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_keyboard.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
+#include <wlr/types/wlr_output_management_v1.h>
+#include <wlr/types/wlr_primary_selection.h>
+#include <wlr/types/wlr_primary_selection_v1.h>
#include <wlr/types/wlr_pointer.h>
+#include <wlr/types/wlr_presentation_time.h>
+#include <wlr/types/wlr_screencopy_v1.h>
+#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_seat.h>
+#include <wlr/types/wlr_viewporter.h>
#include <wlr/types/wlr_xcursor_manager.h>
+#include <wlr/types/wlr_xdg_activation_v1.h>
+#include <wlr/types/wlr_xdg_decoration_v1.h>
+#include <wlr/types/wlr_xdg_output_v1.h>
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h>
@@ -26,6 +39,11 @@
#include <xkbcommon/xkbcommon.h>
// -----------------------------------------------------------------------
+// macros
+
+#define ROUND(x) ((int)((x)+0.5))
+
+// -----------------------------------------------------------------------
// types
enum
@@ -35,11 +53,45 @@ enum
CursorResize,
};
+typedef union Arg Arg;
+typedef struct Button Button;
+typedef struct Key Key;
typedef struct Keyboard Keyboard;
typedef struct Client Client;
+typedef struct Layout Layout;
typedef struct Monitor Monitor;
typedef struct Server Server;
+struct Rectangle
+{
+ int x, y;
+ int w, h;
+};
+
+union Arg
+{
+ int i;
+ uint ui;
+ float f;
+ void *v;
+};
+
+struct Key
+{
+ uint modifier;
+ xkb_keysym_t sym;
+ void (*action)(Arg *);
+ Arg arg;
+};
+
+struct Button
+{
+ uint mod;
+ uint button;
+ void (*func)(const Arg *);
+ const Arg arg;
+};
+
struct Keyboard
{
struct wl_list link;
@@ -47,21 +99,41 @@ struct Keyboard
struct {
struct wl_listener press;
struct wl_listener modify;
+ struct wl_listener destroy;
} event;
};
struct Client
{
struct wl_list link;
+ struct wl_list stack;
+
struct wlr_xdg_surface *xdg;
+
struct {
struct wl_listener map;
struct wl_listener unmap;
struct wl_listener destroy;
struct wl_listener request_move;
+ struct wl_listener request_title;
struct wl_listener request_resize;
+ struct wl_listener request_fullscreen;
} event;
- int x, y, mapped;
+
+ struct wlr_box geo, oldgeo;
+
+ uint tags;
+ int border : 4;
+ int ismapped : 1;
+ int isfloating : 1;
+ int isurgent : 1;
+ int isfullscreen : 1;
+};
+
+struct Layout
+{
+ char *symbol;
+ void (*arrange)(Monitor *);
};
struct Monitor
@@ -70,20 +142,45 @@ struct Monitor
struct wlr_output *output;
struct {
struct wl_listener render;
+ struct wl_listener destroy;
} event;
};
+struct MonitorRule
+{
+ char *name;
+ float mfact;
+ int nmaster;
+ float scale;
+ const Layout *lt;
+ enum wl_output_transform rr;
+ int x;
+ int y;
+};
+
+struct Rule
+{
+ char *id;
+ char *title;
+ uint tags;
+ int floating;
+ int monitor;
+};
+
struct Server
{
- struct wl_display *display;
- struct wlr_backend *backend;
- struct wlr_renderer *renderer;
+ struct wl_display *display;
+ struct wlr_backend *backend;
+ struct wlr_renderer *renderer;
+ struct wlr_presentation *present;
struct {
struct wlr_xdg_shell *xdg;
} shell;
struct wl_list clients;
+ struct wl_list stack;
+ Client *selected;
struct {
Client *client;
@@ -95,7 +192,7 @@ struct Server
struct {
struct wlr_output_layout *layout;
struct wl_list list;
- } output;
+ } monitor;
struct {
struct wlr_cursor *dot;
@@ -109,9 +206,10 @@ struct Server
} input;
struct {
- struct wl_listener make_output;
struct wl_listener make_input;
+ struct wl_listener make_monitor;
struct wl_listener make_xdg_surface;
+ struct wl_listener make_layer_surface;
struct wl_listener cursor_move;
struct wl_listener cursor_move_abs;
@@ -129,8 +227,11 @@ extern struct Server server;
// -----------------------------------------------------------------------
// functions
+/* util.c */
+void scale_box(struct wlr_box *, float);
+
/* output.c */
-void make_output(struct wl_listener *, void *);
+void make_monitor(struct wl_listener *, void *);
/* xdg.c */
void make_xdg_surface(struct wl_listener *, void *);
@@ -149,6 +250,10 @@ void request_set_selection(struct wl_listener *, void *);
/* client.c */
void focus(Client *client, struct wlr_surface *new);
-Client* clientat(double, double, struct wlr_surface **, double *, double *);
-int clienthas(Client *, double, double, struct wlr_surface **, double *, double *);
+Client* client_at(double, double, struct wlr_surface **, double *, double *);
+int client_has(Client *, double, double, struct wlr_surface **, double *, double *);
void setinteractive(Client *client, int mode, uint32 edges);
+
+#define CONFIG(a,b,...) extern a cfg·##b
+#include "config.h"
+#undef CONFIG