// Common methods // an event method implementation func GetComponentFromHost(Host, Type) return(this.codename + '.GetComponentFromHost(' + d("Host") + ', ' + d("Type") + ')') end func GetStreamFromHost(Host) return(this.codename + '.GetStreamFromHost(' + d("Host") + ')') end func add_event_type_body(point, obj, type, handler, handler_type, args_type, body, data) if(linked(point)) e_args = ((args_type) ? args_type : '') blk_init.println(obj, '.', handler, ' += new ', handler_type, '(', point, this.id, ');') // store old block old_blk = blk old_lvars = blk_lvars // create event code blk_lvars = block.reggen().inc().inc() blk = block.reggen().inc().inc() event(point, data) // move block to implementation blk_proc_imp.inc().println((sys.get_project() == "Console") ? 'static ' : '', type + ' ' + point + this.id + '(' + e_args + ') { // ' + sys.get_obj_name(this.name) + ':' + ((this.props("Text")=='undefined property') ? point : len(this.props("Text")) ? this.props("Text") : point)) if(not blk_lvars.empty()) blk_proc_imp.copyhere(blk_lvars) end blk_proc_imp.copyhere(blk) if(body) blk_proc_imp.copyhere(body) end blk_proc_imp.println('}').dec().println() // remove and restore block.delete(blk) block.delete(blk_lvars) blk = old_blk blk_lvars = old_lvars this.setfield(point, 'defined') end end // makes complex an event method func add_event_type(point, obj, type, handler, handler_type, args_type, data) add_event_type_body(point, obj, type, handler, handler_type, args_type, 0, data) end