GiwClock
GiwClock - A clock widget


Synopsis
#include <gtkclock.h>

                       
GiwClock;
GtkWidget*    giw_clock_new                                (void);
void                giw_clock_get_time                         (GiwClock *clock, guint *hours, guint *minutes, guint *seconds);
void                giw_clock_set_time                         (GiwClock *clock, guint hours, guint minutes, guint seconds);
void                giw_clock_enable_alarm                 (GiwClock *clock, gboolean option);
void                giw_clock_set_alarm                       (GiwClock *clock, guint hours, guint minutes, guint seconds);
void                giw_clock_stop                                (GiwClock *clock);
void                giw_clock_start                               (GiwClock *clock);


Object Hierarchy
GObject
   +----GtkObject
           +----GtkWidget
                    +----GiwClock


Signal Prototypes
"alarm"
  void         user_function      (GiwClock *clock, gpointer user_data);


Description

GiwClock is a clock, with 60 ticks and three needles.
It can be created with a giw_clock_new(), an cofigured with the functions below.


Details

GiwClock
typedef struct GiwClock _GiwClock

The GiwClock struct contains private data only, and should be manipulated using the functions below.

giw_clock_new()

GtkWidget*    giw_clock_new                                (void);

Creates a new clock, with initial time of 00:00:00, and it starts counting time automatically.

Returns: a new clock.

giw_clock_get_time()

void                giw_clock_get_time                         (GiwClock *clock, guint *hours, guint *minutes, guint *seconds);

Gets the current time of the clock (not the bios time), this is the time since  the clock was created.

clock :
A clock.
hours:
Integer to receive the hours (between 0 and 24).
minutes:
Integer to receive the minutes (between 0 and 60).
seconds:
Integer to receive the seconds (between 0 and 60).

giw_clock_set_time()

void                giw_clock_set_time                         (GiwClock *clock, guint hours, guint minutes, guint seconds);

Sets the time of the clock


clock : A clock.
hours:
The hours (between 0 and 24).
minutes:
T
he minutes (between 0 and 60).
seconds:
The seconds (between 0 and 60).

giw_clock_enable_alarm()

void                giw_clock_enable_alarm                 (GiwClock *clock, gboolean option);

Enables or disables the alarm. If it's enabled the time is checked every time to verify is the time s the same as the alarm. When the alarm is verified, the "alarm" signal is emmited, and the alarm option is disabled automatically. The default option is disabled.


clock: A clock.
option
: TRUE to enable, and FALSE to disable.

giw_clock_set_alarm()

void                giw_clock_set_alarm                       (GiwClock *clock, guint hours, guint minutes, guint seconds);

Sets the alarm time (only has effects if the alarm is enabled, with giw_clock_enable_alarm).


clock : A clock.
hours:
The alarm hours (between 0 and 24).
minutes:
T
he alarm minutes (between 0 and 60).
seconds:
The alarm seconds (between 0 and 60).

giw_clock_stop()

void                giw_clock_stop                                (GiwClock *clock);

Stops the clock at the time it is


clock : A clock.

giw_clock_start()

void                giw_clock_start                                (GiwClock *clock);

Starts the clock at the time it was stopped.


clock : A clock.

Signals

The "alarm" signal
void        user_function                  (GiwClock *clock, gpointer user_data);

clock: The object which received the signal.
user_data: user data set when the signal handler was connected.