~ubuntu-branches/ubuntu/precise/xfce4-power-manager/precise

« back to all changes in this revision

Viewing changes to src/egg-idletime.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2009-12-04 16:13:45 UTC
  • mfrom: (6.2.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091204161345-pkcz5rs7pudco2hl
Tags: 0.8.4.2-1ubuntu1
* Merge from Debian testing, remaining Ubuntu changes:
  - debian/patches:
    + xubuntu-use-notification-icons.patch: use our notification-* icons for
      notification bubbles instead of the normal ones LP: #437374
    + 10_pc.patch: added patched files to POTFILES.skip
    + series: created, with these two patches
  - debian/rules: add --with quilt
  - debian/control: build-depends on quilt (>= 0.46-7~)
  - debian/README.source: added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2007 Richard Hughes <richard@hughsie.com>
 
4
 *
 
5
 * Licensed under the GNU General Public License Version 2
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
#ifndef __EGG_IDLETIME_H
 
23
#define __EGG_IDLETIME_H
 
24
 
 
25
#include <glib-object.h>
 
26
 
 
27
G_BEGIN_DECLS
 
28
 
 
29
#define EGG_IDLETIME_TYPE               (egg_idletime_get_type ())
 
30
#define EGG_IDLETIME(o)                 (G_TYPE_CHECK_INSTANCE_CAST ((o), EGG_IDLETIME_TYPE, EggIdletime))
 
31
#define EGG_IDLETIME_CLASS(k)           (G_TYPE_CHECK_CLASS_CAST((k), EGG_IDLETIME_TYPE, EggIdletimeClass))
 
32
#define EGG_IS_IDLETIME(o)              (G_TYPE_CHECK_INSTANCE_TYPE ((o), EGG_IDLETIME_TYPE))
 
33
#define EGG_IS_IDLETIME_CLASS(k)        (G_TYPE_CHECK_CLASS_TYPE ((k), EGG_IDLETIME_TYPE))
 
34
#define EGG_IDLETIME_GET_CLASS(o)       (G_TYPE_INSTANCE_GET_CLASS ((o), EGG_IDLETIME_TYPE, EggIdletimeClass))
 
35
 
 
36
enum
 
37
{
 
38
    TIMEOUT_INPUT = 0,
 
39
    TIMEOUT_BRIGHTNESS_ON_AC,
 
40
    TIMEOUT_BRIGHTNESS_ON_BATTERY,
 
41
    TIMEOUT_INACTIVITY_ON_AC,
 
42
    TIMEOUT_INACTIVITY_ON_BATTERY
 
43
};
 
44
 
 
45
typedef struct EggIdletimePrivate EggIdletimePrivate;
 
46
 
 
47
typedef struct
 
48
{
 
49
        GObject                  parent;
 
50
        EggIdletimePrivate      *priv;
 
51
} EggIdletime;
 
52
 
 
53
typedef struct
 
54
{
 
55
        GObjectClass    parent_class;
 
56
        void            (* alarm_expired)               (EggIdletime    *idletime,
 
57
                                                         guint           timer_id);
 
58
        void            (* reset)                       (EggIdletime    *idletime);
 
59
} EggIdletimeClass;
 
60
 
 
61
GType            egg_idletime_get_type                  (void);
 
62
EggIdletime     *egg_idletime_new                       (void);
 
63
 
 
64
void             egg_idletime_alarm_reset_all           (EggIdletime    *idletime);
 
65
gboolean         egg_idletime_alarm_set                 (EggIdletime    *idletime,
 
66
                                                         guint           alarm_id,
 
67
                                                         guint           timeout);
 
68
gboolean         egg_idletime_alarm_remove              (EggIdletime    *idletime,
 
69
                                                         guint           alarm_id);
 
70
gint64           egg_idletime_get_time                  (EggIdletime    *idletime);
 
71
#ifdef EGG_TEST
 
72
void             egg_idletime_test                      (gpointer        data);
 
73
#endif
 
74
 
 
75
G_END_DECLS
 
76
 
 
77
#endif  /* __EGG_IDLETIME_H */