bool show;
bool preview;
bool outlines;
- uint32_t criteria;
+ enum lab_view_criteria criteria;
struct wl_list fields; /* struct window_switcher_field.link */
} window_switcher;
LAB_STATE_DISABLED
};
-/* All criteria is applied in AND logic */
+/*
+ * This enum type is a set of bit flags where each set bit makes the
+ * criteria more restrictive. For example:
+ *
+ * (LAB_VIEW_CRITERIA_FULLSCREEN | LAB_VIEW_CRITERIA_CURRENT_WORKSPACE)
+ * matches only fullscreen views on the current workspace, while
+ *
+ * (LAB_VIEW_CRITERIA_ALWAYS_ON_TOP | LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP)
+ * would be contradictory and match nothing at all.
+ */
enum lab_view_criteria {
/* No filter -> all focusable views */
LAB_VIEW_CRITERIA_NONE = 0,
* to make them available even in builds with xwayland support disabled.
*/
enum lab_window_type {
+ LAB_WINDOW_TYPE_INVALID = -1,
LAB_WINDOW_TYPE_DESKTOP = 0,
LAB_WINDOW_TYPE_DOCK,
LAB_WINDOW_TYPE_TOOLBAR,
struct buf;
struct view;
struct server;
-enum lab_cycle_dir;
/* Begin window switcher */
void osd_begin(struct server *server, enum lab_cycle_dir direction);
#define LABWC_OUTPUT_H
#include <wlr/types/wlr_output.h>
-
-enum lab_edge;
+#include "common/edge.h"
#define LAB_NR_LAYERS (4)
struct wl_list link;
char *identifier;
char *title;
- int window_type;
+ enum lab_window_type window_type;
char *sandbox_engine;
char *sandbox_app_id;
enum lab_tristate shaded;
#include <stdbool.h>
#include <wayland-util.h>
+#include "config/types.h"
enum window_rule_event {
LAB_WINDOW_RULE_EVENT_ON_FIRST_MAP = 0,
struct window_rule {
char *identifier;
char *title;
- int window_type;
+ enum lab_window_type window_type;
char *sandbox_engine;
char *sandbox_app_id;
bool match_once;
static void load_default_key_bindings(void);
static void load_default_mouse_bindings(void);
-static int
+static enum lab_window_type
parse_window_type(const char *type)
{
if (!type) {
- return -1;
+ return LAB_WINDOW_TYPE_INVALID;
}
if (!strcasecmp(type, "desktop")) {
return LAB_WINDOW_TYPE_DESKTOP;
} else if (!strcasecmp(type, "normal")) {
return LAB_WINDOW_TYPE_NORMAL;
} else {
- return -1;
+ return LAB_WINDOW_TYPE_INVALID;
}
}
fill_window_rule(xmlNode *node)
{
struct window_rule *window_rule = znew(*window_rule);
- window_rule->window_type = -1; // Window types are >= 0
+ window_rule->window_type = LAB_WINDOW_TYPE_INVALID;
wl_list_append(&rc.window_rules, &window_rule->link);
wl_list_init(&window_rule->actions);
rc.tablet.force_mouse_emulation = false;
rc.tablet.output_name = NULL;
- rc.tablet.rotation = 0;
+ rc.tablet.rotation = LAB_ROTATE_NONE;
rc.tablet.box = (struct wlr_fbox){0};
tablet_load_default_button_mappings();
rc.tablet_tool.motion = LAB_MOTION_ABSOLUTE;
t[i].value = button[i];
t[i].type = TOKEN_INT;
}
- t[size].type = 0;
+ t[size].type = TOKEN_NONE;
process_bytes(&pixmap, t, color);
return pixmap;
}
cursor_set_visible(seat, /* visible */ true);
if (seat->cursor_scroll_wheel_emulation) {
- uint32_t orientation;
+ enum wl_pointer_axis orientation;
double delta;
if (fabs(event->delta_x) > fabs(event->delta_y)) {
orientation = WL_POINTER_AXIS_HORIZONTAL_SCROLL;
*/
last_button = 0;
last_view = NULL;
- last_type = 0;
+ last_type = LAB_SSD_NONE;
return true;
}
return false;
{
struct view_query *query = znew(*query);
/* Must be synced with view_matches_criteria() in window-rules.c */
- query->window_type = -1;
+ query->window_type = LAB_WINDOW_TYPE_INVALID;
query->maximized = VIEW_AXIS_INVALID;
query->decoration = LAB_SSD_MODE_INVALID;
return query;
return false;
}
- if (query->window_type >= 0 && !view_contains_window_type(view, query->window_type)) {
+ if (query->window_type != LAB_WINDOW_TYPE_INVALID
+ && !view_contains_window_type(view, query->window_type)) {
return false;
}