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

Clock tray component. More...

#include "jwm.h"
#include "clock.h"
#include "tray.h"
#include "color.h"
#include "font.h"
#include "timing.h"
#include "main.h"
#include "command.h"
#include "cursor.h"
#include "popup.h"
#include "misc.h"
#include "settings.h"
#include "event.h"
#include "action.h"

Go to the source code of this file.

Data Structures

struct  ClockType
 Structure to respresent a clock tray component. More...
 

Typedefs

typedef struct ClockType ClockType
 Structure to respresent a clock tray component.
 

Functions

static void Create (TrayComponentType *cp)
 Initialize a clock tray component.
 
static void Resize (TrayComponentType *cp)
 Resize a clock tray component.
 
static void Destroy (TrayComponentType *cp)
 Destroy a clock tray component.
 
static void ProcessClockButtonPress (TrayComponentType *cp, int x, int y, int button)
 Process a press event on a clock tray component.
 
static void ProcessClockButtonRelease (TrayComponentType *cp, int x, int y, int button)
 
static void ProcessClockMotionEvent (TrayComponentType *cp, int x, int y, int mask)
 Process a motion event on a clock tray component.
 
static void DrawClock (ClockType *clk, const TimeType *now)
 Draw a clock tray component.
 
static void SignalClock (const struct TimeType *now, int x, int y, Window w, void *data)
 
void InitializeClock (void)
 Initialize clocks.
 
void StartupClock (void)
 Start clock(s).
 
void DestroyClock (void)
 Destroy clock(s).
 
TrayComponentTypeCreateClock (const char *format, const char *zone, int width, int height)
 Create a clock tray component.
 
void AddClockAction (TrayComponentType *cp, const char *action, int mask)
 Add an action to a clock.
 
void SignalClock (const TimeType *now, int x, int y, Window w, void *data)
 Update a clock tray component.
 

Variables

static const char * DEFAULT_FORMAT = "%I:%M %p"
 The default time format to use.
 
static ClockTypeclocks
 

Detailed Description

Clock tray component.

Author
Joe Wingbermuehle
Date
2005-2006

Definition in file clock.c.

Typedef Documentation

typedef struct ClockType ClockType

Structure to respresent a clock tray component.

Function Documentation

void AddClockAction ( TrayComponentType cp,
const char *  action,
int  mask 
)

Add an action to a clock.

Definition at line 158 of file clock.c.

References ClockType::actions, AddAction(), and TrayComponentType::object.

Referenced by ParseClock().

void Create ( TrayComponentType cp)
static

Initialize a clock tray component.

Definition at line 167 of file clock.c.

References display, TrayComponentType::height, JXCreatePixmap, TrayComponentType::pixmap, rootDepth, rootWindow, and TrayComponentType::width.

Referenced by CreateClock().

TrayComponentType* CreateClock ( const char *  format,
const char *  zone,
int  width,
int  height 
)
read
void Destroy ( TrayComponentType cp)
static

Destroy a clock tray component.

Definition at line 201 of file clock.c.

References Assert, display, JXFreePixmap, and TrayComponentType::pixmap.

Referenced by CreateClock().

void DestroyClock ( void  )
void DrawClock ( ClockType clk,
const TimeType now 
)
static
void InitializeClock ( void  )

Initialize clocks.

Definition at line 68 of file clock.c.

Referenced by Initialize().

void ProcessClockButtonPress ( TrayComponentType cp,
int  x,
int  y,
int  button 
)
static

Process a press event on a clock tray component.

Definition at line 210 of file clock.c.

References ClockType::actions, TrayComponentType::object, and ProcessActionPress().

Referenced by CreateClock().

void ProcessClockButtonRelease ( TrayComponentType cp,
int  x,
int  y,
int  button 
)
static

Definition at line 216 of file clock.c.

References ClockType::actions, TrayComponentType::object, and ProcessActionRelease().

Referenced by CreateClock().

void ProcessClockMotionEvent ( TrayComponentType cp,
int  x,
int  y,
int  mask 
)
static

Process a motion event on a clock tray component.

Definition at line 223 of file clock.c.

References GetCurrentTime(), ClockType::mouseTime, ClockType::mousex, ClockType::mousey, TrayComponentType::object, TrayComponentType::screenx, and TrayComponentType::screeny.

Referenced by CreateClock().

void Resize ( TrayComponentType cp)
static
static void SignalClock ( const struct TimeType now,
int  x,
int  y,
Window  w,
void *  data 
)
static

Referenced by CreateClock(), and DestroyClock().

void SignalClock ( const TimeType now,
int  x,
int  y,
Window  w,
void *  data 
)
void StartupClock ( void  )

Variable Documentation

ClockType* clocks
static

Definition at line 49 of file clock.c.

Referenced by CreateClock().

const char* DEFAULT_FORMAT = "%I:%M %p"
static

The default time format to use.

Definition at line 47 of file clock.c.

Referenced by CreateClock().

joewing.net / Projects / JWM