#-----------------------------------------------------------------------------
#                          PyPanel Configuration
#-----------------------------------------------------------------------------

BG_COLOR        = "0x122744"    # Panel background color (hex triplet)
TASK_COLOR      = "0xd6d6d6"    # Normal task name color 
SHADED_COLOR    = "0x9d9d9d"    # Shaded task name color 
MINIMIZED_COLOR = "0x7d7d7d"    # Minimized task name color
WS_COLOR        = "0xffffff"    # Workspace name color 
LINE_COLOR      = "0x606060"    # Vertical task seperator line color 
APPICONS        = 1             # Show application icons (1 yes / 0 no)
SHOWALL         = 1             # Show all tasks (1 yes / 0 no - only minimized)
SHOWLINES       = 1             # Show task seperator lines (1 yes / 0 no)
TRANSPARENCY    = 1             # Use transparent background (1 yes / 0 no)
SHADE           = 100           # Transparency shading (0 [black] - 100 [clear])
P_LOCATION      = 1             # Top/Bottom
P_START         = 0             # Starting X coordinate of the panel (pixel)
P_SPACER        = 6             # Spacing between panel objects (pixels)
P_HEIGHT        = 24            # Panel height (pixels)
#P_WIDTH         = 600          # Panel width (pixels) Default is screen width
I_HEIGHT        = 16            # Icon height (pixels)
I_WIDTH         = 16            # Icon Width (pixels)
CLOCK_COLOR     = "0xffffff"    # Clock text color
CLOCK_FORMAT    = "%D %I:%M %p" # 'man strftime' for formatting options
LEFT_OBJ        = "workspace"   # Left side object (workspace/clock/"")
RIGHT_OBJ       = "clock"       # Setting to "" will open the space for tasks

# Workspace/task font
FONT            = "-schumacher-clean-medium-r-normal-*-14-*-*-*-*-*-*-*"


#----------------------------------------------------------------------------
#                    Button Event Function Definitions
#----------------------------------------------------------------------------
# Left click   - button 1 
# Middle click - button 2
# Right click  - button 3
# Wheel up     - button 4
# Wheel down   - button 5 
#
# changeWorkspace(num)     - increases/decreases the current workspace by num
# toggleMinimize(task)     - iconify/deiconify task
# toggleShade(task)        - shade/unshade task
# raiseTask(task, focus=0) - raise task and optionally give it input focus
# lowerTask(task, focus=0) - lower task and optionally give it input focus
#----------------------------------------------------------------------------

#----------------------------------
def leftObjButtonEvent(pp, button):
#----------------------------------
    """ Button event handler for the panel's left side object """
        
    if button == 1:
        pp.changeWorkspace(-1)
    elif button == 2:
        pp.changeWorkspace(2)
    elif button == 3:
        pp.changeWorkspace(1)
    elif button == 4:
        pp.changeWorkspace(1)
    elif button == 5:
        pp.changeWorkspace(-1)
        
#-----------------------------------
def rightObjButtonEvent(pp, button):
#-----------------------------------
    """ Button event handler for the panel's right side object """
    
    if button == 1:
        os.system("xclock &")
    elif button == 2:
        pass
    elif button == 3:
        pass
    elif button == 4:
        pass
    elif button == 5:
        pass
        
#-------------------------------------
def taskButtonEvent(pp, button, task):
#-------------------------------------
    """ Button event handler for the panel's tasks """
    
    if button == 1:
        pp.toggleMinimize(task)
    elif button == 2:
        task.obj.destroy() # destroy task
    elif button == 3:
        # Example - XMMS doesn't shade, so attempting to shade it
        #           here will minimize it instead.  task.tclass is the 
        #           tasks class name (WM_CLASS).
        if "xmms" in task.tclass:
            pp.toggleMinimize(task)
        else:
            pp.toggleShade(task)
    elif button == 4:
        pp.taskRaise(task, focus=1)
    elif button == 5:
        pp.taskLower(task, focus=0)
        
    