PhoshDBusLoginManagerSkeleton

PhoshDBusLoginManagerSkeleton

Functions

Signals

Types and Values

Object Hierarchy

    GInterface
    ╰── PhoshDBusLoginManager
    GObject
    ├── GDBusInterfaceSkeleton
       ╰── PhoshDBusLoginManagerSkeleton
    ╰── GDBusProxy
        ╰── PhoshDBusLoginManagerProxy

Prerequisites

PhoshDBusLoginManager requires GObject.

Implemented Interfaces

PhoshDBusLoginManagerProxy implements GDBusInterface, GInitable, GAsyncInitable and PhoshDBusLoginManager.

PhoshDBusLoginManagerSkeleton implements GDBusInterface and PhoshDBusLoginManager.

Known Implementations

PhoshDBusLoginManager is implemented by PhoshDBusLoginManagerProxy and PhoshDBusLoginManagerSkeleton.

Description

Functions

phosh_dbus_login_manager_interface_info ()

GDBusInterfaceInfo *
phosh_dbus_login_manager_interface_info
                               (void);

Gets a machine-readable description of the org.freedesktop.login1.Manager D-Bus interface.

Returns

A GDBusInterfaceInfo. Do not free.

[transfer none]


phosh_dbus_login_manager_override_properties ()

guint
phosh_dbus_login_manager_override_properties
                               (GObjectClass *klass,
                                guint property_id_begin);

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

Parameters

klass

The class structure for a GObject derived class.

 

property_id_begin

The property id to assign to the first overridden property.

 

Returns

The last property id.


phosh_dbus_login_manager_complete_get_session ()

void
phosh_dbus_login_manager_complete_get_session
                               (PhoshDBusLoginManager *object,
                                GDBusMethodInvocation *invocation,
                                const gchar *object_path);

Helper function used in service implementations to finish handling invocations of the GetSession() 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.

Parameters

object

A PhoshDBusLoginManager.

 

invocation

A GDBusMethodInvocation.

[transfer full]

object_path

Parameter to return.

 

phosh_dbus_login_manager_complete_inhibit ()

void
phosh_dbus_login_manager_complete_inhibit
                               (PhoshDBusLoginManager *object,
                                GDBusMethodInvocation *invocation,
                                GUnixFDList *fd_list,
                                GVariant *pipe_fd);

Helper function used in service implementations to finish handling invocations of the Inhibit() 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.

Parameters

object

A PhoshDBusLoginManager.

 

invocation

A GDBusMethodInvocation.

[transfer full]

fd_list

A GUnixFDList or NULL.

[nullable]

pipe_fd

Parameter to return.

 

phosh_dbus_login_manager_emit_prepare_for_sleep ()

void
phosh_dbus_login_manager_emit_prepare_for_sleep
                               (PhoshDBusLoginManager *object,
                                gboolean arg_start);

Emits the "PrepareForSleep" D-Bus signal.

Parameters

object

A PhoshDBusLoginManager.

 

arg_start

Argument to pass with the signal.

 

phosh_dbus_login_manager_call_get_session ()

void
phosh_dbus_login_manager_call_get_session
                               (PhoshDBusLoginManager *proxy,
                                const gchar *arg_session_id,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously invokes the GetSession() D-Bus method on proxy . 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 g_main_context_push_thread_default()). You can then call phosh_dbus_login_manager_call_get_session_finish() to get the result of the operation.

See phosh_dbus_login_manager_call_get_session_sync() for the synchronous, blocking version of this method.

Parameters

proxy

A PhoshDBusLoginManagerProxy.

 

arg_session_id

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback .

 

phosh_dbus_login_manager_call_get_session_finish ()

gboolean
phosh_dbus_login_manager_call_get_session_finish
                               (PhoshDBusLoginManager *proxy,
                                gchar **out_object_path,
                                GAsyncResult *res,
                                GError **error);

Finishes an operation started with phosh_dbus_login_manager_call_get_session().

Parameters

proxy

A PhoshDBusLoginManagerProxy.

 

out_object_path

Return location for return parameter or NULL to ignore.

[out][optional]

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to phosh_dbus_login_manager_call_get_session().

 

error

Return location for error or NULL.

 

Returns

TRUE if the call succeeded, FALSE if error is set.

[skip]


phosh_dbus_login_manager_call_get_session_sync ()

