-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added automatic generation of ewmh atom list and corresponding name m…
…apping. Added a scheme utility to maintain this mapping.
- Loading branch information
1 parent
5d65fdc
commit 2d0fd6e
Showing
15 changed files
with
189 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2017, Jeffrey E. Bedard | ||
#ifndef JBWM_JBWMATOMINDEX_H | ||
#define JBWM_JBWMATOMINDEX_H | ||
enum JBWMAtomIndex{ | ||
JBWM_EWMH_SUPPORTED, | ||
JBWM_EWMH_CURRENT_DESKTOP, | ||
JBWM_EWMH_NUMBER_OF_DESKTOPS, | ||
JBWM_EWMH_DESKTOP_VIEWPORT, | ||
JBWM_EWMH_DESKTOP_GEOMETRY, | ||
JBWM_EWMH_SUPPORTING_WM_CHECK, | ||
JBWM_EWMH_ACTIVE_WINDOW, | ||
JBWM_EWMH_MOVERESIZE_WINDOW, | ||
JBWM_EWMH_CLOSE_WINDOW, | ||
JBWM_EWMH_CLIENT_LIST, | ||
JBWM_EWMH_VIRTUAL_ROOTS, | ||
JBWM_EWMH_CLIENT_LIST_STACKING, | ||
JBWM_EWMH_FRAME_EXTENTS, | ||
|
||
JBWM_EWMH_WM_ALLOWED_ACTIONS, | ||
JBWM_EWMH_WM_NAME, | ||
JBWM_EWMH_WM_DESKTOP, | ||
JBWM_EWMH_WM_MOVERESIZE, | ||
JBWM_EWMH_WM_PID, | ||
JBWM_EWMH_WM_WINDOW_TYPE, | ||
JBWM_EWMH_WM_STATE, | ||
|
||
JBWM_EWMH_WM_ACTION_MOVE, | ||
JBWM_EWMH_WM_ACTION_RESIZE, | ||
JBWM_EWMH_WM_ACTION_CLOSE, | ||
JBWM_EWMH_WM_ACTION_SHADE, | ||
JBWM_EWMH_WM_ACTION_FULLSCREEN, | ||
JBWM_EWMH_WM_ACTION_CHANGE_DESKTOP, | ||
JBWM_EWMH_WM_ACTION_ABOVE, | ||
JBWM_EWMH_WM_ACTION_BELOW, | ||
JBWM_EWMH_WM_ACTION_MAXIMIZE_HORZ, | ||
JBWM_EWMH_WM_ACTION_MAXIMIZE_VERT, | ||
|
||
JBWM_EWMH_WM_STATE_STICKY, | ||
JBWM_EWMH_WM_STATE_MAXIMIZED_VERT, | ||
JBWM_EWMH_WM_STATE_MAXIMIZED_HORZ, | ||
JBWM_EWMH_WM_STATE_SHADED, | ||
JBWM_EWMH_WM_STATE_HIDDEN, | ||
JBWM_EWMH_WM_STATE_FULLSCREEN, | ||
JBWM_EWMH_WM_STATE_ABOVE, | ||
JBWM_EWMH_WM_STATE_BELOW, | ||
JBWM_EWMH_WM_STATE_FOCUSED, | ||
|
||
// The following entry must be last: | ||
JBWM_EWMH_ATOMS_COUNT, | ||
}; | ||
#endif//JBWM_JBWMATOMINDEX_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
":";exec guile -s $0 "$@" | ||
; for MIT Scheme | ||
(define copyright "Copyright 2017, Jeffrey E. Bedard") | ||
(define net '("SUPPORTED" "CURRENT_DESKTOP" "NUMBER_OF_DESKTOPS" | ||
"DESKTOP_VIEWPORT" "DESKTOP_GEOMETRY" "SUPPORTING_WM_CHECK" | ||
"ACTIVE_WINDOW" "MOVERESIZE_WINDOW" "CLOSE_WINDOW" "CLIENT_LIST" | ||
"VIRTUAL_ROOTS" "CLIENT_LIST_STACKING" "FRAME_EXTENTS")) | ||
(define wm '("ALLOWED_ACTIONS" "NAME" "DESKTOP" "MOVERESIZE" "PID" | ||
"WINDOW_TYPE" "STATE")) | ||
(define wm-action '("MOVE" "RESIZE" "CLOSE" "SHADE" "FULLSCREEN" | ||
"CHANGE_DESKTOP" "ABOVE" "BELOW" "MAXIMIZE_HORZ" "MAXIMIZE_VERT")) | ||
(define wm-state '("STICKY" "MAXIMIZED_VERT" "MAXIMIZED_HORZ" "SHADED" | ||
"HIDDEN" "FULLSCREEN" "ABOVE" "BELOW" "FOCUSED")) | ||
(define get-copyright-line (lambda () | ||
(string-append "// " copyright "\n"))) | ||
(define begin-array-definition (lambda (name) (begin | ||
(display (string-append (get-copyright-line) | ||
"static char * " name " [] = {\n")) | ||
0))) | ||
(define begin-enum-definition (lambda (name) | ||
(display (string-append "enum " name "{\n")))) | ||
(define end-c-definition (lambda () (display "};\n"))) | ||
(define master-prefix "_NET_") | ||
(define print-each (lambda (prefix l) | ||
(if (null? l) | ||
(begin (display "\n") 0) | ||
(begin | ||
(display (string-append "\t\"" master-prefix | ||
prefix (car l) "\",\n")) | ||
(print-each prefix (cdr l)))))) | ||
(define print-enum-line (lambda (prefix item) | ||
(display (string-append "\t" master-prefix prefix item ",\n")))) | ||
(define print-each-enum (lambda (prefix l) | ||
(if (null? l) | ||
(begin (display "\n") 0) | ||
(begin | ||
(print-enum-line prefix (car l)) | ||
(print-each-enum prefix (cdr l)))))) | ||
; (begin (display (string-append | ||
; "\t" master-prefix prefix (car l) ",\n")) | ||
; (print-each-enum prefix (cdr l)))))) | ||
|
||
; The execution begins: | ||
|
||
; For atom_names: | ||
(define f (open-output-file "ewmh_atoms.c")) | ||
(set-current-output-port! f) | ||
(begin-array-definition "jbwm_atom_names") | ||
(print-each "" net) | ||
(print-each "WM_" wm) | ||
(print-each "WM_ACTION_" wm-action) | ||
(print-each "WM_STATE_" wm-state) | ||
(end-c-definition) | ||
;(display "};\n") | ||
(close-port f) | ||
|
||
; JBWMAtomIndex: | ||
(define f (open-output-file "JBWMAtomIndex.h")) | ||
(set-current-output-port! f) | ||
(display (string-append | ||
(get-copyright-line) | ||
"#ifndef JBWM_JBWMATOMINDEX_H\n" | ||
"#define JBWM_JBWMATOMINDEX_H\n")) | ||
(begin-enum-definition "JBWMAtomIndex") | ||
(set! master-prefix "JBWM_EWMH_") | ||
(print-each-enum "" net) | ||
(print-each-enum "WM_" wm) | ||
(print-each-enum "WM_ACTION_" wm-action) | ||
(print-each-enum "WM_STATE_" wm-state) | ||
(display "\t// The following entry must be last:\n") | ||
(print-enum-line "" "ATOMS_COUNT") | ||
(end-c-definition) | ||
(display "#endif//JBWM_JBWMATOMINDEX_H\n") | ||
(close-port f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2017, Jeffrey E. Bedard | ||
static char * jbwm_atom_names [] = { | ||
"_NET_SUPPORTED", | ||
"_NET_CURRENT_DESKTOP", | ||
"_NET_NUMBER_OF_DESKTOPS", | ||
"_NET_DESKTOP_VIEWPORT", | ||
"_NET_DESKTOP_GEOMETRY", | ||
"_NET_SUPPORTING_WM_CHECK", | ||
"_NET_ACTIVE_WINDOW", | ||
"_NET_MOVERESIZE_WINDOW", | ||
"_NET_CLOSE_WINDOW", | ||
"_NET_CLIENT_LIST", | ||
"_NET_VIRTUAL_ROOTS", | ||
"_NET_CLIENT_LIST_STACKING", | ||
"_NET_FRAME_EXTENTS", | ||
|
||
"_NET_WM_ALLOWED_ACTIONS", | ||
"_NET_WM_NAME", | ||
"_NET_WM_DESKTOP", | ||
"_NET_WM_MOVERESIZE", | ||
"_NET_WM_PID", | ||
"_NET_WM_WINDOW_TYPE", | ||
"_NET_WM_STATE", | ||
|
||
"_NET_WM_ACTION_MOVE", | ||
"_NET_WM_ACTION_RESIZE", | ||
"_NET_WM_ACTION_CLOSE", | ||
"_NET_WM_ACTION_SHADE", | ||
"_NET_WM_ACTION_FULLSCREEN", | ||
"_NET_WM_ACTION_CHANGE_DESKTOP", | ||
"_NET_WM_ACTION_ABOVE", | ||
"_NET_WM_ACTION_BELOW", | ||
"_NET_WM_ACTION_MAXIMIZE_HORZ", | ||
"_NET_WM_ACTION_MAXIMIZE_VERT", | ||
|
||
"_NET_WM_STATE_STICKY", | ||
"_NET_WM_STATE_MAXIMIZED_VERT", | ||
"_NET_WM_STATE_MAXIMIZED_HORZ", | ||
"_NET_WM_STATE_SHADED", | ||
"_NET_WM_STATE_HIDDEN", | ||
"_NET_WM_STATE_FULLSCREEN", | ||
"_NET_WM_STATE_ABOVE", | ||
"_NET_WM_STATE_BELOW", | ||
"_NET_WM_STATE_FOCUSED", | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters