mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 07:00:53 +00:00
libsysprof: add bus-type property
This commit is contained in:
@ -38,6 +38,7 @@ struct _SysprofDocumentDBusMessageClass
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
PROP_BUS_TYPE,
|
||||||
PROP_DESTINATION,
|
PROP_DESTINATION,
|
||||||
PROP_FLAGS,
|
PROP_FLAGS,
|
||||||
PROP_INTERFACE,
|
PROP_INTERFACE,
|
||||||
@ -77,6 +78,10 @@ sysprof_document_dbus_message_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
|
case PROP_BUS_TYPE:
|
||||||
|
g_value_set_enum (value, sysprof_document_dbus_message_get_bus_type (self));
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_FLAGS:
|
case PROP_FLAGS:
|
||||||
g_value_set_flags (value, sysprof_document_dbus_message_get_flags (self));
|
g_value_set_flags (value, sysprof_document_dbus_message_get_flags (self));
|
||||||
break;
|
break;
|
||||||
@ -141,6 +146,12 @@ sysprof_document_dbus_message_class_init (SysprofDocumentDBusMessageClass *klass
|
|||||||
|
|
||||||
document_frame_class->type_name = N_("D-Bus Message");
|
document_frame_class->type_name = N_("D-Bus Message");
|
||||||
|
|
||||||
|
properties[PROP_BUS_TYPE] =
|
||||||
|
g_param_spec_enum ("bus-type", NULL, NULL,
|
||||||
|
G_TYPE_BUS_TYPE,
|
||||||
|
0,
|
||||||
|
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
properties[PROP_MESSAGE_LENGTH] =
|
properties[PROP_MESSAGE_LENGTH] =
|
||||||
g_param_spec_uint ("message-length", NULL, NULL,
|
g_param_spec_uint ("message-length", NULL, NULL,
|
||||||
0, G_MAXUINT16, 0,
|
0, G_MAXUINT16, 0,
|
||||||
@ -418,3 +429,18 @@ sysprof_document_dbus_message_get_message_type (SysprofDocumentDBusMessage *self
|
|||||||
|
|
||||||
return g_dbus_message_get_message_type (message);
|
return g_dbus_message_get_message_type (message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GBusType
|
||||||
|
sysprof_document_dbus_message_get_bus_type (SysprofDocumentDBusMessage *self)
|
||||||
|
{
|
||||||
|
const SysprofCaptureDBusMessage *dbus_message;
|
||||||
|
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_DBUS_MESSAGE (self), FALSE);
|
||||||
|
|
||||||
|
dbus_message = SYSPROF_DOCUMENT_FRAME_GET (self, SysprofCaptureDBusMessage);
|
||||||
|
|
||||||
|
if (dbus_message->bus_type == 1 || dbus_message->bus_type == 2)
|
||||||
|
return dbus_message->bus_type;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
@ -63,6 +63,8 @@ SYSPROF_AVAILABLE_IN_ALL
|
|||||||
const char *sysprof_document_dbus_message_get_signature (SysprofDocumentDBusMessage *self);
|
const char *sysprof_document_dbus_message_get_signature (SysprofDocumentDBusMessage *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GDBusMessageFlags sysprof_document_dbus_message_get_flags (SysprofDocumentDBusMessage *self);
|
GDBusMessageFlags sysprof_document_dbus_message_get_flags (SysprofDocumentDBusMessage *self);
|
||||||
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
GBusType sysprof_document_dbus_message_get_bus_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