1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
3
* Copyright (C) 2005-2011 Richard Hughes <richard@hughsie.com>
5
* Licensed under the GNU General Public License Version 2
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.
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.
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.
26
#include <libupower-glib/upower.h>
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,
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);
44
gboolean gsd_power_is_hardware_a_vm (void);
45
guint gsd_power_enable_screensaver_watchdog (void);
46
void reset_idletime (void);
48
/* Backlight helpers */
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)
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))
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,
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,
72
gboolean external_monitor_is_connected (GnomeRRScreen *screen);
75
void play_loop_start (guint *id);
76
void play_loop_stop (guint *id);
80
#endif /* __GPMCOMMON_H */