[idl-generator] Add event handler support

It is 2-space indent :)
There is some code in the macro of `handle_cmd_begin` above