mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-gtk: add getter for callgraph
This commit is contained in:
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
PROP_CALLGRAPH,
|
||||||
PROP_DOCUMENT,
|
PROP_DOCUMENT,
|
||||||
PROP_TRACEABLES,
|
PROP_TRACEABLES,
|
||||||
N_PROPS
|
N_PROPS
|
||||||
@ -154,6 +155,10 @@ sysprof_callgraph_view_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
|
case PROP_CALLGRAPH:
|
||||||
|
g_value_set_object (value, sysprof_callgraph_view_get_callgraph (self));
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_DOCUMENT:
|
case PROP_DOCUMENT:
|
||||||
g_value_set_object (value, sysprof_callgraph_view_get_document (self));
|
g_value_set_object (value, sysprof_callgraph_view_get_document (self));
|
||||||
break;
|
break;
|
||||||
@ -200,6 +205,11 @@ sysprof_callgraph_view_class_init (SysprofCallgraphViewClass *klass)
|
|||||||
object_class->get_property = sysprof_callgraph_view_get_property;
|
object_class->get_property = sysprof_callgraph_view_get_property;
|
||||||
object_class->set_property = sysprof_callgraph_view_set_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] =
|
properties[PROP_DOCUMENT] =
|
||||||
g_param_spec_object ("document", NULL, NULL,
|
g_param_spec_object ("document", NULL, NULL,
|
||||||
SYSPROF_TYPE_DOCUMENT,
|
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)))
|
if ((descendants_first = gtk_tree_list_model_get_row (descendants_tree, 0)))
|
||||||
gtk_tree_list_row_set_expanded (descendants_first, TRUE);
|
gtk_tree_list_row_set_expanded (descendants_first, TRUE);
|
||||||
|
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CALLGRAPH]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -460,3 +472,19 @@ buildable_iface_init (GtkBuildableIface *iface)
|
|||||||
{
|
{
|
||||||
iface->get_internal_child = sysprof_callgraph_view_get_internal_child;
|
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;
|
typedef struct _SysprofCallgraphViewClass SysprofCallgraphViewClass;
|
||||||
|
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
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
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
SysprofDocument *sysprof_callgraph_view_get_document (SysprofCallgraphView *self);
|
SysprofCallgraph *sysprof_callgraph_view_get_callgraph (SysprofCallgraphView *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
void sysprof_callgraph_view_set_document (SysprofCallgraphView *self,
|
SysprofDocument *sysprof_callgraph_view_get_document (SysprofCallgraphView *self);
|
||||||
SysprofDocument *document);
|
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
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
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
void sysprof_callgraph_view_set_traceables (SysprofCallgraphView *self,
|
GListModel *sysprof_callgraph_view_get_traceables (SysprofCallgraphView *self);
|
||||||
GListModel *model);
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
void sysprof_callgraph_view_set_traceables (SysprofCallgraphView *self,
|
||||||
|
GListModel *model);
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofCallgraphView, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofCallgraphView, g_object_unref)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user