JWM Source Documentation
Data Structures | Typedefs | Functions | Variables
taskbar.c File Reference

Task list tray component. More...

#include "jwm.h"
#include "taskbar.h"
#include "tray.h"
#include "timing.h"
#include "main.h"
#include "client.h"
#include "clientlist.h"
#include "color.h"
#include "popup.h"
#include "button.h"
#include "cursor.h"
#include "icon.h"
#include "error.h"
#include "winmenu.h"
#include "screen.h"
#include "settings.h"
#include "event.h"
#include "misc.h"
#include "desktop.h"

Go to the source code of this file.

Data Structures

struct  TaskBarType
 
struct  ClientEntry
 
struct  TaskEntry
 

Typedefs

typedef struct TaskBarType TaskBarType
 
typedef struct ClientEntry ClientEntry
 
typedef struct TaskEntry TaskEntry
 

Functions

static void ComputeItemSize (TaskBarType *tp)
 Determine the size of items in the task bar.
 
static char ShouldShowEntry (const TaskEntry *tp)
 Determine if there is anything to show for the specified entry.
 
static char ShouldFocusEntry (const TaskEntry *tp)
 Determine if we should attempt to focus an entry.
 
static TaskEntryGetEntry (TaskBarType *bar, int x, int y)
 Get the item associated with a coordinate on the task bar.
 
static void Render (const TaskBarType *bp)
 Draw a specific task bar.
 
static void ShowClientList (TaskBarType *bar, TaskEntry *tp)
 Show the menu associated with a task list item.
 
static void RunTaskBarCommand (MenuAction *action, unsigned button)
 Run a menu action.
 
static void SetSize (TrayComponentType *cp, int width, int height)
 Set the size of a task bar tray component.
 
static void Create (TrayComponentType *cp)
 Initialize a task bar tray component.
 
static void Resize (TrayComponentType *cp)
 Resize a task bar tray component.
 
static void ProcessTaskButtonEvent (TrayComponentType *cp, int x, int y, int mask)
 Process a task list button event.
 
static void MinimizeGroup (const TaskEntry *tp)
 Minimize all clients in a group.
 
static void FocusGroup (const TaskEntry *tp)
 Raise all clients in a group and focus the top-most.
 
static void ProcessTaskMotionEvent (TrayComponentType *cp, int x, int y, int mask)
 Process a task list motion event.
 
static void SignalTaskbar (const TimeType *now, int x, int y, Window w, void *data)
 Signal task bar (for popups).
 
void InitializeTaskBar (void)
 Initialize task bar data.
 
void ShutdownTaskBar (void)
 Shutdown the task bar.
 
void DestroyTaskBar (void)
 Destroy task bar data.
 
TrayComponentTypeCreateTaskBar ()
 Create a new task bar tray component.
 
void AddClientToTaskBar (ClientNode *np)
 Add a client to the task bar.
 
void RemoveClientFromTaskBar (ClientNode *np)
 Remove a client from the task bar.
 
void UpdateTaskBar (void)
 Update all task bars.
 
void FocusNext (void)
 Focus the next client in the task bar.
 
void FocusPrevious (void)
 Focus the previous client in the task bar.
 
void SetMaxTaskBarItemWidth (TrayComponentType *cp, const char *value)
 Set the maximum width of an item in the task bar.
 
void SetTaskBarHeight (TrayComponentType *cp, const char *value)
 Set the preferred height of the specified task bar.
 
void SetTaskBarLabeled (TrayComponentType *cp, char labeled)
 Set whether the label should be displayed.
 
void UpdateNetClientList (void)
 Maintain the _NET_CLIENT_LIST[_STACKING] properties on the root.
 

Variables

static TaskBarTypebars
 
static TaskEntrytaskEntries
 
static TaskEntrytaskEntriesTail
 

Detailed Description

Task list tray component.

Author
Joe Wingbermuehle
Date
2005-2006

Definition in file taskbar.c.

Typedef Documentation

typedef struct ClientEntry ClientEntry
typedef struct TaskBarType TaskBarType
typedef struct TaskEntry TaskEntry

Function Documentation

void AddClientToTaskBar ( ClientNode np)
void ComputeItemSize ( TaskBarType tp)
static
void Create ( TrayComponentType cp)
static
TrayComponentType* CreateTaskBar ( )
read
void DestroyTaskBar ( void  )

Destroy task bar data.

Definition at line 103 of file taskbar.c.

References TaskBarType::next, Release, SignalTaskbar(), and UnregisterCallback().

Referenced by Destroy().

void FocusGroup ( const TaskEntry tp)
static
void FocusNext ( void  )
void FocusPrevious ( void  )
TaskEntry * GetEntry ( TaskBarType bar,
int  x,
int  y 
)
static

