mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-gtk: add getter for callgraph
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_CALLGRAPH,
|
||||
PROP_DOCUMENT,
|
||||
PROP_TRACEABLES,
|
||||
N_PROPS
|
||||
@ -154,6 +155,10 @@ sysprof_callgraph_view_get_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_CALLGRAPH:
|
||||
g_value_set_object (value, sysprof_callgraph_view_get_callgraph (self));
|
||||
break;
|
||||
|
||||
case PROP_DOCUMENT:
|
||||
g_value_set_object (value, sysprof_callgraph_view_get_document (self));
|
||||
break;
|
||||
@ -200,6 +205,11 @@ sysprof_callgraph_view_class_init (SysprofCallgraphViewClass *klass)
|
||||
object_class->get_property = sysprof_callgraph_view_get_property;
|
||||
object_class->set_property = sysprof_callgraph_view_set_property;
|
||||
|
||||
properties[PROP_CALLGRAPH] =
|
||||
g_param_spec_object ("callgraph", NULL, NULL,
|
||||
SYSPROF_TYPE_CALLGRAPH,
|
||||
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
properties[PROP_DOCUMENT] =
|
||||
g_param_spec_object ("document", NULL, NULL,
|
||||
SYSPROF_TYPE_DOCUMENT,
|
||||
@ -338,6 +348,8 @@ sysprof_callgraph_view_reload_cb (GObject *object,
|
||||
|
||||
if ((descendants_first = gtk_tree_list_model_get_row (descendants_tree, 0)))
|
||||
gtk_tree_list_row_set_expanded (descendants_first, TRUE);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CALLGRAPH]);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -460,3 +472,19 @@ buildable_iface_init (GtkBuildableIface *iface)
|
||||
{
|
||||
iface->get_internal_child = sysprof_callgraph_view_get_internal_child;
|
||||
}
|
||||
|
||||
/**
|
||||
* sysprof_callgraph_view_get_callgraph:
|
||||
* @self: a #SysprofCallgraphView
|
||||
*
|
||||
* Gets the callgraph being displayed.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): a #SysprofCallgraph or %NULL
|
||||
*/
|
||||
SysprofCallgraph *
|
||||
sysprof_callgraph_view_get_callgraph (SysprofCallgraphView *self)
|
||||
{
|
||||
g_return_val_if_fail (SYSPROF_IS_CALLGRAPH_VIEW (self), NULL);
|
||||
|
||||
return self->callgraph;
|
||||
}
|
||||
|
||||
@ -36,17 +36,19 @@ typedef struct _SysprofCallgraphView SysprofCallgraphView;
|
||||
typedef struct _SysprofCallgraphViewClass SysprofCallgraphViewClass;
|
||||
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
GType sysprof_callgraph_view_get_type (void) G_GNUC_CONST;
|
||||
GType sysprof_callgraph_view_get_type (void) G_GNUC_CONST;
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
SysprofDocument *sysprof_callgraph_view_get_document (SysprofCallgraphView *self);
|
||||
SysprofCallgraph *sysprof_callgraph_view_get_callgraph (SysprofCallgraphView *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
void sysprof_callgraph_view_set_document (SysprofCallgraphView *self,
|
||||
SysprofDocument *document);
|
||||
SysprofDocument *sysprof_callgraph_view_get_document (SysprofCallgraphView *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
GListModel *sysprof_callgraph_view_get_traceables (SysprofCallgraphView *self);
|
||||
void sysprof_callgraph_view_set_document (SysprofCallgraphView *self,
|
||||
SysprofDocument *document);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
void sysprof_callgraph_view_set_traceables (SysprofCallgraphView *self,
|
||||
GListModel *model);
|
||||
GListModel *sysprof_callgraph_view_get_traceables (SysprofCallgraphView *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
void sysprof_callgraph_view_set_traceables (SysprofCallgraphView *self,
|
||||
GListModel *model);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofCallgraphView, g_object_unref)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user