#############################################################################
#                                                                           #
#                        BUTTON BINDING DESCRIPTIONS                        #
#                                                                           #
#############################################################################

#
# OSF Button Binding Descriptions
#
Buttons DefaultButtonBindings
{
    <Btn1Down>        icon|frame      f.raise
    <Btn3Down>        icon            f.post_wmenu
    <Btn1Down>        root            f.menu RootMenu
    <Btn3Down>        root            f.menu RightRootMenu
}
 
Buttons ExplicitButtonBindings
{
    <Btn1Down>        frame|icon      f.raise
    <Btn3Down>        frame|icon      f.post_wmenu
    <Btn1Down>        root            f.menu RootMenu
    <Btn3Down>        root            f.menu RightRootMenu
}
 
Buttons PointerButtonBindings
{
    <Btn1Down>        frame|icon      f.raise
    <Btn3Down>        frame|icon      f.post_wmenu
    <Btn1Down>        root            f.menu RootMenu
    <Btn3Down>        root            f.menu RightRootMenu
    <Btn1Down>        window          f.raise
}

#
# SGI 4Dwm Button Binding Descriptions
#
Buttons 4DwmButtonBindings
{
    <Btn1Down>           root         f.menu 4DwmRootMenu
    <Btn1Click>          frame        f.raise
    <Btn1Click>          icon         f.normalize
    Ctrl<Btn1Down>       frame|icon   f.lower
    Shift<Btn1Down>      frame|icon   f.raise
    Shift Ctrl<Btn1Down> window       f.raise_resize

    <Btn2Down>           frame|icon   f.move
    Ctrl<Btn2Down>       frame|icon   f.lower
    Shift<Btn2Down>      frame|icon   f.raise
    Shift Ctrl<Btn2Down> window       f.raise_move

    <Btn3Down>           root         f.menu 4DwmRightRootMenu
    <Btn3Down>           frame|icon   f.post_wmenu
    Ctrl<Btn3Down>       frame|icon   f.post_wmenu
    Shift<Btn3Down>      frame|icon   f.post_wmenu
    Shift Ctrl<Btn3Down> window       f.post_wmenu
}


#############################################################################
#                                                                           #
#                       KEY BINDING DESCRIPTIONS                            #
#                                                                           #
#############################################################################

#
# OSF key binding descriptions
#
Keys DefaultKeyBindings
{
    Shift<Key>Escape           window|icon      f.post_wmenu
    Meta<Key>space             window|icon      f.post_wmenu
    Meta<Key>Tab               root|icon|window f.next_key
    Meta Shift<Key>Tab         root|icon|window f.prev_key
    Meta<Key>Escape            root|icon|window f.next_key
    Meta Shift<Key>Escape      root|icon|window f.prev_key
    Meta Shift Ctrl<Key>exclam root|icon|window f.set_behavior
    Meta<Key>F6                window           f.next_key transient
    Meta Shift<Key>F6          window           f.prev_key transient
    <Key>F4                    icon             f.post_wmenu
}


#
# SGI 4Dwm key binding descriptions
#
Keys 4DwmKeyBindings
{
    # Same as the standard OSF Key Bindings
    Shift<Key>Escape           window|icon      f.post_wmenu
    Meta<Key>space             window|icon      f.post_wmenu
    Meta<Key>Tab               root|icon|window f.next_key
    Meta Shift<Key>Tab         root|icon|window f.prev_key
    Meta<Key>Escape            root|icon|window f.next_key
    Meta Shift<Key>Escape      root|icon|window f.prev_key
    Meta Shift Ctrl<Key>exclam root|icon|window f.set_behavior
    Meta<Key>F6                window           f.next_key transient
    Meta Shift<Key>F6          window           f.prev_key transient
    <Key>F4                    icon             f.post_wmenu

    # SGI added key bindings
    Shift<Key>Escape           root             f.menu 4DwmRootMenu
    Meta<Key>space             root             f.menu 4DwmRootMenu
}


#############################################################################
#                                                                           #
#                         ROOT MENU PANE DEFINITIONS                        #
#                                                                           #
#############################################################################

#
# OSF Root Menu Description
#
Menu RootMenu
{
    "Root Menu"                                 f.title
    "New Window"                                f.exec "xterm -T `hostname` &"
    "xsetroot"                                  f.menu setroot
    "clients"                                   f.menu clients
    no-label                                    f.separator
    "Log Out"       _L                          f.exec "/usr/bin/X11/endsession"
}

