|  |  |  | GNOME Desktop Library Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | ||||
struct GnomeIdleMonitor; struct GnomeIdleMonitorClass; void (*GnomeIdleMonitorWatchFunc) (GnomeIdleMonitor *monitor,guint id,gpointer user_data); GnomeIdleMonitor * gnome_idle_monitor_new (void); GnomeIdleMonitor * gnome_idle_monitor_new_for_device (GdkDevice *device); guint gnome_idle_monitor_add_idle_watch (GnomeIdleMonitor *monitor,guint64 interval_msec,GnomeIdleMonitorWatchFunc callback,gpointer user_data,GDestroyNotify notify); guint gnome_idle_monitor_add_user_active_watch (GnomeIdleMonitor *monitor,GnomeIdleMonitorWatchFunc callback,gpointer user_data,GDestroyNotify notify); void gnome_idle_monitor_remove_watch (GnomeIdleMonitor *monitor,guint id); gint64 gnome_idle_monitor_get_idletime (GnomeIdleMonitor *monitor);
void (*GnomeIdleMonitorWatchFunc) (GnomeIdleMonitor *monitor,guint id,gpointer user_data);
GnomeIdleMonitor *  gnome_idle_monitor_new              (void);
| Returns : | a new GnomeIdleMonitor that tracks the server-global
idletime for all devices. To track device-specific idletime,
use gnome_idle_monitor_new_for_device(). | 
GnomeIdleMonitor *  gnome_idle_monitor_new_for_device   (GdkDevice *device);
| 
 | A GdkDevice to get the idle time for. | 
| Returns : | a new GnomeIdleMonitor that tracks the device-specific
idletime for device. If device-specific idletime is not available,NULLis returned, anderroris set. To track server-global
idletime for all devices, usegnome_idle_monitor_new(). | 
guint gnome_idle_monitor_add_idle_watch (GnomeIdleMonitor *monitor,guint64 interval_msec,GnomeIdleMonitorWatchFunc callback,gpointer user_data,GDestroyNotify notify);
| 
 | A GnomeIdleMonitor | 
| 
 | The idletime interval, in milliseconds | 
| 
 | The callback to call when the user has
accumulated interval_msecmilliseconds of idle time. [allow-none] | 
| 
 | The user data to pass to the callback. [allow-none] | 
| 
 | A GDestroyNotify | 
| Returns : | a watch id
Adds a watch for a specific idle time. The callback will be called
when the user has accumulated interval_msecmilliseconds of idle time.
This function will return an ID that can either be passed tognome_idle_monitor_remove_watch(), or can be used to tell idle time
watches apart if you have more than one.
Also note that this function will only care about positive transitions
(user's idle time exceeding a certain time). If you want to know about
when the user has become active, usegnome_idle_monitor_add_user_active_watch(). | 
guint gnome_idle_monitor_add_user_active_watch (GnomeIdleMonitor *monitor,GnomeIdleMonitorWatchFunc callback,gpointer user_data,GDestroyNotify notify);
| 
 | A GnomeIdleMonitor | 
| 
 | The callback to call when the user is active again. [allow-none] | 
| 
 | The user data to pass to the callback. [allow-none] | 
| 
 | A GDestroyNotify | 
| Returns : | a watch id
Add a one-time watch to know when the user is active again.
Note that this watch is one-time and will de-activate after the
function is called, for efficiency purposes. It's most convenient
to call this when an idle watch, as added by gnome_idle_monitor_add_idle_watch(), has triggered. | 
void gnome_idle_monitor_remove_watch (GnomeIdleMonitor *monitor,guint id);
Removes an idle time watcher, previously added by
gnome_idle_monitor_add_idle_watch() or
gnome_idle_monitor_add_user_active_watch().
| 
 | A GnomeIdleMonitor | 
| 
 | A watch ID | 
gint64              gnome_idle_monitor_get_idletime     (GnomeIdleMonitor *monitor);
| 
 | A GnomeIdleMonitor | 
| Returns : | The current idle time, in milliseconds, or -1 for not supported |