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

Dock tray component. More...

#include "jwm.h"
#include "dock.h"
#include "tray.h"
#include "main.h"
#include "error.h"
#include "color.h"
#include "misc.h"

Go to the source code of this file.

Data Structures

struct  DockNode
 Structure to represent a docked window. More...
 
struct  DockType
 Structure to represent a dock tray component. More...
 

Macros

#define SYSTEM_TRAY_REQUEST_DOCK   0
 
#define SYSTEM_TRAY_BEGIN_MESSAGE   1
 
#define SYSTEM_TRAY_CANCEL_MESSAGE   2
 
#define SYSTEM_TRAY_ORIENTATION_HORZ   0
 
#define SYSTEM_TRAY_ORIENTATION_VERT   1
 

Typedefs

typedef struct DockNode DockNode
 Structure to represent a docked window.
 
typedef struct DockType DockType
 Structure to represent a dock tray component.
 

Functions

static void SetSize (TrayComponentType *cp, int width, int height)
 Set the size of a dock component.
 
static void Create (TrayComponentType *cp)
 Initialize a dock component.
 
static void Resize (TrayComponentType *cp)
 Resize a dock component.
 
static void DockWindow (Window win)
 Add a window to the dock.
 
static void UpdateDock (void)
 Layout items on the dock.
 
static void GetDockItemSize (int *size)
 Get the size of a particular window on the dock.
 
static void GetDockSize (int *width, int *height)
 Get the size of the dock.
 
void InitializeDock (void)
 Initialize dock data.
 
void StartupDock (void)
 Startup the dock.
 
void ShutdownDock (void)
 Shutdown the dock.
 
void DestroyDock (void)
 Destroy dock data.
 
TrayComponentTypeCreateDock (int width)
 Create a dock component.
 
void HandleDockEvent (const XClientMessageEvent *event)
 Handle a dock event.
 
char HandleDockResizeRequest (const XResizeRequestEvent *event)
 Handle a resize request event.
 
char HandleDockConfigureRequest (const XConfigureRequestEvent *event)
 Handle a configure request event.
 
char HandleDockReparentNotify (const XReparentEvent *event)
 Handle a reparent notify event.
 
char HandleDockSelectionClear (const XSelectionClearEvent *event)
 Handle a selection clear event.
 
char HandleDockDestroy (Window win)
 Remove a window from the dock.
 

Variables

static const char BASE_SELECTION_NAME [] = "_NET_SYSTEM_TRAY_S%d"
 
static DockTypedock = NULL
 
static char owner
 
static Atom dockAtom
 
static unsigned long orientation
 

Detailed Description

Dock tray component.

Author
Joe Wingbermuehle
Date
2006

Definition in file dock.c.

Macro Definition Documentation

#define SYSTEM_TRAY_BEGIN_MESSAGE   1

Definition at line 19 of file dock.c.

Referenced by HandleDockEvent().

#define SYSTEM_TRAY_CANCEL_MESSAGE   2

Definition at line 20 of file dock.c.

Referenced by HandleDockEvent().

#define SYSTEM_TRAY_ORIENTATION_HORZ   0

Definition at line 22 of file dock.c.

Referenced by GetDockItemSize(), GetDockSize(), SetSize(), and UpdateDock().

#define SYSTEM_TRAY_ORIENTATION_VERT   1

Definition at line 23 of file dock.c.

Referenced by SetSize().

#define SYSTEM_TRAY_REQUEST_DOCK   0

Definition at line 18 of file dock.c.

Referenced by HandleDockEvent().

Typedef Documentation

typedef struct DockNode DockNode

Structure to represent a docked window.

typedef struct DockType DockType

Structure to represent a dock tray component.

Function Documentation

void Create ( TrayComponentType cp)
static
TrayComponentType* CreateDock ( int  width)
read
void DestroyDock ( void  )

Destroy dock data.

Definition at line 136 of file dock.c.

