aboutsummaryrefslogtreecommitdiff
path: root/nexgb/auto_screensaver.go
diff options
context:
space:
mode:
Diffstat (limited to 'nexgb/auto_screensaver.go')
-rw-r--r--nexgb/auto_screensaver.go48
1 files changed, 36 insertions, 12 deletions
diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go
index c023eec..1e47b91 100644
--- a/nexgb/auto_screensaver.go
+++ b/nexgb/auto_screensaver.go
@@ -1,7 +1,7 @@
package xgb
/*
- This file was generated by screensaver.xml on May 6 2012 3:00:44am EDT.
+ This file was generated by screensaver.xml on May 6 2012 5:48:47pm EDT.
This file is automatically generated. Edit at your peril!
*/
@@ -9,19 +9,29 @@ package xgb
// in one package. They are still listed here for reference.
// import "xproto"
-// Skipping definition for base type 'Char'
-
-// Skipping definition for base type 'Card32'
-
-// Skipping definition for base type 'Double'
-
-// Skipping definition for base type 'Bool'
+// ScreensaverInit must be called before using the MIT-SCREEN-SAVER extension.
+func (c *Conn) ScreensaverInit() error {
+ reply, err := c.QueryExtension(16, "MIT-SCREEN-SAVER").Reply()
+ switch {
+ case err != nil:
+ return err
+ case !reply.Present:
+ return newError("No extension named MIT-SCREEN-SAVER could be found on on the server.")
+ }
-// Skipping definition for base type 'Float'
+ c.extLock.Lock()
+ c.extensions["MIT-SCREEN-SAVER"] = reply.MajorOpcode
+ for evNum, fun := range newExtEventFuncs["MIT-SCREEN-SAVER"] {
+ newEventFuncs[int(reply.FirstEvent)+evNum] = fun
+ }
+ c.extLock.Unlock()
-// Skipping definition for base type 'Id'
+ return nil
+}
-// Skipping definition for base type 'Card8'
+func init() {
+ newExtEventFuncs["MIT-SCREEN-SAVER"] = make(map[int]newEventFun)
+}
// Skipping definition for base type 'Int16'
@@ -35,6 +45,20 @@ package xgb
// Skipping definition for base type 'Card16'
+// Skipping definition for base type 'Char'
+
+// Skipping definition for base type 'Card32'
+
+// Skipping definition for base type 'Double'
+
+// Skipping definition for base type 'Bool'
+
+// Skipping definition for base type 'Float'
+
+// Skipping definition for base type 'Id'
+
+// Skipping definition for base type 'Card8'
+
const (
ScreensaverKindBlanked = 0
ScreensaverKindInternal = 1
@@ -182,7 +206,7 @@ func (v ScreensaverNotifyEvent) String() string {
}
func init() {
- newEventFuncs[0] = NewScreensaverNotifyEvent
+ newExtEventFuncs["MIT-SCREEN-SAVER"][0] = NewScreensaverNotifyEvent
}
// Request ScreensaverQueryVersion