CScreensaver.UPower

g CScreensaver.UPower CScreensaver.UPower GObject.GInterface GObject.GInterface GObject.GInterface->CScreensaver.UPower

Implementations:

CScreensaver.UPowerProxy, CScreensaver.UPowerSkeleton

Methods

class

interface_info ()

class

override_properties (klass, property_id_begin)

call_enumerate_devices (cancellable, callback, *user_data)

call_enumerate_devices_finish (res)

call_enumerate_devices_sync (cancellable)

complete_enumerate_devices (invocation, devices)

emit_device_added (arg_device)

emit_device_removed (arg_device)

Virtual Methods

do_device_added (arg_device)

do_device_removed (arg_device)

do_handle_enumerate_devices (invocation)

Properties

Name

Type

Flags

Short Description

on-battery

bool

r/w

OnBattery

Signals

Name

Short Description

device-added

On the client-side, this signal is emitted whenever the D-Bus signal ‘“DeviceAdded” [gdbus-signal-org-freedesktop-UPower.DeviceAdded]’ is received.

device-removed

On the client-side, this signal is emitted whenever the D-Bus signal ‘“DeviceRemoved” [gdbus-signal-org-freedesktop-UPower.DeviceRemoved]’ is received.

handle-enumerate-devices

Signal emitted when a remote caller is invoking the ‘EnumerateDevices() [gdbus-method-org-freedesktop-UPower.EnumerateDevices]’ D-Bus method.

Fields

None

Class Details

class CScreensaver.UPower
Bases:

GObject.GInterface

Structure:

CScreensaver.UPowerIface

Abstract interface type for the D-Bus interface ‘org.freedesktop.UPower [gdbus-interface-org-freedesktop-UPower.top_of_page]’.

classmethod interface_info()
Returns:

A Gio.DBusInterfaceInfo. Do not free.

Return type:

Gio.DBusInterfaceInfo

Gets a machine-readable description of the ‘org.freedesktop.UPower [gdbus-interface-org-freedesktop-UPower.top_of_page]’ D-Bus interface.

classmethod override_properties(klass, property_id_begin)
Parameters:
Returns:

The last property id.

Return type:

int

Overrides all GObject.Object properties in the CScreensaver.UPower interface for a concrete class. The properties are overridden in the order they are defined.

call_enumerate_devices(cancellable, callback, *user_data)
Parameters:

Asynchronously invokes the ‘EnumerateDevices() [gdbus-method-org-freedesktop-UPower.EnumerateDevices]’ D-Bus method on self. When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from (see GLib.MainContext.push_thread_default()). You can then call CScreensaver.UPower.call_enumerate_devices_finish() to get the result of the operation.

See CScreensaver.UPower.call_enumerate_devices_sync() for the synchronous, blocking version of this method.

call_enumerate_devices_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to CScreensaver.UPower.call_enumerate_devices().

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

out_devices:

Return location for return parameter or None to ignore.

Return type:

(bool, out_devices: GLib.Variant)

Finishes an operation started with CScreensaver.UPower.call_enumerate_devices().

call_enumerate_devices_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

out_devices:

Return location for return parameter or None to ignore.

Return type:

(bool, out_devices: GLib.Variant)

Synchronously invokes the ‘EnumerateDevices() [gdbus-method-org-freedesktop-UPower.EnumerateDevices]’ D-Bus method on self. The calling thread is blocked until a reply is received.

See CScreensaver.UPower.call_enumerate_devices() for the asynchronous version of this method.

complete_enumerate_devices(invocation, devices)
Parameters:

Helper function used in service implementations to finish handling invocations of the ‘EnumerateDevices() [gdbus-method-org-freedesktop-UPower.EnumerateDevices]’ D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.

This method will free invocation, you cannot use it afterwards.

emit_device_added(arg_device)
Parameters:

arg_device (str) – Argument to pass with the signal.

Emits the ‘“DeviceAdded” [gdbus-signal-org-freedesktop-UPower.DeviceAdded]’ D-Bus signal.

emit_device_removed(arg_device)
Parameters:

arg_device (str) – Argument to pass with the signal.

Emits the ‘“DeviceRemoved” [gdbus-signal-org-freedesktop-UPower.DeviceRemoved]’ D-Bus signal.

do_device_added(arg_device) virtual
Parameters:

arg_device (str) –

do_device_removed(arg_device) virtual
Parameters:

arg_device (str) –

do_handle_enumerate_devices(invocation) virtual
Parameters:

invocation (Gio.DBusMethodInvocation) –

Return type:

bool

Signal Details

CScreensaver.UPower.signals.device_added(u_power, arg_device)
Signal Name:

device-added

Flags:

RUN_LAST

Parameters:

On the client-side, this signal is emitted whenever the D-Bus signal ‘“DeviceAdded” [gdbus-signal-org-freedesktop-UPower.DeviceAdded]’ is received.

On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.

CScreensaver.UPower.signals.device_removed(u_power, arg_device)
Signal Name:

device-removed

Flags:

RUN_LAST

Parameters:

On the client-side, this signal is emitted whenever the D-Bus signal ‘“DeviceRemoved” [gdbus-signal-org-freedesktop-UPower.DeviceRemoved]’ is received.

On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.

CScreensaver.UPower.signals.handle_enumerate_devices(u_power, invocation)
Signal Name:

handle-enumerate-devices

Flags:

RUN_LAST

Parameters:
Returns:

Gio.DBUS_METHOD_INVOCATION_HANDLED or True if the invocation was handled, Gio.DBUS_METHOD_INVOCATION_UNHANDLED or False to let other signal handlers run.

Return type:

bool

Signal emitted when a remote caller is invoking the ‘EnumerateDevices() [gdbus-method-org-freedesktop-UPower.EnumerateDevices]’ D-Bus method.

If a signal handler returns True, it means the signal handler will handle the invocation (e.g. take a reference to invocation and eventually call CScreensaver.UPower.complete_enumerate_devices() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the Gio.DBusError.UNKNOWN_METHOD error is returned.

Property Details

CScreensaver.UPower.props.on_battery
Name:

on-battery

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property ‘“OnBattery” [gdbus-property-org-freedesktop-UPower.OnBattery]’.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.