References Release.

Referenced by Destroy().

void DockWindow ( Window  win)
static
void GetDockItemSize ( int *  size)
static

Get the size of a particular window on the dock.

Definition at line 493 of file dock.c.

References DockType::cp, TrayComponentType::height, DockType::itemSize, orientation, SYSTEM_TRAY_ORIENTATION_HORZ, and TrayComponentType::width.

Referenced by GetDockSize(), and UpdateDock().

void GetDockSize ( int *  width,
int *  height 
)
static

Get the size of the dock.

Definition at line 507 of file dock.c.

References Assert, GetDockItemSize(), Max, DockNode::next, DockType::nodes, orientation, and SYSTEM_TRAY_ORIENTATION_HORZ.

Referenced by DockWindow(), HandleDockDestroy(), and SetSize().

char HandleDockConfigureRequest ( const XConfigureRequestEvent *  event)

Handle a configure request event.

Handle a configure request.

Definition at line 301 of file dock.c.

References Assert, DockNode::next, DockType::nodes, UpdateDock(), and DockNode::window.

Referenced by HandleConfigureRequest().

char HandleDockDestroy ( Window  win)
void HandleDockEvent ( const XClientMessageEvent *  event)

Handle a dock event.

Handle a client message sent to the dock window.

Definition at line 262 of file dock.c.

References Assert, Debug(), DockWindow(), SYSTEM_TRAY_BEGIN_MESSAGE, SYSTEM_TRAY_CANCEL_MESSAGE, and SYSTEM_TRAY_REQUEST_DOCK.

Referenced by HandleClientMessage().

char HandleDockReparentNotify ( const XReparentEvent *  event)

Handle a reparent notify event.

Definition at line 324 of file dock.c.

References Assert, DockType::cp, DockNode::needs_reparent, DockNode::next, DockType::nodes, UpdateDock(), DockNode::window, and TrayComponentType::window.

Referenced by WaitForEvent().

char HandleDockResizeRequest ( const XResizeRequestEvent *  event)

Handle a resize request event.

Handle a resize request.

Definition at line 280 of file dock.c.

References Assert, DockNode::next, DockType::nodes, UpdateDock(), and DockNode::window.

Referenced by WaitForEvent().

char HandleDockSelectionClear ( const XSelectionClearEvent *  event)

Handle a selection clear event.

Definition at line 363 of file dock.c.

References Debug(), dockAtom, and owner.

Referenced by HandleSelectionClear().

void InitializeDock ( void  )

Initialize dock data.

Definition at line 64 of file dock.c.

References owner.

Referenced by Initialize().

void Resize ( TrayComponentType cp)
static

Resize a dock component.

Definition at line 255 of file dock.c.

References display, TrayComponentType::height, JXResizeWindow, UpdateDock(), TrayComponentType::width, and TrayComponentType::window.

Referenced by CreateDock().

void SetSize ( TrayComponentType cp,
int  width,
int  height 
)
static
void ShutdownDock ( void  )
void StartupDock ( void  )
void UpdateDock ( void  )
static

Variable Documentation

const char BASE_SELECTION_NAME[] = "_NET_SYSTEM_TRAY_S%d"
static

Definition at line 47 of file dock.c.

Referenced by StartupDock().

DockType* dock = NULL
static

Definition at line 49 of file dock.c.

Referenced by CreateDock().

Atom dockAtom
static

Definition at line 51 of file dock.c.

Referenced by Create(), HandleDockSelectionClear(), ShutdownDock(), and StartupDock().

unsigned long orientation
static

Definition at line 52 of file dock.c.

Referenced by Create(), GetDockItemSize(), GetDockSize(), SetSize(), and UpdateDock().

char owner
static

Definition at line 50 of file dock.c.

Referenced by Create(), HandleDockSelectionClear(), InitializeDock(), and ShutdownDock().

joewing.net / Projects / JWM