[gobject-introspection] scanner: Add "notify" signal to GObject
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] scanner: Add "notify" signal to GObject
- Date: Fri, 9 Sep 2011 22:08:44 +0000 (UTC)
commit c3da3d46ffa9c3b53e7f7132eaa9c9c722ebc859
Author: Colin Walters <walters verbum org>
Date: Fri Sep 9 18:07:19 2011 -0400
scanner: Add "notify" signal to GObject
For gjs we want to switch to using introspection data for signals, and
the "notify" signal being missing from GObject was a problem.
giscanner/gdumpparser.py | 3 +++
tests/repository/gitestrepo.c | 9 +++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index c0c4ef6..4f3a71b 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -221,6 +221,9 @@ blob containing data gleaned from GObject's primitive introspection."""
gtype_name=record.ctype.replace('Spec', ''),
get_type='intern',
c_symbol_prefix=prefix)
+ node.signals.append(ast.Signal('notify', ast.Return(ast.TYPE_NONE), [],
+ detailed=True, when='first', no_recurse=True,
+ no_hooks=True, action=True))
node.fundamental = True
if record.name == 'ParamSpec':
node.is_abstract = True
diff --git a/tests/repository/gitestrepo.c b/tests/repository/gitestrepo.c
index e7c3ae4..cdaeb4c 100644
--- a/tests/repository/gitestrepo.c
+++ b/tests/repository/gitestrepo.c
@@ -78,6 +78,15 @@ main(int argc, char **argv)
g_assert (siginfo != NULL);
g_base_info_unref (siginfo);
+ /* Test notify on gobject */
+
+ info = g_irepository_find_by_name (repo, "GObject", "Object");
+ g_assert (info != NULL);
+ siginfo = g_object_info_find_signal (info, "notify");
+ g_assert (siginfo != NULL);
+ g_base_info_unref (siginfo);
+ g_base_info_unref (info);
+
/* vfunc tests */
{
GIVFuncInfo *vfunc;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]