Get the item associated with a coordinate on the task bar.

Definition at line 924 of file taskbar.c.

References TaskBarType::itemHeight, TaskBarType::itemWidth, TaskBarType::layout, LAYOUT_HORIZONTAL, TaskEntry::next, and ShouldShowEntry().

Referenced by ProcessTaskButtonEvent(), and SignalTaskbar().

void InitializeTaskBar ( void  )

Initialize task bar data.

Definition at line 86 of file taskbar.c.

Referenced by Initialize().

void MinimizeGroup ( const TaskEntry tp)
static

Minimize all clients in a group.

Definition at line 334 of file taskbar.c.

References ClientEntry::client, TaskEntry::clients, MinimizeClient(), ClientEntry::next, and ShouldFocus().

Referenced by ProcessTaskButtonEvent().

void ProcessTaskButtonEvent ( TrayComponentType cp,
int  x,
int  y,
int  mask 
)
static
void ProcessTaskMotionEvent ( TrayComponentType cp,
int  x,
int  y,
int  mask 
)
static
void RemoveClientFromTaskBar ( ClientNode np)

Remove a client from the task bar.

Remove a client from the task bar(s).

Definition at line 624 of file taskbar.c.

References ClientEntry::client, TaskEntry::clients, ClientEntry::next, TaskEntry::next, ClientEntry::prev, TaskEntry::prev, Release, RequireTaskUpdate(), and UpdateNetClientList().

Referenced by RemoveClient().

void Render ( const TaskBarType bp)
static
void Resize ( TrayComponentType cp)
static
void RunTaskBarCommand ( MenuAction action,
unsigned  button 
)
static
void SetMaxTaskBarItemWidth ( TrayComponentType cp,
const char *  value 
)

Set the maximum width of an item in the task bar.

Set the maximum width of task bar items.

Definition at line 951 of file taskbar.c.

References _, Assert, JUNLIKELY, TaskBarType::maxItemWidth, TrayComponentType::object, and Warning().

Referenced by ParseTaskList().

void SetSize ( TrayComponentType cp,
int  width,
int  height 
)
static

Set the size of a task bar tray component.

Definition at line 152 of file taskbar.c.

References TaskBarType::layout, LAYOUT_HORIZONTAL, LAYOUT_VERTICAL, and TrayComponentType::object.

Referenced by CreateTaskBar().

void SetTaskBarHeight ( TrayComponentType cp,
const char *  value 
)

Set the preferred height of the specified task bar.

Set the preferred height of task bar items.

Definition at line 968 of file taskbar.c.

References _, JUNLIKELY, TrayComponentType::object, TaskBarType::userHeight, and Warning().

Referenced by ParseTaskList().

void SetTaskBarLabeled ( TrayComponentType cp,
char  labeled 
)

Set whether the label should be displayed.

Set whether labels should be displayed (or icon only).

Definition at line 982 of file taskbar.c.

References TaskBarType::labeled, and TrayComponentType::object.

Referenced by ParseTaskList().

char ShouldFocusEntry ( const TaskEntry tp)
static

Determine if we should attempt to focus an entry.

Definition at line 910 of file taskbar.c.

References ClientEntry::client, TaskEntry::clients, ClientEntry::next, ShouldFocus(), STAT_CANFOCUS, STAT_TAKEFOCUS, ClientNode::state, and ClientState::status.

Referenced by FocusNext(), and FocusPrevious().

char ShouldShowEntry ( const TaskEntry tp)
static

Determine if there is anything to show for the specified entry.

Definition at line 898 of file taskbar.c.

References ClientEntry::client, TaskEntry::clients, ClientEntry::next, and ShouldFocus().

Referenced by ComputeItemSize(), GetEntry(), Render(), and UpdateTaskBar().

void ShowClientList ( TaskBarType bar,
TaskEntry tp 
)
static
void ShutdownTaskBar ( void  )

Shutdown the task bar.

Definition at line 94 of file taskbar.c.

References TaskBarType::buffer, display, JXFreePixmap, and TaskBarType::next.

Referenced by Shutdown().

void SignalTaskbar ( const TimeType now,
int  x,
int  y,
Window  w,
void *  data 
)
static
void UpdateNetClientList ( void  )
void UpdateTaskBar ( void  )

Variable Documentation

TaskBarType* bars
static

Definition at line 61 of file taskbar.c.

Referenced by CreateTaskBar().

TaskEntry* taskEntries
static

Definition at line 62 of file taskbar.c.

TaskEntry* taskEntriesTail
static

Definition at line 63 of file taskbar.c.

Referenced by AddClientToTaskBar().

joewing.net / Projects / JWM