[gnome-builder/search] GbSearchResult: add activated signal
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/search] GbSearchResult: add activated signal
- Date: Tue, 16 Dec 2014 00:52:05 +0000 (UTC)
commit 12ad130be3eec807e849b51e3f4420b314cc75dd
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 15 16:50:58 2014 -0800
GbSearchResult: add activated signal
src/search/gb-search-result.c | 25 +++++++++++++++++++++++++
src/search/gb-search-result.h | 7 +++++--
2 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/src/search/gb-search-result.c b/src/search/gb-search-result.c
index 948fc28..879c2c6 100644
--- a/src/search/gb-search-result.c
+++ b/src/search/gb-search-result.c
@@ -31,7 +31,13 @@ enum {
LAST_PROP
};
+enum {
+ ACTIVATE,
+ LAST_SIGNAL
+};
+
static GParamSpec *gParamSpecs [LAST_PROP];
+static guint gSignals [LAST_SIGNAL];
GtkWidget *
gb_search_result_new (void)
@@ -60,6 +66,14 @@ gb_search_result_compare_func (gconstpointer result1,
return ret;
}
+void
+gb_search_result_activate (GbSearchResult *result)
+{
+ g_return_if_fail (GB_IS_SEARCH_RESULT (result));
+
+ g_signal_emit (result, gSignals [ACTIVATE], 0);
+}
+
static void
gb_search_result_finalize (GObject *object)
{
@@ -104,6 +118,17 @@ gb_search_result_class_init (GbSearchResultClass *klass)
object_class->finalize = gb_search_result_finalize;
object_class->get_property = gb_search_result_get_property;
object_class->set_property = gb_search_result_set_property;
+
+ gSignals [ACTIVATE] =
+ g_signal_new ("activate",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GbSearchResultClass, activate),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
}
static void
diff --git a/src/search/gb-search-result.h b/src/search/gb-search-result.h
index 44e66bf..73b14ec 100644
--- a/src/search/gb-search-result.h
+++ b/src/search/gb-search-result.h
@@ -44,12 +44,15 @@ struct _GbSearchResult
struct _GbSearchResultClass
{
GtkBinClass parent;
+
+ void (*activate) (GbSearchResult *result);
};
-GType gb_search_result_get_type (void);
-GtkWidget *gb_search_result_new (void);
+void gb_search_result_activate (GbSearchResult *result);
gint gb_search_result_compare_func (gconstpointer result1,
gconstpointer result2);
+GType gb_search_result_get_type (void);
+GtkWidget *gb_search_result_new (void);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]