diff options
Diffstat (limited to 'nexgb/xgbgen/go_event.go')
-rw-r--r-- | nexgb/xgbgen/go_event.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index 71252a7..41f9320 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -28,6 +28,14 @@ func (e *Event) Define(c *Context) { // Makes sure that this event type is an Event interface. c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) c.Putln("") + c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) + if e.NoSequence { + c.Putln("return uint16(0)") + } else { + c.Putln("return v.Sequence") + } + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") @@ -99,6 +107,14 @@ func (e *EventCopy) Define(c *Context) { // Makes sure that this event type is an Event interface. c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) c.Putln("") + c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) + if e.Old.(*Event).NoSequence { + c.Putln("return uint16(0)") + } else { + c.Putln("return v.Sequence") + } + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") |