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