var cl = sig.parent_symbol as Class;
csignew.add_argument (new CCodeConstant ("\"%s\"".printf (sig.get_cname ())));
csignew.add_argument (new CCodeIdentifier (type.get_type_id ()));
- csignew.add_argument (new CCodeConstant ("G_SIGNAL_RUN_LAST"));
+ string[] flags = new string[0];
+ if (sig.run_type == "first") {
+ flags += "G_SIGNAL_RUN_FIRST";
+ } else if (sig.run_type == "cleanup") {
+ flags += "G_SIGNAL_RUN_CLEANUP";
+ } else {
+ flags += "G_SIGNAL_RUN_LAST";
+ }
+ if (sig.is_detailed) {
+ flags += "G_SIGNAL_DETAILED";
+ }
+
+ if (sig.no_recurse) {
+ flags += "G_SIGNAL_NO_RECURSE";
+ }
+
+ if (sig.is_action) {
+ flags += "G_SIGNAL_ACTION";
+ }
+
+ if (sig.no_hooks) {
+ flags += "G_SIGNAL_NO_HOOKS";
+ }
+
+ csignew.add_argument (new CCodeConstant (string.joinv (" | ", flags)));
+
if (sig.default_handler == null) {
csignew.add_argument (new CCodeConstant ("0"));
} else {
* */
public Method default_handler { get; private set; }
+ public bool is_detailed { get; set; }
+
+ public bool no_recurse { get; set; }
+
+ public string run_type { get; set; }
+
+ public bool is_action { get; set; }
+
+ public bool no_hooks { get; set; }
+
+
private string cname;
private bool lock_used = false;
public Signal (string name, DataType return_type, SourceReference? source_reference = null, Comment? comment = null) {
base (name, source_reference, comment);
this.return_type = return_type;
+ this.run_type = "last";
}
/**
}
}
+ void process_signal_attribute (Attribute a) {
+ if (a.has_argument ("detailed")) {
+ is_detailed = a.get_bool ("detailed");
+ }
+ if (a.has_argument ("no_recurse")) {
+ no_recurse = a.get_bool ("no_recurse");
+ }
+ if (a.has_argument ("run")) {
+ var arg = a.get_string ("run");
+ if (arg == "first") {
+ run_type = "first";
+ } else if (arg == "last") {
+ run_type = "last";
+ } else if (arg == "cleanup") {
+ run_type = "cleanup";
+ }
+ }
+
+ if (a.has_argument ("action")) {
+ is_action = a.get_bool ("action");
+ }
+
+ if (a.has_argument ("no_hooks")) {
+ no_hooks = a.get_bool ("no_hooks");
+ }
+ }
+
/**
* Process all associated attributes.
*/
if (a.name == "HasEmitter") {
has_emitter = true;
}
+ if (a.name == "Signal") {
+ process_signal_attribute (a);
+ }
}
}