src/Palete/GirFile.vala
authorAlan Knowles <alan@roojs.com>
Thu, 7 May 2015 06:55:50 +0000 (14:55 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 7 May 2015 06:55:50 +0000 (14:55 +0800)
src/Palete/GirFile.vala

index e7907f1..dc92487 100644 (file)
@@ -6,9 +6,9 @@ namespace Palete {
  
         
     
-       public class GirFile : GirBase {
+       public class Gir : GirObject {
     
-               public GirFile (string ns)  
+               public Gir (string ns)  
                {
                        base(ns);
                        this.load();
@@ -363,3 +363,16 @@ namespace Palete {
                
 
                }
+               
+               public string doc(string what)
+               {
+                       var ar = what.split(".");
+                       var cls = this.classes.get(ar[1]);
+                       if (ar.length == 2) {
+                               return cls.doctxt != null ? cls.doctxt : "";
+                       }
+                       // return the property.. by default..
+                       var pr = cls.props.get(ar[2]);
+                       return pr.doctxt != null ? pr.doctxt : "";
+
+               }