ccode_params.append_printf ("%ssentinel = \"%s\"", separator, m.sentinel);
separator = ", ";
}
- if (m is CreationMethod && ((CreationMethod)m).custom_return_type_cname != null) {
- ccode_params.append_printf ("%stype = \"%s\"", separator, ((CreationMethod)m).custom_return_type_cname);
- separator = ", ";
- }
- if (m is CreationMethod && !m.has_construct_function) {
- ccode_params.append_printf ("%shas_construct_function = false", separator);
- separator = ", ";
+ var cm = m as CreationMethod;
+ if (cm != null) {
+ if (cm.custom_return_type_cname != null) {
+ ccode_params.append_printf ("%stype = \"%s\"", separator, cm.custom_return_type_cname);
+ separator = ", ";
+ }
+ if (!m.has_new_function) {
+ ccode_params.append_printf ("%shas_new_function = false", separator);
+ separator = ", ";
+ }
+ if (!m.has_construct_function) {
+ ccode_params.append_printf ("%shas_construct_function = false", separator);
+ separator = ", ";
+ } else if (m.name == ".new" && m.get_real_cname () != cm.get_default_construct_function ()) {
+ ccode_params.append_printf ("%sconstruct_function = \"%s\"", separator, cm.get_default_construct_function ());
+ separator = ", ";
+ }
}
if (ccode_params.len > 0) {
}
public override string get_real_cname () {
+ var ccode_attribute = get_attribute ("CCode");
+ if (ccode_attribute != null && ccode_attribute.has_argument ("construct_function")) {
+ return ccode_attribute.get_string ("construct_function");
+ }
+
+ return get_default_construct_function ();
+ }
+
+ public string get_default_construct_function () {
var parent = parent_symbol as Class;
if (parent == null || parent.is_compact) {
return get_cname ();
}
- var ccode_attribute = get_attribute ("CCode");
- if (ccode_attribute != null && ccode_attribute.has_argument ("construct_function")) {
- return ccode_attribute.get_string ("construct_function");
- }
-
string infix = "construct";
if (CodeContext.get ().profile == Profile.DOVA) {
public uchar saved_state;
public uchar state;
public Gdk.Window window;
- public Widget (GLib.Type type, ...);
+ [CCode (has_new_function = false, construct_function = "gtk_widget_new")]
+ 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);
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class Widget : Gtk.Object, Atk.Implementor, Gtk.Buildable, Gtk.SizeRequest {
- public Widget (GLib.Type type, ...);
+ [CCode (has_new_function = false, construct_function = "gtk_widget_new")]
+ 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_device_events (Gdk.Device device, Gdk.EventMask events);
}
public class Widget {
- public extern Widget (GLib.Type type, ...);
+ [CCode (has_new_function = false, construct_function = "gtk_widget_new")]
+ public extern Widget (...);
[CCode (cname = "GTK_WIDGET_FLAGS")]
public extern WidgetFlags get_flags ();
}
public class Widget {
- public extern Widget (GLib.Type type, ...);
+ [CCode (has_new_function = false, construct_function = "gtk_widget_new")]
+ public extern Widget (...);
}
public interface Editable {