+2007-12-01 Jürg Billeter <j@bitron.ch>
+
+ * vala/parser.y, vala/valaclass.vala, vala/valacreationmethod.vala,
+ vala/valainterfacewriter.vala, vala/valamemberaccess.vala,
+ vala/valasemanticanalyzer.vala, vala/valastruct.vala: don't let named
+ creation methods conflict with normal methods
+
+ * gobject/valaccodegenerator.vala: fix revealed typo
+
+ * vapi/cairo.vapi: Matrix is a value-type, declare it as struct
+
+ * vapi/packages/gtk+-2.0/gtk+-2.0-custom.vala,
+ vapi/packages/gtk+-2.0/gtk+-2.0.metadata: remove default creation
+ method from Gtk.Widget
+
+ * vapi/gtk+-2.0.vapi: regenerated
+
2007-11-30 Jürg Billeter <j@bitron.ch>
* gobject/valaccodegenerator.vala,
element_expr = get_ref_expression (ma);
var clendecl = new CCodeDeclaration ("int");
- clendecl.add_declarator (CCodeVariableDeclarator.with_initializer (get_array_length_cname (collection_backup.name, 1), array_len));
+ clendecl.add_declarator (new CCodeVariableDeclarator.with_initializer (get_array_length_cname (collection_backup.name, 1), array_len));
cblock.add_statement (clendecl);
var cfrag = new CCodeFragment ();
: NEW member_name open_parens opt_argument_list CLOSE_PARENS opt_object_initializer
{
ValaSourceReference *src = src(@2);
+ vala_member_access_set_creation_member (VALA_MEMBER_ACCESS ($2), TRUE);
ValaObjectCreationExpression *expr = vala_code_context_create_object_creation_expression (context, VALA_MEMBER_ACCESS ($2), src);
g_object_unref ($2);
g_object_unref (src);
m.this_parameter.type_reference.data_type = this;
m.scope.add (m.this_parameter.name, m.this_parameter);
}
- if (m is CreationMethod && m.name == null) {
- default_construction_method = m;
+ if (m is CreationMethod) {
+ if (m.name == null) {
+ default_construction_method = m;
+ m.name = ".new";
+ } else {
+ m.name = ".new." + m.name;
+ }
}
methods.add (m);
public override string! get_default_cname () {
var parent = parent_symbol;
assert (parent is DataType);
- if (name == null) {
+ if (name.len () == ".new".len ()) {
return "%snew".printf (((DataType) parent).get_lower_case_cprefix ());
} else {
- return "%snew_%s".printf (((DataType) parent).get_lower_case_cprefix (), name);
+ return "%snew_%s".printf (((DataType) parent).get_lower_case_cprefix (), name.offset (".new.".len ()));
}
}
}
write_string (" ");
var datatype = (DataType) m.parent_symbol;
write_identifier (datatype.name);
-
- if (m.name != null) {
- write_string (".");
- write_identifier (m.name);
- }
+ write_identifier (m.name.offset (".new".len ()));
} else if (!m.instance) {
write_string (" static");
} else if (m.is_abstract) {
*/
public bool prototype_access { get; set; }
+ /**
+ * Specifies whether the member is used for object creation.
+ */
+ public bool creation_member { get; set; }
+
private Expression _inner;
private Gee.List<TypeReference> type_argument_list = new ArrayList<TypeReference> ();
if (expr.inner is MemberAccess || expr.inner is BaseAccess) {
base_symbol = expr.inner.symbol_reference;
- if (base_symbol is Namespace || base_symbol is DataType) {
+
+ if (expr.creation_member && base_symbol is DataType) {
+ // check for named creation method
+ expr.symbol_reference = base_symbol.scope.lookup (".new." + expr.member_name);
+ }
+
+ if (expr.symbol_reference == null && (base_symbol is Namespace || base_symbol is DataType)) {
expr.symbol_reference = base_symbol.scope.lookup (expr.member_name);
if (expr.inner is BaseAccess) {
// inner expression is base access
m.this_parameter.type_reference.data_type = this;
m.scope.add (m.this_parameter.name, m.this_parameter);
}
- if (m is CreationMethod && m.name == null) {
- default_construction_method = m;
+ if (m is CreationMethod) {
+ if (m.name == null) {
+ default_construction_method = m;
+ m.name = ".new";
+ } else {
+ m.name = ".new." + m.name;
+ }
}
methods.add (m);
public weak Pattern get_source ();
public void set_matrix (Matrix matrix);
- public void get_matrix (Matrix matrix);
+ public void get_matrix (out Matrix matrix);
public void set_antialias (Antialias antialias);
public Antialias get_antialias ();
public void select_font_face (string! family, FontSlant slant, FontWeight weight);
public void set_font_size (double size);
- public void set_font_matrix (Matrix! matrix);
- public void get_font_matrix (Matrix matrix);
+ public void set_font_matrix (Matrix matrix);
+ public void get_font_matrix (out Matrix matrix);
public void set_font_options (ref FontOptions! options);
public void get_font_options (ref FontOptions options);
public Filter get_filter ();
public void set_matrix (Matrix matrix);
- public void get_matrix (Matrix matrix);
+ public void get_matrix (out Matrix matrix);
public PatternType get_type ();
}
public void glyph_extents (Glyph[] glyphs, int num_glyphs, ref TextExtents extents);
public weak FontFace get_font_face ();
public void get_font_options (ref FontOptions options);
- public void get_font_matrix (Matrix font_matrix);
- public void get_ctm (Matrix ctm);
+ public void get_font_matrix (out Matrix font_matrix);
+ public void get_ctm (out Matrix ctm);
public FontType get_type ();
}
public int get_depth ();
}
- [CCode (free_function = "g_free", cname = "cairo_matrix_t")]
- public class Matrix {
- public void init (double xx, double yx, double xy, double yy, double x0, double y0);
- public void init_identity ();
- public void init_translate (double tx, double ty);
- public void init_scale (double sx, double sy);
- public void init_rotate (double radians);
+ [CCode (cname = "cairo_matrix_t")]
+ public struct Matrix {
+ [CCode (cname = "cairo_matrix_init")]
+ public Matrix (double xx, double yx, double xy, double yy, double x0, double y0);
+ [CCode (cname = "cairo_matrix_init_identity")]
+ public Matrix.identity ();
+ [CCode (cname = "cairo_matrix_init_translate")]
+ public Matrix.translate (double tx, double ty);
+ [CCode (cname = "cairo_matrix_init_scale")]
+ public Matrix.scale (double sx, double sy);
+ [CCode (cname = "cairo_matrix_init_rotate")]
+ public Matrix.rotate (double radians);
+
public void translate (double tx, double ty);
public void scale (double sx, double sy);
public void rotate (double radians);
public Gtk.Requisition requisition;
public Gtk.Allocation allocation;
public weak Gdk.Window window;
+ public Widget (GLib.Type type, ...);
[CCode (cname = "GTK_WIDGET_FLAGS")]
public Gtk.WidgetFlags get_flags ();
[CCode (cname = "GTK_WIDGET_SET_FLAGS")]
public void set_flags (Gtk.WidgetFlags flags);
[CCode (cname = "GTK_WIDGET_UNSET_FLAGS")]
public void unset_flags (Gtk.WidgetFlags flags);
- public Widget ();
public bool activate ();
public void add_accelerator (string accel_signal, Gtk.AccelGroup accel_group, uint accel_key, Gdk.ModifierType accel_mods, Gtk.AccelFlags accel_flags);
public void add_events (int events);
public void modify_font (Pango.FontDescription font_desc);
public void modify_style (Gtk.RcStyle style);
public void modify_text (Gtk.StateType state, out Gdk.Color color);
- public Widget (GLib.Type type, ...);
public void path (uint path_length, string path, string path_reversed);
public static void pop_colormap ();
public static void pop_composite_child ();
public class Widget {
[Import]
+ public Widget (GLib.Type type, ...);
+
+ [Import]
[CCode (cname = "GTK_WIDGET_FLAGS")]
public WidgetFlags get_flags ();
GtkWidget::unrealize has_emitter="1"
gtk_window_has_toplevel_focus hidden="1" experimental="1"
gtk_window_is_active hidden="1" experimental="1"
+gtk_widget_new hidden="1"
GtkWindow::activate_default name="default_activated" experimental="1"
GtkWindow::activate_focus name="focus_activated" experimental="1"
GtkWindow::set_focus has_emitter="1"