DBusGMethod

## DBusGMethod DBusGMethod — GMethod Info & Invocation |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

                DBusGMethodInfo;
                DBusGMethodInvocation;
    gchar*      dbus_g_method_get_sender        (DBusGMethodInvocation *context);
    DBusMessage* dbus_g_method_get_reply        (DBusGMethodInvocation *context);
    void        dbus_g_method_send_reply        (DBusGMethodInvocation *context,
                                                 DBusMessage *reply);
    void        dbus_g_method_return            (DBusGMethodInvocation *context,
                                                 ...);
    void        dbus_g_method_return_error      (DBusGMethodInvocation *context,
                                                 GError *error);

## Description

These types are used to call methods on GObject objects.

## Details

### DBusGMethodInfo

    typedef struct {
      GCallback                 function;
      GClosureMarshal           marshaller;
      int                       data_offset;
    } DBusGMethodInfo;

Object typically generated by dbus-binding-tool that stores a mapping from introspection data to a function pointer for a C method to be invoked.

GCallback `function`; | C method to invoke
GClosureMarshal `marshaller`; | Marshaller to invoke method
int `data_offset`; | Offset into the introspection data

### DBusGMethodInvocation

    typedef struct _DBusGMethodInvocation DBusGMethodInvocation;

### dbus_g_method_get_sender ()

    gchar*      dbus_g_method_get_sender        (DBusGMethodInvocation *context);

Get the sender of a message so we can send a "reply" later (i.e. send a message directly to a service which invoked the method at a later time).

`context` : | the method context
Returns : | the unique name of teh sender

### dbus_g_method_get_reply ()

    DBusMessage* dbus_g_method_get_reply        (DBusGMethodInvocation *context);

Get the reply message to append reply values Used as a sidedoor when you can't generate dbus values of the correct type due to glib binding limitations

`context` : | the method context
Returns : | a DBusMessage with the reply

### dbus_g_method_send_reply ()

    void        dbus_g_method_send_reply        (DBusGMethodInvocation *context,
                                                 DBusMessage *reply);

Used as a sidedoor when you can't generate dbus values of the correct type due to glib binding limitations

`context` : | the method context
`reply` : | the reply message, will be unreffed

### dbus_g_method_return ()

    void        dbus_g_method_return            (DBusGMethodInvocation *context,
                                                 ...);

Send a return message for a given method invocation, with arguments. This function also frees the sending context.

`context` : | the method context
`...` : |

### dbus_g_method_return_error ()

    void        dbus_g_method_return_error      (DBusGMethodInvocation *context,
                                                 GError *error);

Send a error message for a given method invocation. This function also frees the sending context.

`context` : | the method context
`error` : | the error to send

## See Also

DBusGMessage