~ctf/unity-settings-daemon/bug1389099_mic_volume_icons

« back to all changes in this revision

Viewing changes to plugins/power/gpm-common.h

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-02-07 11:44:36 UTC
  • Revision ID: package-import@ubuntu.com-20140207114436-7t5u3yvwc4ul7w3e
Tags: upstream-14.04.0
ImportĀ upstreamĀ versionĀ 14.04.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2005-2011 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
20
 */
 
21
 
 
22
#ifndef __GPMCOMMON_H
 
23
#define __GPMCOMMON_H
 
24
 
 
25
#include <glib.h>
 
26
#include <libupower-glib/upower.h>
 
27
 
 
28
G_BEGIN_DECLS
 
29
 
 
30
/* UPower helpers */
 
31
gchar           *gpm_get_timestring                     (guint           time);
 
32
const gchar     *gpm_device_to_localised_string         (UpDevice       *device);
 
33
const gchar     *gpm_device_kind_to_localised_string    (UpDeviceKind    kind,
 
34
                                                         guint           number);
 
35
const gchar     *gpm_device_kind_to_icon                (UpDeviceKind    kind);
 
36
const gchar     *gpm_device_technology_to_localised_string (UpDeviceTechnology technology_enum);
 
37
const gchar     *gpm_device_state_to_localised_string   (UpDeviceState   state);
 
38
GIcon           *gpm_upower_get_device_icon             (UpDevice       *device,
 
39
                                                         gboolean        use_symbolic);
 
40
gchar           *gpm_upower_get_device_summary          (UpDevice       *device);
 
41
gchar           *gpm_upower_get_device_description      (UpDevice       *device);
 
42
 
 
43
/* Power helpers */
 
44
gboolean         gsd_power_is_hardware_a_vm             (void);
 
45
guint            gsd_power_enable_screensaver_watchdog  (void);
 
46
void             reset_idletime                         (void);
 
47
 
 
48
/* Backlight helpers */
 
49
 
 
50
/* on ACPI machines we have 4-16 levels, on others it's ~150 */
 
51
#define BRIGHTNESS_STEP_AMOUNT(max) ((max) < 20 ? 1 : (max) / 20)
 
52
 
 
53
#define ABS_TO_PERCENTAGE(min, max, value) gsd_power_backlight_abs_to_percentage(min, max, value)
 
54
#define PERCENTAGE_TO_ABS(min, max, value) (min + (((max - min) * value) / 100))
 
55
 
 
56
int              gsd_power_backlight_abs_to_percentage  (int min, int max, int value);
 
57
gboolean         backlight_available                    (GnomeRRScreen *rr_screen);
 
58
int              backlight_get_abs                      (GnomeRRScreen *rr_screen, GError **error);
 
59
int              backlight_get_percentage               (GnomeRRScreen *rr_screen, GError **error);
 
60
int              backlight_get_min                      (GnomeRRScreen *rr_screen);
 
61
int              backlight_get_max                      (GnomeRRScreen *rr_screen, GError **error);
 
62
gboolean         backlight_set_percentage               (GnomeRRScreen *rr_screen,
 
63
                                                         guint value,
 
64
                                                         GError **error);
 
65
int              backlight_step_up                      (GnomeRRScreen *rr_screen, GError **error);
 
66
int              backlight_step_down                    (GnomeRRScreen *rr_screen, GError **error);
 
67
int              backlight_set_abs                      (GnomeRRScreen *rr_screen,
 
68
                                                         guint value,
 
69
                                                         GError **error);
 
70
 
 
71
/* RandR helpers */
 
72
gboolean         external_monitor_is_connected          (GnomeRRScreen *screen);
 
73
 
 
74
/* Sound helpers */
 
75
void             play_loop_start                        (guint *id);
 
76
void             play_loop_stop                         (guint *id);
 
77
 
 
78
G_END_DECLS
 
79
 
 
80
#endif  /* __GPMCOMMON_H */