Fixes bug 587068.
ccall.add_argument (new CCodeIdentifier (constant.get_cname ()));
return ccall;
} else if (array_expr.symbol_reference is Property) {
- Gee.List<CCodeExpression> size = array_expr.get_array_sizes ();
- return size[dim - 1];
+ var prop = (Property) array_expr.symbol_reference;
+ if (!prop.no_array_length) {
+ Gee.List<CCodeExpression> size = array_expr.get_array_sizes ();
+ return size[dim - 1];
+ }
}
} else if (array_expr is NullLiteral) {
return new CCodeConstant ("0");
ccall.add_argument (cexpr);
var array_type = prop.property_type as ArrayType;
- if (array_type != null && rhs != null) {
+ if (array_type != null && !prop.no_array_length && rhs != null) {
for (int dim = 1; dim <= array_type.rank; dim++) {
ccall.add_argument (head.get_array_length_cexpression (rhs, dim));
}
expr.ccodenode = ccomma;
} else {
var array_type = base_property.property_type as ArrayType;
- if (array_type != null) {
+ if (array_type != null && !base_property.no_array_length) {
for (int dim = 1; dim <= array_type.rank; dim++) {
var temp_var = get_temp_variable (int_type);
var ctemp = new CCodeIdentifier (temp_var.name);
write_indent ();
write_string ("[NoAccessorMethod]");
}
-
+ if (prop.property_type is ArrayType && prop.no_array_length) {
+ write_indent ();
+ write_string ("[CCode (array_length = false");
+
+ if (prop.array_null_terminated) {
+ write_string (", array_null_terminated = true");
+ }
+
+ write_string (")]");
+ }
+
write_indent ();
write_accessibility (prop);
*/
public Expression default_expression { get; set; }
+ public bool no_array_length { get; set; }
+
+ public bool array_null_terminated { get; set; }
+
/**
* Nickname of this property.
*/
if (a.has_argument ("notify")) {
notify = a.get_bool ("notify");
}
+ if (a.has_argument ("array_length")) {
+ no_array_length = !a.get_bool ("array_length");
+ }
+ if (a.has_argument ("array_null_terminated")) {
+ array_null_terminated = a.get_bool ("array_null_terminated");
+ }
}
/**
[CCode (type = "GIcon*", has_construct_function = false)]
public ThemedIcon.with_default_fallbacks (string iconname);
public string name { construct; }
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] names { get; construct; }
[NoAccessorMethod]
public bool use_default_fallbacks { get; construct; }
public void set_website (string website);
public void set_website_label (string website_label);
public void set_wrap_license (bool wrap_license);
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] artists { get; set; }
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] authors { get; set; }
public string comments { get; set; }
public string copyright { get; set; }
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] documenters { get; set; }
public string license { get; set; }
public Gdk.Pixbuf logo { get; set; }
public void set_value (double value);
public Gtk.Adjustment adjustment { get; set; }
[NoAccessorMethod]
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] icons { owned get; set; }
[NoAccessorMethod]
public Gtk.IconSize size { get; set; }
[CCode (has_construct_function = false)]
public SourceLanguageManager ();
public void set_search_path ([CCode (array_length = false)] string[]? dirs);
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] language_ids { get; }
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] search_path { get; set; }
}
[CCode (cheader_filename = "gtksourceview/gtksourceview.h")]
public SourceStyleSchemeManager ();
public void prepend_search_path (string path);
public void set_search_path (string path);
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] scheme_ids { get; }
+ [CCode (array_length = false, array_null_terminated = true)]
public string[] search_path { get; set; }
}
[CCode (cheader_filename = "gtksourceview/gtksourceview.h")]
var prop = new Property (fix_prop_name (node.name), parse_type (prop_node.type), null, null, current_source_reference);
prop.access = SymbolAccessibility.PUBLIC;
prop.interface_only = true;
-
+
+ if (prop_node.type.is_interface && prop_node.type.interface == "GStrv") {
+ prop.no_array_length = true;
+ prop.array_null_terminated = true;
+ }
+
if (prop_node.readable) {
prop.get_accessor = new PropertyAccessor (true, false, false, prop.property_type.copy (), null, null);
}