+2007-09-15 Jürg Billeter <j@bitron.ch>
+
+ * vala/valainterfacewriter.vala, vala/valamethod.vala,
+ vala/valasemanticanalyzer.vala, vala/valastruct.vala,
+ gobject/valacodegenerator.vala,
+ gobject/valacodegeneratorinvocationexpression.vala,
+ gobject/valacodegeneratormethod.vala, vapigen/valagidlparser.vala,
+ vapi/glib-2.0.vala: support creation methods in structs, replace
+ InstanceByReference method attribute by SimpleType type attribute
+ (inverse effect)
+
+ * tests/Makefile.am, tests/structs.exp, tests/structs.vala: add struct
+ declaration test
+
+ * vapi/gdk-2.0.vala, vapi/gtk+-2.0.vala, vapi/pango.vala: regenerated
+
2007-09-15 Jürg Billeter <j@bitron.ch>
* vala/scanner.l: support real literals with exponent
}
public override void visit_end_object_creation_expression (ObjectCreationExpression! expr) {
+ CCodeExpression struct_instance = null;
+ CCodeFunctionCall creation_call = null;
+
+ if (expr.type_reference.data_type is Struct) {
+ // value-type initialization
+ var temp_decl = get_temp_variable_declarator (expr.type_reference, false, expr);
+ temp_vars.add (temp_decl);
+
+ struct_instance = new CCodeIdentifier (get_variable_cname (temp_decl.name));
+ }
+
if (expr.symbol_reference == null) {
// no creation method
if (expr.type_reference.data_type == glist_type ||
- expr.type_reference.data_type == gslist_type) {
+ expr.type_reference.data_type == gslist_type) {
// NULL is an empty list
expr.ccodenode = new CCodeConstant ("NULL");
} else if (expr.type_reference.data_type is Class && expr.type_reference.data_type.is_subtype_of (gobject_type)) {
- var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_object_new"));
-
- ccall.add_argument (new CCodeConstant (expr.type_reference.data_type.get_type_id ()));
-
- ccall.add_argument (new CCodeConstant ("NULL"));
-
- expr.ccodenode = ccall;
- } else {
- var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
-
- ccall.add_argument (new CCodeConstant (expr.type_reference.data_type.get_cname ()));
-
- ccall.add_argument (new CCodeConstant ("1"));
-
- expr.ccodenode = ccall;
+ creation_call = new CCodeFunctionCall (new CCodeIdentifier ("g_object_new"));
+ creation_call.add_argument (new CCodeConstant (expr.type_reference.data_type.get_type_id ()));
+ creation_call.add_argument (new CCodeConstant ("NULL"));
+ } else if (expr.type_reference.data_type is Class) {
+ creation_call = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
+ creation_call.add_argument (new CCodeConstant (expr.type_reference.data_type.get_cname ()));
+ creation_call.add_argument (new CCodeConstant ("1"));
+ } else if (expr.type_reference.data_type is Struct) {
+ // memset needs string.h
+ string_h_needed = true;
+ creation_call = new CCodeFunctionCall (new CCodeIdentifier ("memset"));
+ creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, struct_instance));
+ creation_call.add_argument (new CCodeConstant ("0"));
+ creation_call.add_argument (new CCodeIdentifier ("sizeof (%s)".printf (expr.type_reference.get_cname ())));
}
} else if (expr.symbol_reference is Method) {
// use creation method
var m = (Method) expr.symbol_reference;
var params = m.get_parameters ();
- var ccall = new CCodeFunctionCall (new CCodeIdentifier (m.get_cname ()));
+ creation_call = new CCodeFunctionCall (new CCodeIdentifier (m.get_cname ()));
+
+ if (struct_instance != null) {
+ creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, struct_instance));
+ }
if (expr.type_reference.data_type is Class && expr.type_reference.data_type.is_subtype_of (gobject_type)) {
foreach (TypeReference type_arg in expr.type_reference.get_type_arguments ()) {
if (type_arg.takes_ownership) {
- ccall.add_argument (get_dup_func_expression (type_arg));
- ccall.add_argument (get_destroy_func_expression (type_arg));
+ creation_call.add_argument (get_dup_func_expression (type_arg));
+ creation_call.add_argument (get_destroy_func_expression (type_arg));
} else {
- ccall.add_argument (new CCodeConstant ("NULL"));
- ccall.add_argument (new CCodeConstant ("NULL"));
+ creation_call.add_argument (new CCodeConstant ("NULL"));
+ creation_call.add_argument (new CCodeConstant ("NULL"));
}
}
}
}
}
- ccall.add_argument (cexpr);
+ creation_call.add_argument (cexpr);
i++;
}
while (params_it.next ()) {
* parameter yet */
param.default_expression.accept (this);
- ccall.add_argument ((CCodeExpression) param.default_expression.ccodenode);
+ creation_call.add_argument ((CCodeExpression) param.default_expression.ccodenode);
i++;
}
if (expr.can_fail) {
// method can fail
current_method_inner_error = true;
- ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("inner_error")));
+ creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("inner_error")));
}
if (ellipsis) {
// ensure variable argument list ends with NULL
- ccall.add_argument (new CCodeConstant ("NULL"));
+ creation_call.add_argument (new CCodeConstant ("NULL"));
}
-
- expr.ccodenode = ccall;
} else if (expr.symbol_reference is EnumValue) {
// error code
var ev = (EnumValue) expr.symbol_reference;
var en = (Enum) ev.parent_symbol;
- var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_set_error"));
- ccall.add_argument (new CCodeIdentifier ("error"));
- ccall.add_argument (new CCodeIdentifier (en.get_upper_case_cname ()));
- ccall.add_argument (new CCodeIdentifier (ev.get_cname ()));
+ creation_call = new CCodeFunctionCall (new CCodeIdentifier ("g_set_error"));
+ creation_call.add_argument (new CCodeIdentifier ("error"));
+ creation_call.add_argument (new CCodeIdentifier (en.get_upper_case_cname ()));
+ creation_call.add_argument (new CCodeIdentifier (ev.get_cname ()));
foreach (Expression arg in expr.get_argument_list ()) {
- ccall.add_argument ((CCodeExpression) arg.ccodenode);
+ creation_call.add_argument ((CCodeExpression) arg.ccodenode);
}
-
- expr.ccodenode = ccall;
} else {
assert (false);
}
+ if (expr.type_reference.data_type is Struct) {
+ var ccomma = new CCodeCommaExpression ();
+ ccomma.append_expression (creation_call);
+ ccomma.append_expression (struct_instance);
+
+ expr.ccodenode = ccomma;
+ } else if (creation_call != null) {
+ expr.ccodenode = creation_call;
+ }
+
visit_expression (expr);
}
} else if (m is ArrayMoveMethod) {
requires_array_move = true;
}
-
- /* explicitly use strong reference as ccall gets unrefed
- * at end of inner block
- */
+
CCodeExpression instance;
if (m != null && m.instance) {
var base_method = m;
instance_expression_type = ma.inner.static_type;
}
- if (m.instance_by_reference && (ma.inner != null || m.parent_symbol != current_type_symbol)) {
+ if (m.parent_symbol is Struct && !((Struct) m.parent_symbol).is_simple_type () && (ma.inner != null || m.parent_symbol != current_type_symbol)) {
instance = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance);
}
CCodeFormalParameter instance_param = null;
- if (m.instance) {
+ if (m.instance || (m.parent_symbol is Struct && m is CreationMethod)) {
var this_type = new TypeReference ();
this_type.data_type = find_parent_type (m);
if (m.base_interface_method != null) {
base_type.data_type = (DataType) m.base_method.parent_symbol;
instance_param = new CCodeFormalParameter ("base", base_type.get_cname ());
} else {
- if (m.instance_by_reference) {
+ if (m.parent_symbol is Struct && !((Struct) m.parent_symbol).is_simple_type ()) {
instance_param = new CCodeFormalParameter ("*self", this_type.get_cname ());
} else {
instance_param = new CCodeFormalParameter ("self", this_type.get_cname ());
cinit.append (cdecl);
} else {
var st = (Struct) m.parent_symbol;
- var cdecl = new CCodeDeclaration (st.get_cname () + "*");
- var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_slice_new0"));
- ccall.add_argument (new CCodeIdentifier (st.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", ccall));
- cinit.append (cdecl);
+
+ // memset needs string.h
+ string_h_needed = true;
+ var czero = new CCodeFunctionCall (new CCodeIdentifier ("memset"));
+ czero.add_argument (new CCodeIdentifier ("self"));
+ czero.add_argument (new CCodeConstant ("0"));
+ czero.add_argument (new CCodeIdentifier ("sizeof (%s)".printf (st.get_cname ())));
+ cinit.append (new CCodeExpressionStatement (czero));
}
}
function.block.add_statement (new CCodeExpressionStatement (cfreeparams));
}
- var creturn = new CCodeReturnStatement ();
- creturn.return_expression = new CCodeIdentifier ("self");
- function.block.add_statement (creturn);
+ if (current_type_symbol is Class) {
+ var creturn = new CCodeReturnStatement ();
+ creturn.return_expression = new CCodeIdentifier ("self");
+ function.block.add_statement (creturn);
+ }
}
bool return_value = true;
TESTS = \
hello.vala \
classes.vala \
+ structs.vala \
property-sample.vala \
\
test-001.vala \
\
hello.exp \
classes.exp \
+ structs.exp \
property-sample.exp \
\
test-001.exp \
--- /dev/null
+Structs Test:
+new SimpleStruct ()
+new PublicStruct ()
+new StructWithCreationMethod ()
+StructWithCreationMethod
+new StructWithNamedCreationMethod ()
+StructWithNamedCreationMethod
+.
--- /dev/null
+using GLib;
+
+struct SimpleStruct {
+}
+
+public struct PublicStruct {
+}
+
+struct StructWithCreationMethod {
+ public StructWithCreationMethod () {
+ stdout.printf ("StructWithCreationMethod\n");
+ }
+}
+
+struct StructWithNamedCreationMethod {
+ public StructWithNamedCreationMethod.named () {
+ stdout.printf ("StructWithNamedCreationMethod\n");
+ }
+}
+
+static class StructsTest {
+ static int main (string[] args) {
+ stdout.printf ("Structs Test:\n");
+
+ stdout.printf ("new SimpleStruct ()\n");
+ var simple_struct = new SimpleStruct ();
+ stdout.printf ("new PublicStruct ()\n");
+ var public_struct = new PublicStruct ();
+ stdout.printf ("new StructWithCreationMethod ()\n");
+ var struct_with_creation_method = new StructWithCreationMethod ();
+ stdout.printf ("new StructWithNamedCreationMethod ()\n");
+ var struct_with_named_creation_method = new StructWithNamedCreationMethod.named ();
+
+ stdout.printf (".\n");
+
+ return 0;
+ }
+}
+
write_indent ();
write_string ("[InstanceLast]");
}
- if (m.instance_by_reference) {
- write_indent ();
- write_string ("[InstanceByReference]");
- }
var ccode_params = new String ();
var separator = "";
* or as the last argument in C code. Defaults to first.
*/
public bool instance_last { get; set; }
-
- /**
- * Specifies whether the instance of a value type should be passed by
- * reference. Only valid for instance methods of value types.
- */
- public bool instance_by_reference { get; set; }
-
+
/**
* Specifies the virtual or abstract method this method overrides.
* Reference must be weak as virtual methods set base_method to
returns_modified_pointer = true;
} else if (a.name == "InstanceLast") {
instance_last = true;
- } else if (a.name == "InstanceByReference") {
- instance_by_reference = true;
} else if (a.name == "FloatingReference") {
return_type.floating_reference = true;
} else if (a.name == "NoArrayLength") {
public override void visit_creation_method (CreationMethod! m) {
m.return_type = new TypeReference ();
- m.return_type.data_type = (DataType) m.parent_symbol;
- m.return_type.transfers_ownership = true;
if (current_symbol is Class) {
+ m.return_type.data_type = (DataType) m.parent_symbol;
+ m.return_type.transfers_ownership = true;
+
// check for floating reference
var cl = (Class) current_symbol;
while (cl != null) {
type = expr.type_reference.data_type;
}
- if (!type.is_reference_type () && !(type is Enum)) {
- expr.error = true;
- Report.error (expr.source_reference, "Can't create instance of value type `%s'".printf (expr.type_reference.to_string ()));
- return;
- }
-
current_source_file.add_symbol_dependency (type, SourceFileDependencyType.SOURCE);
expr.static_type = expr.type_reference.copy ();
} else if (type is Struct) {
var st = (Struct) type;
+ expr.static_type.transfers_ownership = false;
+
if (expr.symbol_reference == null) {
expr.symbol_reference = st.default_construction_method;
}
private string get_value_function;
private string set_value_function;
private string default_value = null;
-
+ private bool simple_type;
+
/**
* Specifies the default construction method.
*/
}
public override void accept_children (CodeVisitor! visitor) {
+ foreach (TypeReference type in base_types) {
+ type.accept (visitor);
+ }
+
foreach (TypeParameter p in type_parameters) {
p.accept (visitor);
}
foreach (Attribute a in attributes) {
if (a.name == "CCode") {
process_ccode_attribute (a);
+ } else if (a.name == "SimpleType") {
+ simple_type = true;
} else if (a.name == "IntegerType") {
process_integer_type_attribute (a);
} else if (a.name == "FloatingType") {
return -1;
}
+
+ /**
+ * Returns whether this struct is a simple type, i.e. whether
+ * instances are passed by value.
+ */
+ public bool is_simple_type () {
+ foreach (TypeReference type in base_types) {
+ var st = type.data_type as Struct;
+ if (st != null && st.is_simple_type ()) {
+ return true;
+ }
+ }
+ return simple_type;
+ }
}
public ushort red;
public ushort green;
public ushort blue;
- [InstanceByReference]
public Gdk.Color copy ();
- [InstanceByReference]
public bool equal (out Gdk.Color colorb);
- [InstanceByReference]
public void free ();
public static GLib.Type get_type ();
- [InstanceByReference]
public uint hash ();
public static bool parse (string spec, out Gdk.Color color);
- [InstanceByReference]
public weak string to_string ();
}
[CCode (cheader_filename = "gdk/gdk.h")]
public int width;
public int height;
public static GLib.Type get_type ();
- [InstanceByReference]
public bool intersect (out Gdk.Rectangle src2, out Gdk.Rectangle dest);
- [InstanceByReference]
public void union (out Gdk.Rectangle src2, out Gdk.Rectangle dest);
}
[CCode (cheader_filename = "gdk/gdk.h")]
* Mathias Hasselmann <mathias.hasselmann@gmx.de>
*/
+[SimpleType]
[CCode (cname = "gboolean", cheader_filename = "glib.h", type_id = "G_TYPE_BOOLEAN", marshaller_type_name = "BOOLEAN", get_value_function = "g_value_get_boolean", set_value_function = "g_value_set_boolean", default_value = "FALSE")]
public struct bool {
}
+[SimpleType]
[CCode (cname = "gpointer", cheader_filename = "glib.h", type_id = "G_TYPE_POINTER", marshaller_type_name = "POINTER", get_value_function = "g_value_get_pointer", set_value_function = "g_value_set_pointer", default_value = "NULL")]
public struct pointer {
[CCode (cname ="GPOINTER_TO_INT")]
public uint to_uint ();
}
+[SimpleType]
[CCode (cname = "gconstpointer", cheader_filename = "glib.h", type_id = "G_TYPE_POINTER", marshaller_type_name = "POINTER", get_value_function = "g_value_get_pointer", set_value_function = "g_value_set_pointer", default_value = "NULL")]
public struct constpointer {
}
+[SimpleType]
[CCode (cname = "gchar", cprefix = "g_ascii_", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "\'\\0\'")]
[IntegerType (rank = 1)]
public struct char {
public char toupper ();
}
+[SimpleType]
[CCode (cname = "guchar", cheader_filename = "glib.h", type_id = "G_TYPE_UCHAR", marshaller_type_name = "UCHAR", get_value_function = "g_value_get_uchar", set_value_function = "g_value_set_uchar", default_value = "\'\\0\'")]
[IntegerType (rank = 2)]
public struct uchar {
public string! to_string (string! format = "%hhu");
}
+[SimpleType]
[CCode (cname = "gint", cheader_filename = "glib.h", type_id = "G_TYPE_INT", marshaller_type_name = "INT", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0")]
[IntegerType (rank = 9)]
public struct int {
public pointer to_pointer ();
}
+[SimpleType]
[CCode (cname = "guint", cheader_filename = "glib.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U")]
[IntegerType (rank = 10)]
public struct uint {
public pointer to_pointer ();
}
+[SimpleType]
[CCode (cname = "gshort", cheader_filename = "glib.h", default_value = "0")]
[IntegerType (rank = 5)]
public struct short {
public string! to_string (string! format = "%hi");
}
+[SimpleType]
[CCode (cname = "gushort", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 6)]
public struct ushort {
public string! to_string (string! format = "%hu");
}
+[SimpleType]
[CCode (cname = "glong", cheader_filename = "glib.h", type_id = "G_TYPE_LONG", marshaller_type_name = "LONG", get_value_function = "g_value_get_long", set_value_function = "g_value_set_long", default_value = "0L")]
[IntegerType (rank = 14)]
public struct long {
public string! to_string (string! format = "%li");
}
+[SimpleType]
[CCode (cname = "gulong", cheader_filename = "glib.h", type_id = "G_TYPE_ULONG", marshaller_type_name = "ULONG", get_value_function = "g_value_get_ulong", set_value_function = "g_value_set_ulong", default_value = "0UL")]
[IntegerType (rank = 15)]
public struct ulong {
public string! to_string (string! format = "%lu");
}
+[SimpleType]
[CCode (cname = "gint8", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "0")]
[IntegerType (rank = 3)]
public struct int8 {
public string! to_string (string! format = "%hhi");
}
+[SimpleType]
[CCode (cname = "guint8", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 4)]
public struct uint8 {
public string! to_string (string! format = "%hhu");
}
+[SimpleType]
[CCode (cname = "gint16", cheader_filename = "glib.h", default_value = "0")]
[IntegerType (rank = 7)]
public struct int16 {
public string! to_string (string! format = "%hi");
}
+[SimpleType]
[CCode (cname = "guint16", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 8)]
public struct uint16 {
public string! to_string (string! format = "%hu");
}
+[SimpleType]
[CCode (cname = "gint32", cheader_filename = "glib.h", default_value = "0")]
[IntegerType (rank = 11)]
public struct int32 {
public string! to_string (string! format = "%i");
}
+[SimpleType]
[CCode (cname = "guint32", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 12)]
public struct uint32 {
public string! to_string (string! format = "%u");
}
+[SimpleType]
[CCode (cname = "gint64", cheader_filename = "glib.h", type_id = "G_TYPE_INT64", marshaller_type_name = "INT64", get_value_function = "g_value_get_int64", set_value_function = "g_value_set_int64", default_value = "0LL")]
[IntegerType (rank = 16)]
public struct int64 {
public string! to_string (string! format = "%lli");
}
+[SimpleType]
[CCode (cname = "guint64", cheader_filename = "glib.h", type_id = "G_TYPE_UINT64", marshaller_type_name = "UINT64", get_value_function = "g_value_get_uint64", set_value_function = "g_value_set_uint64", default_value = "0ULL")]
[IntegerType (rank = 17)]
public struct uint64 {
public string! to_string (string! format = "%llu");
}
+[SimpleType]
[CCode (cname = "float", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_FLOAT", marshaller_type_name = "FLOAT", get_value_function = "g_value_get_float", set_value_function = "g_value_set_float", default_value = "0.0F")]
[FloatingType (rank = 1)]
public struct float {
public string! to_string (string! format = "%g");
}
+[SimpleType]
[CCode (cname = "double", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_DOUBLE", marshaller_type_name = "DOUBLE", get_value_function = "g_value_get_double", set_value_function = "g_value_set_double", default_value = "0.0")]
[FloatingType (rank = 2)]
public struct double {
public string! to_string (string! format = "%g");
}
+[SimpleType]
[CCode (cname = "gunichar", cprefix = "g_unichar_", cheader_filename = "glib.h", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0U")]
[IntegerType (rank = 13)]
public struct unichar {
[CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "glib.h")]
namespace GLib {
[CCode (type_id = "G_TYPE_GTYPE")]
- public struct Type {
+ public struct Type : ulong {
[CCode (cname = "G_TYPE_IS_OBJECT")]
public bool is_object ();
[CCode (cname = "G_TYPE_IS_ABSTRACT")]
[CCode (cname = "G_TYPE_IS_VALUE_TYPE")]
public bool is_value_type ();
- //public Type[] children (out uint n_children = null);
+ public Type[] children ();
public uint depth ();
public static Type from_name (string! name);
- //public Type[] interfaces (out uint n_interfaces = null);
+ public Type[] interfaces ();
public bool is_a (Type is_a_type);
public weak string! name ();
public Type parent ();
public int right;
public int top;
public int bottom;
- [InstanceByReference]
public Gtk.Border copy ();
- [InstanceByReference]
public void free ();
public static GLib.Type get_type ();
}
public struct Requisition {
public int width;
public int height;
- [InstanceByReference]
public Gtk.Requisition copy ();
- [InstanceByReference]
public void free ();
public static GLib.Type get_type ();
}
[CCode (cheader_filename = "gtk/gtk.h")]
public struct TextIter {
- [InstanceByReference]
public bool backward_char ();
- [InstanceByReference]
public bool backward_chars (int count);
- [InstanceByReference]
public bool backward_cursor_position ();
- [InstanceByReference]
public bool backward_cursor_positions (int count);
- [InstanceByReference]
public bool backward_find_char (Gtk.TextCharPredicate pred, pointer user_data, out Gtk.TextIter limit);
- [InstanceByReference]
public bool backward_line ();
- [InstanceByReference]
public bool backward_lines (int count);
- [InstanceByReference]
public bool backward_search (string str, Gtk.TextSearchFlags flags, out Gtk.TextIter match_start, out Gtk.TextIter match_end, out Gtk.TextIter limit);
- [InstanceByReference]
public bool backward_sentence_start ();
- [InstanceByReference]
public bool backward_sentence_starts (int count);
- [InstanceByReference]
public bool backward_to_tag_toggle (Gtk.TextTag tag);
- [InstanceByReference]
public bool backward_visible_cursor_position ();
- [InstanceByReference]
public bool backward_visible_cursor_positions (int count);
- [InstanceByReference]
public bool backward_visible_line ();
- [InstanceByReference]
public bool backward_visible_lines (int count);
- [InstanceByReference]
public bool backward_visible_word_start ();
- [InstanceByReference]
public bool backward_visible_word_starts (int count);
- [InstanceByReference]
public bool backward_word_start ();
- [InstanceByReference]
public bool backward_word_starts (int count);
- [InstanceByReference]
public bool begins_tag (Gtk.TextTag tag);
- [InstanceByReference]
public bool can_insert (bool default_editability);
- [InstanceByReference]
public int compare (out Gtk.TextIter rhs);
- [InstanceByReference]
public Gtk.TextIter copy ();
- [InstanceByReference]
public bool editable (bool default_setting);
- [InstanceByReference]
public bool ends_line ();
- [InstanceByReference]
public bool ends_sentence ();
- [InstanceByReference]
public bool ends_tag (Gtk.TextTag tag);
- [InstanceByReference]
public bool ends_word ();
- [InstanceByReference]
public bool equal (out Gtk.TextIter rhs);
- [InstanceByReference]
public bool forward_char ();
- [InstanceByReference]
public bool forward_chars (int count);
- [InstanceByReference]
public bool forward_cursor_position ();
- [InstanceByReference]
public bool forward_cursor_positions (int count);
- [InstanceByReference]
public bool forward_find_char (Gtk.TextCharPredicate pred, pointer user_data, out Gtk.TextIter limit);
- [InstanceByReference]
public bool forward_line ();
- [InstanceByReference]
public bool forward_lines (int count);
- [InstanceByReference]
public bool forward_search (string str, Gtk.TextSearchFlags flags, out Gtk.TextIter match_start, out Gtk.TextIter match_end, out Gtk.TextIter limit);
- [InstanceByReference]
public bool forward_sentence_end ();
- [InstanceByReference]
public bool forward_sentence_ends (int count);
- [InstanceByReference]
public void forward_to_end ();
- [InstanceByReference]
public bool forward_to_line_end ();
- [InstanceByReference]
public bool forward_to_tag_toggle (Gtk.TextTag tag);
- [InstanceByReference]
public bool forward_visible_cursor_position ();
- [InstanceByReference]
public bool forward_visible_cursor_positions (int count);
- [InstanceByReference]
public bool forward_visible_line ();
- [InstanceByReference]
public bool forward_visible_lines (int count);
- [InstanceByReference]
public bool forward_visible_word_end ();
- [InstanceByReference]
public bool forward_visible_word_ends (int count);
- [InstanceByReference]
public bool forward_word_end ();
- [InstanceByReference]
public bool forward_word_ends (int count);
- [InstanceByReference]
public void free ();
- [InstanceByReference]
public bool get_attributes (Gtk.TextAttributes values);
- [InstanceByReference]
public weak Gtk.TextBuffer get_buffer ();
- [InstanceByReference]
public int get_bytes_in_line ();
- [InstanceByReference]
public unichar get_char ();
- [InstanceByReference]
public int get_chars_in_line ();
- [InstanceByReference]
public weak Gtk.TextChildAnchor get_child_anchor ();
- [InstanceByReference]
public weak Pango.Language get_language ();
- [InstanceByReference]
public int get_line ();
- [InstanceByReference]
public int get_line_index ();
- [InstanceByReference]
public int get_line_offset ();
- [InstanceByReference]
public weak GLib.SList get_marks ();
- [InstanceByReference]
public int get_offset ();
- [InstanceByReference]
public weak Gdk.Pixbuf get_pixbuf ();
- [InstanceByReference]
public weak string get_slice (out Gtk.TextIter end);
- [InstanceByReference]
public weak GLib.SList get_tags ();
- [InstanceByReference]
public weak string get_text (out Gtk.TextIter end);
- [InstanceByReference]
public weak GLib.SList get_toggled_tags (bool toggled_on);
public static GLib.Type get_type ();
- [InstanceByReference]
public int get_visible_line_index ();
- [InstanceByReference]
public int get_visible_line_offset ();
- [InstanceByReference]
public weak string get_visible_slice (out Gtk.TextIter end);
- [InstanceByReference]
public weak string get_visible_text (out Gtk.TextIter end);
- [InstanceByReference]
public bool has_tag (Gtk.TextTag tag);
- [InstanceByReference]
public bool in_range (out Gtk.TextIter start, out Gtk.TextIter end);
- [InstanceByReference]
public bool inside_sentence ();
- [InstanceByReference]
public bool inside_word ();
- [InstanceByReference]
public bool is_cursor_position ();
- [InstanceByReference]
public bool is_end ();
- [InstanceByReference]
public bool is_start ();
- [InstanceByReference]
public void order (out Gtk.TextIter second);
- [InstanceByReference]
public void set_line (int line_number);
- [InstanceByReference]
public void set_line_index (int byte_on_line);
- [InstanceByReference]
public void set_line_offset (int char_on_line);
- [InstanceByReference]
public void set_offset (int char_offset);
- [InstanceByReference]
public void set_visible_line_index (int byte_on_line);
- [InstanceByReference]
public void set_visible_line_offset (int char_on_line);
- [InstanceByReference]
public bool starts_line ();
- [InstanceByReference]
public bool starts_sentence ();
- [InstanceByReference]
public bool starts_word ();
- [InstanceByReference]
public bool toggles_tag (Gtk.TextTag tag);
}
[CCode (cheader_filename = "gtk/gtk.h")]
public pointer user_data;
public pointer user_data2;
public pointer user_data3;
- [InstanceByReference]
public Gtk.TreeIter copy ();
- [InstanceByReference]
public void free ();
public static GLib.Type get_type ();
}
public ushort red;
public ushort green;
public ushort blue;
- [InstanceByReference]
public Pango.Color copy ();
- [InstanceByReference]
public void free ();
public static GLib.Type get_type ();
- [InstanceByReference]
public bool parse (string spec);
- [InstanceByReference]
public weak string to_string ();
}
[CCode (cheader_filename = "pango/pango.h")]
public double yy;
public double x0;
public double y0;
- [InstanceByReference]
public void concat (out Pango.Matrix new_matrix);
- [InstanceByReference]
public Pango.Matrix copy ();
- [InstanceByReference]
public void free ();
- [InstanceByReference]
public double get_font_scale_factor ();
public static GLib.Type get_type ();
- [InstanceByReference]
public void rotate (double degrees);
- [InstanceByReference]
public void scale (double scale_x, double scale_y);
- [InstanceByReference]
public void transform_distance (double dx, double dy);
- [InstanceByReference]
public void transform_pixel_rectangle (out Pango.Rectangle rect);
- [InstanceByReference]
public void transform_point (double x, double y);
- [InstanceByReference]
public void transform_rectangle (out Pango.Rectangle rect);
- [InstanceByReference]
public void translate (double tx, double ty);
}
[CCode (cheader_filename = "pango/pango.h")]
(param_node.name == "self" ||
param.type.@interface.has_suffix (current_data_type.get_cname ()))) {
// instance method
-
- if (!current_data_type.is_reference_type () &&
- param.type.is_pointer) {
- m.instance_by_reference = true;
- }
-
continue;
} else {
// static method