]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/region.h
Imported Upstream version 20090110
[ion3.git] / ioncore / region.h
index b2feff748852b02ee512ed4f7f3d24cfcd4d9792..ea4e5d54410390aa54a9edbfd79d8be50026f547 100644 (file)
@@ -1,43 +1,43 @@
 /*
  * ion/ioncore/region.h
  *
- * Copyright (c) Tuomo Valkonen 1999-2006
+ * 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_REGION_H
 #define ION_IONCORE_REGION_H
 
 #include <libtu/obj.h>
+#include <libtu/stringstore.h>
 #include <libmainloop/hooks.h>
 #include "common.h"
 #include "rectangle.h"
 
-#define REGION_MAPPED        0x0001
-#define REGION_ACTIVE        0x0002
-#define REGION_HAS_GRABS     0x0004
-#define REGION_TAGGED        0x0008
+#define REGION_MAPPED               0x0001
+#define REGION_ACTIVE               0x0002
+#define REGION_HAS_GRABS            0x0004
+#define REGION_TAGGED               0x0008
+#define REGION_PSEUDOACTIVE         0x0010
 #define REGION_BINDINGS_ARE_GRABBED 0x0020
-#define REGION_GRAB_ON_PARENT 0x0040
-#define REGION_ACTIVITY      0x0100
-#define REGION_SKIP_FOCUS    0x0200
-#define REGION_CWINS_BEING_RESCUED 0x0400
-#define REGION_PLEASE_WARP   0x0800
+#define REGION_GRAB_ON_PARENT       0x0040
+#define REGION_ACTIVITY             0x0100
+#define REGION_SKIP_FOCUS           0x0200
+#define REGION_CWINS_BEING_RESCUED  0x0400
+#define REGION_PLEASE_WARP          0x0800
 #define REGION_BINDING_UPDATE_SCHEDULED 0x1000
 
-#define REGION_GOTO_FOCUS    0x0001
-#define REGION_GOTO_NOWARP   0x0002
-#define REGION_GOTO_ENTERWINDOW 0x0004
+#define REGION_GOTO_FOCUS           0x0001
+#define REGION_GOTO_NOWARP          0x0002
+#define REGION_GOTO_ENTERWINDOW     0x0004
 
 /* Use region_is_fully_mapped instead for most cases. */
 #define REGION_IS_MAPPED(R)     (((WRegion*)(R))->flags&REGION_MAPPED)
 #define REGION_MARK_MAPPED(R)   (((WRegion*)(R))->flags|=REGION_MAPPED)
 #define REGION_MARK_UNMAPPED(R) (((WRegion*)(R))->flags&=~REGION_MAPPED)
 #define REGION_IS_ACTIVE(R)     (((WRegion*)(R))->flags&REGION_ACTIVE)
+#define REGION_IS_PSEUDOACTIVE(R) (((WRegion*)(R))->flags&REGION_PSEUDOACTIVE)
 #define REGION_IS_TAGGED(R)     (((WRegion*)(R))->flags&REGION_TAGGED)
 #define REGION_IS_URGENT(R)     (((WRegion*)(R))->flags&REGION_URGENT)
 #define REGION_GEOM(R)          (((WRegion*)(R))->geom)
@@ -58,6 +58,8 @@
 
 typedef int WRegionFitMode;
 
+typedef StringId WRegionNotify;
+
 
 typedef enum{
     REGION_ORDER_FRONT,
@@ -126,19 +128,17 @@ DYNFUN Window region_xwindow(const WRegion *reg);
 DYNFUN void region_activated(WRegion *reg);
 DYNFUN void region_inactivated(WRegion *reg);
 DYNFUN void region_updategr(WRegion *reg);
-DYNFUN bool region_rqclose(WRegion *reg, bool relocate);
+DYNFUN void region_rqclose(WRegion *reg, bool relocate);
 DYNFUN WRegion *region_rqclose_propagate(WRegion *reg, WRegion *maybe_sub);
 DYNFUN WRegion *region_current(WRegion *mgr);
 DYNFUN void region_notify_rootpos(WRegion *reg, int x, int y);
-DYNFUN bool region_may_destroy(WRegion *reg);
+DYNFUN bool region_may_dispose(WRegion *reg);
 DYNFUN WRegion *region_managed_control_focus(WRegion *mgr, WRegion *reg);
 DYNFUN void region_managed_remove(WRegion *reg, WRegion *sub);
 DYNFUN bool region_managed_prepare_focus(WRegion *reg, WRegion *sub, 
                                          int flags, WPrepareFocusResult *res);
-DYNFUN void region_managed_activated(WRegion *reg, WRegion *sub);
-DYNFUN void region_managed_inactivated(WRegion *reg, WRegion *sub);
-DYNFUN void region_managed_notify(WRegion *reg, WRegion *sub, const char *how);
-DYNFUN bool region_managed_may_destroy(WRegion *mgr, WRegion *reg);
+DYNFUN void region_managed_notify(WRegion *reg, WRegion *sub, WRegionNotify how);
+DYNFUN WRegion *region_managed_disposeroot(WRegion *mgr, WRegion *reg);
 DYNFUN bool region_managed_rqorder(WRegion *reg, WRegion *sub, 
                                    WRegionOrder order);
 
@@ -162,7 +162,7 @@ extern bool region_reparent(WRegion *reg, WWindow *target,
 extern void region_updategr_default(WRegion *reg);
 
 extern void region_rootpos(WRegion *reg, int *xret, int *yret);
-extern void region_notify_change(WRegion *reg, const char *how);
+extern void region_notify_change(WRegion *reg, WRegionNotify how);
 
 extern bool region_goto(WRegion *reg);
 extern bool region_goto_flags(WRegion *reg, int flags);
@@ -171,6 +171,12 @@ extern bool region_is_fully_mapped(WRegion *reg);
 
 extern void region_detach_manager(WRegion *reg);
 
+extern WRegion *region_disposeroot(WRegion *reg);
+
+extern bool region_dispose(WRegion *reg);
+extern bool region_rqdispose(WRegion *reg);
+extern void region_defer_rqdispose(WRegion *reg);
+
 extern WWindow *region_parent(WRegion *reg);
 extern WRegion *region_manager(WRegion *reg);
 extern WRegion *region_manager_or_parent(WRegion *reg);
@@ -184,10 +190,11 @@ extern Window region_root_of(const WRegion *reg);
 extern WScreen *region_screen_of(WRegion *reg);
 extern bool region_same_rootwin(const WRegion *reg1, const WRegion *reg2);
 
-extern bool region_manager_allows_destroying(WRegion *reg);
-
 extern WRegion *region_managed_within(WRegion *reg, WRegion *mgd);
 
+extern void region_set_manager_pseudoactivity(WRegion *reg);
+extern void region_unset_manager_pseudoactivity(WRegion *reg);
+
 extern WHook *region_notify_hook;
 
 #endif /* ION_IONCORE_REGION_H */