# This file should be processed using FvwmM4 like:
#   ModuleSynchronous FvwmM4 -lock -m4-squote {{ -m4-equote }} \
#     -DBcN=1 -DBmN=2 -DBoN=3 -DBiN=4 -DBlN=5 -DBrN=6 \
#     -DTitlHeig=16 -DFaceName=redmond98 -DFaceFile=_images \
#     -DCompRoot=$[FVWM_DATADIR]/themes/multichoice/buttons main

# Button roles used: Options (o), Close (c), Maximize (m), Iconify (i),
# Stick (s), Shade (h); and pseudo buttons: TitleLeft, TitleRight

FuncFvwmDecorBackground

changecom  # don't treat comments specially

define({{BcC}}, ifdef({{BcN}}, {{}}, {{#}}))
define({{BmC}}, ifdef({{BmN}}, {{}}, {{#}}))
define({{BoC}}, ifdef({{BoN}}, {{}}, {{#}}))
define({{BiC}}, ifdef({{BiN}}, {{}}, {{#}}))
define({{BsC}}, ifdef({{BsN}}, {{}}, {{#}}))
define({{BhC}}, ifdef({{BhN}}, {{}}, {{#}}))
define({{BlC}}, ifdef({{BlN}}, {{}}, {{#}}))
define({{BrC}}, ifdef({{BrN}}, {{}}, {{#}}))

ifdef({{HaveTitleEdges}}, {{
define({{BlC}}, ifdef({{BlN}}, {{}}, {{#}}))
define({{BrC}}, ifdef({{BrN}}, {{}}, {{#}}))
}}, {{
define({{BlC}}, {{#}})
define({{BrC}}, {{#}})
}})

BcC Style "*" Button BcN
BmC Style "*" Button BmN
BoC Style "*" Button BoN
BiC Style "*" Button BiN
BsC Style "*" Button BsN
BhC Style "*" Button BhN
BlC Style "*" Button BlN
BrC Style "*" Button BrN

ifdef({{HaveMiniIcon}}, {{
define({{old_BOC}}, BoC)
define({{BoC}}, {{#}})
}})

DestroyFunc FuncFvwmUnReloadDecor
AddToFunc   FuncFvwmUnReloadDecor

DestroyFunc FuncFvwmReloadDecor
AddToFunc   FuncFvwmReloadDecor
+ I FuncFvwmDecorBackground

include(CompRoot/faces/FaceFile)

ifdef({{HaveMiniIcon}}, {{
define({{BoC}}, old_BOC)
BoC AddButtonStyle BoN MiniIcon
AddToFunc   FuncFvwmReloadDecor
+ I BoC AddButtonStyle BoN MiniIcon
}})

ButtonStyle All - Clear
BmC ButtonStyle BmN - MWMDecorMax
BoC ButtonStyle BoN - MWMDecorMenu
BiC ButtonStyle BiN - MWMDecorMin
BhC ButtonStyle BhN - MWMDecorShade
BsC ButtonStyle BsN - MWMDecorStick

ifdef({{HaveMinTHeig}}, {{
TitleStyle Height MinHeight TitlHeig
}}, {{
ifdef({{UserHeig}}, {{
TitleStyle Height UserHeig
}}, {{
TitleStyle Height TitlHeig
}})
}})

#     button	context	modifie	function
BcC Mouse 0 	BcN	A	FuncFvwmDeleteOrDestroy
BmC Mouse 1 	BmN	A	FuncFvwmMaximize
BmC Mouse 2 	BmN	A	FuncFvwmMaximizeVertically
BmC Mouse 3 	BmN	A	FuncFvwmMaximizeHorizontally
BmC Mouse 1 	BmN	S	Maximize grow grow
BmC Mouse 2 	BmN	S	Maximize    0 grow
BmC Mouse 3 	BmN	S	Maximize grow    0
BoC Mouse 1 	BoN	A	FuncFvwmWindowOpsOrAction Delete
BoC MouseXX 2 3	BoN	A	Menu MenuFvwmWindowMove
BoC MouseXX 3 2	BoN	A	Menu MenuFvwmWindowGroupOps
BiC Mouse 0 	BiN	A	FuncFvwmIconify
BhC Mouse 1 	BhN	A	WindowShade toggle
BhC Mouse 2 	BhN	A	WindowShade true
BhC Mouse 3 	BhN	A	WindowShade false
BsC Mouse 0 	BsN	A	Stick
BcC Mouse 0 	BcN	CM	FuncFvwmShowButtonInfo "Delete on click^nDestroy on double click"
BmC Mouse 0 	BmN	CM	FuncFvwmShowButtonInfo "Mouse 1 - Maximize:^n^tfully on click^n^tmenu on double click^nMouse 2 - Maximize vertically^nMouse 3 - Maximize horizontally^nAll with Shift - Maximize grow"
BoC Mouse 0 	BoN	CM	FuncFvwmShowButtonInfo "Mouse 1 - WindowOps menu; Delete on double click^nMouse 2/3 - Move menu^nMouse 3/2 - Resource Group menu"
BiC Mouse 0 	BiN	CM	FuncFvwmShowButtonInfo "Iconify"
BhC Mouse 0 	BhN	CM	FuncFvwmShowButtonInfo "WindowShade:^n^tMouse 1 - toggle^n^tMouse 2 - true^n^tMouse 3 - false"
BsC Mouse 0 	BsN	CM	FuncFvwmShowButtonInfo "Stick"
# simulate title bindings on two edge buttons:
BlC FuncFvwmSetTitleBindings BlN
BrC FuncFvwmSetTitleBindings BrN

DestroyFunc FuncFvwmOverRideWindowLook
AddToFunc   FuncFvwmOverRideWindowLook
ifdef({{HaveTitleEdges}}, {{
# This is usually not in this component, but title edges can't be non-flat
+ I TitleStyle -- flat
+ I ButtonStyle All -- flat
}})

DestroyFunc FuncFvwmStartWindowButtons
AddToFunc   FuncFvwmStartWindowButtons
ifdef({{HaveTitleEdges}}, {{
# This is usually not in this component, but title edges can't be non-flat
+ I TitleStyle -- flat
+ I ButtonStyle All -- flat
}})

DestroyFunc FuncFvwmStopWindowButtons
AddToFunc   FuncFvwmStopWindowButtons
+ I FuncFvwmRemoveAllButtons
BcC + I Mouse 0 	BcN	A	-
BmC + I Mouse 1 	BmN	A	-
BmC + I Mouse 2 	BmN	A	-
BmC + I Mouse 3 	BmN	A	-
BmC + I Mouse 1 	BmN	S	-
BmC + I Mouse 2 	BmN	S	-
BmC + I Mouse 3 	BmN	S	-
BoC + I Mouse 1 	BoN	A	-
BoC + I Mouse 2 	BoN	A	-
BoC + I Mouse 3 	BoN	A	-
BiC + I Mouse 0 	BiN	A	-
BhC + I Mouse 1 	BhN	A	-
BhC + I Mouse 2 	BhN	A	-
BhC + I Mouse 3 	BhN	A	-
BsC + I Mouse 0 	BsN	A	-
BcC + I Mouse 0 	BcN	CM	-
BmC + I Mouse 0 	BmN	CM	-
BoC + I Mouse 0 	BoN	CM	-
BiC + I Mouse 0 	BiN	CM	-
BhC + I Mouse 0 	BhN	CM	-
BsC + I Mouse 0 	BsN	CM	-
#
BlC + I FuncFvwmUnsetTitleBindings BlN
BrC + I FuncFvwmUnsetTitleBindings BrN
