mirror of
https://github.com/labwc/labwc.git
synced 2026-02-15 22:05:25 -05:00
tree-wide: use enum types/constants where appropriate
- add LAB_WINDOW_TYPE_INVALID in place of literal -1 - document more clearly that enum lab_view_criteria is a bitset - other one-off replacements of integer values/types for consistency Note: variables of type enum lab_view_criteria are already used extensively throughout the code to contain combinations of the declared enum values. I am not introducing any new usage here, just changing the single uint32_t to be consistent with all the other usages.
This commit is contained in:
parent
ef766d16f0
commit
80b28f16c7
10 changed files with 27 additions and 17 deletions
|
|
@ -79,7 +79,7 @@ view_query_create(void)
|
|||
{
|
||||
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;
|
||||
|
|
@ -132,7 +132,8 @@ view_matches_query(struct view *view, struct view_query *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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue