JWM Source Documentation

tray.h File Reference

Header for the tray functions. More...

#include "hint.h"

Go to the source code of this file.

Data Structures

struct  TrayComponentType
 Structure to hold common tray component data. More...
struct  TrayType
 Structure to represent a tray. More...

Typedefs

typedef struct TrayComponentType TrayComponentType
 Structure to hold common tray component data.
typedef struct TrayType TrayType
 Structure to represent a tray.

Enumerations

enum  LayoutType { LAYOUT_HORIZONTAL, LAYOUT_VERTICAL }
 Enumeration of tray layouts. More...
enum  TrayAlignmentType {
  TALIGN_FIXED, TALIGN_LEFT, TALIGN_TOP, TALIGN_CENTER,
  TALIGN_RIGHT, TALIGN_BOTTOM
}
 Enumeration of tray alignments. More...

Functions

void InitializeTray ()
void StartupTray ()
void ShutdownTray ()
void DestroyTray ()
TrayTypeCreateTray ()
 Create a new tray.
TrayComponentTypeCreateTrayComponent ()
 Create a tray component.
void AddTrayComponent (TrayType *tp, TrayComponentType *cp)
 Add a tray component to a tray.
void ShowTray (TrayType *tp)
 Show a tray.
void ShowAllTrays ()
 Show all trays.
void HideTray (TrayType *tp)
 Hide a tray.
void DrawTray ()
 Draw all trays.
void DrawSpecificTray (const TrayType *tp)
 Draw a specific tray.
void UpdateSpecificTray (const TrayType *tp, const TrayComponentType *cp)
 Update a component on a tray.
void ResizeTray (TrayType *tp)
 Resize a tray.
TrayTypeGetTrays ()
 Get a linked list of trays.
int GetTrayCount ()
 Get the number of trays.
Window GetSupportingWindow ()
 Get a window to use as the supporting window.
int ProcessTrayEvent (const XEvent *event)
 Process an event that may be for a tray.
void SignalTray (const struct TimeType *now, int x, int y)
 Signal the trays.
void SetAutoHideTray (TrayType *tp, int v)
 Set whether auto hide is enabled for a tray.
void SetTrayX (TrayType *tp, const char *str)
 Set the tray x-coordinate.
void SetTrayY (TrayType *tp, const char *str)
 Set the tray y-coordinate.
void SetTrayWidth (TrayType *tp, const char *str)
 Set the tray width.
void SetTrayHeight (TrayType *tp, const char *str)
 Set the tray height.
void SetTrayLayout (TrayType *tp, const char *str)
 Set the tray layout.
void SetTrayLayer (TrayType *tp, const char *str)
 Set the tray layer.
void SetTrayBorder (TrayType *tp, const char *str)
 Set the tray border size.
void SetTrayHorizontalAlignment (TrayType *tp, const char *str)
 Set the tray horizontal alignment.
void SetTrayVerticalAlignment (TrayType *tp, const char *str)
 Set the tray vertical alignment.
void SetTrayOpacity (const char *str)
 Set the tray transparency level.

Detailed Description

Header for the tray functions.

Author:
Joe Wingbermuehle
Date:
2004-2006

Definition in file tray.h.


Typedef Documentation

Structure to hold common tray component data.

Sizing is handled as follows:

  • The component is created via a factory method. It sets its requested size (0 for no preference).
  • The SetSize callback is issued with size constraints (0 for no constraint). The component should update width and height in SetSize.
  • The Create callback is issued with finalized size information. Resizing is handled as follows:
  • A component determines that it needs to change size. It updates its requested size (0 for no preference).
  • The component calls ResizeTray.
  • The SetSize callback is issued with size constraints (0 for no constraint). The component should update width and height in SetSize.
  • The Resize callback is issued with finalized size information.
typedef struct TrayType TrayType

Structure to represent a tray.


Enumeration Type Documentation

enum LayoutType

Enumeration of tray layouts.

Enumerator:
LAYOUT_HORIZONTAL 

Left-to-right.

LAYOUT_VERTICAL 

Top-to-bottom.

Definition at line 18 of file tray.h.

Enumeration of tray alignments.

Enumerator:
TALIGN_FIXED 

Fixed at user specified x and y coordinates.

TALIGN_LEFT 

Left aligned.

TALIGN_TOP 

Top aligned.

TALIGN_CENTER 

Center aligned.

TALIGN_RIGHT 

Right aligned.

TALIGN_BOTTOM 

Bottom aligned.

Definition at line 24 of file tray.h.


Function Documentation

void AddTrayComponent ( TrayType tp,
TrayComponentType cp 
)

Add a tray component to a tray.

Parameters:
tpThe tray to update.
cpThe tray component to add.
TrayType* CreateTray ( )

Create a new tray.

Returns:
A new, empty tray.
TrayComponentType* CreateTrayComponent ( )

Create a tray component.

Returns:
A new tray component structure.
void DestroyTray ( )
void DrawSpecificTray ( const TrayType tp)

Draw a specific tray.

Parameters:
tpThe tray to draw.
void DrawTray ( )

Draw all trays.

Window GetSupportingWindow ( )

Get a window to use as the supporting window.

This is used by clients to validate that compliant window manager is running.

Returns:
The supporting window.
int GetTrayCount ( )

Get the number of trays.

Returns:
The number of trays.
TrayType* GetTrays ( )

Get a linked list of trays.

Returns:
The trays.
void HideTray ( TrayType tp)

Hide a tray.

Parameters:
tpThe tray to hide.
void InitializeTray ( )
int ProcessTrayEvent ( const XEvent *  event)

Process an event that may be for a tray.

Parameters:
eventThe event to process.
Returns:
1 if this event was for a tray, 0 otherwise.
void ResizeTray ( TrayType tp)

Resize a tray.

Parameters:
tpThe tray to resize containing the new requested size information.
void SetAutoHideTray ( TrayType tp,
int  v 
)

Set whether auto hide is enabled for a tray.

Parameters:
tpThe tray.
v1 to enable, 0 to disable.
void SetTrayBorder ( TrayType tp,
const char *  str 
)

Set the tray border size.

Parameters:
tpThe tray.
strThe border size (ASCII, pixels).
void SetTrayHeight ( TrayType tp,
const char *  str 
)

Set the tray height.

Parameters:
tpThe tray.
strThe height (ASCII, pixels).
void SetTrayHorizontalAlignment ( TrayType tp,
const char *  str 
)

Set the tray horizontal alignment.

Parameters:
tpThe tray.
strThe alignment(ASCII).
void SetTrayLayer ( TrayType tp,
const char *  str 
)

Set the tray layer.

Parameters:
tpThe tray.
strThe layer (ASCII).
void SetTrayLayout ( TrayType tp,
const char *  str 
)

Set the tray layout.

Parameters:
tpThe tray.
strA string representation of the layout to use.
void SetTrayOpacity ( const char *  str)

Set the tray transparency level.

Parameters:
strThe value (ASCII).
void SetTrayVerticalAlignment ( TrayType tp,
const char *  str 
)

Set the tray vertical alignment.

Parameters:
tpThe tray.
strThe alignment(ASCII).
void SetTrayWidth ( TrayType tp,
const char *  str 
)

Set the tray width.

Parameters:
tpThe tray.
strThe width (ASCII, pixels).
void SetTrayX ( TrayType tp,
const char *  str 
)

Set the tray x-coordinate.

Parameters:
tpThe tray.
strThe x-coordinate (ASCII, pixels, negative ok).
void SetTrayY ( TrayType tp,
const char *  str 
)

Set the tray y-coordinate.

Parameters:
tpThe tray.
strThe y-coordinate (ASCII, pixels, negative ok).
void ShowAllTrays ( )

Show all trays.

void ShowTray ( TrayType tp)

Show a tray.

Parameters:
tpThe tray to show.
void ShutdownTray ( )
void SignalTray ( const struct TimeType now,
int  x,
int  y 
)

Signal the trays.

This function is called regularly so that autohide, etc. can take place.

Parameters:
nowThe current time.
xThe mouse x-coordinate (root relative).
yThe mouse y-coordinate (root relative).
void StartupTray ( )
void UpdateSpecificTray ( const TrayType tp,
const TrayComponentType cp 
)

Update a component on a tray.

Parameters:
tpThe tray containing the component.
cpThe component that needs updating.