2012-08-30 00:54:38 +02:00
|
|
|
/*
|
|
|
|
* ld-category-view.c
|
|
|
|
*
|
|
|
|
* This file is a part of logdiag.
|
2020-09-28 04:49:03 +02:00
|
|
|
* Copyright 2012 Přemysl Eric Janouch
|
2012-08-30 00:54:38 +02:00
|
|
|
*
|
|
|
|
* See the file LICENSE for licensing information.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "liblogdiag.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:ld-category-view
|
2012-10-08 09:11:32 +02:00
|
|
|
* @short_description: Interface for objects displaying categories
|
2012-08-30 00:54:38 +02:00
|
|
|
* @see_also: #LdCategory
|
|
|
|
*
|
2012-10-08 09:11:32 +02:00
|
|
|
* #LdCategoryView defines objects displaying contents of #LdCategory
|
|
|
|
* hierarchies.
|
2012-08-30 00:54:38 +02:00
|
|
|
*/
|
|
|
|
|
2021-10-25 00:27:32 +02:00
|
|
|
G_DEFINE_INTERFACE (LdCategoryView, ld_category_view, 0)
|
2012-08-30 00:54:38 +02:00
|
|
|
|
|
|
|
static void
|
2012-10-08 09:11:32 +02:00
|
|
|
ld_category_view_default_init (LdCategoryViewInterface *iface)
|
2012-08-30 00:54:38 +02:00
|
|
|
{
|
2012-10-08 09:11:32 +02:00
|
|
|
GParamSpec *pspec;
|
2012-08-30 00:54:38 +02:00
|
|
|
|
|
|
|
/**
|
2012-10-08 09:11:32 +02:00
|
|
|
* LdCategoryView::symbol-selected:
|
|
|
|
* @self: an #LdCategoryView object.
|
|
|
|
* @symbol: the selected #LdSymbol object.
|
|
|
|
* @path: location of the symbol within the library.
|
2012-08-30 00:54:38 +02:00
|
|
|
*
|
2012-10-08 09:11:32 +02:00
|
|
|
* A symbol has been selected.
|
2012-08-30 00:54:38 +02:00
|
|
|
*/
|
2012-10-08 09:11:32 +02:00
|
|
|
iface->symbol_selected_signal = g_signal_new
|
|
|
|
("symbol-selected", G_TYPE_FROM_INTERFACE (iface),
|
|
|
|
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
|
|
|
|
ld_marshal_VOID__OBJECT_STRING,
|
|
|
|
G_TYPE_NONE, 2, LD_TYPE_SYMBOL,
|
|
|
|
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2012-08-30 00:54:38 +02:00
|
|
|
|
2012-10-08 09:11:32 +02:00
|
|
|
/**
|
|
|
|
* LdCategoryView::symbol-deselected:
|
|
|
|
* @self: an #LdCategoryView object.
|
|
|
|
* @symbol: the deselected #LdSymbol object.
|
|
|
|
* @path: location of the symbol within the library.
|
|
|
|
*
|
|
|
|
* A symbol has been deselected.
|
|
|
|
*/
|
|
|
|
iface->symbol_deselected_signal = g_signal_new
|
|
|
|
("symbol-deselected", G_TYPE_FROM_INTERFACE (iface),
|
|
|
|
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
|
|
|
|
ld_marshal_VOID__OBJECT_STRING,
|
|
|
|
G_TYPE_NONE, 2, LD_TYPE_SYMBOL,
|
|
|
|
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2012-10-08 04:40:41 +02:00
|
|
|
|
2012-10-08 09:11:32 +02:00
|
|
|
/**
|
|
|
|
* LdCategoryView:category:
|
|
|
|
*
|
|
|
|
* The #LdCategory this object retrieves content from.
|
|
|
|
*/
|
|
|
|
pspec = g_param_spec_object ("category", "Category",
|
|
|
|
"The symbol category that is shown by this object.",
|
|
|
|
LD_TYPE_CATEGORY, G_PARAM_READWRITE);
|
|
|
|
g_object_interface_install_property (iface, pspec);
|
2012-10-08 04:40:41 +02:00
|
|
|
}
|
|
|
|
|
2012-10-08 09:11:32 +02:00
|
|
|
/**
|
|
|
|
* ld_category_view_set_category:
|
2018-06-24 23:19:12 +02:00
|
|
|
* @self: an #LdCategoryView object.
|
2012-10-08 09:11:32 +02:00
|
|
|
* @category: the #LdCategory to be assigned to the view.
|
|
|
|
*
|
|
|
|
* Assign an #LdCategory object to the view.
|
|
|
|
*/
|
|
|
|
void
|
2021-10-25 16:49:23 +02:00
|
|
|
ld_category_view_set_category (LdCategoryView *self, LdCategory *category)
|
2012-08-30 00:54:38 +02:00
|
|
|
{
|
|
|
|
g_return_if_fail (LD_IS_CATEGORY_VIEW (self));
|
2012-10-08 09:11:32 +02:00
|
|
|
LD_CATEGORY_VIEW_GET_INTERFACE (self)->set_category (self, category);
|
2012-08-30 00:54:38 +02:00
|
|
|
}
|
|
|
|
|
2012-10-08 09:11:32 +02:00
|
|
|
/**
|
|
|
|
* ld_category_view_get_category:
|
|
|
|
* @self: an #LdCategoryView object.
|
|
|
|
*
|
|
|
|
* Get the #LdCategory object assigned to this view.
|
|
|
|
* The reference count on the category is not incremented.
|
|
|
|
*/
|
|
|
|
LdCategory *
|
|
|
|
ld_category_view_get_category (LdCategoryView *self)
|
2012-08-30 00:54:38 +02:00
|
|
|
{
|
2012-10-08 09:11:32 +02:00
|
|
|
g_return_val_if_fail (LD_IS_CATEGORY_VIEW (self), NULL);
|
|
|
|
return LD_CATEGORY_VIEW_GET_INTERFACE (self)->get_category (self);
|
2012-08-30 00:54:38 +02:00
|
|
|
}
|