replacement_symbol_name = replacement_symbol_name[0:-2];
}
- replacement_symbol = current_tree.search_symbol_str (sym, replacement.value);
+ replacement_symbol = current_tree.search_symbol_str (sym, replacement_symbol_name);
}
if (replacement != null && replacement_symbol == null) {
var deprecation_string = "No replacement specified.";
if (since != null && replacement_symbol != null) {
- deprecation_string = "%s: Replaced by %s.".printf (since, get_docbook_link (replacement_symbol));
+ deprecation_string = "%s: Replaced by %s.".printf (since, get_gtkdoc_link (replacement_symbol));
} else if (since != null && replacement_symbol == null) {
deprecation_string = "%s: No replacement specified.".printf (since);
} else if (since == null && replacement_symbol != null) {
- deprecation_string = "Replaced by %s.".printf (get_docbook_link (replacement_symbol));
+ deprecation_string = "Replaced by %s.".printf (get_gtkdoc_link (replacement_symbol));
} else {
reporter.simple_warning ("Missing ‘since’ and ‘replacement’ arguments to ‘Deprecated’ attribute on %s.", sym.get_full_name ());
}
return ((Api.Delegate)item).get_cname ();
} else if (item is Api.Enum) {
return ((Api.Enum)item).get_cname ();
+ } else if (item is Api.EnumValue) {
+ return ((Api.EnumValue)item).get_cname ();
}
return null;
}
return """<link linkend="%s:CAPS"><literal>%s</literal></link>""".printf (to_docbook_id (cls.get_type_id ()), cls.get_type_id ());
}
+ public string? get_gtkdoc_link (Api.Node symbol) {
+ if (symbol is Class || symbol is Interface || symbol is Struct || symbol is Enum || symbol is ErrorDomain) {
+ return "#%s".printf (get_cname (symbol));
+ }
+
+ if (symbol is Method) {
+ return "%s ()".printf (((Method) symbol).get_cname ());
+ }
+
+ if (symbol is Constant || symbol is Api.EnumValue || symbol is ErrorCode) {
+ return "%%%s".printf (get_cname (symbol));
+ }
+
+ if (symbol is Api.Signal) {
+ return "#%s::%s".printf (get_cname (symbol.parent), ((Api.Signal) symbol).get_cname ());
+ }
+
+ if (symbol is Property) {
+ return "#%s:%s".printf (get_cname (symbol.parent), ((Property) symbol).get_cname ());
+ }
+
+ if (symbol is Field && (symbol.parent is Class || symbol.parent is Struct)) {
+ var field = symbol as Field;
+ if (field.is_static) {
+ return field.get_cname ();
+ } else {
+ return "#%s.%s".printf (get_cname (symbol.parent), field.get_cname ());
+ }
+ }
+
+ return get_cname (symbol) ?? symbol.get_full_name ();
+ }
+
public string? get_docbook_link (Api.Item item, bool is_dbus = false, bool is_async_finish = false) {
if (item is Api.Method) {
string name;