XedMessage

XedMessage — message bus message object

Functions

Properties

char * method Read
char * object-path Read
XedMessageType * type Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── XedMessage

Includes

#include <xed/xed-message.h>

Description

Communication on a XedMessageBus is done through messages. Messages are sent over the bus and received by connecting callbacks on the message bus. A XedMessage is an instantiation of a XedMessageType, containing values for the arguments as specified in the message type.

A message can be seen as a method call, or signal emission depending on who is the sender and who is the receiver. There is no explicit distinction between methods and signals.

Functions

XED_MESSAGE_CONST()

#define XED_MESSAGE_CONST(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_MESSAGE, XedMessage const))

xed_message_get_message_type ()

struct _XedMessageType
xed_message_get_message_type (XedMessage *message);

xed_message_get ()

void
xed_message_get (XedMessage *message,
                 ...);

Get values of message arguments. The supplied var_args should contain pairs of keys and pointers to variables which are set to the argument value for the specified key.

Parameters

message

the XedMessage

 

...

a NULL variable argument list of key/value container pairs

 

xed_message_get_valist ()

void
xed_message_get_valist (XedMessage *message,
                        va_list var_args);

Get values of message arguments. The supplied var_args should contain pairs of keys and pointers to variables which are set to the argument value for the specified key.

Parameters

message

the XedMessage

 

var_args

a NULL variable argument list of key/value container pairs

 

xed_message_get_value ()

void
xed_message_get_value (XedMessage *message,
                       const gchar *key,
                       GValue *value);

Get the value of a specific message argument. value will be initialized with the correct type.

Parameters

message

the XedMessage

 

key

the argument key

 

value

value return container.

[out]

xed_message_set ()

void
xed_message_set (XedMessage *message,
                 ...);

Set values of message arguments. The supplied var_args should contain pairs of keys and argument values.

Parameters

message

the XedMessage

 

...

a NULL terminated variable list of key/value pairs

 

xed_message_set_valist ()

void
xed_message_set_valist (XedMessage *message,
                        va_list var_args);

Set values of message arguments. The supplied var_args should contain pairs of keys and argument values.

Parameters

message

the XedMessage

 

var_args

a NULL terminated variable list of key/value pairs

 

xed_message_set_value ()

void
xed_message_set_value (XedMessage *message,
                       const gchar *key,
                       GValue *value);

Set value of message argument key to value .

Parameters

message

the XedMessage

 

key

the argument key

 

value

the argument value.

[out]

xed_message_set_valuesv ()

void
xed_message_set_valuesv (XedMessage *message,
                         const gchar **keys,
                         GValue *values,
                         gint n_values);

Set message argument values.

Parameters

message

the XedMessage

 

keys

keys to set values for.

[array length=n_values]

values

values to set.

[array length=n_values]

n_values

number of arguments to set values for

 

xed_message_get_object_path ()

const gchar *
xed_message_get_object_path (XedMessage *message);

Get the message object path.

Parameters

message

the XedMessage

 

Returns

the message object path


xed_message_get_method ()

const gchar *
xed_message_get_method (XedMessage *message);

Get the message method.

Parameters

message

the XedMessage

 

Returns

the message method


xed_message_has_key ()

gboolean
xed_message_has_key (XedMessage *message,
                     const gchar *key);

Check whether the message has a specific key.

Parameters

message

the XedMessage

 

key

the argument key

 

Returns

TRUE if message has argument key


xed_message_get_key_type ()

GType
xed_message_get_key_type (XedMessage *message,
                          const gchar *key);

Get the type of a message argument.

Parameters

message

the XedMessage

 

key

the argument key

 

Returns

the type of key


xed_message_validate ()

gboolean
xed_message_validate (XedMessage *message);

Validates the message arguments according to the message type.

Parameters

message

the XedMessage

 

Returns

TRUE if the message is valid

Property Details

The “method” property

  “method”                   char *

The messages method.

Owner: XedMessage

Flags: Read

Default value: NULL


The “object-path” property

  “object-path”              char *

The message object path.

Owner: XedMessage

Flags: Read

Default value: NULL


The “type” property

  “type”                     XedMessageType *

The message type.

Owner: XedMessage

Flags: Read / Write / Construct Only