[devhelp] parser: handle property and signal types as their own types



commit ccddab48d32b2065c7f53d4fc3c4fb7e997c5ef8
Author: Frédéric Péters <fpeters 0d be>
Date:   Wed Jan 27 15:17:43 2016 +0100

    parser: handle property and signal types as their own types

 src/dh-link.c   |   10 ++++++++++
 src/dh-link.h   |    4 +++-
 src/dh-parser.c |    6 ++++++
 3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/dh-link.c b/src/dh-link.c
index 2f5b13c..4337eda 100644
--- a/src/dh-link.c
+++ b/src/dh-link.c
@@ -319,6 +319,16 @@ dh_link_get_type_as_string (DhLink *link)
                  * have an ESTABLISHED term for it, leave it
                  * untranslated. */
                 return _("Type");
+        case DH_LINK_TYPE_PROPERTY:
+                /* i18n: in the programming language context, if you don't
+                 * have an ESTABLISHED term for it, leave it
+                 * untranslated. */
+                return _("Property");
+        case DH_LINK_TYPE_SIGNAL:
+                /* i18n: in the programming language context, if you don't
+                 * have an ESTABLISHED term for it, leave it
+                 * untranslated. */
+                return _("Signal");
         }
 
         return "";
diff --git a/src/dh-link.h b/src/dh-link.h
index 71452be..21c1625 100644
--- a/src/dh-link.h
+++ b/src/dh-link.h
@@ -30,7 +30,9 @@ typedef enum {
         DH_LINK_TYPE_STRUCT,
         DH_LINK_TYPE_MACRO,
         DH_LINK_TYPE_ENUM,
-        DH_LINK_TYPE_TYPEDEF
+        DH_LINK_TYPE_TYPEDEF,
+        DH_LINK_TYPE_PROPERTY,
+        DH_LINK_TYPE_SIGNAL
 } DhLinkType;
 
 typedef enum {
diff --git a/src/dh-parser.c b/src/dh-parser.c
index 60f24cb..7ae1624 100644
--- a/src/dh-parser.c
+++ b/src/dh-parser.c
@@ -327,6 +327,12 @@ parser_start_node_keyword (DhParser             *parser,
                 }
                 else if (strcmp (type, "typedef") == 0) {
                         link_type = DH_LINK_TYPE_TYPEDEF;
+                }
+                else if (strcmp (type, "property") == 0) {
+                        link_type = DH_LINK_TYPE_PROPERTY;
+                }
+                else if (strcmp (type, "signal") == 0) {
+                        link_type = DH_LINK_TYPE_ENUM;
                 } else {
                         link_type = DH_LINK_TYPE_KEYWORD;
                 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]