X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fmanage.h;h=ba5473740e1fbdec47e2909c803813777e194a8a;hp=45ddf6a6179ec9b894761fb5c43b44cf59ddf0d6;hb=e3aec18706513a87eaa7839dfdaf7e0fcd0d8d2a;hpb=de22e45179cb3bafa490294d31d47f361047a30a diff --git a/ioncore/manage.h b/ioncore/manage.h index 45ddf6a..ba54737 100644 --- a/ioncore/manage.h +++ b/ioncore/manage.h @@ -1,12 +1,9 @@ /* * ion/ioncore/manage.h * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2009. * - * 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,15 +98,21 @@ extern WPHolder *region_prepare_manage_transient_default(WRegion *reg, /* Rescue */ +#define REGION_RESCUE_PHFLAGS_OK 0x01 +#define REGION_RESCUE_NODEEP 0x02 + INTRSTRUCT(WRescueInfo); +extern WPHolder *rescueinfo_pholder(WRescueInfo *info); + /* 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(WRegion *reg, WPHolder *ph, int flags); 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); +extern bool region_do_rescue_this(WRegion *tosave, WRescueInfo *info, int ph_flags); #endif /* ION_IONCORE_MANAGE_H */