mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 23:51:06 +00:00
libsysprof: add message-type property
This commit is contained in:
@ -40,6 +40,7 @@ enum {
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_MESSAGE,
|
PROP_MESSAGE,
|
||||||
PROP_MESSAGE_LENGTH,
|
PROP_MESSAGE_LENGTH,
|
||||||
|
PROP_MESSAGE_TYPE,
|
||||||
PROP_SERIAL,
|
PROP_SERIAL,
|
||||||
PROP_SENDER,
|
PROP_SENDER,
|
||||||
PROP_DESTINATION,
|
PROP_DESTINATION,
|
||||||
@ -90,6 +91,10 @@ sysprof_document_dbus_message_get_property (GObject *object,
|
|||||||
g_value_set_string (value, sysprof_document_dbus_message_get_destination (self));
|
g_value_set_string (value, sysprof_document_dbus_message_get_destination (self));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_MESSAGE_TYPE:
|
||||||
|
g_value_set_enum (value, sysprof_document_dbus_message_get_message_type (self));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
}
|
}
|
||||||
@ -131,6 +136,12 @@ sysprof_document_dbus_message_class_init (SysprofDocumentDBusMessageClass *klass
|
|||||||
NULL,
|
NULL,
|
||||||
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
properties[PROP_MESSAGE_TYPE] =
|
||||||
|
g_param_spec_enum ("message-type", NULL, NULL,
|
||||||
|
G_TYPE_DBUS_MESSAGE_TYPE,
|
||||||
|
G_DBUS_MESSAGE_TYPE_INVALID,
|
||||||
|
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,3 +262,16 @@ sysprof_document_dbus_message_get_destination (SysprofDocumentDBusMessage *self)
|
|||||||
/* Safe because of self->message */
|
/* Safe because of self->message */
|
||||||
return g_dbus_message_get_destination (message);
|
return g_dbus_message_get_destination (message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GDBusMessageType
|
||||||
|
sysprof_document_dbus_message_get_message_type (SysprofDocumentDBusMessage *self)
|
||||||
|
{
|
||||||
|
g_autoptr(GDBusMessage) message = NULL;
|
||||||
|
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_DBUS_MESSAGE (self), 0);
|
||||||
|
|
||||||
|
if (!(message = sysprof_document_dbus_message_dup_message (self)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return g_dbus_message_get_message_type (message);
|
||||||
|
}
|
||||||
|
|||||||
@ -35,20 +35,22 @@ typedef struct _SysprofDocumentDBusMessage SysprofDocumentDBusMessage;
|
|||||||
typedef struct _SysprofDocumentDBusMessageClass SysprofDocumentDBusMessageClass;
|
typedef struct _SysprofDocumentDBusMessageClass SysprofDocumentDBusMessageClass;
|
||||||
|
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GType sysprof_document_dbus_message_get_type (void) G_GNUC_CONST;
|
GType sysprof_document_dbus_message_get_type (void) G_GNUC_CONST;
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
guint sysprof_document_dbus_message_get_message_length (SysprofDocumentDBusMessage *self);
|
guint sysprof_document_dbus_message_get_message_length (SysprofDocumentDBusMessage *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
const guint8 *sysprof_document_dbus_message_get_message_data (SysprofDocumentDBusMessage *self,
|
const guint8 *sysprof_document_dbus_message_get_message_data (SysprofDocumentDBusMessage *self,
|
||||||
guint *length);
|
guint *length);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GDBusMessage *sysprof_document_dbus_message_dup_message (SysprofDocumentDBusMessage *self);
|
GDBusMessage *sysprof_document_dbus_message_dup_message (SysprofDocumentDBusMessage *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
guint sysprof_document_dbus_message_get_serial (SysprofDocumentDBusMessage *self);
|
guint sysprof_document_dbus_message_get_serial (SysprofDocumentDBusMessage *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
const char *sysprof_document_dbus_message_get_destination (SysprofDocumentDBusMessage *self);
|
const char *sysprof_document_dbus_message_get_destination (SysprofDocumentDBusMessage *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
const char *sysprof_document_dbus_message_get_sender (SysprofDocumentDBusMessage *self);
|
const char *sysprof_document_dbus_message_get_sender (SysprofDocumentDBusMessage *self);
|
||||||
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
GDBusMessageType sysprof_document_dbus_message_get_message_type (SysprofDocumentDBusMessage *self);
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofDocumentDBusMessage, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofDocumentDBusMessage, g_object_unref)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user