aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/context.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-04-29 03:38:29 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-04-29 03:38:29 -0400
commit6bf0191fb01f4c0b65bcd444bb5381013c627f95 (patch)
treef83d00c55a92568e8345849c6753253d17bc393d /nexgb/xgbgen/context.go
parent52a21b415ad95b2c4649254447388cb329cee1a4 (diff)
downloadhaven-6bf0191fb01f4c0b65bcd444bb5381013c627f95.tar.gz
haven-6bf0191fb01f4c0b65bcd444bb5381013c627f95.tar.xz
haven-6bf0191fb01f4c0b65bcd444bb5381013c627f95.zip
progress. still not working. this is incredibly difficult.
Diffstat (limited to 'nexgb/xgbgen/context.go')
-rw-r--r--nexgb/xgbgen/context.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go
index e5acb12..712cad4 100644
--- a/nexgb/xgbgen/context.go
+++ b/nexgb/xgbgen/context.go
@@ -5,7 +5,6 @@ import (
"encoding/xml"
"fmt"
"log"
- "strings"
)
type Context struct {
@@ -33,31 +32,6 @@ func (c *Context) Put(format string, v ...interface{}) {
}
}
-// TypePrefix searches the parsed XML for a type matching 'needle'.
-// It then returns the appropriate prefix to be used in source code.
-// Note that the core X protocol *is* a namespace, but does not have a prefix.
-// Also note that you should probably check the BaseTypeMap and TypeMap
-// before calling this function.
-func (c *Context) TypePrefix(needle Type) string {
- // If this is xproto, quit. No prefixes needed.
- if c.xml.Header == "xproto" {
- return ""
- }
-
- // First check for the type in the current namespace.
- if c.xml.HasType(needle) {
- return strings.Title(c.xml.Header)
- }
-
- // Now check each of the imports...
- for _, imp := range c.xml.Imports {
- if imp.xml.Header != "xproto" && imp.xml.HasType(needle) {
- return strings.Title(imp.xml.Header)
- }
- }
-
- return ""
-}
// Translate is the big daddy of them all. It takes in an XML byte slice
// and writes Go code to the 'out' buffer.
@@ -76,14 +50,4 @@ func (c *Context) Translate(xmlBytes []byte) {
// It's Morphin' Time!
c.xml.Morph(c)
-
- // for _, req := range c.xml.Requests {
- // if req.Name != "CreateContext" && req.Name != "MakeCurrent" {
- // continue
- // }
- // log.Println(req.Name)
- // for _, field := range req.Fields {
- // log.Println("\t", field.XMLName.Local, field.Type.Morph(c))
- // }
- // }
}