summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-07-28 15:50:43 +0200
committerBastien Nocera <hadess@hadess.net>2021-07-28 15:50:43 +0200
commitd7203cf2213d27810fd55a656bac92ed608d96ab (patch)
tree329716e2bfca5013623f99e6462b5dc88185dd94
parent4deecd658f18ed49d8b1a468e105c0d7cc4873cc (diff)
downloadgobject-introspection-wip/hadess/add-power-profile-monitor.tar.gz
Add GPowerProfileMonitor to glib annotationswip/hadess/add-power-profile-monitor
See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2194
-rw-r--r--gir/gio-2.0.c87
1 files changed, 87 insertions, 0 deletions
diff --git a/gir/gio-2.0.c b/gir/gio-2.0.c
index c1ffdd09..063276ad 100644
--- a/gir/gio-2.0.c
+++ b/gir/gio-2.0.c
@@ -2654,6 +2654,35 @@
/**
+ * GPowerProfileMonitor:
+ *
+ * #GPowerProfileMonitor monitors system power profile and notifies on
+ * changes.
+ *
+ * Since: 2.70
+ */
+
+
+/**
+ * GPowerProfileMonitor:power-saver-enabled:
+ *
+ * Whether “Power Saver” mode is enabled on the system.
+ *
+ * Since: 2.70
+ */
+
+
+/**
+ * GPowerProfileMonitorInterface:
+ * @g_iface: The parent interface.
+ *
+ * The virtual function table for #GPowerProfileMonitor.
+ *
+ * Since: 2.70
+ */
+
+
+/**
* GPropertyAction:
*
* This type is opaque.
@@ -7413,6 +7442,39 @@
/**
+ * SECTION:gpowerprofilemonitor
+ * @title: GPowerProfileMonitor
+ * @short_description: Power profile monitor
+ * @include: gio/gio.h
+ *
+ * #GPowerProfileMonitor makes it possible for applications as well as OS components
+ * to monitor system power profiles and act upon them. It currently only exports
+ * whether the system is in “Power Saver” mode (known as “Low Power” mode on
+ * some systems).
+ *
+ * When in “Low Power” mode, it is recommended that applications:
+ * - disabling automatic downloads
+ * - reduce the rate of refresh from online sources such as calendar or
+ * email synchronisation
+ * - if the application has expensive visual effects, reduce them
+ *
+ * It is also likely that OS components providing services to applications will
+ * lower their own background activity, for the sake of the system.
+ *
+ * There are a variety of tools that exist for power consumption analysis, but those
+ * usually depend on the OS and hardware used. On Linux, one could use `upower` to
+ * monitor the battery discharge rate, `powertop` to check on the background activity
+ * or activity at all), `sysprof` to inspect CPU usage, and `intel_gpu_time` to
+ * profile GPU usage.
+ *
+ * Don't forget to disconnect the #GPowerProfileMonitor::notify::power-saver-enabled
+ * signal, and unref the #GPowerProfileMonitor itself when exiting.
+ *
+ * Since: 2.70
+ */
+
+
+/**
* SECTION:gpropertyaction
* @title: GPropertyAction
* @short_description: A GAction reflecting a GObject property
@@ -31284,6 +31346,31 @@
/**
+ * g_power_profile_monitor_dup_default:
+ *
+ * Gets a reference to the default #GPowerProfileMonitor for the system.
+ *
+ * Returns: (not nullable) (transfer full): a new reference to the default #GPowerProfileMonitor
+ * Since: 2.70
+ */
+
+
+/**
+ * g_power_profile_monitor_get_power_saver_enabled:
+ * @monitor: a #GPowerProfileMonitor
+ *
+ * Gets whether the system is in “Power Saver” mode.
+ *
+ * You are expected to listen to the
+ * #GPowerProfileMonitor::notify::power-saver-enabled signal to know when the profile has
+ * changed.
+ *
+ * Returns: Whether the system is in “Power Saver” mode.
+ * Since: 2.70
+ */
+
+
+/**
* g_property_action_new:
* @name: the name of the action to create
* @object: (type GObject.Object): the object that has the property