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 @@ #ifndef _SWAY_CAIRO_H #define _SWAY_CAIRO_H + +#include "config.h" #include <stdint.h> #include <cairo/cairo.h> #include <wlr/types/wlr_output.h> +#if HAVE_GDK_PIXBUF +#include <gdk-pixbuf/gdk-pixbuf.h> +#endif void cairo_set_source_u32(cairo_t *cairo, uint32_t color); 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) cairo_surface_t *cairo_image_surface_scale(cairo_surface_t *image, int width, int height); -#include "config.h" -#ifdef HAVE_GDK_PIXBUF -#include <gdk-pixbuf/gdk-pixbuf.h> +#if HAVE_GDK_PIXBUF cairo_surface_t* gdk_cairo_image_surface_create_from_pixbuf( const GdkPixbuf *gdkbuf); -#endif //WITH_GDK_PIXBUF + +#endif // HAVE_GDK_PIXBUF #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 @@ #ifndef _SWAY_STRINGOP_H #define _SWAY_STRINGOP_H -#include <stdlib.h> -#include "list.h" -#if !HAVE_DECL_SETENV -// Not sure why we need to provide this -extern int setenv(const char *, const char *, int); -#endif +#include "list.h" // array of whitespace characters to use for delims 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; sway_cmd input_cmd_middle_emulation; sway_cmd input_cmd_natural_scroll; sway_cmd input_cmd_pointer_accel; +sway_cmd input_cmd_scroll_factor; sway_cmd input_cmd_repeat_delay; sway_cmd input_cmd_repeat_rate; 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 { int middle_emulation; int natural_scroll; float pointer_accel; + float scroll_factor; int repeat_delay; int repeat_rate; int scroll_button; @@ -168,14 +169,24 @@ struct output_config { }; /** + * Stores size of gaps for each side + */ +struct side_gaps { + int top; + int right; + int bottom; + int left; +}; + +/** * Stores configuration for a workspace, regardless of whether the workspace * exists. */ struct workspace_config { char *workspace; - char *output; + list_t *outputs; int gaps_inner; - int gaps_outer; + struct side_gaps gaps_outer; }; struct bar_config { @@ -328,6 +339,12 @@ struct ipc_policy { uint32_t features; }; +enum focus_follows_mouse_mode { + FOLLOWS_NO, + FOLLOWS_YES, + FOLLOWS_ALWAYS +}; + enum focus_wrapping_mode { WRAP_NO, WRAP_YES, @@ -379,7 +396,7 @@ struct sway_config { enum sway_popup_during_fullscreen popup_during_fullscreen; // Flags - bool focus_follows_mouse; + enum focus_follows_mouse_mode focus_follows_mouse; enum mouse_warping_mode mouse_warping; enum focus_wrapping_mode focus_wrapping; bool active; @@ -393,7 +410,7 @@ struct sway_config { bool smart_gaps; int gaps_inner; - int gaps_outer; + struct side_gaps gaps_outer; list_t *config_chain; 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 { pcre *app_id; pcre *con_mark; uint32_t con_id; // internal ID -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND pcre *class; uint32_t id; // X11 window ID 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, struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, void *user_data); -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND void output_unmanaged_for_each_surface(struct sway_output *output, struct wl_list *unmanaged, sway_surface_iterator_func_t iterator, 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 @@ #include <wlr/types/wlr_xdg_shell.h> #include "config.h" #include "list.h" -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND #include "sway/xwayland.h" #endif @@ -44,7 +44,7 @@ struct sway_server { struct wlr_xdg_shell *xdg_shell; struct wl_listener xdg_shell_surface; -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND struct sway_xwayland xwayland; struct wl_listener xwayland_surface; struct wl_listener xwayland_ready; @@ -80,7 +80,7 @@ void handle_idle_inhibitor_v1(struct wl_listener *listener, void *data); void handle_layer_shell_surface(struct wl_listener *listener, void *data); void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); void handle_xdg_shell_surface(struct wl_listener *listener, void *data); -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND void handle_xwayland_surface(struct wl_listener *listener, void *data); #endif 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; struct sway_container_state { // Container properties enum sway_container_layout layout; - double con_x, con_y; - double con_width, con_height; + double x, y; + double width, height; bool is_fullscreen; @@ -60,9 +60,8 @@ struct sway_container_state { bool border_left; bool border_right; - // View properties - double view_x, view_y; - double view_width, view_height; + double content_x, content_y; + double content_width, content_height; }; struct sway_container { @@ -89,6 +88,9 @@ struct sway_container { double saved_x, saved_y; double saved_width, saved_height; + double content_x, content_y; + int content_width, content_height; + bool is_fullscreen; enum sway_container_border border; @@ -104,7 +106,12 @@ struct sway_container { bool border_right; // The gaps currently applied to the container. - double current_gaps; + struct { + int top; + int right; + int bottom; + int left; + } current_gaps; struct sway_workspace *workspace; // NULL when hidden in the scratchpad struct sway_container *parent; // NULL if container in root of workspace @@ -205,7 +212,7 @@ void container_init_floating(struct sway_container *container); void container_set_floating(struct sway_container *container, bool enable); -void container_set_geometry_from_floating_view(struct sway_container *con); +void container_set_geometry_from_content(struct sway_container *con); /** * 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 { struct wlr_output_layout *output_layout; struct wl_listener output_layout_change; -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link #endif 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 @@ #include <wlr/types/wlr_surface.h> #include <wlr/types/wlr_xdg_shell_v6.h> #include "config.h" -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND #include <wlr/xwayland.h> #endif #include "sway/input/input-manager.h" @@ -16,7 +16,7 @@ struct sway_xdg_decoration; enum sway_view_type { SWAY_VIEW_XDG_SHELL_V6, SWAY_VIEW_XDG_SHELL, -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND SWAY_VIEW_XWAYLAND, #endif }; @@ -28,7 +28,7 @@ enum sway_view_prop { VIEW_PROP_INSTANCE, VIEW_PROP_WINDOW_TYPE, VIEW_PROP_WINDOW_ROLE, -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND VIEW_PROP_X11_WINDOW_ID, VIEW_PROP_X11_PARENT_ID, #endif @@ -67,10 +67,6 @@ struct sway_view { pid_t pid; - // Geometry of the view itself (excludes borders) in layout coordinates - double x, y; - int width, height; - double saved_x, saved_y; int saved_width, saved_height; @@ -104,7 +100,7 @@ struct sway_view { union { struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; struct wlr_xdg_surface *wlr_xdg_surface; -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND struct wlr_xwayland_surface *wlr_xwayland_surface; #endif struct wlr_wl_shell_surface *wlr_wl_shell_surface; @@ -148,7 +144,7 @@ struct sway_xdg_shell_view { struct wl_listener unmap; struct wl_listener destroy; }; -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND struct sway_xwayland_view { struct sway_view view; @@ -327,7 +323,7 @@ struct sway_view *view_from_wlr_xdg_surface( struct wlr_xdg_surface *xdg_surface); struct sway_view *view_from_wlr_xdg_surface_v6( struct wlr_xdg_surface_v6 *xdg_surface_v6); -#ifdef HAVE_XWAYLAND +#if HAVE_XWAYLAND struct sway_view *view_from_wlr_xwayland_surface( struct wlr_xwayland_surface *xsurface); #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 { enum sway_container_layout layout; enum sway_container_layout prev_split_layout; - int current_gaps; + struct side_gaps current_gaps; int gaps_inner; - int gaps_outer; + struct side_gaps gaps_outer; struct sway_output *output; // NULL if no outputs are connected 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); */ bool parse_boolean(const char *boolean, bool current); +/** + * Given a string that represents a floating point value, return a float. + * Returns NAN on error. + */ +float parse_float(const char *value); + enum wlr_direction opposite_direction(enum wlr_direction d); #endif |