]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
signaturebuilder: add support for basic type highlighting
authorFlorian Brosch <flo.brosch@gmail.com>
Wed, 28 Oct 2009 01:59:55 +0000 (02:59 +0100)
committerFlorian Brosch <flo.brosch@gmail.com>
Wed, 28 Oct 2009 01:59:55 +0000 (02:59 +0100)
icons/devhelpstyle.css
icons/style.css
icons/wikistyle.css
src/libvaladoc/api/signaturebuilder.vala
src/libvaladoc/api/typesymbol.vala
src/libvaladoc/content/run.vala
src/libvaladoc/html/htmlrenderer.vala

index 88e0e15a55a28c48aafc420a07baac7fb779410e..36be221896423ecc9e4a686b1bdcae602ddc8ed3 100644 (file)
@@ -105,7 +105,7 @@ div.site_body {
 }
 
 
-.main_other_type {
+.main_type {
        text-decoration: none;
        font-style: italic;
        color: #000000;
@@ -482,5 +482,11 @@ a.navi_link:hover, a.external_link:hover {
 }
 
 .main_code_definition a, .leaf_code_definition a {
+       text-decoration: none;
        color: inherit;
 }
+
+.main_code_definition a:hover, .leaf_code_definition a:hover {
+       text-decoration: underline;
+}
+
index dc498b4efe1a79ba3b83e36cc223775d6c34d0c6..d7d0785ac872985b5777da3896e5b0aa8fc5df01 100644 (file)
@@ -119,7 +119,7 @@ div.site_navigation {
 }
 
 
-.main_other_type {
+.main_type {
        text-decoration: none;
        font-style: italic;
        color: #000000;
@@ -496,5 +496,11 @@ a.navi_link:hover, a.external_link:hover {
 }
 
 .main_code_definition a, .leaf_code_definition a {
+       text-decoration: none;
        color: inherit;
 }
+
+.main_code_definition a:hover, .leaf_code_definition a:hover {
+       text-decoration: underline;
+}
+
index 5990d11f9b292fbbf52d3df1d2fd395b45611ba9..5f7f0eb82ae423f399be3b8ecbbc5d82e20d1437 100644 (file)
@@ -112,7 +112,7 @@ div.site_navigation {
 }
 
 
-.main_other_type {
+.main_type {
        text-decoration: none;
        font-style: italic;
        color: #000000;
index 68fc17f818621cb4bb1609de951b31f818c18358..7322fde5998a27ef3e4314b0580247dc8883cf4c 100644 (file)
@@ -65,7 +65,12 @@ public class Valadoc.Api.SignatureBuilder {
        }
 
        public SignatureBuilder append_type (Node node, bool spaced = true) {
-               Run inner = new Run (Run.Style.LANG_TYPE);
+               Run.Style style = Run.Style.LANG_TYPE;
+               if (node is TypeSymbol && ((TypeSymbol)node).is_basic_type) {
+                       style = Run.Style.LANG_BASIC_TYPE;
+               }
+
+               Run inner = new Run (style);
                inner.content.add (new SymbolLink (node, node.name));
                return append_content (inner, spaced);
        }
index 716125d7d89c539f73fba62ee3a82334288f22a7..12028f77e71f9be5c54052a3240ffcc9977c8dc0 100644 (file)
@@ -28,6 +28,19 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
                base (symbol, parent);
        }
 
+       public bool is_basic_type {
+               get {
+                       if (this.symbol is Vala.Struct) {
+                               unowned Vala.Struct mystruct = (Vala.Struct) this.symbol;
+                               return mystruct.base_type == null && (mystruct.is_boolean_type () || mystruct.is_floating_type () || mystruct.is_integer_type ());
+                       } else if (this.symbol is Vala.Class) {
+                               unowned Vala.Class myclass = (Vala.Class) this.symbol;
+                               return myclass.base_class == null && myclass.name == "string";
+                       }
+                       return false;
+               }
+       }
+
        protected override void process_comments (Settings settings, DocumentationParser parser) {
                var source_comment = ((Vala.TypeSymbol) symbol).comment;
                if (source_comment != null) {
index cc0662258323b53ddcbe7093f1014a50f3ec6440..cc6072ce0d9cfda8237437209631a5d6ba502820 100755 (executable)
@@ -33,6 +33,7 @@ public class Valadoc.Content.Run : InlineContent, Inline {
                STROKE,
                LANG_KEYWORD,
                LANG_LITERAL,
+               LANG_BASIC_TYPE,
                LANG_TYPE
        }
 
index 435cd56cf613e29651a226c09d60403f55d54d0e..e02076bfa48730d0edc5402b447c2cf169f52bb6 100755 (executable)
@@ -267,10 +267,14 @@ public class Valadoc.Html.HtmlRenderer : ContentRenderer {
                        tag = "span";
                        css_type = "main_optional_parameter";
                        break;
-               case Run.Style.LANG_TYPE:
+               case Run.Style.LANG_BASIC_TYPE:
                        tag = "span";
                        css_type = "main_basic_type";
                        break;
+               case Run.Style.LANG_TYPE:
+                       tag = "span";
+                       css_type = "main_type";
+                       break;
                }
                if (tag != null) {
                        writer.start_tag (tag, {"class", css_type});