Menu RightRootMenu
{
    "Root Menu"                                 f.title
    "New Window"                                f.exec "xterm -T `hostname` &"
    "xsetroot"                                  f.menu setroot
    "clients"                                   f.menu clients
    no-label                                    f.separator
    "Shuffle Up"                                f.circle_up
    "Shuffle Down"                              f.circle_down
    "Refresh"                                   f.refresh
    no-label                                    f.separator
    "Restart Mwm"                               f.restart
    "Quit Mwm"      _Q                          f.quit_mwm
    no-label                                    f.separator
    "Log Out"       _L                          f.exec "/usr/bin/X11/endsession"
}

#
# SGI 4Dwm Root Menu Descriptions.
#
Menu 4DwmRootMenu
{
    "4D Window Manager"                         f.title
    "New Window"    _N                          f.exec "xterm -T `hostname` &"
    "xsetroot"                                  f.menu setroot
    "clients"                                   f.menu clients
     no-label                                   f.separator
    "Log Out"       _L                          f.exec "/usr/bin/X11/endsession"
}

Menu 4DwmRightRootMenu
{
    "4D Window Manager"                         f.title
    "New Window"    _N                          f.exec "xterm -T `hostname` &"
    "xsetroot"                                  f.menu setroot
    "clients"                                   f.menu clients
    no-label                                    f.separator
    "Shuffle Up"    _U                          f.circle_up
    "Shuffle Down"  _D                          f.circle_down
    "Tidy Icons"    _T                          f.pack_icons
    "Minimize All"  _M                          f.minimize_all
    "Restore All"   _A                          f.normalize_all
    "Refresh All"   _f                          f.refresh
    no-label                                    f.separator
    "Restart 4Dwm"  _R                          f.restart
    "Quit 4Dwm"     _Q                          f.quit_mwm
    no-label                                    f.separator
    "Log Out"       _L                          f.exec "/usr/bin/X11/endsession"
}

#############################################################################
#                                                                            #
#                            WINDOW PANE DEFINITIONS                            #
#                                                                            #
#############################################################################

#
# OSF Default Window Menu Description
#

Menu DefaultWindowMenu
{
    Restore         _R        Alt<Key>F5        f.normalize
    Move            _M        Alt<Key>F7        f.move
    Size            _S        Alt<Key>F8        f.resize
    Minimize        _n        Alt<Key>F9        f.minimize
    Maximize        _x        Alt<Key>F10       f.maximize
    Raise           _a        Alt<key>F1        f.raise
    Lower           _L        Alt<Key>F3        f.lower
    no-label                                    f.separator
    Close           _C        Alt<Key>F4        f.kill
}


#
# SGI 4Dwm Window Menu Description.
#

Menu 4DwmWindowMenu
{
    Restore         _R        Alt<Key>F5        f.normalize
    Move            _M        Alt<Key>F7        f.move
    Size            _S        Alt<Key>F8        f.resize
    Minimize        _n        Alt<Key>F9        f.minimize
    Maximize        _x        Alt<Key>F10       f.maximize
    Raise           _a        Alt<key>F1        f.raise
    Lower           _L        Alt<Key>F3        f.lower
    no-label                                    f.separator
    Close           _C                          f.kill
    Quit            _Q                          f.quit_app
}

menu "setroot"
{
    "escher"    f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/escherknot"
    "granite"   f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/granite"
    "gray"      f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/gray"
    "scales"    f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/scales"
    "sgi_logo"  f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/sgilogo128"
    "weave"     f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/wide_weave"
}

menu "clients"
{
    "snapshot"  f.exec "snapshot -b"
    "showmap"   f.exec "showmap"
    "makemap"   f.exec "makemap"
    "cedit"     f.exec "cedit"
    "calendar"  f.exec "/usr/sbin/ical &"
     no-label   f.separator
    "wsh"       f.exec "/bin/wsh &"
    "xterm"     f.exec "xterm -T `hostname` &"
     no-label   f.separator
    "xmag"      f.exec "xmag &"
    "xcalc"     f.exec "xcalc &"
    "xshowcmap" f.exec "xshowcmap &"
}
