X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fmanage.h;h=d0faed21956fbe354597497a1eb14d2efe509ca6;hp=5354beaa501317fb4eb8c7a786e41fb5484bb032;hb=ae4260bb64817c11f9a7140324cd3e3ba113e297;hpb=8366314611bf30a0f31d25bf5f5023186fa87692 diff --git a/ioncore/manage.h b/ioncore/manage.h index 5354bea..d0faed2 100644 --- a/ioncore/manage.h +++ b/ioncore/manage.h @@ -1,12 +1,9 @@ /* * ion/ioncore/manage.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #ifndef ION_IONCORE_MANAGE_H @@ -28,12 +25,29 @@ INTRSTRUCT(WManageParams); {FALSE, FALSE, FALSE, FALSE, FALSE, ForgetGravity, {0, 0, 0, 0}, NULL} enum{ - MANAGE_REDIR_PREFER_YES, - MANAGE_REDIR_PREFER_NO, - MANAGE_REDIR_STRICT_YES, - MANAGE_REDIR_STRICT_NO + MANAGE_PRIORITY_NONE, + MANAGE_PRIORITY_LOW, + MANAGE_PRIORITY_NORMAL, + MANAGE_PRIORITY_GROUP, + MANAGE_PRIORITY_NO, + /* Special */ + MANAGE_PRIORITY_NOREDIR }; +#define MANAGE_PRIORITY_OK(PRIORITY, OUR) \ + ((PRIORITY) <= (OUR) || (PRIORITY)==MANAGE_PRIORITY_NOREDIR) + +#define MANAGE_PRIORITY_SUB(PRIORITY, OUR) \ + ((PRIORITY)==MANAGE_PRIORITY_NOREDIR \ + ? MANAGE_PRIORITY_NO \ + : (PRIORITY) < (OUR) ? (OUR) : (PRIORITY)) + +#define MANAGE_PRIORITY_SUBX(PRIORITY, OUR) \ + ((PRIORITY)==MANAGE_PRIORITY_NOREDIR || (OUR) < (PRIORITY) \ + ? MANAGE_PRIORITY_NO \ + : MANAGE_PRIORITY_NONE) + + DECLSTRUCT(WManageParams){ bool switchto; bool jumpto; @@ -84,9 +98,14 @@ extern WPHolder *region_prepare_manage_transient_default(WRegion *reg, /* Rescue */ -extern bool region_rescue_clientwins(WRegion *reg, WPHolder *ph); -extern bool region_rescue_child_clientwins(WRegion *reg, WPHolder *ph); -extern bool region_rescue_some_clientwins(WRegion *reg, WPHolder *ph, +INTRSTRUCT(WRescueInfo); + +/* if ph is given, it is used, otherwise one is looked for when needed */ +extern bool region_rescue(WRegion *reg, WPHolder *ph); +extern bool region_rescue_needed(WRegion *reg); +extern bool region_rescue_clientwins(WRegion *reg, WRescueInfo *info); +extern bool region_rescue_child_clientwins(WRegion *reg, WRescueInfo *info); +extern bool region_rescue_some_clientwins(WRegion *reg, WRescueInfo *info, WRegionIterator *iter, void *st);