gboolean
phosh_dbus_login_manager_call_get_session_sync
                               (PhoshDBusLoginManager *proxy,
                                const gchar *arg_session_id,
                                gchar **out_object_path,
                                GCancellable *cancellable,
                                GError **error);

Synchronously invokes the GetSession() D-Bus method on proxy . The calling thread is blocked until a reply is received.

See phosh_dbus_login_manager_call_get_session() for the asynchronous version of this method.

Parameters

proxy

A PhoshDBusLoginManagerProxy.

 

arg_session_id

Argument to pass with the method invocation.

 

out_object_path

Return location for return parameter or NULL to ignore.

[out][optional]

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 

Returns

TRUE if the call succeeded, FALSE if error is set.

[skip]


phosh_dbus_login_manager_call_inhibit ()

void
phosh_dbus_login_manager_call_inhibit (PhoshDBusLoginManager *proxy,
                                       const gchar *arg_what,
                                       const gchar *arg_who,
                                       const gchar *arg_why,
                                       const gchar *arg_mode,
                                       GUnixFDList *fd_list,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Asynchronously invokes the Inhibit() D-Bus method on proxy . 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 g_main_context_push_thread_default()). You can then call phosh_dbus_login_manager_call_inhibit_finish() to get the result of the operation.

See phosh_dbus_login_manager_call_inhibit_sync() for the synchronous, blocking version of this method.

Parameters

proxy

A PhoshDBusLoginManagerProxy.

 

arg_what

Argument to pass with the method invocation.

 

arg_who

Argument to pass with the method invocation.

 

arg_why

Argument to pass with the method invocation.

 

arg_mode

Argument to pass with the method invocation.

 

fd_list

A GUnixFDList or NULL.

[nullable]

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback .

 

phosh_dbus_login_manager_call_inhibit_finish ()

gboolean
phosh_dbus_login_manager_call_inhibit_finish
                               (PhoshDBusLoginManager *proxy,
                                GVariant **out_pipe_fd,
                                GUnixFDList **out_fd_list,
                                GAsyncResult *res,
                                GError **error);

Finishes an operation started with phosh_dbus_login_manager_call_inhibit().

Parameters

proxy

A PhoshDBusLoginManagerProxy.

 

out_pipe_fd

Return location for return parameter or NULL to ignore.

[out][optional]

out_fd_list

Return location for a GUnixFDList or NULL to ignore.

[out][optional]

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to phosh_dbus_login_manager_call_inhibit().

 

error

Return location for error or NULL.

 

Returns

TRUE if the call succeeded, FALSE if error is set.

[skip]


phosh_dbus_login_manager_call_inhibit_sync ()

gboolean
phosh_dbus_login_manager_call_inhibit_sync
                               (PhoshDBusLoginManager *proxy,
                                const gchar *arg_what,
                                const gchar *arg_who,
                                const gchar *arg_why,
                                const gchar *arg_mode,
                                GUnixFDList *fd_list,
                                GVariant **out_pipe_fd,
                                GUnixFDList **out_fd_list,
                                GCancellable *cancellable,
                                GError **error);

Synchronously invokes the Inhibit() D-Bus method on proxy . The calling thread is blocked until a reply is received.

See phosh_dbus_login_manager_call_inhibit() for the asynchronous version of this method.

Parameters

proxy

A PhoshDBusLoginManagerProxy.

 

arg_what

Argument to pass with the method invocation.

 

arg_who

Argument to pass with the method invocation.

 

arg_why

Argument to pass with the method invocation.

 

arg_mode

Argument to pass with the method invocation.

 

fd_list

A GUnixFDList or NULL.

[nullable]

out_pipe_fd

Return location for return parameter or NULL to ignore.

[out][optional]

out_fd_list

Return location for a GUnixFDList or NULL.

[out]

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 

Returns

TRUE if the call succeeded, FALSE if error is set.

[skip]


phosh_dbus_login_manager_proxy_new ()

void
phosh_dbus_login_manager_proxy_new (GDBusConnection *connection,
                                    GDBusProxyFlags flags,
                                    const gchar *name,
                                    const gchar *object_path,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously creates a proxy for the D-Bus interface org.freedesktop.login1.Manager. See g_dbus_proxy_new() for more details.

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 g_main_context_push_thread_default()). You can then call phosh_dbus_login_manager_proxy_new_finish() to get the result of the operation.

