From 28a511253284a7be082d6c41e40aa2172b675263 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Fri, 21 Sep 2018 08:37:21 +0200 Subject: nexgb: export {Major,Minor}Version for extensions --- nexgb/bigreq/bigreq.go | 5 +++++ nexgb/composite/composite.go | 5 +++++ nexgb/damage/damage.go | 5 +++++ nexgb/dpms/dpms.go | 5 +++++ nexgb/dri2/dri2.go | 5 +++++ nexgb/ge/ge.go | 5 +++++ nexgb/glx/glx.go | 5 +++++ nexgb/randr/randr.go | 5 +++++ nexgb/record/record.go | 5 +++++ nexgb/render/render.go | 5 +++++ nexgb/res/res.go | 5 +++++ nexgb/screensaver/screensaver.go | 5 +++++ nexgb/shape/shape.go | 5 +++++ nexgb/shm/shm.go | 5 +++++ nexgb/xcmisc/xcmisc.go | 5 +++++ nexgb/xevie/xevie.go | 5 +++++ nexgb/xf86dri/xf86dri.go | 5 +++++ nexgb/xf86vidmode/xf86vidmode.go | 5 +++++ nexgb/xfixes/xfixes.go | 5 +++++ nexgb/xgbgen/context.go | 6 ++++++ nexgb/xinerama/xinerama.go | 5 +++++ nexgb/xprint/xprint.go | 5 +++++ nexgb/xselinux/xselinux.go | 5 +++++ nexgb/xtest/xtest.go | 5 +++++ nexgb/xv/xv.go | 5 +++++ nexgb/xvmc/xvmc.go | 5 +++++ 26 files changed, 131 insertions(+) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index d045d7f..b0dd1a8 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 0 + MinorVersion = 0 +) + // Init must be called before using the BIG-REQUESTS extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 12, "BIG-REQUESTS").Reply() diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index a7047d0..cad0ce1 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -10,6 +10,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 0 + MinorVersion = 4 +) + // Init must be called before using the Composite extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 9, "Composite").Reply() diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index d83246c..7edccd2 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -10,6 +10,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 1 +) + // Init must be called before using the DAMAGE extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 6, "DAMAGE").Reply() diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index 64aa176..3c4b7ce 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 0 + MinorVersion = 0 +) + // Init must be called before using the DPMS extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 4, "DPMS").Reply() diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 30dd60c..5ae789d 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 4 +) + // Init must be called before using the DRI2 extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 4, "DRI2").Reply() diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index b2bffdd..676a4ed 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 0 +) + // Init must be called before using the Generic Event Extension extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 23, "Generic Event Extension").Reply() diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 9a03429..cba9593 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 4 +) + // Init must be called before using the GLX extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 3, "GLX").Reply() diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index bb7bc61..63717be 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -10,6 +10,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 5 +) + // Init must be called before using the RANDR extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 5, "RANDR").Reply() diff --git a/nexgb/record/record.go b/nexgb/record/record.go index fd04dc7..c981bdd 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 13 +) + // Init must be called before using the RECORD extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 6, "RECORD").Reply() diff --git a/nexgb/render/render.go b/nexgb/render/render.go index fdd9d41..458869d 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 0 + MinorVersion = 11 +) + // Init must be called before using the RENDER extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 6, "RENDER").Reply() diff --git a/nexgb/res/res.go b/nexgb/res/res.go index b97f562..27f659e 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 2 +) + // Init must be called before using the X-Resource extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 10, "X-Resource").Reply() diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index eb128cf..dd31e10 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 1 +) + // Init must be called before using the MIT-SCREEN-SAVER extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 16, "MIT-SCREEN-SAVER").Reply() diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 3a4af24..90eba07 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 1 +) + // Init must be called before using the SHAPE extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 5, "SHAPE").Reply() diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index cad726a..36fd043 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 2 +) + // Init must be called before using the MIT-SHM extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 7, "MIT-SHM").Reply() diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 71cc078..7a9d486 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 1 +) + // Init must be called before using the XC-MISC extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 7, "XC-MISC").Reply() diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 6a3637d..76b8e56 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 0 +) + // Init must be called before using the XEVIE extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 5, "XEVIE").Reply() diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index dec6b37..42f04d1 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 4 + MinorVersion = 1 +) + // Init must be called before using the XFree86-DRI extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 11, "XFree86-DRI").Reply() diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index fd9d70f..7529c5a 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 2 + MinorVersion = 2 +) + // Init must be called before using the XFree86-VidModeExtension extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 24, "XFree86-VidModeExtension").Reply() diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 7716d09..50bf40d 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -11,6 +11,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 5 + MinorVersion = 0 +) + // Init must be called before using the XFIXES extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 6, "XFIXES").Reply() diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 579c480..32dee58 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -101,6 +101,12 @@ func (c *Context) Morph(xmlBytes []byte) { if c.protocol.isExt() { xname := c.protocol.ExtXName + c.Putln("const (") + c.Putln("MajorVersion = %s", c.protocol.MajorVersion) + c.Putln("MinorVersion = %s", c.protocol.MinorVersion) + c.Putln(")") + c.Putln("") + c.Putln("// Init must be called before using the %s extension.", xname) c.Putln("func Init(c *xgb.Conn) error {") diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index fe4f164..31b9f8d 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 1 +) + // Init must be called before using the XINERAMA extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 8, "XINERAMA").Reply() diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 7616845..7d7d3e4 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 0 +) + // Init must be called before using the XpExtension extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 11, "XpExtension").Reply() diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 7265c26..5f53e2e 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 1 + MinorVersion = 0 +) + // Init must be called before using the SELinux extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 7, "SELinux").Reply() diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index bf961f7..282f004 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -9,6 +9,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 2 + MinorVersion = 2 +) + // Init must be called before using the XTEST extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 5, "XTEST").Reply() diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index df81bac..1c658c5 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -10,6 +10,11 @@ import ( "janouch.name/haven/nexgb/xproto" ) +const ( + MajorVersion = 2 + MinorVersion = 2 +) + // Init must be called before using the XVideo extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 6, "XVideo").Reply() diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index b05f952..ca4c831 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -10,6 +10,11 @@ import ( "janouch.name/haven/nexgb/xv" ) +const ( + MajorVersion = 1 + MinorVersion = 1 +) + // Init must be called before using the XVideo-MotionCompensation extension. func Init(c *xgb.Conn) error { reply, err := xproto.QueryExtension(c, 25, "XVideo-MotionCompensation").Reply() -- cgit v1.2.3-70-g09d2