aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/config.h')
-rw-r--r--include/sway/config.h67
1 files changed, 40 insertions, 27 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 59f22ae2..2e24c3ae 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -5,9 +5,10 @@
5#include <string.h> 5#include <string.h>
6#include <time.h> 6#include <time.h>
7#include <wlr/interfaces/wlr_switch.h> 7#include <wlr/interfaces/wlr_switch.h>
8#include <wlr/types/wlr_box.h>
9#include <wlr/types/wlr_tablet_tool.h> 8#include <wlr/types/wlr_tablet_tool.h>
9#include <wlr/util/box.h>
10#include <xkbcommon/xkbcommon.h> 10#include <xkbcommon/xkbcommon.h>
11#include <xf86drmMode.h>
11#include "../include/config.h" 12#include "../include/config.h"
12#include "list.h" 13#include "list.h"
13#include "swaynag.h" 14#include "swaynag.h"
@@ -47,7 +48,7 @@ enum binding_flags {
47}; 48};
48 49
49/** 50/**
50 * A key binding and an associated command. 51 * A key (or mouse) binding and an associated command.
51 */ 52 */
52struct sway_binding { 53struct sway_binding {
53 enum binding_input_type type; 54 enum binding_input_type type;
@@ -61,12 +62,10 @@ struct sway_binding {
61 char *command; 62 char *command;
62}; 63};
63 64
64/** 65enum sway_switch_trigger {
65 * A mouse binding and an associated command. 66 SWAY_SWITCH_TRIGGER_OFF,
66 */ 67 SWAY_SWITCH_TRIGGER_ON,
67struct sway_mouse_binding { 68 SWAY_SWITCH_TRIGGER_TOGGLE,
68 uint32_t button;
69 char *command;
70}; 69};
71 70
72/** 71/**
@@ -74,7 +73,7 @@ struct sway_mouse_binding {
74 */ 73 */
75struct sway_switch_binding { 74struct sway_switch_binding {
76 enum wlr_switch_type type; 75 enum wlr_switch_type type;
77 enum wlr_switch_state state; 76 enum sway_switch_trigger trigger;
78 uint32_t flags; 77 uint32_t flags;
79 char *command; 78 char *command;
80}; 79};
@@ -246,6 +245,12 @@ enum scale_filter_mode {
246 SCALE_FILTER_SMART, 245 SCALE_FILTER_SMART,
247}; 246};
248 247
248enum render_bit_depth {
249 RENDER_BIT_DEPTH_DEFAULT, // the default is currently 8
250 RENDER_BIT_DEPTH_8,
251 RENDER_BIT_DEPTH_10,
252};
253
249/** 254/**
250 * Size and position configuration for a particular output. 255 * Size and position configuration for a particular output.
251 * 256 *
@@ -257,6 +262,7 @@ struct output_config {
257 int width, height; 262 int width, height;
258 float refresh_rate; 263 float refresh_rate;
259 int custom_mode; 264 int custom_mode;
265 drmModeModeInfo drm_mode;
260 int x, y; 266 int x, y;
261 float scale; 267 float scale;
262 enum scale_filter_mode scale_filter; 268 enum scale_filter_mode scale_filter;
@@ -264,6 +270,7 @@ struct output_config {
264 enum wl_output_subpixel subpixel; 270 enum wl_output_subpixel subpixel;
265 int max_render_time; // In milliseconds 271 int max_render_time; // In milliseconds
266 int adaptive_sync; 272 int adaptive_sync;
273 enum render_bit_depth render_bit_depth;
267 274
268 char *background; 275 char *background;
269 char *background_option; 276 char *background_option;
@@ -281,6 +288,12 @@ struct side_gaps {
281 int left; 288 int left;
282}; 289};
283 290
291enum smart_gaps_mode {
292 SMART_GAPS_OFF,
293 SMART_GAPS_ON,
294 SMART_GAPS_INVERSE_OUTER,
295};
296
284/** 297/**
285 * Stores configuration for a workspace, regardless of whether the workspace 298 * Stores configuration for a workspace, regardless of whether the workspace
286 * exists. 299 * exists.
@@ -292,6 +305,12 @@ struct workspace_config {
292 struct side_gaps gaps_outer; 305 struct side_gaps gaps_outer;
293}; 306};
294 307
308enum pango_markup_config {
309 PANGO_MARKUP_DISABLED = false,
310 PANGO_MARKUP_ENABLED = true,
311 PANGO_MARKUP_DEFAULT // The default is font dependent ("pango:" prefix)
312};
313
295struct bar_config { 314struct bar_config {
296 char *swaybar_command; 315 char *swaybar_command;
297 struct wl_client *client; 316 struct wl_client *client;
@@ -323,7 +342,7 @@ struct bar_config {
323 char *position; 342 char *position;
324 list_t *bindings; 343 list_t *bindings;
325 char *status_command; 344 char *status_command;
326 bool pango_markup; 345 enum pango_markup_config pango_markup;
327 char *font; 346 char *font;
328 int height; // -1 not defined 347 int height; // -1 not defined
329 bool workspace_buttons; 348 bool workspace_buttons;
@@ -410,14 +429,6 @@ enum sway_popup_during_fullscreen {
410 POPUP_LEAVE, 429 POPUP_LEAVE,
411}; 430};
412 431
413enum command_context {
414 CONTEXT_CONFIG = 1 << 0,
415 CONTEXT_BINDING = 1 << 1,
416 CONTEXT_IPC = 1 << 2,
417 CONTEXT_CRITERIA = 1 << 3,
418 CONTEXT_ALL = 0xFFFFFFFF,
419};
420
421enum focus_follows_mouse_mode { 432enum focus_follows_mouse_mode {
422 FOLLOWS_NO, 433 FOLLOWS_NO,
423 FOLLOWS_YES, 434 FOLLOWS_YES,
@@ -480,8 +491,8 @@ struct sway_config {
480 enum sway_container_layout default_orientation; 491 enum sway_container_layout default_orientation;
481 enum sway_container_layout default_layout; 492 enum sway_container_layout default_layout;
482 char *font; 493 char *font;
483 size_t font_height; 494 int font_height;
484 size_t font_baseline; 495 int font_baseline;
485 bool pango_markup; 496 bool pango_markup;
486 int titlebar_border_thickness; 497 int titlebar_border_thickness;
487 int titlebar_h_padding; 498 int titlebar_h_padding;
@@ -512,7 +523,7 @@ struct sway_config {
512 bool tiling_drag; 523 bool tiling_drag;
513 int tiling_drag_threshold; 524 int tiling_drag_threshold;
514 525
515 bool smart_gaps; 526 enum smart_gaps_mode smart_gaps;
516 int gaps_inner; 527 int gaps_inner;
517 struct side_gaps gaps_outer; 528 struct side_gaps gaps_outer;
518 529
@@ -535,12 +546,15 @@ struct sway_config {
535 struct { 546 struct {
536 struct border_colors focused; 547 struct border_colors focused;
537 struct border_colors focused_inactive; 548 struct border_colors focused_inactive;
549 struct border_colors focused_tab_title;
538 struct border_colors unfocused; 550 struct border_colors unfocused;
539 struct border_colors urgent; 551 struct border_colors urgent;
540 struct border_colors placeholder; 552 struct border_colors placeholder;
541 float background[4]; 553 float background[4];
542 } border_colors; 554 } border_colors;
543 555
556 bool has_focused_tab_title;
557
544 // floating view 558 // floating view
545 int32_t floating_maximum_width; 559 int32_t floating_maximum_width;
546 int32_t floating_maximum_height; 560 int32_t floating_maximum_height;
@@ -559,7 +573,7 @@ struct sway_config {
559 struct sway_node *node; 573 struct sway_node *node;
560 struct sway_container *container; 574 struct sway_container *container;
561 struct sway_workspace *workspace; 575 struct sway_workspace *workspace;
562 bool using_criteria; 576 bool node_overridden; // True if the node is selected by means other than focus
563 struct { 577 struct {
564 int argc; 578 int argc;
565 char **argv; 579 char **argv;
@@ -690,14 +704,13 @@ void free_bar_binding(struct bar_binding *binding);
690void free_workspace_config(struct workspace_config *wsc); 704void free_workspace_config(struct workspace_config *wsc);
691 705
692/** 706/**
693 * Updates the value of config->font_height based on the max title height 707 * Updates the value of config->font_height based on the metrics for title's
694 * reported by each container. If recalculate is true, the containers will 708 * font as reported by pango.
695 * recalculate their heights before reporting. 709 *
696 *
697 * If the height has changed, all containers will be rearranged to take on the 710 * If the height has changed, all containers will be rearranged to take on the
698 * new size. 711 * new size.
699 */ 712 */
700void config_update_font_height(bool recalculate); 713void config_update_font_height(void);
701 714
702/** 715/**
703 * Convert bindsym into bindcode using the first configured layout. 716 * Convert bindsym into bindcode using the first configured layout.