See phosh_dbus_login_manager_proxy_new_sync() for the synchronous, blocking version of this constructor.

Parameters

connection

A GDBusConnection.

 

flags

Flags from the GDBusProxyFlags enumeration.

 

name

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

[nullable]

object_path

An object path.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied.

 

user_data

User data to pass to callback .

 

phosh_dbus_login_manager_proxy_new_finish ()

PhoshDBusLoginManager *
phosh_dbus_login_manager_proxy_new_finish
                               (GAsyncResult *res,
                                GError **error);

Finishes an operation started with phosh_dbus_login_manager_proxy_new().

Parameters

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to phosh_dbus_login_manager_proxy_new().

 

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type PhoshDBusLoginManagerProxy]


phosh_dbus_login_manager_proxy_new_sync ()

PhoshDBusLoginManager *
phosh_dbus_login_manager_proxy_new_sync
                               (GDBusConnection *connection,
                                GDBusProxyFlags flags,
                                const gchar *name,
                                const gchar *object_path,
                                GCancellable *cancellable,
                                GError **error);

Synchronously creates a proxy for the D-Bus interface org.freedesktop.login1.Manager. See g_dbus_proxy_new_sync() for more details.

The calling thread is blocked until a reply is received.

See phosh_dbus_login_manager_proxy_new() for the asynchronous version of this constructor.

Parameters

connection

A GDBusConnection.

 

flags

Flags from the GDBusProxyFlags enumeration.

 

name

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

[nullable]

object_path

An object path.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type PhoshDBusLoginManagerProxy]


phosh_dbus_login_manager_proxy_new_for_bus ()

void
phosh_dbus_login_manager_proxy_new_for_bus
                               (GBusType bus_type,
                                GDBusProxyFlags flags,
                                const gchar *name,
                                const gchar *object_path,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Like phosh_dbus_login_manager_proxy_new() but takes a GBusType instead of a GDBusConnection.

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 g_main_context_push_thread_default()). You can then call phosh_dbus_login_manager_proxy_new_for_bus_finish() to get the result of the operation.

See phosh_dbus_login_manager_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.

Parameters

bus_type

A GBusType.

 

flags

Flags from the GDBusProxyFlags enumeration.

 

name

A bus name (well-known or unique).

 

object_path

An object path.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied.

 

user_data

User data to pass to callback .

 

phosh_dbus_login_manager_proxy_new_for_bus_finish ()

PhoshDBusLoginManager *
phosh_dbus_login_manager_proxy_new_for_bus_finish
                               (GAsyncResult *res,
                                GError **error);

Finishes an operation started with phosh_dbus_login_manager_proxy_new_for_bus().

Parameters

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to phosh_dbus_login_manager_proxy_new_for_bus().

 

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type PhoshDBusLoginManagerProxy]


phosh_dbus_login_manager_proxy_new_for_bus_sync ()

PhoshDBusLoginManager *
phosh_dbus_login_manager_proxy_new_for_bus_sync
                               (GBusType bus_type,
                                GDBusProxyFlags flags,
                                const gchar *name,
                                const gchar *object_path,
                                GCancellable *cancellable,
                                GError **error);

Like phosh_dbus_login_manager_proxy_new_sync() but takes a GBusType instead of a GDBusConnection.

The calling thread is blocked until a reply is received.

See phosh_dbus_login_manager_proxy_new_for_bus() for the asynchronous version of this constructor.

Parameters

bus_type

A GBusType.

 

flags

Flags from the GDBusProxyFlags enumeration.

 

name

A bus name (well-known or unique).

 

object_path

An object path.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type PhoshDBusLoginManagerProxy]


phosh_dbus_login_manager_skeleton_new ()

PhoshDBusLoginManager *
phosh_dbus_login_manager_skeleton_new (void);

Creates a skeleton object for the D-Bus interface org.freedesktop.login1.Manager.

Returns

The skeleton object.

[transfer full][type PhoshDBusLoginManagerSkeleton]

Types and Values

struct PhoshDBusLoginManagerIface

struct PhoshDBusLoginManagerIface {
  GTypeInterface parent_iface;

  gboolean (*handle_get_session) (
    PhoshDBusLoginManager *object,
    GDBusMethodInvocation *invocation,
    const gchar *arg_session_id);

