aboutsummaryrefslogtreecommitdiffstats
path: root/calmwm.h
diff options
context:
space:
mode:
authoroga2009-12-10 17:16:51 +0000
committeroga2009-12-10 17:16:51 +0000
commit14ac3391c5d071a67de062f4857280212e12afdb (patch)
tree7b3c4be635704fcb02ad2444a881fe93e02b595f /calmwm.h
parent4c4c8d61c662cfe45e4aa6b6662a1c00947225db (diff)
downloadcwm-14ac3391c5d071a67de062f4857280212e12afdb.tar.gz
finish unfucking the screen_ctx handling.
remove screen_current() it was utterly bogus when nscreens > 1. pass a fake client_ctx in the case where there's no client and the kbfunc or mousefunc doesn't need a real one, it just contains the current screen, modify these functions so that they pass down the screen context to their callees. make groups per screen, it's the only way it makes sense in this regard. ok okan@.
Diffstat (limited to '')
-rw-r--r--calmwm.h84
1 files changed, 43 insertions, 41 deletions
diff --git a/calmwm.h b/calmwm.h
index ed475fd..14fb7e7 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: calmwm.h,v 1.103 2009/12/08 16:52:17 okan Exp $
+ * $Id: calmwm.h,v 1.104 2009/12/10 17:16:51 oga Exp $
*/
#ifndef _CALMWM_H_
@@ -59,31 +59,48 @@ struct color {
struct client_ctx;
TAILQ_HEAD(cycle_entry_q, client_ctx);
+TAILQ_HEAD(group_ctx_q, group_ctx);
+TAILQ_HEAD(client_ctx_q, client_ctx);
+
+#define CALMWM_NGROUPS 9
+struct group_ctx {
+ TAILQ_ENTRY(group_ctx) entry;
+ struct client_ctx_q clients;
+ const char *name;
+ int shortcut;
+ int hidden;
+ int nhidden;
+ int highstack;
+};
struct screen_ctx {
- TAILQ_ENTRY(screen_ctx) entry;
+ TAILQ_ENTRY(screen_ctx) entry;
- u_int which;
- Window rootwin;
- Window menuwin;
+ u_int which;
+ Window rootwin;
+ Window menuwin;
- struct color color[CWM_COLOR_MAX];
- GC gc;
+ struct color color[CWM_COLOR_MAX];
+ GC gc;
- int altpersist;
+ int altpersist;
- int xmax;
- int ymax;
+ int xmax;
+ int ymax;
- struct cycle_entry_q mruq;
+ struct cycle_entry_q mruq;
- XftDraw *xftdraw;
- XftColor xftcolor;
- XftFont *font;
- u_int fontheight;
+ XftDraw *xftdraw;
+ XftColor xftcolor;
+ XftFont *font;
+ u_int fontheight;
- int xinerama_no;
- XineramaScreenInfo *xinerama;
+ int xinerama_no;
+ XineramaScreenInfo *xinerama;
+ struct group_ctx *group_active;
+ struct group_ctx groups[CALMWM_NGROUPS];
+ int group_hideall;
+ struct group_ctx_q groupq;
};
TAILQ_HEAD(screen_ctx_q, screen_ctx);
@@ -157,23 +174,8 @@ struct client_ctx {
char *app_cliarg;
};
-TAILQ_HEAD(client_ctx_q, client_ctx);
-
extern const char *shortcut_to_name[];
-#define CALMWM_NGROUPS 9
-struct group_ctx {
- TAILQ_ENTRY(group_ctx) entry;
- struct client_ctx_q clients;
- const char *name;
- int shortcut;
- int hidden;
- int nhidden;
- int highstack;
-};
-
-TAILQ_HEAD(group_ctx_q, group_ctx);
-
/* Autogroups */
struct autogroupwin {
TAILQ_ENTRY(autogroupwin) entry;
@@ -354,11 +356,12 @@ void client_vertmaximize(struct client_ctx *);
void client_horizmaximize(struct client_ctx *);
void client_map(struct client_ctx *);
void client_mtf(struct client_ctx *);
-struct client_ctx *client_cycle(int);
+struct client_ctx *client_cycle(struct screen_ctx *, int);
void client_getsizehints(struct client_ctx *);
void client_applysizehints(struct client_ctx *);
-struct menu *menu_filter(struct menu_q *, char *, char *, int,
+struct menu *menu_filter(struct screen_ctx *, struct menu_q *,
+ char *, char *, int,
void (*)(struct menu_q *, struct menu_q *, char *),
void (*)(struct menu *, int));
void menu_init(struct screen_ctx *);
@@ -397,8 +400,7 @@ void *xcalloc(size_t, size_t);
char *xstrdup(const char *);
struct screen_ctx *screen_fromroot(Window);
-struct screen_ctx *screen_current(void);
-void screen_updatestackingorder(void);
+void screen_updatestackingorder(struct screen_ctx *);
void screen_init_xinerama(struct screen_ctx *);
XineramaScreenInfo *screen_find_xinerama(struct screen_ctx *, int, int);
@@ -471,14 +473,14 @@ void search_match_text(struct menu_q *, struct menu_q *,
void search_match_exec(struct menu_q *, struct menu_q *,
char *);
-void group_init(void);
-void group_hidetoggle(int);
-void group_only(int);
-void group_cycle(int);
+void group_init(struct screen_ctx *);
+void group_hidetoggle(struct screen_ctx *, int);
+void group_only(struct screen_ctx *, int);
+void group_cycle(struct screen_ctx *, int);
void group_sticky(struct client_ctx *);
void group_client_delete(struct client_ctx *);
void group_menu(XButtonEvent *);
-void group_alltoggle(void);
+void group_alltoggle(struct screen_ctx *);
void group_sticky_toggle_enter(struct client_ctx *);
void group_sticky_toggle_exit(struct client_ctx *);
void group_autogroup(struct client_ctx *);