diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/cairo.h | 12 | ||||
-rw-r--r-- | include/stringop.h | 7 | ||||
-rw-r--r-- | include/sway/commands.h | 1 | ||||
-rw-r--r-- | include/sway/config.h | 25 | ||||
-rw-r--r-- | include/sway/criteria.h | 2 | ||||
-rw-r--r-- | include/sway/output.h | 2 | ||||
-rw-r--r-- | include/sway/server.h | 6 | ||||
-rw-r--r-- | include/sway/tree/container.h | 21 | ||||
-rw-r--r-- | include/sway/tree/root.h | 2 | ||||
-rw-r--r-- | include/sway/tree/view.h | 16 | ||||
-rw-r--r-- | include/sway/tree/workspace.h | 4 | ||||
-rw-r--r-- | include/util.h | 6 |
12 files changed, 65 insertions, 39 deletions
diff --git a/include/cairo.h b/include/cairo.h index 86530b60..f28c072f 100644 --- a/include/cairo.h +++ b/include/cairo.h | |||
@@ -1,8 +1,13 @@ | |||
1 | #ifndef _SWAY_CAIRO_H | 1 | #ifndef _SWAY_CAIRO_H |
2 | #define _SWAY_CAIRO_H | 2 | #define _SWAY_CAIRO_H |
3 | |||
4 | #include "config.h" | ||
3 | #include <stdint.h> | 5 | #include <stdint.h> |
4 | #include <cairo/cairo.h> | 6 | #include <cairo/cairo.h> |
5 | #include <wlr/types/wlr_output.h> | 7 | #include <wlr/types/wlr_output.h> |
8 | #if HAVE_GDK_PIXBUF | ||
9 | #include <gdk-pixbuf/gdk-pixbuf.h> | ||
10 | #endif | ||
6 | 11 | ||
7 | void cairo_set_source_u32(cairo_t *cairo, uint32_t color); | 12 | void cairo_set_source_u32(cairo_t *cairo, uint32_t color); |
8 | cairo_subpixel_order_t to_cairo_subpixel_order(enum wl_output_subpixel subpixel); | 13 | cairo_subpixel_order_t to_cairo_subpixel_order(enum wl_output_subpixel subpixel); |
@@ -10,12 +15,11 @@ cairo_subpixel_order_t to_cairo_subpixel_order(enum wl_output_subpixel subpixel) | |||
10 | cairo_surface_t *cairo_image_surface_scale(cairo_surface_t *image, | 15 | cairo_surface_t *cairo_image_surface_scale(cairo_surface_t *image, |
11 | int width, int height); | 16 | int width, int height); |
12 | 17 | ||
13 | #include "config.h" | 18 | #if HAVE_GDK_PIXBUF |
14 | #ifdef HAVE_GDK_PIXBUF | ||
15 | #include <gdk-pixbuf/gdk-pixbuf.h> | ||
16 | 19 | ||
17 | cairo_surface_t* gdk_cairo_image_surface_create_from_pixbuf( | 20 | cairo_surface_t* gdk_cairo_image_surface_create_from_pixbuf( |
18 | const GdkPixbuf *gdkbuf); | 21 | const GdkPixbuf *gdkbuf); |
19 | #endif //WITH_GDK_PIXBUF | 22 | |
23 | #endif // HAVE_GDK_PIXBUF | ||
20 | 24 | ||
21 | #endif | 25 | #endif |
diff --git a/include/stringop.h b/include/stringop.h index 01bbdaa9..919e605c 100644 --- a/include/stringop.h +++ b/include/stringop.h | |||
@@ -1,12 +1,7 @@ | |||
1 | #ifndef _SWAY_STRINGOP_H | 1 | #ifndef _SWAY_STRINGOP_H |
2 | #define _SWAY_STRINGOP_H | 2 | #define _SWAY_STRINGOP_H |
3 | #include <stdlib.h> | ||
4 | #include "list.h" | ||
5 | 3 | ||
6 | #if !HAVE_DECL_SETENV | 4 | #include "list.h" |
7 | // Not sure why we need to provide this | ||
8 | extern int setenv(const char *, const char *, int); | ||
9 | #endif | ||
10 | 5 | ||
11 | // array of whitespace characters to use for delims | 6 | // array of whitespace characters to use for delims |
12 | extern const char whitespace[]; | 7 | extern const char whitespace[]; |
diff --git a/include/sway/commands.h b/include/sway/commands.h index 45f9addd..b0339313 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h | |||
@@ -230,6 +230,7 @@ sway_cmd input_cmd_map_to_output; | |||
230 | sway_cmd input_cmd_middle_emulation; | 230 | sway_cmd input_cmd_middle_emulation; |
231 | sway_cmd input_cmd_natural_scroll; | 231 | sway_cmd input_cmd_natural_scroll; |
232 | sway_cmd input_cmd_pointer_accel; | 232 | sway_cmd input_cmd_pointer_accel; |
233 | sway_cmd input_cmd_scroll_factor; | ||
233 | sway_cmd input_cmd_repeat_delay; | 234 | sway_cmd input_cmd_repeat_delay; |
234 | sway_cmd input_cmd_repeat_rate; | 235 | sway_cmd input_cmd_repeat_rate; |
235 | sway_cmd input_cmd_scroll_button; | 236 | sway_cmd input_cmd_scroll_button; |
diff --git a/include/sway/config.h b/include/sway/config.h index 5a355139..4927b8e0 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -100,6 +100,7 @@ struct input_config { | |||
100 | int middle_emulation; | 100 | int middle_emulation; |
101 | int natural_scroll; | 101 | int natural_scroll; |
102 | float pointer_accel; | 102 | float pointer_accel; |
103 | float scroll_factor; | ||
103 | int repeat_delay; | 104 | int repeat_delay; |
104 | int repeat_rate; | 105 | int repeat_rate; |
105 | int scroll_button; | 106 | int scroll_button; |
@@ -168,14 +169,24 @@ struct output_config { | |||
168 | }; | 169 | }; |
169 | 170 | ||
170 | /** | 171 | /** |
172 | * Stores size of gaps for each side | ||
173 | */ | ||
174 | struct side_gaps { | ||
175 | int top; | ||
176 | int right; | ||
177 | int bottom; | ||
178 | int left; | ||
179 | }; | ||
180 | |||
181 | /** | ||
171 | * Stores configuration for a workspace, regardless of whether the workspace | 182 | * Stores configuration for a workspace, regardless of whether the workspace |
172 | * exists. | 183 | * exists. |
173 | */ | 184 | */ |
174 | struct workspace_config { | 185 | struct workspace_config { |
175 | char *workspace; | 186 | char *workspace; |
176 | char *output; | 187 | list_t *outputs; |
177 | int gaps_inner; | 188 | int gaps_inner; |
178 | int gaps_outer; | 189 | struct side_gaps gaps_outer; |
179 | }; | 190 | }; |
180 | 191 | ||
181 | struct bar_config { | 192 | struct bar_config { |
@@ -328,6 +339,12 @@ struct ipc_policy { | |||
328 | uint32_t features; | 339 | uint32_t features; |
329 | }; | 340 | }; |
330 | 341 | ||
342 | enum focus_follows_mouse_mode { | ||
343 | FOLLOWS_NO, | ||
344 | FOLLOWS_YES, | ||
345 | FOLLOWS_ALWAYS | ||
346 | }; | ||
347 | |||
331 | enum focus_wrapping_mode { | 348 | enum focus_wrapping_mode { |
332 | WRAP_NO, | 349 | WRAP_NO, |
333 | WRAP_YES, | 350 | WRAP_YES, |
@@ -379,7 +396,7 @@ struct sway_config { | |||
379 | enum sway_popup_during_fullscreen popup_during_fullscreen; | 396 | enum sway_popup_during_fullscreen popup_during_fullscreen; |
380 | 397 | ||
381 | // Flags | 398 | // Flags |
382 | bool focus_follows_mouse; | 399 | enum focus_follows_mouse_mode focus_follows_mouse; |
383 | enum mouse_warping_mode mouse_warping; | 400 | enum mouse_warping_mode mouse_warping; |
384 | enum focus_wrapping_mode focus_wrapping; | 401 | enum focus_wrapping_mode focus_wrapping; |
385 | bool active; | 402 | bool active; |
@@ -393,7 +410,7 @@ struct sway_config { | |||
393 | 410 | ||
394 | bool smart_gaps; | 411 | bool smart_gaps; |
395 | int gaps_inner; | 412 | int gaps_inner; |
396 | int gaps_outer; | 413 | struct side_gaps gaps_outer; |
397 | 414 | ||
398 | list_t *config_chain; | 415 | list_t *config_chain; |
399 | const char *current_config_path; | 416 | const char *current_config_path; |
diff --git a/include/sway/criteria.h b/include/sway/criteria.h index 323ba01d..3eb583d5 100644 --- a/include/sway/criteria.h +++ b/include/sway/criteria.h | |||
@@ -25,7 +25,7 @@ struct criteria { | |||
25 | pcre *app_id; | 25 | pcre *app_id; |
26 | pcre *con_mark; | 26 | pcre *con_mark; |
27 | uint32_t con_id; // internal ID | 27 | uint32_t con_id; // internal ID |
28 | #ifdef HAVE_XWAYLAND | 28 | #if HAVE_XWAYLAND |
29 | pcre *class; | 29 | pcre *class; |
30 | uint32_t id; // X11 window ID | 30 | uint32_t id; // X11 window ID |
31 | pcre *instance; | 31 | pcre *instance; |
diff --git a/include/sway/output.h b/include/sway/output.h index 5efe1660..43c1ab96 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -119,7 +119,7 @@ void output_layer_for_each_surface(struct sway_output *output, | |||
119 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, | 119 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, |
120 | void *user_data); | 120 | void *user_data); |
121 | 121 | ||
122 | #ifdef HAVE_XWAYLAND | 122 | #if HAVE_XWAYLAND |
123 | void output_unmanaged_for_each_surface(struct sway_output *output, | 123 | void output_unmanaged_for_each_surface(struct sway_output *output, |
124 | struct wl_list *unmanaged, sway_surface_iterator_func_t iterator, | 124 | struct wl_list *unmanaged, sway_surface_iterator_func_t iterator, |
125 | void *user_data); | 125 | void *user_data); |
diff --git a/include/sway/server.h b/include/sway/server.h index 5fced224..a3233d66 100644 --- a/include/sway/server.h +++ b/include/sway/server.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <wlr/types/wlr_xdg_shell.h> | 14 | #include <wlr/types/wlr_xdg_shell.h> |
15 | #include "config.h" | 15 | #include "config.h" |
16 | #include "list.h" | 16 | #include "list.h" |
17 | #ifdef HAVE_XWAYLAND | 17 | #if HAVE_XWAYLAND |
18 | #include "sway/xwayland.h" | 18 | #include "sway/xwayland.h" |
19 | #endif | 19 | #endif |
20 | 20 | ||
@@ -44,7 +44,7 @@ struct sway_server { | |||
44 | struct wlr_xdg_shell *xdg_shell; | 44 | struct wlr_xdg_shell *xdg_shell; |
45 | struct wl_listener xdg_shell_surface; | 45 | struct wl_listener xdg_shell_surface; |
46 | 46 | ||
47 | #ifdef HAVE_XWAYLAND | 47 | #if HAVE_XWAYLAND |
48 | struct sway_xwayland xwayland; | 48 | struct sway_xwayland xwayland; |
49 | struct wl_listener xwayland_surface; | 49 | struct wl_listener xwayland_surface; |
50 | struct wl_listener xwayland_ready; | 50 | struct wl_listener xwayland_ready; |
@@ -80,7 +80,7 @@ void handle_idle_inhibitor_v1(struct wl_listener *listener, void *data); | |||
80 | void handle_layer_shell_surface(struct wl_listener *listener, void *data); | 80 | void handle_layer_shell_surface(struct wl_listener *listener, void *data); |
81 | void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); | 81 | void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); |
82 | void handle_xdg_shell_surface(struct wl_listener *listener, void *data); | 82 | void handle_xdg_shell_surface(struct wl_listener *listener, void *data); |
83 | #ifdef HAVE_XWAYLAND | 83 | #if HAVE_XWAYLAND |
84 | void handle_xwayland_surface(struct wl_listener *listener, void *data); | 84 | void handle_xwayland_surface(struct wl_listener *listener, void *data); |
85 | #endif | 85 | #endif |
86 | void handle_server_decoration(struct wl_listener *listener, void *data); | 86 | void handle_server_decoration(struct wl_listener *listener, void *data); |
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 4366a010..f907aad2 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -41,8 +41,8 @@ enum wlr_direction; | |||
41 | struct sway_container_state { | 41 | struct sway_container_state { |
42 | // Container properties | 42 | // Container properties |
43 | enum sway_container_layout layout; | 43 | enum sway_container_layout layout; |
44 | double con_x, con_y; | 44 | double x, y; |
45 | double con_width, con_height; | 45 | double width, height; |
46 | 46 | ||
47 | bool is_fullscreen; | 47 | bool is_fullscreen; |
48 | 48 | ||
@@ -60,9 +60,8 @@ struct sway_container_state { | |||
60 | bool border_left; | 60 | bool border_left; |
61 | bool border_right; | 61 | bool border_right; |
62 | 62 | ||
63 | // View properties | 63 | double content_x, content_y; |
64 | double view_x, view_y; | 64 | double content_width, content_height; |
65 | double view_width, view_height; | ||
66 | }; | 65 | }; |
67 | 66 | ||
68 | struct sway_container { | 67 | struct sway_container { |
@@ -89,6 +88,9 @@ struct sway_container { | |||
89 | double saved_x, saved_y; | 88 | double saved_x, saved_y; |
90 | double saved_width, saved_height; | 89 | double saved_width, saved_height; |
91 | 90 | ||
91 | double content_x, content_y; | ||
92 | int content_width, content_height; | ||
93 | |||
92 | bool is_fullscreen; | 94 | bool is_fullscreen; |
93 | 95 | ||
94 | enum sway_container_border border; | 96 | enum sway_container_border border; |
@@ -104,7 +106,12 @@ struct sway_container { | |||
104 | bool border_right; | 106 | bool border_right; |
105 | 107 | ||
106 | // The gaps currently applied to the container. | 108 | // The gaps currently applied to the container. |
107 | double current_gaps; | 109 | struct { |
110 | int top; | ||
111 | int right; | ||
112 | int bottom; | ||
113 | int left; | ||
114 | } current_gaps; | ||
108 | 115 | ||
109 | struct sway_workspace *workspace; // NULL when hidden in the scratchpad | 116 | struct sway_workspace *workspace; // NULL when hidden in the scratchpad |
110 | struct sway_container *parent; // NULL if container in root of workspace | 117 | struct sway_container *parent; // NULL if container in root of workspace |
@@ -205,7 +212,7 @@ void container_init_floating(struct sway_container *container); | |||
205 | 212 | ||
206 | void container_set_floating(struct sway_container *container, bool enable); | 213 | void container_set_floating(struct sway_container *container, bool enable); |
207 | 214 | ||
208 | void container_set_geometry_from_floating_view(struct sway_container *con); | 215 | void container_set_geometry_from_content(struct sway_container *con); |
209 | 216 | ||
210 | /** | 217 | /** |
211 | * Determine if the given container is itself floating. | 218 | * Determine if the given container is itself floating. |
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h index a2d464f9..ceccc920 100644 --- a/include/sway/tree/root.h +++ b/include/sway/tree/root.h | |||
@@ -16,7 +16,7 @@ struct sway_root { | |||
16 | struct wlr_output_layout *output_layout; | 16 | struct wlr_output_layout *output_layout; |
17 | 17 | ||
18 | struct wl_listener output_layout_change; | 18 | struct wl_listener output_layout_change; |
19 | #ifdef HAVE_XWAYLAND | 19 | #if HAVE_XWAYLAND |
20 | struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link | 20 | struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link |
21 | #endif | 21 | #endif |
22 | struct wl_list drag_icons; // sway_drag_icon::link | 22 | struct wl_list drag_icons; // sway_drag_icon::link |
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 4a8c3cb1..4716c688 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <wlr/types/wlr_surface.h> | 4 | #include <wlr/types/wlr_surface.h> |
5 | #include <wlr/types/wlr_xdg_shell_v6.h> | 5 | #include <wlr/types/wlr_xdg_shell_v6.h> |
6 | #include "config.h" | 6 | #include "config.h" |
7 | #ifdef HAVE_XWAYLAND | 7 | #if HAVE_XWAYLAND |
8 | #include <wlr/xwayland.h> | 8 | #include <wlr/xwayland.h> |
9 | #endif | 9 | #endif |
10 | #include "sway/input/input-manager.h" | 10 | #include "sway/input/input-manager.h" |
@@ -16,7 +16,7 @@ struct sway_xdg_decoration; | |||
16 | enum sway_view_type { | 16 | enum sway_view_type { |
17 | SWAY_VIEW_XDG_SHELL_V6, | 17 | SWAY_VIEW_XDG_SHELL_V6, |
18 | SWAY_VIEW_XDG_SHELL, | 18 | SWAY_VIEW_XDG_SHELL, |
19 | #ifdef HAVE_XWAYLAND | 19 | #if HAVE_XWAYLAND |
20 | SWAY_VIEW_XWAYLAND, | 20 | SWAY_VIEW_XWAYLAND, |
21 | #endif | 21 | #endif |
22 | }; | 22 | }; |
@@ -28,7 +28,7 @@ enum sway_view_prop { | |||
28 | VIEW_PROP_INSTANCE, | 28 | VIEW_PROP_INSTANCE, |
29 | VIEW_PROP_WINDOW_TYPE, | 29 | VIEW_PROP_WINDOW_TYPE, |
30 | VIEW_PROP_WINDOW_ROLE, | 30 | VIEW_PROP_WINDOW_ROLE, |
31 | #ifdef HAVE_XWAYLAND | 31 | #if HAVE_XWAYLAND |
32 | VIEW_PROP_X11_WINDOW_ID, | 32 | VIEW_PROP_X11_WINDOW_ID, |
33 | VIEW_PROP_X11_PARENT_ID, | 33 | VIEW_PROP_X11_PARENT_ID, |
34 | #endif | 34 | #endif |
@@ -67,10 +67,6 @@ struct sway_view { | |||
67 | 67 | ||
68 | pid_t pid; | 68 | pid_t pid; |
69 | 69 | ||
70 | // Geometry of the view itself (excludes borders) in layout coordinates | ||
71 | double x, y; | ||
72 | int width, height; | ||
73 | |||
74 | double saved_x, saved_y; | 70 | double saved_x, saved_y; |
75 | int saved_width, saved_height; | 71 | int saved_width, saved_height; |
76 | 72 | ||
@@ -104,7 +100,7 @@ struct sway_view { | |||
104 | union { | 100 | union { |
105 | struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; | 101 | struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; |
106 | struct wlr_xdg_surface *wlr_xdg_surface; | 102 | struct wlr_xdg_surface *wlr_xdg_surface; |
107 | #ifdef HAVE_XWAYLAND | 103 | #if HAVE_XWAYLAND |
108 | struct wlr_xwayland_surface *wlr_xwayland_surface; | 104 | struct wlr_xwayland_surface *wlr_xwayland_surface; |
109 | #endif | 105 | #endif |
110 | struct wlr_wl_shell_surface *wlr_wl_shell_surface; | 106 | struct wlr_wl_shell_surface *wlr_wl_shell_surface; |
@@ -148,7 +144,7 @@ struct sway_xdg_shell_view { | |||
148 | struct wl_listener unmap; | 144 | struct wl_listener unmap; |
149 | struct wl_listener destroy; | 145 | struct wl_listener destroy; |
150 | }; | 146 | }; |
151 | #ifdef HAVE_XWAYLAND | 147 | #if HAVE_XWAYLAND |
152 | struct sway_xwayland_view { | 148 | struct sway_xwayland_view { |
153 | struct sway_view view; | 149 | struct sway_view view; |
154 | 150 | ||
@@ -327,7 +323,7 @@ struct sway_view *view_from_wlr_xdg_surface( | |||
327 | struct wlr_xdg_surface *xdg_surface); | 323 | struct wlr_xdg_surface *xdg_surface); |
328 | struct sway_view *view_from_wlr_xdg_surface_v6( | 324 | struct sway_view *view_from_wlr_xdg_surface_v6( |
329 | struct wlr_xdg_surface_v6 *xdg_surface_v6); | 325 | struct wlr_xdg_surface_v6 *xdg_surface_v6); |
330 | #ifdef HAVE_XWAYLAND | 326 | #if HAVE_XWAYLAND |
331 | struct sway_view *view_from_wlr_xwayland_surface( | 327 | struct sway_view *view_from_wlr_xwayland_surface( |
332 | struct wlr_xwayland_surface *xsurface); | 328 | struct wlr_xwayland_surface *xsurface); |
333 | #endif | 329 | #endif |
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index b5ae92f3..7abfbff1 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h | |||
@@ -32,9 +32,9 @@ struct sway_workspace { | |||
32 | enum sway_container_layout layout; | 32 | enum sway_container_layout layout; |
33 | enum sway_container_layout prev_split_layout; | 33 | enum sway_container_layout prev_split_layout; |
34 | 34 | ||
35 | int current_gaps; | 35 | struct side_gaps current_gaps; |
36 | int gaps_inner; | 36 | int gaps_inner; |
37 | int gaps_outer; | 37 | struct side_gaps gaps_outer; |
38 | 38 | ||
39 | struct sway_output *output; // NULL if no outputs are connected | 39 | struct sway_output *output; // NULL if no outputs are connected |
40 | list_t *floating; // struct sway_container | 40 | list_t *floating; // struct sway_container |
diff --git a/include/util.h b/include/util.h index f143d0c0..84318fe7 100644 --- a/include/util.h +++ b/include/util.h | |||
@@ -59,6 +59,12 @@ uint32_t parse_color(const char *color); | |||
59 | */ | 59 | */ |
60 | bool parse_boolean(const char *boolean, bool current); | 60 | bool parse_boolean(const char *boolean, bool current); |
61 | 61 | ||
62 | /** | ||
63 | * Given a string that represents a floating point value, return a float. | ||
64 | * Returns NAN on error. | ||
65 | */ | ||
66 | float parse_float(const char *value); | ||
67 | |||
62 | enum wlr_direction opposite_direction(enum wlr_direction d); | 68 | enum wlr_direction opposite_direction(enum wlr_direction d); |
63 | 69 | ||
64 | #endif | 70 | #endif |