  gboolean (*handle_inhibit) (
    PhoshDBusLoginManager *object,
    GDBusMethodInvocation *invocation,
    GUnixFDList *fd_list,
    const gchar *arg_what,
    const gchar *arg_who,
    const gchar *arg_why,
    const gchar *arg_mode);

  void (*prepare_for_sleep) (
    PhoshDBusLoginManager *object,
    gboolean arg_start);
};

Virtual table for the D-Bus interface org.freedesktop.login1.Manager.

Members

GTypeInterface parent_iface;

The parent interface.

 

handle_get_session ()

Handler for the “handle-get-session” signal.

 

handle_inhibit ()

Handler for the “handle-inhibit” signal.

 

prepare_for_sleep ()

Handler for the “prepare-for-sleep” signal.

 

struct PhoshDBusLoginManagerProxy

struct PhoshDBusLoginManagerProxy;

The PhoshDBusLoginManagerProxy structure contains only private data and should only be accessed using the provided API.


struct PhoshDBusLoginManagerProxyClass

struct PhoshDBusLoginManagerProxyClass {
  GDBusProxyClass parent_class;
};

Class structure for PhoshDBusLoginManagerProxy.

Members


struct PhoshDBusLoginManagerSkeleton

struct PhoshDBusLoginManagerSkeleton;

The PhoshDBusLoginManagerSkeleton structure contains only private data and should only be accessed using the provided API.


struct PhoshDBusLoginManagerSkeletonClass

struct PhoshDBusLoginManagerSkeletonClass {
  GDBusInterfaceSkeletonClass parent_class;
};

Class structure for PhoshDBusLoginManagerSkeleton.

Members


PhoshDBusLoginManager

typedef struct _PhoshDBusLoginManager PhoshDBusLoginManager;

Abstract interface type for the D-Bus interface org.freedesktop.login1.Manager.


PhoshDBusLoginManagerProxyPrivate

typedef struct _PhoshDBusLoginManagerProxyPrivate PhoshDBusLoginManagerProxyPrivate;

PhoshDBusLoginManagerSkeletonPrivate

typedef struct _PhoshDBusLoginManagerSkeletonPrivate PhoshDBusLoginManagerSkeletonPrivate;

Signal Details

The “handle-get-session” signal

gboolean
user_function (PhoshDBusLoginManager *object,
               GDBusMethodInvocation *invocation,
               char                  *arg_session_id,
               gpointer               user_data)

Signal emitted when a remote caller is invoking the GetSession() 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 phosh_dbus_login_manager_complete_get_session() 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 G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

Parameters

object

A PhoshDBusLoginManager.

 

invocation

A GDBusMethodInvocation.

 

arg_session_id

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 

Returns

G_DBUS_METHOD_INVOCATION_HANDLED or TRUE if the invocation was handled, G_DBUS_METHOD_INVOCATION_UNHANDLED or FALSE to let other signal handlers run.

Flags: Run Last


The “handle-inhibit” signal

gboolean
user_function (PhoshDBusLoginManager *object,
               GDBusMethodInvocation *invocation,
               GUnixFDList           *fd_list,
               char                  *arg_what,
               char                  *arg_who,
               char                  *arg_why,
               char                  *arg_mode,
               gpointer               user_data)

Signal emitted when a remote caller is invoking the Inhibit() 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 phosh_dbus_login_manager_complete_inhibit() 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 G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

Parameters

object

A PhoshDBusLoginManager.

 

invocation

A GDBusMethodInvocation.

 

fd_list

A GUnixFDList or NULL.

[nullable]

arg_what

Argument passed by remote caller.

 

arg_who

Argument passed by remote caller.

 

arg_why

Argument passed by remote caller.

 

arg_mode

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 

Returns

G_DBUS_METHOD_INVOCATION_HANDLED or TRUE if the invocation was handled, G_DBUS_METHOD_INVOCATION_UNHANDLED or FALSE to let other signal handlers run.

Flags: Run Last


The “prepare-for-sleep” signal

void
user_function (PhoshDBusLoginManager *object,
               gboolean               arg_start,
               gpointer               user_data)

On the client-side, this signal is emitted whenever the D-Bus signal "PrepareForSleep" 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.

Parameters

object

A PhoshDBusLoginManager.

 

arg_start

Argument.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last