Debian Codegraph @

fvwm/components/functions/Window-Buttons-Vertical

raw
1 # Menus for window buttons
2 # This the same as the 'Window-Buttons' file, except that it provides
3 # functions for vertically-aligned desktop pages.
4 # Usage:
5 #
6 # Mouse (mbutton#) (button#) (mod) Window-Button-Function (Button#) (menu) (function)
7 #
8 # Where:
9 # mbutton# - number of the mouse button (0 - all buttons, 1 - left button,
10 # 2 - middle button, 3 - right button)
11 # button# - number of the window title button, 0-9
12 # mod - modifier, see ~/.fvwm/functions/Keyboard-Modifiers
13 # Button# - number of the window title button, Button0-Button9
14 # menu - name of the menu opened on the mouse hold
15 # function - function executed after mouse click
16
17 # The windows can have several states: its original or mouse resized state,
18 # a minimized state, a maximized state, a fullscreen state, and several other.
19 # A mouse click must set the windows into the wanted state, and when in
20 # fullscreen, the window must retrun in its precedent state.
21 # We need 3 environment variables per windows, 2 will contain its original or
22 # mouse resized width and height, the third one will contain a string
23 # corresponding to its state (excepted fullscreen).
24 # The fullscreen functions are implemented into the Fullscreen file.
25
26 # Variables creation and destruction {{{1
27 # They must survive a restart => SetEnv
28 # FvwmEvent will do it.
29 DestroyFunc Window-State-Init
30 AddToFunc Window-State-Init
31 + I SetEnv "CurrentWindowState_$[w.id]" Default
32 + I SetEnv "WindowWidth_$[w.id]" "$[w.width]p"
33 + I SetEnv "WindowHeight_$[w.id]" "$[w.height]p"
34
35 DestroyFunc Window-State-Destroy
36 AddToFunc Window-State-Destroy
37 + I UnsetEnv "CurrentWindowState_$[w.id]"
38 + I UnsetEnv "WindowWidth_$[w.id]"
39 + I UnsetEnv "WindowHeight_$[w.id]"
40
41 # Variables update, see components/Window-Basic
42
43 # param for fvwm-event: add_window, destroy_window, property_change
44 DestroyModuleConfig FvwmEvent-Window-State-Init: *
45 *FvwmEvent-Window-State-Init: add_window Window-State-Init
46 *FvwmEvent-Window-State-Init: destroy_window Window-State-Destroy
47 Module FvwmEvent FvwmEvent-Window-State-Init
48
49 ## Wrapper function for the resizing functions {{{1
50 # Logic: if actual_size=size then default_size else size
51 # Syntax: Window-Resize <size>
52 # Where size is one of Maximize-Minimize-Default-A100-H100-V100-VHgrow-Hgrow-Vgrow
53 # For fullscreen see components/Fullscreen
54 DestroyFunc Window-Resize
55 AddToFunc Window-Resize
56 + I Test (EnvMatch CurrentWindowState_$[w.id] "$0") NS-Default
57 + I TestRc (NoMatch) NS-"$0"
58
59 DestroyFunc NS-Maximize
60 AddToFunc NS-Maximize
61 + I Maximize True 100 100
62 + I SetEnv CurrentWindowState_$[w.id] Maximize
63
64 DestroyFunc NS-Minimize
65 AddToFunc NS-Minimize
66 + I ResizeMaximize direction East 200p 60p
67 + I SetEnv CurrentWindowState_$[w.id] Minimize
68
69 DestroyFunc NS-Default
70 AddToFunc NS-Default
71 + I Maximize $[WindowWidth_$[w.id]] $[WindowHeight_$[w.id]]
72 + I SetEnv CurrentWindowState_$[w.id] Default
73
74 DestroyFunc NS-A100
75 AddToFunc NS-A100
76 + I Maximize True 100 100
77 + I SetEnv CurrentWindowState_$[w.id] A100
78
79 DestroyFunc NS-H100
80 AddToFunc NS-H100
81 + I Maximize True 100 0
82 + I SetEnv CurrentWindowState_$[w.id] H100
83
84 DestroyFunc NS-V100
85 AddToFunc NS-V100
86 + I Maximize True 0 100
87 + I SetEnv CurrentWindowState_$[w.id] V100
88
89 DestroyFunc NS-Hgrow
90 AddToFunc NS-Hgrow
91 + I Maximize True grow 0
92 + I SetEnv CurrentWindowState_$[w.id] Hgrow
93
94 DestroyFunc NS-Vgrow
95 AddToFunc NS-Vgrow
96 + I Maximize True 0 grow
97 + I SetEnv CurrentWindowState_$[w.id] Vgrow
98
99 DestroyFunc NS-VHgrow
100 AddToFunc NS-VHgrow
101 + I Maximize True grow grow
102 + I SetEnv CurrentWindowState_$[w.id] VHgrow
103
104 # Wrapper functions for window decorations {{{1
105 DestroyFunc Window-MoveToPage-Forward
106 AddToFunc Window-MoveToPage-Forward
107 + I MoveToPage-Down
108
109 DestroyFunc Window-MoveToPage-Backward
110 AddToFunc Window-MoveToPage-Backward
111 + I MoveToPage-Up
112
113 DestroyFunc Window-WarpToPage-Forward
114 AddToFunc Window-WarpToPage-Forward
115 + I WarpToPage-Down
116
117 DestroyFunc Window-WarpToPage-Backward
118 AddToFunc Window-WarpToPage-Backward
119 + I WarpToPage-Up
120
121
122 DestroyFunc Window-Button-Function
123 AddToFunc Window-Button-Function
124 + H Popup $1 $0 0 100
125 + C $2 $3 $4 $5 $6 $7 $8 $9
126
127
128 DestroyMenu /Window-Menu-Close
129 AddToMenu /Window-Menu-Close
130 + '$[gt.Iconify]' Window-Iconify
131 + '$[gt.Close]' Close
132 + '$[gt.Destroy]' Destroy
133 + "" Nop
134 + '$[gt.Identify]' FvwmIdent
135
136 DestroyMenu /Window-Menu-Maximize
137 AddToMenu /Window-Menu-Maximize
138 + '$[gt.Maximize]' Maximize
139 + '$[gt.Maximize horizontally]' Maximize 100 0
140 + '$[gt.Maximize vertically]' Maximize 0 100
141 + "" Nop
142 + '$[gt.Take all free space]' Maximize grow grow
143 + '$[gt.Take all horizontal space]' Maximize grow 0
144 + '$[gt.Take all vertical space]' Maximize 0 grow
145 + "" Nop
146 + '$[gt.Fullscreen]' Fullscreen
147
148 DestroyMenu /Window-Menu-Layer
149 AddToMenu /Window-Menu-Layer
150 + '$[gt.Stay raised]' Layer 0 5
151 + '$[gt.Normal mode]' Layer 0 4
152 + '$[gt.Stay lowered]' Layer 0 3
153 + '$[gt.Stick]' Stick
154 + "" Nop
155 + '$[gt.Refresh]' RefreshWindow
156
157 DestroyMenu /Window-Menu-Page
158 AddToMenu /Window-Menu-Page
159 + DynamicPopupAction Function /Window-Menu-Page-generator
160
161 DestroyFunc /Window-Menu-Page-generator
162 AddToFunc /Window-Menu-Page-generator
163 + I DestroyMenu recreate /Window-Menu-Page
164 + I AddToMenu /Window-Menu-Page '$[gt.Move to upper page]' Window-MoveToPage-Backward
165 + I AddToMenu /Window-Menu-Page '$[gt.Move to previous page]' MoveToPage-Focus prev
166 + I AddToMenu /Window-Menu-Page '$[gt.Move to lower page]' Window-MoveToPage-Forward
167 + I AddTomenu /Window-Menu-Page "" Nop
168 + I AddToMenu /Window-Menu-Page '$[gt.Jump to upper page]' Window-WarpToPage-Backward
169 + I AddToMenu /Window-Menu-Page '$[gt.Jump to previous page]' WarpToPage prev
170 + I AddToMenu /Window-Menu-Page '$[gt.Jump to lower page]' Window-WarpToPage-Forward
171 + I AddToMenu /Window-Menu-Page "" Nop
172 + I PipeRead 'for i in `seq 0 $(($[desk.pagesy]-1))` ; do echo "AddToMenu /Window-Menu-Page \'$[gt.Move to page] $(($i+1))\' MoveToPage 0 $i" ; done'
173
174
175 # Combined version of menu for window styles other than FVWM-Crystal {{{1
176 DestroyMenu /Window-Menu
177 AddToMenu /Window-Menu
178 + '$[gt.Iconify]' Window-Iconify
179 + '$[gt.Stick]' Stick
180 + '$[gt.Stay raised]' Layer 0 5
181 + '$[gt.Normal mode]' Layer 0 4
182 + '$[gt.Fullscreen]' Fullscreen
183 + "" Nop
184 + '$[gt.Move to upper page]' Window-MoveToPage-Backward
185 + '$[gt.Move to lower page]' Window-MoveToPage-Forward
186 + "" Nop
187 + '$[gt.Identify]' FvwmIdent
188 + '$[gt.Close]' Close
189
190 # vim:ft=fvwm