JWM Source Documentation
|
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). | |
TrayComponentType * | CreateClock (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 ClockType * | clocks |
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().
|
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().
|
read |
Create a clock tray component.
Create a clock component for the tray.
Definition at line 108 of file clock.c.
References ClockType::actions, Allocate, clocks, CopyString(), ClockType::cp, Create(), TrayComponentType::Create, CreateTrayComponent(), DEFAULT_FORMAT, Destroy(), TrayComponentType::Destroy, Settings::doubleClickDelta, ClockType::format, ClockType::lastTime, Min, ClockType::mouseTime, ClockType::mousex, ClockType::mousey, TimeType::ms, ClockType::next, TrayComponentType::object, Settings::popupDelay, TrayComponentType::ProcessButtonPress, TrayComponentType::ProcessButtonRelease, ProcessClockButtonPress(), ProcessClockButtonRelease(), ProcessClockMotionEvent(), TrayComponentType::ProcessMotionEvent, RegisterCallback(), TrayComponentType::requestedHeight, TrayComponentType::requestedWidth, Resize(), TrayComponentType::Resize, TimeType::seconds, settings, SignalClock(), ClockType::userWidth, and ClockType::zone.
Referenced by ParseClock().
|
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 | ) |
Destroy clock(s).
Definition at line 88 of file clock.c.
References ClockType::actions, ClockType::cp, DestroyActions(), ClockType::format, ClockType::next, Release, SignalClock(), UnregisterCallback(), and ClockType::zone.
Referenced by Destroy().
Draw a clock tray component.
Definition at line 252 of file clock.c.
References COLOR_CLOCK_BG1, COLOR_CLOCK_BG2, COLOR_CLOCK_FG, colors, ClockType::cp, display, DrawHorizontalGradient(), FONT_CLOCK, ClockType::format, GetStringHeight(), GetStringWidth(), GetTimeString(), TrayComponentType::height, JXFillRectangle, JXSetForeground, ClockType::lastTime, TrayComponentType::pixmap, RenderString(), TrayComponentType::requestedWidth, ResizeTray(), rootGC, TimeType::seconds, TrayComponentType::tray, UpdateSpecificTray(), ClockType::userWidth, TrayComponentType::width, and ClockType::zone.
Referenced by Resize(), and SignalClock().
void InitializeClock | ( | void | ) |
|
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().
|
static |
Definition at line 216 of file clock.c.
References ClockType::actions, TrayComponentType::object, and ProcessActionRelease().
Referenced by CreateClock().
|
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().
|
static |
Resize a clock tray component.
Definition at line 174 of file clock.c.
References Assert, display, DrawClock(), GetCurrentTime(), TrayComponentType::height, JXCreatePixmap, JXFreePixmap, ClockType::lastTime, TrayComponentType::object, TrayComponentType::pixmap, rootDepth, rootWindow, and TrayComponentType::width.
Referenced by CreateClock().
|
static |
Referenced by CreateClock(), and DestroyClock().
void SignalClock | ( | const TimeType * | now, |
int | x, | ||
int | y, | ||
Window | w, | ||
void * | data | ||
) |
Update a clock tray component.
Definition at line 233 of file clock.c.
References ClockType::cp, Settings::doubleClickDelta, DrawClock(), GetTimeDifference(), GetTimeString(), ClockType::mouseTime, ClockType::mousex, ClockType::mousey, POPUP_CLOCK, Settings::popupDelay, settings, ShowPopup(), TrayComponentType::tray, TrayType::window, and ClockType::zone.
void StartupClock | ( | void | ) |
Start clock(s).
Definition at line 74 of file clock.c.
References ClockType::cp, FONT_CLOCK, GetStringHeight(), ClockType::next, TrayComponentType::requestedHeight, and TrayComponentType::requestedWidth.
Referenced by Startup().
|
static |
Definition at line 49 of file clock.c.
Referenced by CreateClock().
|
static |
joewing.net / Projects / JWM