From 96375f46459e2a3bdfc4f84701c8f02de213bc32 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Thu, 26 May 2016 09:35:32 +0000 Subject: [PATCH 01/28] Add socks5 API from Yawning's or-ctl-filter repo borrow code from this git commit id 8897fe5b847b70fd54f19d1114d04e3bb67912d8 https://github.com/Yawning/or-ctl-filter --- socks5/client.go | 153 ++++++++++++++++++++++ socks5/common.go | 272 +++++++++++++++++++++++++++++++++++++++ socks5/server.go | 200 ++++++++++++++++++++++++++++ socks5/server_rfc1929.go | 84 ++++++++++++ 4 files changed, 709 insertions(+) create mode 100644 socks5/client.go create mode 100644 socks5/common.go create mode 100644 socks5/server.go create mode 100644 socks5/server_rfc1929.go diff --git a/socks5/client.go b/socks5/client.go new file mode 100644 index 0000000..474d2e1 --- /dev/null +++ b/socks5/client.go @@ -0,0 +1,153 @@ +/* + * client.go - SOCSK5 client implementation. + * + * To the extent possible under law, Yawning Angel has waived all copyright and + * related or neighboring rights to or-ctl-filter, using the creative commons + * "cc0" public domain dedication. See LICENSE or + * for full details. + */ + +package socks5 + +import ( + "fmt" + "io" + "net" + "time" +) + +// Redispatch dials the provided proxy and redispatches an existing request. +func Redispatch(proxyNet, proxyAddr string, req *Request) (conn net.Conn, bndAddr *Address, err error) { + defer func() { + if err != nil && conn != nil { + conn.Close() + } + }() + + conn, err = clientHandshake(proxyNet, proxyAddr, req) + if err != nil { + return nil, nil, err + } + bndAddr, err = clientCmd(conn, req) + return +} + +func clientHandshake(proxyNet, proxyAddr string, req *Request) (net.Conn, error) { + conn, err := net.Dial(proxyNet, proxyAddr) + if err != nil { + return nil, err + } + if err := conn.SetDeadline(time.Now().Add(requestTimeout)); err != nil { + return conn, err + } + authMethod, err := clientNegotiateAuth(conn, req) + if err != nil { + return conn, err + } + if err := clientAuthenticate(conn, req, authMethod); err != nil { + return conn, err + } + if err := conn.SetDeadline(time.Time{}); err != nil { + return conn, err + } + + return conn, nil +} + +func clientNegotiateAuth(conn net.Conn, req *Request) (byte, error) { + useRFC1929 := req.Auth.Uname != nil && req.Auth.Passwd != nil + // XXX: Validate uname/passwd lengths, though should always be valid. + + var buf [3]byte + buf[0] = version + buf[1] = 1 + if useRFC1929 { + buf[2] = authUsernamePassword + } else { + buf[2] = authNoneRequired + } + + if _, err := conn.Write(buf[:]); err != nil { + return authNoAcceptableMethods, err + } + + var resp [2]byte + if _, err := io.ReadFull(conn, resp[:]); err != nil { + return authNoAcceptableMethods, err + } + if err := validateByte("version", resp[0], version); err != nil { + return authNoAcceptableMethods, err + } + if err := validateByte("method", resp[1], buf[2]); err != nil { + return authNoAcceptableMethods, err + } + + return resp[1], nil +} + +func clientAuthenticate(conn net.Conn, req *Request, authMethod byte) error { + switch authMethod { + case authNoneRequired: + case authUsernamePassword: + var buf []byte + buf = append(buf, authRFC1929Ver) + buf = append(buf, byte(len(req.Auth.Uname))) + buf = append(buf, req.Auth.Uname...) + buf = append(buf, byte(len(req.Auth.Passwd))) + buf = append(buf, req.Auth.Passwd...) + if _, err := conn.Write(buf); err != nil { + return err + } + + var resp [2]byte + if _, err := io.ReadFull(conn, resp[:]); err != nil { + return err + } + if err := validateByte("version", resp[0], authRFC1929Ver); err != nil { + return err + } + if err := validateByte("status", resp[1], authRFC1929Success); err != nil { + return err + } + default: + panic(fmt.Sprintf("unknown authentication method: 0x%02x", authMethod)) + } + return nil +} + +func clientCmd(conn net.Conn, req *Request) (*Address, error) { + var buf []byte + buf = append(buf, version) + buf = append(buf, byte(req.Cmd)) + buf = append(buf, rsv) + buf = append(buf, req.Addr.raw...) + if _, err := conn.Write(buf); err != nil { + return nil, err + } + + var respHdr [3]byte + if _, err := io.ReadFull(conn, respHdr[:]); err != nil { + return nil, err + } + + if err := validateByte("version", respHdr[0], version); err != nil { + return nil, err + } + if err := validateByte("rep", respHdr[1], byte(ReplySucceeded)); err != nil { + return nil, clientError(respHdr[1]) + } + if err := validateByte("rsv", respHdr[2], rsv); err != nil { + return nil, err + } + + var bndAddr Address + if err := bndAddr.read(conn); err != nil { + return nil, err + } + + if err := conn.SetDeadline(time.Time{}); err != nil { + return nil, err + } + + return &bndAddr, nil +} diff --git a/socks5/common.go b/socks5/common.go new file mode 100644 index 0000000..aaa82a1 --- /dev/null +++ b/socks5/common.go @@ -0,0 +1,272 @@ +/* + * common.go - SOCSK5 common definitons/routines. + * + * To the extent possible under law, Yawning Angel has waived all copyright and + * related or neighboring rights to or-ctl-filter, using the creative commons + * "cc0" public domain dedication. See LICENSE or + * for full details. + */ + +// Package socks5 implements a SOCKS5 client/server. For more information see +// RFC 1928 and RFC 1929. +// +// Notes: +// * GSSAPI authentication, is NOT supported. +// * The authentication provided by the client is always accepted. +// * A lot of the code is shamelessly stolen from obfs4proxy. +package socks5 + +import ( + "errors" + "fmt" + "io" + "net" + "strconv" + "syscall" + "time" +) + +const ( + version = 0x05 + rsv = 0x00 + + atypIPv4 = 0x01 + atypDomainName = 0x03 + atypIPv6 = 0x04 + + authNoneRequired = 0x00 + authUsernamePassword = 0x02 + authNoAcceptableMethods = 0xff + + inboundTimeout = 5 * time.Second + requestTimeout = 30 * time.Second +) + +var errInvalidAtyp = errors.New("invalid address type") + +// ReplyCode is a SOCKS 5 reply code. +type ReplyCode byte + +// The various SOCKS 5 reply codes from RFC 1928. +const ( + ReplySucceeded ReplyCode = iota + ReplyGeneralFailure + ReplyConnectionNotAllowed + ReplyNetworkUnreachable + ReplyHostUnreachable + ReplyConnectionRefused + ReplyTTLExpired + ReplyCommandNotSupported + ReplyAddressNotSupported +) + +// Command is a SOCKS 5 command. +type Command byte + +// The various SOCKS 5 commands. +const ( + CommandConnect Command = 0x01 + CommandTorResolve Command = 0xf0 + CommandTorResolvePTR Command = 0xf1 +) + +// Address is a SOCKS 5 address + port. +type Address struct { + raw []byte + addrStr string + portStr string +} + +// FromString parses the provided "host:port" format address and populates the +// Address fields. +func (addr *Address) FromString(addrStr string) (err error) { + addr.addrStr, addr.portStr, err = net.SplitHostPort(addrStr) + if err != nil { + return + } + + var raw []byte + if ip := net.ParseIP(addr.addrStr); ip != nil { + if v4Addr := ip.To4(); v4Addr != nil { + raw = append(raw, atypIPv4) + raw = append(raw, v4Addr...) + } else if v6Addr := ip.To16(); v6Addr != nil { + raw = append(raw, atypIPv6) + raw = append(raw, v6Addr...) + } else { + return errors.New("unsupported IP address type") + } + } else { + // Must be a FQDN. + if len(addr.addrStr) > 255 { + return fmt.Errorf("invalid FQDN, len > 255 bytes (%d bytes)", len(addr.addrStr)) + } + raw = append(raw, atypDomainName) + raw = append(raw, addr.addrStr...) + } + + var port uint64 + if port, err = strconv.ParseUint(addr.portStr, 10, 16); err != nil { + return + } + raw = append(raw, byte(port>>8)) + raw = append(raw, byte(port&0xff)) + + addr.raw = raw + return +} + +// String returns the string representation of the address, in "host:port" +// format. +func (addr *Address) String() string { + return addr.addrStr + ":" + addr.portStr +} + +// HostPort returns the string representation of the addess, split into the +// host and port components. +func (addr *Address) HostPort() (string, string) { + return addr.addrStr, addr.portStr +} + +func (addr *Address) read(conn net.Conn) (err error) { + // The address looks like: + // uint8_t atyp + // uint8_t addr[] (Length depends on atyp) + // uint16_t port + + // Read the atype. + var atyp byte + if atyp, err = readByte(conn); err != nil { + return + } + addr.raw = append(addr.raw, atyp) + + // Read the address. + var rawAddr []byte + switch atyp { + case atypIPv4: + rawAddr = make([]byte, net.IPv4len) + if _, err = io.ReadFull(conn, rawAddr); err != nil { + return + } + v4Addr := net.IPv4(rawAddr[0], rawAddr[1], rawAddr[2], rawAddr[3]) + addr.addrStr = v4Addr.String() + case atypDomainName: + var alen byte + if alen, err = readByte(conn); err != nil { + return + } + if alen == 0 { + return fmt.Errorf("domain name with 0 length") + } + rawAddr = make([]byte, alen) + addr.raw = append(addr.raw, alen) + if _, err = io.ReadFull(conn, rawAddr); err != nil { + return + } + addr.addrStr = string(rawAddr) + case atypIPv6: + rawAddr = make([]byte, net.IPv6len) + if _, err = io.ReadFull(conn, rawAddr); err != nil { + return + } + v6Addr := make(net.IP, net.IPv6len) + copy(v6Addr[:], rawAddr) + addr.addrStr = fmt.Sprintf("[%s]", v6Addr.String()) + default: + return errInvalidAtyp + } + addr.raw = append(addr.raw, rawAddr...) + + // Read the port. + var rawPort [2]byte + if _, err = io.ReadFull(conn, rawPort[:]); err != nil { + return + } + port := int(rawPort[0])<<8 | int(rawPort[1]) + addr.portStr = fmt.Sprintf("%d", port) + addr.raw = append(addr.raw, rawPort[:]...) + + return +} + +// ErrorToReplyCode converts an error to the "best" reply code. +func ErrorToReplyCode(err error) ReplyCode { + if cErr, ok := err.(clientError); ok { + return ReplyCode(cErr) + } + opErr, ok := err.(*net.OpError) + if !ok { + return ReplyGeneralFailure + } + + errno, ok := opErr.Err.(syscall.Errno) + if !ok { + return ReplyGeneralFailure + } + switch errno { + case syscall.EADDRNOTAVAIL: + return ReplyAddressNotSupported + case syscall.ETIMEDOUT: + return ReplyTTLExpired + case syscall.ENETUNREACH: + return ReplyNetworkUnreachable + case syscall.EHOSTUNREACH: + return ReplyHostUnreachable + case syscall.ECONNREFUSED, syscall.ECONNRESET: + return ReplyConnectionRefused + default: + return ReplyGeneralFailure + } +} + +// Request describes a SOCKS 5 request. +type Request struct { + Auth AuthInfo + Cmd Command + Addr Address + + conn net.Conn +} + +type clientError ReplyCode + +func (e clientError) Error() string { + switch ReplyCode(e) { + case ReplySucceeded: + return "socks5: succeeded" + case ReplyGeneralFailure: + return "socks5: general failure" + case ReplyConnectionNotAllowed: + return "socks5: connection not allowed" + case ReplyNetworkUnreachable: + return "socks5: network unreachable" + case ReplyHostUnreachable: + return "socks5: host unreachable" + case ReplyConnectionRefused: + return "socks5: connection refused" + case ReplyTTLExpired: + return "socks5: ttl expired" + case ReplyCommandNotSupported: + return "socks5: command not supported" + case ReplyAddressNotSupported: + return "socks5: address not supported" + default: + return fmt.Sprintf("socks5: reply code: 0x%02x", e) + } +} + +func readByte(conn net.Conn) (byte, error) { + var tmp [1]byte + if _, err := conn.Read(tmp[:]); err != nil { + return 0, err + } + return tmp[0], nil +} + +func validateByte(descr string, val, expected byte) error { + if val != expected { + return fmt.Errorf("message field '%s' was 0x%02x (expected 0x%02x)", descr, val, expected) + } + return nil +} diff --git a/socks5/server.go b/socks5/server.go new file mode 100644 index 0000000..61c61e4 --- /dev/null +++ b/socks5/server.go @@ -0,0 +1,200 @@ +/* + * server.go - SOCSK5 server implementation. + * + * To the extent possible under law, Yawning Angel has waived all copyright and + * related or neighboring rights to or-ctl-filter, using the creative commons + * "cc0" public domain dedication. See LICENSE or + * for full details. + */ + +package socks5 + +import ( + "bytes" + "fmt" + "io" + "net" + "time" +) + +// Handshake attempts to handle a incoming client handshake over the provided +// connection and receive the SOCKS5 request. The routine handles sending +// appropriate errors if applicable, but will not close the connection. +func Handshake(conn net.Conn) (*Request, error) { + // Arm the handshake timeout. + var err error + if err = conn.SetDeadline(time.Now().Add(inboundTimeout)); err != nil { + return nil, err + } + defer func() { + // Disarm the handshake timeout, only propagate the error if + // the handshake was successful. + nerr := conn.SetDeadline(time.Time{}) + if err == nil { + err = nerr + } + }() + + req := new(Request) + req.conn = conn + + // Negotiate the protocol version and authentication method. + var method byte + if method, err = req.negotiateAuth(); err != nil { + return nil, err + } + + // Authenticate if neccecary. + if err = req.authenticate(method); err != nil { + return nil, err + } + + // Read the client command. + if err = req.readCommand(); err != nil { + return nil, err + } + + return req, err +} + +// Reply sends a SOCKS5 reply to the corresponding request. The BND.ADDR and +// BND.PORT fields are always set to an address/port corresponding to +// "0.0.0.0:0". +func (req *Request) Reply(code ReplyCode) error { + return req.ReplyAddr(code, nil) +} + +// ReplyAddr sends a SOCKS5 reply to the corresponding request. The BND.ADDR +// and BND.PORT fields are specified by addr, or "0.0.0.0:0" if not provided. +func (req *Request) ReplyAddr(code ReplyCode, addr *Address) error { + // The server sends a reply message. + // uint8_t ver (0x05) + // uint8_t rep + // uint8_t rsv (0x00) + // uint8_t atyp + // uint8_t bnd_addr[] + // uint16_t bnd_port + + resp := []byte{version, byte(code), rsv} + if addr == nil { + var nilAddr [net.IPv4len + 2]byte + resp = append(resp, atypIPv4) + resp = append(resp, nilAddr[:]...) + } else { + resp = append(resp, addr.raw...) + } + + _, err := req.conn.Write(resp[:]) + return err + +} + +func (req *Request) negotiateAuth() (byte, error) { + // The client sends a version identifier/selection message. + // uint8_t ver (0x05) + // uint8_t nmethods (>= 1). + // uint8_t methods[nmethods] + + var err error + if err = req.readByteVerify("version", version); err != nil { + return 0, err + } + + // Read the number of methods, and the methods. + var nmethods byte + method := byte(authNoAcceptableMethods) + if nmethods, err = req.readByte(); err != nil { + return method, err + } + methods := make([]byte, nmethods) + if _, err := io.ReadFull(req.conn, methods); err != nil { + return 0, err + } + + // Pick the best authentication method, prioritizing authenticating + // over not if both options are present. + if bytes.IndexByte(methods, authUsernamePassword) != -1 { + method = authUsernamePassword + } else if bytes.IndexByte(methods, authNoneRequired) != -1 { + method = authNoneRequired + } + + // The server sends a method selection message. + // uint8_t ver (0x05) + // uint8_t method + msg := []byte{version, method} + if _, err = req.conn.Write(msg); err != nil { + return 0, err + } + + return method, nil +} + +func (req *Request) authenticate(method byte) error { + switch method { + case authNoneRequired: + return nil + case authUsernamePassword: + return req.authRFC1929() + case authNoAcceptableMethods: + return fmt.Errorf("no acceptable authentication methods") + default: + // This should never happen as only supported auth methods should be + // negotiated. + return fmt.Errorf("negotiated unsupported method 0x%02x", method) + } +} + +func (req *Request) readCommand() error { + // The client sends the request details. + // uint8_t ver (0x05) + // uint8_t cmd + // uint8_t rsv (0x00) + // uint8_t atyp + // uint8_t dst_addr[] + // uint16_t dst_port + + var err error + var cmd byte + if err = req.readByteVerify("version", version); err != nil { + req.Reply(ReplyGeneralFailure) + return err + } + if cmd, err = req.readByte(); err != nil { + req.Reply(ReplyGeneralFailure) + return err + } + switch Command(cmd) { + case CommandConnect, CommandTorResolve, CommandTorResolvePTR: + req.Cmd = Command(cmd) + default: + req.Reply(ReplyCommandNotSupported) + return fmt.Errorf("unsupported SOCKS command: 0x%02x", cmd) + } + if err = req.readByteVerify("reserved", rsv); err != nil { + req.Reply(ReplyGeneralFailure) + return err + } + + // Read the destination address/port. + err = req.Addr.read(req.conn) + if err == errInvalidAtyp { + req.Reply(ReplyAddressNotSupported) + } else if err != nil { + req.Reply(ReplyGeneralFailure) + } + + return err +} + +func (req *Request) readByte() (byte, error) { + return readByte(req.conn) +} + +func (req *Request) readByteVerify(descr string, expected byte) error { + val, err := req.readByte() + if err != nil { + return err + } + return validateByte(descr, val, expected) +} diff --git a/socks5/server_rfc1929.go b/socks5/server_rfc1929.go new file mode 100644 index 0000000..7d0566a --- /dev/null +++ b/socks5/server_rfc1929.go @@ -0,0 +1,84 @@ +/* + * server_rfc1929.go - SOCSK 5 server authentication. + * + * To the extent possible under law, Yawning Angel has waived all copyright and + * related or neighboring rights to or-ctl-filter, using the creative commons + * "cc0" public domain dedication. See LICENSE or + * for full details. + */ + +package socks5 + +import ( + "fmt" + "io" +) + +const ( + authRFC1929Ver = 0x01 + authRFC1929Success = 0x00 + authRFC1929Fail = 0x01 +) + +// AuthInfo is the RFC 1929 Username/Password authentication data. +type AuthInfo struct { + Uname []byte + Passwd []byte +} + +func (req *Request) authRFC1929() (err error) { + sendErrResp := func() { + // Swallow write/flush errors, the auth failure is the relevant error. + resp := []byte{authRFC1929Ver, authRFC1929Fail} + req.conn.Write(resp[:]) + } + + // The client sends a Username/Password request. + // uint8_t ver (0x01) + // uint8_t ulen (>= 1) + // uint8_t uname[ulen] + // uint8_t plen (>= 1) + // uint8_t passwd[plen] + + if err = req.readByteVerify("auth version", authRFC1929Ver); err != nil { + sendErrResp() + return + } + + // Read the username. + var ulen byte + if ulen, err = req.readByte(); err != nil { + sendErrResp() + return + } else if ulen < 1 { + sendErrResp() + return fmt.Errorf("username with 0 length") + } + uname := make([]byte, ulen) + if _, err = io.ReadFull(req.conn, uname); err != nil { + sendErrResp() + return + } + + // Read the password. + var plen byte + if plen, err = req.readByte(); err != nil { + sendErrResp() + return + } else if plen < 1 { + sendErrResp() + return fmt.Errorf("password with 0 length") + } + passwd := make([]byte, plen) + if _, err = io.ReadFull(req.conn, passwd); err != nil { + sendErrResp() + return + } + + req.Auth.Uname = uname + req.Auth.Passwd = passwd + + resp := []byte{authRFC1929Ver, authRFC1929Success} + _, err = req.conn.Write(resp[:]) + return +} From 5ea1977322dbdbd3b1aaa2ee51e195992d2bc157 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Thu, 26 May 2016 10:40:36 +0000 Subject: [PATCH 02/28] Add socks server based on https://github.com/Yawning/or-ctl-filter/blob/master/proxy/socks.go --- socks_server_chain.go | 131 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 socks_server_chain.go diff --git a/socks_server_chain.go b/socks_server_chain.go new file mode 100644 index 0000000..1f185dc --- /dev/null +++ b/socks_server_chain.go @@ -0,0 +1,131 @@ +package main + +import ( + "io" + "net" + "os" + "sync" + + "github.com/subgraph/fw-daemon/socks5" +) + +type SocksChainConfig struct { + TargetSocksNet string + TargetSocksAddr string + ListenSocksNet string + ListenSocksAddr string +} + +type session struct { + cfg *SocksChainConfig + + clientConn net.Conn + upstreamConn net.Conn + + req *socks5.Request + bndAddr *socks5.Address + optData []byte +} + +// InitSocksListener initializes the SOCKS 5 server and starts +// accepting connections. +func InitSocksListener(cfg *SocksChainConfig, wg *sync.WaitGroup) { + ln, err := net.Listen(cfg.ListenSocksNet, cfg.ListenSocksAddr) + if err != nil { + log.Error("ERR/socks: Failed to listen on the socks address: %v", err) + os.Exit(1) + } + + wg.Add(1) + go socksAcceptLoop(cfg, ln, wg) +} + +func socksAcceptLoop(cfg *SocksChainConfig, ln net.Listener, wg *sync.WaitGroup) error { + defer wg.Done() + defer ln.Close() + + for { + conn, err := ln.Accept() + if err != nil { + if e, ok := err.(net.Error); ok && !e.Temporary() { + log.Info("ERR/socks: Failed to Accept(): %v", err) + return err + } + continue + } + s := &session{cfg: cfg, clientConn: conn} + go s.sessionWorker() + } +} + +func (s *session) sessionWorker() { + defer s.clientConn.Close() + + clientAddr := s.clientConn.RemoteAddr() + log.Info("INFO/socks: New connection from: %v", clientAddr) + + // Do the SOCKS handshake with the client, and read the command. + var err error + if s.req, err = socks5.Handshake(s.clientConn); err != nil { + log.Info("ERR/socks: Failed SOCKS5 handshake: %v", err) + return + } + + switch s.req.Cmd { + case socks5.CommandTorResolve, socks5.CommandTorResolvePTR: + err = s.dispatchTorSOCKS() + + // If we reach here, the request has been dispatched and completed. + if err == nil { + // Successfully even, send the response back with the address. + s.req.ReplyAddr(socks5.ReplySucceeded, s.bndAddr) + } + return + case socks5.CommandConnect: + default: + // Should *NEVER* happen, validated as part of handshake. + log.Info("BUG/socks: Unsupported SOCKS command: 0x%02x", s.req.Cmd) + s.req.Reply(socks5.ReplyCommandNotSupported) + return + } + + err = s.dispatchTorSOCKS() + if err != nil { + return + } + s.req.Reply(socks5.ReplySucceeded) + defer s.upstreamConn.Close() + + if s.optData != nil { + if _, err = s.upstreamConn.Write(s.optData); err != nil { + log.Info("ERR/socks: Failed writing OptData: %v", err) + return + } + s.optData = nil + } + + // A upstream connection has been established, push data back and forth + // till the session is done. + var wg sync.WaitGroup + wg.Add(2) + + copyLoop := func(dst, src net.Conn) { + defer wg.Done() + defer dst.Close() + + io.Copy(dst, src) + } + go copyLoop(s.upstreamConn, s.clientConn) + go copyLoop(s.clientConn, s.upstreamConn) + + wg.Wait() + log.Info("INFO/socks: Closed SOCKS connection from: %v", clientAddr) +} + +func (s *session) dispatchTorSOCKS() (err error) { + s.upstreamConn, s.bndAddr, err = socks5.Redispatch(s.cfg.TargetSocksNet, s.cfg.TargetSocksAddr, s.req) + if err != nil { + s.req.Reply(socks5.ErrorToReplyCode(err)) + } + return +} From 28e89eb149248b7cd57eaa9b9e4df8a0647ac722 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Thu, 26 May 2016 10:42:42 +0000 Subject: [PATCH 03/28] Start socks server right before running the blocking runFilter() --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 257decb..3caf134 100644 --- a/main.go +++ b/main.go @@ -168,5 +168,14 @@ func main() { }() */ + socksConfig := SocksChainConfig{ + TargetSocksNet: "tcp", + TargetSocksAddr: "127.0.0.1:9050", + ListenSocksNet: "tcp", + ListenSocksAddr: "127.0.0.1:8850", + } + wg := sync.WaitGroup{} + InitSocksListener(&socksConfig, &wg) + fw.runFilter() } From f87ac5639e81b058431e2762ea7dadd33c4548cb Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 10:08:31 +0000 Subject: [PATCH 04/28] Add work-in-progress unit tests for socks chain not yet working but a good start --- mortal_service.go | 139 +++++++++++++++++++++++++++++++++++++ socks_server_chain_test.go | 91 ++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 mortal_service.go create mode 100644 socks_server_chain_test.go diff --git a/mortal_service.go b/mortal_service.go new file mode 100644 index 0000000..b18fd14 --- /dev/null +++ b/mortal_service.go @@ -0,0 +1,139 @@ +package main + +import ( + "fmt" + "net" + "sync" + "time" +) + +// MortalService can be killed at any time. +type MortalService struct { + network string + address string + connectionCallback func(net.Conn) error + + conns []net.Conn + quit chan bool + listener net.Listener + waitGroup *sync.WaitGroup +} + +// NewMortalService creates a new MortalService +func NewMortalService(network, address string, connectionCallback func(net.Conn) error) *MortalService { + l := MortalService{ + network: network, + address: address, + connectionCallback: connectionCallback, + + conns: make([]net.Conn, 0, 10), + quit: make(chan bool), + waitGroup: &sync.WaitGroup{}, + } + return &l +} + +// Stop will kill our listener and all it's connections +func (l *MortalService) Stop() { + log.Info("stopping listener service %s:%s", l.network, l.address) + close(l.quit) + if l.listener != nil { + l.listener.Close() + } + l.waitGroup.Wait() +} + +func (l *MortalService) acceptLoop() { + defer l.waitGroup.Done() + defer func() { + log.Info("stoping listener service %s:%s", l.network, l.address) + for i, conn := range l.conns { + if conn != nil { + log.Info("Closing connection #%d", i) + conn.Close() + } + } + }() + defer l.listener.Close() + + for { + conn, err := l.listener.Accept() + if nil != err { + if opErr, ok := err.(*net.OpError); ok && opErr.Timeout() { + continue + } else { + log.Info("MortalService connection accept failure: %s\n", err) + select { + case <-l.quit: + return + default: + } + continue + } + } + + l.conns = append(l.conns, conn) + go l.handleConnection(conn, len(l.conns)-1) + } +} + +func (l *MortalService) createDeadlinedListener() error { + if l.network == "tcp" { + tcpAddr, err := net.ResolveTCPAddr("tcp", l.address) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + tcpListener, err := net.ListenTCP("tcp", tcpAddr) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + tcpListener.SetDeadline(time.Now().Add(1e9)) + l.listener = tcpListener + return nil + } else if l.network == "unix" { + unixAddr, err := net.ResolveUnixAddr("unix", l.address) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + unixListener, err := net.ListenUnix("unix", unixAddr) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + unixListener.SetDeadline(time.Now().Add(1e9)) + l.listener = unixListener + return nil + } else { + panic("") + } + return nil +} + +// Start the MortalService +func (l *MortalService) Start() error { + var err error + err = l.createDeadlinedListener() + if err != nil { + return err + } + l.waitGroup.Add(1) + go l.acceptLoop() + return nil +} + +func (l *MortalService) handleConnection(conn net.Conn, id int) error { + defer func() { + log.Info("Closing connection #%d", id) + conn.Close() + l.conns[id] = nil + }() + + log.Info("Starting connection #%d", id) + + for { + if err := l.connectionCallback(conn); err != nil { + log.Error(err.Error()) + return err + } + return nil + } +} diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go new file mode 100644 index 0000000..bc782f3 --- /dev/null +++ b/socks_server_chain_test.go @@ -0,0 +1,91 @@ +package main + +import ( + "bufio" + "bytes" + "fmt" + "golang.org/x/net/proxy" + "net" + "strings" + "sync" + "testing" +) + +type AccumulatingService struct { + net, address string + buffer bytes.Buffer + mortalService *MortalService + hasProtocolInfo bool + hasAuthenticate bool +} + +func NewAccumulatingService(net, address string) *AccumulatingService { + l := AccumulatingService{ + net: net, + address: address, + hasProtocolInfo: true, + hasAuthenticate: true, + } + return &l +} + +func (a *AccumulatingService) Start() { + a.mortalService = NewMortalService(a.net, a.address, a.SessionWorker) + a.mortalService.Start() +} + +func (a *AccumulatingService) Stop() { + fmt.Println("AccumulatingService STOP") + a.mortalService.Stop() +} + +func (a *AccumulatingService) SessionWorker(conn net.Conn) error { + connReader := bufio.NewReader(conn) + for { + + line, err := connReader.ReadBytes('\n') + if err != nil { + fmt.Println("AccumulatingService read error:", err) + } + lineStr := strings.TrimSpace(string(line)) + a.buffer.WriteString(lineStr + "\n") + } + return nil +} + +func TestSocksServerProxyChain(t *testing.T) { + socksConfig := SocksChainConfig{ + TargetSocksNet: "tcp", + TargetSocksAddr: "127.0.0.1:9050", + ListenSocksNet: "tcp", + ListenSocksAddr: "127.0.0.1:8850", + } + wg := sync.WaitGroup{} + InitSocksListener(&socksConfig, &wg) + + auth := proxy.Auth{ + User: "", + Password: "", + } + forward := proxy.NewPerHost(proxy.Direct, proxy.Direct) + + terminatingService := NewAccumulatingService("tcp", "127.0.0.1:1234") + terminatingService.Start() + + socksClient, err := proxy.SOCKS5("tcp", "127.0.0.1:8850", &auth, forward) + conn, err := socksClient.Dial("tcp", "127.0.0.1:1234") + + if err != nil { + panic(err) + } + + rd := bufio.NewReader(conn) + line := []byte{} + line, err = rd.ReadBytes('\n') + if err != nil { + panic(err) + } + fmt.Println("socks client received", string(line)) + + wg.Wait() +} From 50a9633db0a27fa469c37b88d34001c50b9ea7ec Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 20:11:11 +0000 Subject: [PATCH 05/28] work-in-progress unit tests for socks proxy chain --- socks_server_chain_test.go | 125 ++++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 21 deletions(-) diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index bc782f3..c506179 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -4,11 +4,14 @@ import ( "bufio" "bytes" "fmt" - "golang.org/x/net/proxy" + "io" "net" "strings" "sync" "testing" + + "github.com/subgraph/fw-daemon/socks5" + "golang.org/x/net/proxy" ) type AccumulatingService struct { @@ -17,6 +20,7 @@ type AccumulatingService struct { mortalService *MortalService hasProtocolInfo bool hasAuthenticate bool + receivedChan chan bool } func NewAccumulatingService(net, address string) *AccumulatingService { @@ -39,53 +43,132 @@ func (a *AccumulatingService) Stop() { a.mortalService.Stop() } +func (a *AccumulatingService) WaitUntilReceived() { + <-a.receivedChan +} + func (a *AccumulatingService) SessionWorker(conn net.Conn) error { connReader := bufio.NewReader(conn) for { line, err := connReader.ReadBytes('\n') if err != nil { - fmt.Println("AccumulatingService read error:", err) + panic(fmt.Sprintf("AccumulatingService read error: %s", err)) } lineStr := strings.TrimSpace(string(line)) a.buffer.WriteString(lineStr + "\n") + a.receivedChan <- true + } + return nil +} + +func fakeSocksSessionWorker(clientConn net.Conn, targetNet, targetAddr string) error { + defer clientConn.Close() + + clientAddr := clientConn.RemoteAddr() + fmt.Printf("INFO/socks: New connection from: %v\n", clientAddr) + + // Do the SOCKS handshake with the client, and read the command. + fmt.Println("meow1") + req, err := socks5.Handshake(clientConn) + if err != nil { + panic(fmt.Sprintf("ERR/socks: Failed SOCKS5 handshake: %v", err)) + } + + var upstreamConn net.Conn + upstreamConn, err = net.Dial(targetNet, targetAddr) + if err != nil { + panic(err) + } + fmt.Println("meow2") + defer upstreamConn.Close() + req.Reply(socks5.ReplySucceeded) + fmt.Println("meow3") + + // A upstream connection has been established, push data back and forth + // till the session is done. + var wg sync.WaitGroup + wg.Add(2) + + //upstreamConn.Write([]byte("meow 123\r\n")) + fmt.Println("meow4") + copyLoop := func(dst, src net.Conn) { + defer wg.Done() + defer dst.Close() + + io.Copy(dst, src) } + go copyLoop(upstreamConn, clientConn) + go copyLoop(clientConn, upstreamConn) + + fmt.Println("meow5") + + wg.Wait() + fmt.Printf("INFO/socks: Closed SOCKS connection from: %v\n", clientAddr) return nil } func TestSocksServerProxyChain(t *testing.T) { + // socks client ---> socks chain ---> socks server ---> service + socksChainNet := "tcp" + socksChainAddr := "127.0.0.1:7750" + socksServerNet := "tcp" + socksServerAddr := "127.0.0.1:8850" + serviceNet := "tcp" + serviceAddr := "127.0.0.1:9950" + + fmt.Println("foo1") + // setup the service listener + service := NewAccumulatingService(serviceNet, serviceAddr) + service.Start() + defer service.Stop() + + fmt.Println("foo2") + // setup the "socks server" + session := func(clientConn net.Conn) error { + return fakeSocksSessionWorker(clientConn, serviceNet, serviceAddr) + } + socksService := NewMortalService(socksServerNet, socksServerAddr, session) + socksService.Start() + defer socksService.Stop() + + fmt.Println("foo3") + // setup the SOCKS proxy chain socksConfig := SocksChainConfig{ - TargetSocksNet: "tcp", - TargetSocksAddr: "127.0.0.1:9050", - ListenSocksNet: "tcp", - ListenSocksAddr: "127.0.0.1:8850", + TargetSocksNet: socksServerNet, + TargetSocksAddr: socksServerAddr, + ListenSocksNet: socksChainNet, + ListenSocksAddr: socksChainAddr, } wg := sync.WaitGroup{} InitSocksListener(&socksConfig, &wg) + fmt.Println("foo4") + // setup the SOCKS client auth := proxy.Auth{ User: "", Password: "", } forward := proxy.NewPerHost(proxy.Direct, proxy.Direct) - - terminatingService := NewAccumulatingService("tcp", "127.0.0.1:1234") - terminatingService.Start() - - socksClient, err := proxy.SOCKS5("tcp", "127.0.0.1:8850", &auth, forward) - conn, err := socksClient.Dial("tcp", "127.0.0.1:1234") - + socksClient, err := proxy.SOCKS5(socksChainNet, socksChainAddr, &auth, forward) + conn, err := socksClient.Dial(serviceNet, serviceAddr) if err != nil { panic(err) } - rd := bufio.NewReader(conn) - line := []byte{} - line, err = rd.ReadBytes('\n') - if err != nil { - panic(err) - } - fmt.Println("socks client received", string(line)) + fmt.Println("foo5") + conn.Write([]byte("meow 123\r\n")) + service.WaitUntilReceived() + fmt.Println("DATA RECEIVED", service.buffer.String()) + fmt.Println("foo6") + // read a banner from the service + //rd := bufio.NewReader(conn) + //line := []byte{} + //line, err = rd.ReadBytes('\n') + //if err != nil { + // panic(err) + //} + //fmt.Println("socks client received", string(line)) - wg.Wait() + //wg.Wait() } From 94258abb365aefd04ea652a3e024a807d7af14e1 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 20:48:24 +0000 Subject: [PATCH 06/28] Make the test receive a banner through the proxy chain from the service --- socks_server_chain_test.go | 44 ++++++++++++++------------------------ 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index c506179..9656607 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -16,6 +16,7 @@ import ( type AccumulatingService struct { net, address string + banner string buffer bytes.Buffer mortalService *MortalService hasProtocolInfo bool @@ -23,10 +24,11 @@ type AccumulatingService struct { receivedChan chan bool } -func NewAccumulatingService(net, address string) *AccumulatingService { +func NewAccumulatingService(net, address, banner string) *AccumulatingService { l := AccumulatingService{ net: net, address: address, + banner: banner, hasProtocolInfo: true, hasAuthenticate: true, } @@ -49,8 +51,8 @@ func (a *AccumulatingService) WaitUntilReceived() { func (a *AccumulatingService) SessionWorker(conn net.Conn) error { connReader := bufio.NewReader(conn) + conn.Write([]byte(a.banner)) for { - line, err := connReader.ReadBytes('\n') if err != nil { panic(fmt.Sprintf("AccumulatingService read error: %s", err)) @@ -69,7 +71,6 @@ func fakeSocksSessionWorker(clientConn net.Conn, targetNet, targetAddr string) e fmt.Printf("INFO/socks: New connection from: %v\n", clientAddr) // Do the SOCKS handshake with the client, and read the command. - fmt.Println("meow1") req, err := socks5.Handshake(clientConn) if err != nil { panic(fmt.Sprintf("ERR/socks: Failed SOCKS5 handshake: %v", err)) @@ -80,18 +81,15 @@ func fakeSocksSessionWorker(clientConn net.Conn, targetNet, targetAddr string) e if err != nil { panic(err) } - fmt.Println("meow2") defer upstreamConn.Close() req.Reply(socks5.ReplySucceeded) - fmt.Println("meow3") // A upstream connection has been established, push data back and forth // till the session is done. var wg sync.WaitGroup wg.Add(2) - //upstreamConn.Write([]byte("meow 123\r\n")) - fmt.Println("meow4") + //clientConn.Write([]byte("meow 123\r\n")) copyLoop := func(dst, src net.Conn) { defer wg.Done() defer dst.Close() @@ -101,8 +99,6 @@ func fakeSocksSessionWorker(clientConn net.Conn, targetNet, targetAddr string) e go copyLoop(upstreamConn, clientConn) go copyLoop(clientConn, upstreamConn) - fmt.Println("meow5") - wg.Wait() fmt.Printf("INFO/socks: Closed SOCKS connection from: %v\n", clientAddr) return nil @@ -117,13 +113,12 @@ func TestSocksServerProxyChain(t *testing.T) { serviceNet := "tcp" serviceAddr := "127.0.0.1:9950" - fmt.Println("foo1") + banner := "meow 123\r\n" // setup the service listener - service := NewAccumulatingService(serviceNet, serviceAddr) + service := NewAccumulatingService(serviceNet, serviceAddr, banner) service.Start() defer service.Stop() - fmt.Println("foo2") // setup the "socks server" session := func(clientConn net.Conn) error { return fakeSocksSessionWorker(clientConn, serviceNet, serviceAddr) @@ -132,7 +127,6 @@ func TestSocksServerProxyChain(t *testing.T) { socksService.Start() defer socksService.Stop() - fmt.Println("foo3") // setup the SOCKS proxy chain socksConfig := SocksChainConfig{ TargetSocksNet: socksServerNet, @@ -143,7 +137,6 @@ func TestSocksServerProxyChain(t *testing.T) { wg := sync.WaitGroup{} InitSocksListener(&socksConfig, &wg) - fmt.Println("foo4") // setup the SOCKS client auth := proxy.Auth{ User: "", @@ -156,19 +149,14 @@ func TestSocksServerProxyChain(t *testing.T) { panic(err) } - fmt.Println("foo5") - conn.Write([]byte("meow 123\r\n")) - service.WaitUntilReceived() - fmt.Println("DATA RECEIVED", service.buffer.String()) - fmt.Println("foo6") // read a banner from the service - //rd := bufio.NewReader(conn) - //line := []byte{} - //line, err = rd.ReadBytes('\n') - //if err != nil { - // panic(err) - //} - //fmt.Println("socks client received", string(line)) - - //wg.Wait() + rd := bufio.NewReader(conn) + line := []byte{} + line, err = rd.ReadBytes('\n') + if err != nil { + panic(err) + } + if string(line) != banner { + t.Errorf("Did not receive expected banner. Got %s, wanted %s\n", string(line), banner) + } } From 40108ae22755cc58c2c54dca3e1c4399f1607eb1 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 21:02:17 +0000 Subject: [PATCH 07/28] Get rid of useless panic statement --- socks_server_chain_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index 9656607..b49f7b2 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -55,7 +55,7 @@ func (a *AccumulatingService) SessionWorker(conn net.Conn) error { for { line, err := connReader.ReadBytes('\n') if err != nil { - panic(fmt.Sprintf("AccumulatingService read error: %s", err)) + fmt.Printf("AccumulatingService read error: %s\n", err) } lineStr := strings.TrimSpace(string(line)) a.buffer.WriteString(lineStr + "\n") From 7c702b576833c24bd2d646935dfaebc83b2785a5 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 21:16:11 +0000 Subject: [PATCH 08/28] Fix test so that client sends a response and we verify the service gets it --- socks_server_chain_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index b49f7b2..2a7cd5e 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -31,6 +31,7 @@ func NewAccumulatingService(net, address, banner string) *AccumulatingService { banner: banner, hasProtocolInfo: true, hasAuthenticate: true, + receivedChan: make(chan bool, 0), } return &l } @@ -158,5 +159,15 @@ func TestSocksServerProxyChain(t *testing.T) { } if string(line) != banner { t.Errorf("Did not receive expected banner. Got %s, wanted %s\n", string(line), banner) + t.Fail() + } + + // send the service some data and verify it was received + clientData := "hello world\r\n" + conn.Write([]byte(clientData)) + service.WaitUntilReceived() + if service.buffer.String() != strings.TrimSpace(clientData)+"\n" { + t.Errorf("Client sent %s but service only received %s\n", "hello world\n", service.buffer.String()) + t.Fail() } } From c2636d8f973b34044abb2b1952944cd2800c71d4 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 21:19:21 +0000 Subject: [PATCH 09/28] Move all test code to one file for now --- mortal_service.go | 139 ------------------------------------- socks_server_chain_test.go | 132 +++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 139 deletions(-) delete mode 100644 mortal_service.go diff --git a/mortal_service.go b/mortal_service.go deleted file mode 100644 index b18fd14..0000000 --- a/mortal_service.go +++ /dev/null @@ -1,139 +0,0 @@ -package main - -import ( - "fmt" - "net" - "sync" - "time" -) - -// MortalService can be killed at any time. -type MortalService struct { - network string - address string - connectionCallback func(net.Conn) error - - conns []net.Conn - quit chan bool - listener net.Listener - waitGroup *sync.WaitGroup -} - -// NewMortalService creates a new MortalService -func NewMortalService(network, address string, connectionCallback func(net.Conn) error) *MortalService { - l := MortalService{ - network: network, - address: address, - connectionCallback: connectionCallback, - - conns: make([]net.Conn, 0, 10), - quit: make(chan bool), - waitGroup: &sync.WaitGroup{}, - } - return &l -} - -// Stop will kill our listener and all it's connections -func (l *MortalService) Stop() { - log.Info("stopping listener service %s:%s", l.network, l.address) - close(l.quit) - if l.listener != nil { - l.listener.Close() - } - l.waitGroup.Wait() -} - -func (l *MortalService) acceptLoop() { - defer l.waitGroup.Done() - defer func() { - log.Info("stoping listener service %s:%s", l.network, l.address) - for i, conn := range l.conns { - if conn != nil { - log.Info("Closing connection #%d", i) - conn.Close() - } - } - }() - defer l.listener.Close() - - for { - conn, err := l.listener.Accept() - if nil != err { - if opErr, ok := err.(*net.OpError); ok && opErr.Timeout() { - continue - } else { - log.Info("MortalService connection accept failure: %s\n", err) - select { - case <-l.quit: - return - default: - } - continue - } - } - - l.conns = append(l.conns, conn) - go l.handleConnection(conn, len(l.conns)-1) - } -} - -func (l *MortalService) createDeadlinedListener() error { - if l.network == "tcp" { - tcpAddr, err := net.ResolveTCPAddr("tcp", l.address) - if err != nil { - return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) - } - tcpListener, err := net.ListenTCP("tcp", tcpAddr) - if err != nil { - return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) - } - tcpListener.SetDeadline(time.Now().Add(1e9)) - l.listener = tcpListener - return nil - } else if l.network == "unix" { - unixAddr, err := net.ResolveUnixAddr("unix", l.address) - if err != nil { - return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) - } - unixListener, err := net.ListenUnix("unix", unixAddr) - if err != nil { - return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) - } - unixListener.SetDeadline(time.Now().Add(1e9)) - l.listener = unixListener - return nil - } else { - panic("") - } - return nil -} - -// Start the MortalService -func (l *MortalService) Start() error { - var err error - err = l.createDeadlinedListener() - if err != nil { - return err - } - l.waitGroup.Add(1) - go l.acceptLoop() - return nil -} - -func (l *MortalService) handleConnection(conn net.Conn, id int) error { - defer func() { - log.Info("Closing connection #%d", id) - conn.Close() - l.conns[id] = nil - }() - - log.Info("Starting connection #%d", id) - - for { - if err := l.connectionCallback(conn); err != nil { - log.Error(err.Error()) - return err - } - return nil - } -} diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index 2a7cd5e..1ea99c3 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -9,11 +9,143 @@ import ( "strings" "sync" "testing" + "time" "github.com/subgraph/fw-daemon/socks5" "golang.org/x/net/proxy" ) +// MortalService can be killed at any time. +type MortalService struct { + network string + address string + connectionCallback func(net.Conn) error + + conns []net.Conn + quit chan bool + listener net.Listener + waitGroup *sync.WaitGroup +} + +// NewMortalService creates a new MortalService +func NewMortalService(network, address string, connectionCallback func(net.Conn) error) *MortalService { + l := MortalService{ + network: network, + address: address, + connectionCallback: connectionCallback, + + conns: make([]net.Conn, 0, 10), + quit: make(chan bool), + waitGroup: &sync.WaitGroup{}, + } + return &l +} + +// Stop will kill our listener and all it's connections +func (l *MortalService) Stop() { + log.Info("stopping listener service %s:%s", l.network, l.address) + close(l.quit) + if l.listener != nil { + l.listener.Close() + } + l.waitGroup.Wait() +} + +func (l *MortalService) acceptLoop() { + defer l.waitGroup.Done() + defer func() { + log.Info("stoping listener service %s:%s", l.network, l.address) + for i, conn := range l.conns { + if conn != nil { + log.Info("Closing connection #%d", i) + conn.Close() + } + } + }() + defer l.listener.Close() + + for { + conn, err := l.listener.Accept() + if nil != err { + if opErr, ok := err.(*net.OpError); ok && opErr.Timeout() { + continue + } else { + log.Info("MortalService connection accept failure: %s\n", err) + select { + case <-l.quit: + return + default: + } + continue + } + } + + l.conns = append(l.conns, conn) + go l.handleConnection(conn, len(l.conns)-1) + } +} + +func (l *MortalService) createDeadlinedListener() error { + if l.network == "tcp" { + tcpAddr, err := net.ResolveTCPAddr("tcp", l.address) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + tcpListener, err := net.ListenTCP("tcp", tcpAddr) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + tcpListener.SetDeadline(time.Now().Add(1e9)) + l.listener = tcpListener + return nil + } else if l.network == "unix" { + unixAddr, err := net.ResolveUnixAddr("unix", l.address) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + unixListener, err := net.ListenUnix("unix", unixAddr) + if err != nil { + return fmt.Errorf("MortalService.createDeadlinedListener %s %s failure: %s", l.network, l.address, err) + } + unixListener.SetDeadline(time.Now().Add(1e9)) + l.listener = unixListener + return nil + } else { + panic("") + } + return nil +} + +// Start the MortalService +func (l *MortalService) Start() error { + var err error + err = l.createDeadlinedListener() + if err != nil { + return err + } + l.waitGroup.Add(1) + go l.acceptLoop() + return nil +} + +func (l *MortalService) handleConnection(conn net.Conn, id int) error { + defer func() { + log.Info("Closing connection #%d", id) + conn.Close() + l.conns[id] = nil + }() + + log.Info("Starting connection #%d", id) + + for { + if err := l.connectionCallback(conn); err != nil { + log.Error(err.Error()) + return err + } + return nil + } +} + type AccumulatingService struct { net, address string banner string From 9c58cc315ccd1bd0d950cc8b061b7eac171294b4 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 21:32:57 +0000 Subject: [PATCH 10/28] remove superfluous comment --- socks_server_chain_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index 1ea99c3..c8e233d 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -221,8 +221,6 @@ func fakeSocksSessionWorker(clientConn net.Conn, targetNet, targetAddr string) e // till the session is done. var wg sync.WaitGroup wg.Add(2) - //upstreamConn.Write([]byte("meow 123\r\n")) - //clientConn.Write([]byte("meow 123\r\n")) copyLoop := func(dst, src net.Conn) { defer wg.Done() defer dst.Close() From 61039af4e39798f857ffd5a0dd51f005915e6e7d Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 21:52:19 +0000 Subject: [PATCH 11/28] Move process signal subscribe to Main this is so that we can respond to signals with components outside of the Firewall... in this case i'm thinking of the SOCKS proxy chain service --- main.go | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/main.go b/main.go index 3caf134..09ff35e 100644 --- a/main.go +++ b/main.go @@ -60,6 +60,9 @@ type Firewall struct { ruleLock sync.Mutex rulesById map[uint]*Rule nextRuleId uint + + reloadRulesChan chan bool + stopChan chan bool } func (fw *Firewall) setEnabled(flag bool) { @@ -103,6 +106,14 @@ func (fw *Firewall) getRuleById(id uint) *Rule { return fw.rulesById[id] } +func (fw *Firewall) stop() { + fw.stopChan <- true +} + +func (fw *Firewall) reloadRules() { + fw.reloadRulesChan <- true +} + func (fw *Firewall) runFilter() { q := nfqueue.NewNFQueue(0) defer q.Destroy() @@ -111,12 +122,6 @@ func (fw *Firewall) runFilter() { q.Timeout = 5 * time.Minute packets := q.Process() - sigKillChan := make(chan os.Signal, 1) - signal.Notify(sigKillChan, os.Interrupt, os.Kill) - - sigHupChan := make(chan os.Signal, 1) - signal.Notify(sigHupChan, syscall.SIGHUP) - for { select { case pkt := <-packets: @@ -125,9 +130,9 @@ func (fw *Firewall) runFilter() { } else { pkt.Accept() } - case <-sigHupChan: + case <-fw.reloadRulesChan: fw.loadRules() - case <-sigKillChan: + case <-fw.stopChan: return } } @@ -152,11 +157,13 @@ func main() { } fw := &Firewall{ - dbus: ds, - dns: NewDnsCache(), - enabled: true, - logBackend: logBackend, - policyMap: make(map[string]*Policy), + dbus: ds, + dns: NewDnsCache(), + enabled: true, + logBackend: logBackend, + policyMap: make(map[string]*Policy), + reloadRulesChan: make(chan bool, 0), + stopChan: make(chan bool, 0), } ds.fw = fw @@ -176,6 +183,24 @@ func main() { } wg := sync.WaitGroup{} InitSocksListener(&socksConfig, &wg) - fw.runFilter() + + // observe process signals and either + // reload rules or shutdown firewall service + sigKillChan := make(chan os.Signal, 1) + signal.Notify(sigKillChan, os.Interrupt, os.Kill) + + sigHupChan := make(chan os.Signal, 1) + signal.Notify(sigHupChan, syscall.SIGHUP) + + for { + select { + case <-sigHupChan: + fw.reloadRules() + // XXX perhaps restart SOCKS proxy chain service? + case <-sigKillChan: + fw.stop() + return + } + } } From d0ee559a917b0c1ec8488615bdaf97e1bde97cde Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 30 May 2016 23:18:06 +0000 Subject: [PATCH 12/28] Replace hardcoded socks proxy chain with json config file --- main.go | 61 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 09ff35e..85d2137 100644 --- a/main.go +++ b/main.go @@ -2,16 +2,20 @@ package main import ( // _ "net/http/pprof" + "bufio" + "encoding/json" "os" "os/signal" + "regexp" + "strings" + "sync" + "syscall" "time" + "unsafe" "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" "github.com/subgraph/fw-daemon/nfqueue" "github.com/subgraph/fw-daemon/proc" - "sync" - "syscall" - "unsafe" ) var log = logging.MustGetLogger("sgfw") @@ -138,7 +142,52 @@ func (fw *Firewall) runFilter() { } } +type SocksJsonConfig struct { + SocksListener string + TorSocks string +} + +var commentRegexp = regexp.MustCompile("^[ \t]*#") + +func loadConfiguration(configFilePath string) (*SocksJsonConfig, error) { + config := SocksJsonConfig{} + file, err := os.Open(configFilePath) + if err != nil { + return nil, err + } + scanner := bufio.NewScanner(file) + bs := "" + for scanner.Scan() { + line := scanner.Text() + if !commentRegexp.MatchString(line) { + bs += line + "\n" + } + } + if err := json.Unmarshal([]byte(bs), &config); err != nil { + return nil, err + } + return &config, nil +} + func main() { + config, err := loadConfiguration("/etc/fw-daemon-socks.json") + if err != nil { + panic(err) + } + // XXX + fields := strings.Split(config.TorSocks, ":") + torSocksNet := fields[0] + torSocksAddr := fields[1] + fields = strings.Split(config.SocksListener, ":") + socksListenNet := fields[0] + socksListenAddr := fields[1] + socksConfig := SocksChainConfig{ + TargetSocksNet: torSocksNet, + TargetSocksAddr: torSocksAddr, + ListenSocksNet: socksListenNet, + ListenSocksAddr: socksListenAddr, + } + logBackend := setupLoggerBackend() log.SetBackend(logBackend) proc.SetLogger(log) @@ -175,12 +224,6 @@ func main() { }() */ - socksConfig := SocksChainConfig{ - TargetSocksNet: "tcp", - TargetSocksAddr: "127.0.0.1:9050", - ListenSocksNet: "tcp", - ListenSocksAddr: "127.0.0.1:8850", - } wg := sync.WaitGroup{} InitSocksListener(&socksConfig, &wg) fw.runFilter() From 0b04df458268749a6769220494f5df8a0a6566f9 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Wed, 1 Jun 2016 13:51:29 +0000 Subject: [PATCH 13/28] Pass the dbusServer to the SOCKS5 proxy chain --- main.go | 25 +++++++---- socks_server_chain.go | 91 ++++++++++++++++++++++---------------- socks_server_chain_test.go | 6 ++- 3 files changed, 74 insertions(+), 48 deletions(-) diff --git a/main.go b/main.go index 85d2137..9d90446 100644 --- a/main.go +++ b/main.go @@ -169,11 +169,7 @@ func loadConfiguration(configFilePath string) (*SocksJsonConfig, error) { return &config, nil } -func main() { - config, err := loadConfiguration("/etc/fw-daemon-socks.json") - if err != nil { - panic(err) - } +func getSocksChainConfig(config *SocksJsonConfig) *socksChainConfig { // XXX fields := strings.Split(config.TorSocks, ":") torSocksNet := fields[0] @@ -181,12 +177,23 @@ func main() { fields = strings.Split(config.SocksListener, ":") socksListenNet := fields[0] socksListenAddr := fields[1] - socksConfig := SocksChainConfig{ + socksConfig := socksChainConfig{ TargetSocksNet: torSocksNet, TargetSocksAddr: torSocksAddr, ListenSocksNet: socksListenNet, ListenSocksAddr: socksListenAddr, } + return &socksConfig +} + +func main() { + // XXX should this really be hardcoded? + // or should i add a CLI to specify config file location? + config, err := loadConfiguration("/etc/fw-daemon-socks.json") + if err != nil { + panic(err) + } + socksConfig := getSocksChainConfig(config) logBackend := setupLoggerBackend() log.SetBackend(logBackend) @@ -225,7 +232,9 @@ func main() { */ wg := sync.WaitGroup{} - InitSocksListener(&socksConfig, &wg) + chain := NewSocksChain(socksConfig, &wg, ds) + chain.start() + fw.runFilter() // observe process signals and either @@ -240,7 +249,7 @@ func main() { select { case <-sigHupChan: fw.reloadRules() - // XXX perhaps restart SOCKS proxy chain service? + // XXX perhaps restart SOCKS proxy chain service with new proxy config specification? case <-sigKillChan: fw.stop() return diff --git a/socks_server_chain.go b/socks_server_chain.go index 1f185dc..6d95f3d 100644 --- a/socks_server_chain.go +++ b/socks_server_chain.go @@ -9,43 +9,58 @@ import ( "github.com/subgraph/fw-daemon/socks5" ) -type SocksChainConfig struct { +type socksChainConfig struct { TargetSocksNet string TargetSocksAddr string ListenSocksNet string ListenSocksAddr string } -type session struct { - cfg *SocksChainConfig +type socksChain struct { + cfg *socksChainConfig + dbus *dbusServer + listener net.Listener + wg *sync.WaitGroup +} +type socksChainSession struct { + cfg *socksChainConfig clientConn net.Conn upstreamConn net.Conn + req *socks5.Request + bndAddr *socks5.Address + optData []byte +} - req *socks5.Request - bndAddr *socks5.Address - optData []byte +func NewSocksChain(cfg *socksChainConfig, wg *sync.WaitGroup, dbus *dbusServer) *socksChain { + chain := socksChain{ + cfg: cfg, + dbus: dbus, + wg: wg, + } + return &chain } -// InitSocksListener initializes the SOCKS 5 server and starts +// Start initializes the SOCKS 5 server and starts // accepting connections. -func InitSocksListener(cfg *SocksChainConfig, wg *sync.WaitGroup) { - ln, err := net.Listen(cfg.ListenSocksNet, cfg.ListenSocksAddr) +func (s *socksChain) start() { + var err error + s.listener, err = net.Listen(s.cfg.ListenSocksNet, s.cfg.ListenSocksAddr) if err != nil { log.Error("ERR/socks: Failed to listen on the socks address: %v", err) os.Exit(1) } - wg.Add(1) - go socksAcceptLoop(cfg, ln, wg) + s.wg.Add(1) + go s.socksAcceptLoop() } -func socksAcceptLoop(cfg *SocksChainConfig, ln net.Listener, wg *sync.WaitGroup) error { - defer wg.Done() - defer ln.Close() +func (s *socksChain) socksAcceptLoop() error { + defer s.wg.Done() + defer s.listener.Close() for { - conn, err := ln.Accept() + conn, err := s.listener.Accept() if err != nil { if e, ok := err.(net.Error); ok && !e.Temporary() { log.Info("ERR/socks: Failed to Accept(): %v", err) @@ -53,55 +68,55 @@ func socksAcceptLoop(cfg *SocksChainConfig, ln net.Listener, wg *sync.WaitGroup) } continue } - s := &session{cfg: cfg, clientConn: conn} - go s.sessionWorker() + session := &socksChainSession{cfg: s.cfg, clientConn: conn} + go session.sessionWorker() } } -func (s *session) sessionWorker() { - defer s.clientConn.Close() +func (c *socksChainSession) sessionWorker() { + defer c.clientConn.Close() - clientAddr := s.clientConn.RemoteAddr() + clientAddr := c.clientConn.RemoteAddr() log.Info("INFO/socks: New connection from: %v", clientAddr) // Do the SOCKS handshake with the client, and read the command. var err error - if s.req, err = socks5.Handshake(s.clientConn); err != nil { + if c.req, err = socks5.Handshake(c.clientConn); err != nil { log.Info("ERR/socks: Failed SOCKS5 handshake: %v", err) return } - switch s.req.Cmd { + switch c.req.Cmd { case socks5.CommandTorResolve, socks5.CommandTorResolvePTR: - err = s.dispatchTorSOCKS() + err = c.dispatchTorSOCKS() // If we reach here, the request has been dispatched and completed. if err == nil { - // Successfully even, send the response back with the address. - s.req.ReplyAddr(socks5.ReplySucceeded, s.bndAddr) + // Successfully even, send the response back with the addresc. + c.req.ReplyAddr(socks5.ReplySucceeded, c.bndAddr) } return case socks5.CommandConnect: default: // Should *NEVER* happen, validated as part of handshake. - log.Info("BUG/socks: Unsupported SOCKS command: 0x%02x", s.req.Cmd) - s.req.Reply(socks5.ReplyCommandNotSupported) + log.Info("BUG/socks: Unsupported SOCKS command: 0x%02x", c.req.Cmd) + c.req.Reply(socks5.ReplyCommandNotSupported) return } - err = s.dispatchTorSOCKS() + err = c.dispatchTorSOCKS() if err != nil { return } - s.req.Reply(socks5.ReplySucceeded) - defer s.upstreamConn.Close() + c.req.Reply(socks5.ReplySucceeded) + defer c.upstreamConn.Close() - if s.optData != nil { - if _, err = s.upstreamConn.Write(s.optData); err != nil { + if c.optData != nil { + if _, err = c.upstreamConn.Write(c.optData); err != nil { log.Info("ERR/socks: Failed writing OptData: %v", err) return } - s.optData = nil + c.optData = nil } // A upstream connection has been established, push data back and forth @@ -115,17 +130,17 @@ func (s *session) sessionWorker() { io.Copy(dst, src) } - go copyLoop(s.upstreamConn, s.clientConn) - go copyLoop(s.clientConn, s.upstreamConn) + go copyLoop(c.upstreamConn, c.clientConn) + go copyLoop(c.clientConn, c.upstreamConn) wg.Wait() log.Info("INFO/socks: Closed SOCKS connection from: %v", clientAddr) } -func (s *session) dispatchTorSOCKS() (err error) { - s.upstreamConn, s.bndAddr, err = socks5.Redispatch(s.cfg.TargetSocksNet, s.cfg.TargetSocksAddr, s.req) +func (c *socksChainSession) dispatchTorSOCKS() (err error) { + c.upstreamConn, c.bndAddr, err = socks5.Redispatch(c.cfg.TargetSocksNet, c.cfg.TargetSocksAddr, c.req) if err != nil { - s.req.Reply(socks5.ErrorToReplyCode(err)) + c.req.Reply(socks5.ErrorToReplyCode(err)) } return } diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index c8e233d..4fc71be 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -259,14 +259,16 @@ func TestSocksServerProxyChain(t *testing.T) { defer socksService.Stop() // setup the SOCKS proxy chain - socksConfig := SocksChainConfig{ + socksConfig := socksChainConfig{ TargetSocksNet: socksServerNet, TargetSocksAddr: socksServerAddr, ListenSocksNet: socksChainNet, ListenSocksAddr: socksChainAddr, } wg := sync.WaitGroup{} - InitSocksListener(&socksConfig, &wg) + ds := dbusServer{} + chain := NewSocksChain(&socksConfig, &wg, &ds) + chain.start() // setup the SOCKS client auth := proxy.Auth{ From 476745090a25fa8eabd4872c5c6ec513b2fb2d7a Mon Sep 17 00:00:00 2001 From: David Stainton Date: Thu, 2 Jun 2016 08:48:26 +0000 Subject: [PATCH 14/28] WIP --- socks_server_chain.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/socks_server_chain.go b/socks_server_chain.go index 6d95f3d..ab859fc 100644 --- a/socks_server_chain.go +++ b/socks_server_chain.go @@ -86,6 +86,16 @@ func (c *socksChainSession) sessionWorker() { return } + pinfo := c.findProcessForConnection(c.clientConn) + if pinfo == nil { + log.Warning("No proc found for %s", printPacket(pkt, fw.dns.Lookup(pkt.Dst))) + pkt.Accept() + return + } + + // target address of the socks connection + addr := c.req.Addr.String() + switch c.req.Cmd { case socks5.CommandTorResolve, socks5.CommandTorResolvePTR: err = c.dispatchTorSOCKS() From bcbed86e37d69e9e2de099d1e2f02037f2ff1eaf Mon Sep 17 00:00:00 2001 From: David Stainton Date: Thu, 2 Jun 2016 09:12:52 +0000 Subject: [PATCH 15/28] Use go-procsnitch, remove code duplication --- dbus.go | 5 +- main.go | 13 +-- policy.go | 12 +-- proc/proc.go | 200 ----------------------------------------------- proc/proc_pid.go | 149 ----------------------------------- proc/socket.go | 99 ----------------------- prompt.go | 2 +- rules.go | 12 +-- 8 files changed, 23 insertions(+), 469 deletions(-) delete mode 100644 proc/proc.go delete mode 100644 proc/proc_pid.go delete mode 100644 proc/socket.go diff --git a/dbus.go b/dbus.go index f70b628..9d024de 100644 --- a/dbus.go +++ b/dbus.go @@ -3,12 +3,13 @@ package main import ( "errors" "fmt" + "path" "strings" + "github.com/op/go-logging" "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus" "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus/introspect" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" - "path" + // "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" ) const introspectXml = ` diff --git a/main.go b/main.go index 257decb..77a2ea3 100644 --- a/main.go +++ b/main.go @@ -4,14 +4,15 @@ import ( // _ "net/http/pprof" "os" "os/signal" - "time" - - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" - "github.com/subgraph/fw-daemon/nfqueue" - "github.com/subgraph/fw-daemon/proc" "sync" "syscall" + "time" "unsafe" + + "github.com/op/go-logging" + "github.com/subgraph/fw-daemon/nfqueue" + "github.com/subgraph/go-procsnitch" + // "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" ) var log = logging.MustGetLogger("sgfw") @@ -136,7 +137,7 @@ func (fw *Firewall) runFilter() { func main() { logBackend := setupLoggerBackend() log.SetBackend(logBackend) - proc.SetLogger(log) + procsnitch.SetLogger(log) if os.Geteuid() != 0 { log.Error("Must be run as root") diff --git a/policy.go b/policy.go index bec5f0f..f76f3b5 100644 --- a/policy.go +++ b/policy.go @@ -5,14 +5,14 @@ import ( "sync" "github.com/subgraph/fw-daemon/nfqueue" - "github.com/subgraph/fw-daemon/proc" + "github.com/subgraph/go-procsnitch" ) type pendingPkt struct { policy *Policy hostname string pkt *nfqueue.Packet - pinfo *proc.ProcInfo + pinfo *procsnitch.Info } type Policy struct { @@ -43,7 +43,7 @@ func (fw *Firewall) policyForPath(path string) *Policy { return fw.policyMap[path] } -func (p *Policy) processPacket(pkt *nfqueue.Packet, pinfo *proc.ProcInfo) { +func (p *Policy) processPacket(pkt *nfqueue.Packet, pinfo *procsnitch.Info) { p.lock.Lock() defer p.lock.Unlock() name := p.fw.dns.Lookup(pkt.Dst) @@ -214,12 +214,12 @@ func (fw *Firewall) filterPacket(pkt *nfqueue.Packet) { policy.processPacket(pkt, pinfo) } -func findProcessForPacket(pkt *nfqueue.Packet) *proc.ProcInfo { +func findProcessForPacket(pkt *nfqueue.Packet) *procsnitch.Info { switch pkt.Protocol { case nfqueue.TCP: - return proc.LookupTCPSocketProcess(pkt.SrcPort, pkt.Dst, pkt.DstPort) + return procsnitch.LookupTCPSocketProcess(pkt.SrcPort, pkt.Dst, pkt.DstPort) case nfqueue.UDP: - return proc.LookupUDPSocketProcess(pkt.SrcPort) + return procsnitch.LookupUDPSocketProcess(pkt.SrcPort) default: log.Warning("Packet has unknown protocol: %d", pkt.Protocol) return nil diff --git a/proc/proc.go b/proc/proc.go deleted file mode 100644 index 939ebc4..0000000 --- a/proc/proc.go +++ /dev/null @@ -1,200 +0,0 @@ -package proc - -import ( - "encoding/hex" - "errors" - "fmt" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" - "io/ioutil" - "net" - "strconv" - "strings" -) - -var log = logging.MustGetLogger("proc") - -func SetLogger(logger *logging.Logger) { - log = logger -} - -var pcache = &pidCache{} - -func LookupUDPSocketProcess(srcPort uint16) *ProcInfo { - ss := findUDPSocket(srcPort) - if ss == nil { - return nil - } - return pcache.lookup(ss.inode) -} - -func LookupTCPSocketProcess(srcPort uint16, dstAddr net.IP, dstPort uint16) *ProcInfo { - ss := findTCPSocket(srcPort, dstAddr, dstPort) - if ss == nil { - return nil - } - return pcache.lookup(ss.inode) -} - -type ConnectionInfo struct { - pinfo *ProcInfo - local *socketAddr - remote *socketAddr -} - -func (ci *ConnectionInfo) String() string { - return fmt.Sprintf("%v %s %s", ci.pinfo, ci.local, ci.remote) -} - -func (sa *socketAddr) parse(s string) error { - ipPort := strings.Split(s, ":") - if len(ipPort) != 2 { - return fmt.Errorf("badly formatted socket address field: %s", s) - } - ip, err := ParseIp(ipPort[0]) - if err != nil { - return fmt.Errorf("error parsing ip field [%s]: %v", ipPort[0], err) - } - port, err := ParsePort(ipPort[1]) - if err != nil { - return fmt.Errorf("error parsing port field [%s]: %v", ipPort[1], err) - } - sa.ip = ip - sa.port = port - return nil -} - -func ParseIp(ip string) (net.IP, error) { - var result net.IP - dst, err := hex.DecodeString(ip) - if err != nil { - return result, fmt.Errorf("Error parsing IP: %s", err) - } - // Reverse byte order -- /proc/net/tcp etc. is little-endian - // TODO: Does this vary by architecture? - for i, j := 0, len(dst)-1; i < j; i, j = i+1, j-1 { - dst[i], dst[j] = dst[j], dst[i] - } - result = net.IP(dst) - return result, nil -} - -func ParsePort(port string) (uint16, error) { - p64, err := strconv.ParseInt(port, 16, 32) - if err != nil { - return 0, fmt.Errorf("Error parsing port: %s", err) - } - return uint16(p64), nil -} - -func getConnections() ([]*ConnectionInfo, error) { - conns, err := readConntrack() - if err != nil { - return nil, err - } - resolveProcinfo(conns) - return conns, nil -} - -func resolveProcinfo(conns []*ConnectionInfo) { - var sockets []*socketStatus - for _, line := range getSocketLines("tcp") { - if len(strings.TrimSpace(line)) == 0 { - continue - } - ss := new(socketStatus) - if err := ss.parseLine(line); err != nil { - log.Warning("Unable to parse line [%s]: %v", line, err) - } else { - /* - pid := findPidForInode(ss.inode) - if pid > 0 { - ss.pid = pid - fmt.Println("Socket", ss) - sockets = append(sockets, ss) - } - */ - } - } - for _, ci := range conns { - ss := findContrackSocket(ci, sockets) - if ss == nil { - continue - } - pinfo := pcache.lookup(ss.inode) - if pinfo != nil { - ci.pinfo = pinfo - } - } -} - -func findContrackSocket(ci *ConnectionInfo, sockets []*socketStatus) *socketStatus { - for _, ss := range sockets { - if ss.local.port == ci.local.port && ss.remote.ip.Equal(ci.remote.ip) && ss.remote.port == ci.remote.port { - return ss - } - } - return nil -} - -func readConntrack() ([]*ConnectionInfo, error) { - path := fmt.Sprintf("/proc/net/ip_conntrack") - data, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - var result []*ConnectionInfo - lines := strings.Split(string(data), "\n") - for _, line := range lines { - ci, err := parseConntrackLine(line) - if err != nil { - return nil, err - } - if ci != nil { - result = append(result, ci) - } - } - return result, nil -} - -func parseConntrackLine(line string) (*ConnectionInfo, error) { - parts := strings.Fields(line) - if len(parts) < 8 || parts[0] != "tcp" || parts[3] != "ESTABLISHED" { - return nil, nil - } - - local, err := conntrackAddr(parts[4], parts[6]) - if err != nil { - return nil, err - } - remote, err := conntrackAddr(parts[5], parts[7]) - if err != nil { - return nil, err - } - return &ConnectionInfo{ - local: local, - remote: remote, - }, nil -} - -func conntrackAddr(ip_str, port_str string) (*socketAddr, error) { - ip := net.ParseIP(stripLabel(ip_str)) - if ip == nil { - return nil, errors.New("Could not parse IP: " + ip_str) - } - i64, err := strconv.Atoi(stripLabel(port_str)) - if err != nil { - return nil, err - } - return &socketAddr{ - ip: ip, - port: uint16(i64), - }, nil -} - -func stripLabel(s string) string { - idx := strings.Index(s, "=") - if idx == -1 { - return s - } - return s[idx+1:] -} diff --git a/proc/proc_pid.go b/proc/proc_pid.go deleted file mode 100644 index 2000643..0000000 --- a/proc/proc_pid.go +++ /dev/null @@ -1,149 +0,0 @@ -package proc - -import ( - "fmt" - "io/ioutil" - "os" - "path" - "strconv" - "strings" - "sync" - "syscall" -) - -type ProcInfo struct { - Uid int - Pid int - loaded bool - ExePath string - CmdLine string -} - -type pidCache struct { - cacheMap map[uint64]*ProcInfo - lock sync.Mutex -} - -func (pc *pidCache) lookup(inode uint64) *ProcInfo { - pc.lock.Lock() - defer pc.lock.Unlock() - pi, ok := pc.cacheMap[inode] - if ok && pi.loadProcessInfo() { - return pi - } - pc.cacheMap = loadCache() - pi, ok = pc.cacheMap[inode] - if ok && pi.loadProcessInfo() { - return pi - } - return nil -} - -func loadCache() map[uint64]*ProcInfo { - cmap := make(map[uint64]*ProcInfo) - for _, n := range readdir("/proc") { - pid := toPid(n) - if pid != 0 { - pinfo := &ProcInfo{Pid: pid} - for _, inode := range inodesFromPid(pid) { - cmap[inode] = pinfo - } - } - } - return cmap -} - -func toPid(name string) int { - pid, err := strconv.ParseUint(name, 10, 32) - if err != nil { - return 0 - } - fdpath := fmt.Sprintf("/proc/%d/fd", pid) - fi, err := os.Stat(fdpath) - if err != nil { - return 0 - } - if !fi.IsDir() { - return 0 - } - return (int)(pid) -} - -func inodesFromPid(pid int) []uint64 { - var inodes []uint64 - fdpath := fmt.Sprintf("/proc/%d/fd", pid) - for _, n := range readdir(fdpath) { - if link, err := os.Readlink(path.Join(fdpath, n)); err != nil { - if !os.IsNotExist(err) { - log.Warning("Error reading link %s: %v", n, err) - } - } else { - if inode := extractSocket(link); inode > 0 { - inodes = append(inodes, inode) - } - } - } - return inodes -} - -func extractSocket(name string) uint64 { - if !strings.HasPrefix(name, "socket:[") || !strings.HasSuffix(name, "]") { - return 0 - } - val := name[8 : len(name)-1] - inode, err := strconv.ParseUint(val, 10, 64) - if err != nil { - log.Warning("Error parsing inode value from %s: %v", name, err) - return 0 - } - return inode -} - -func readdir(dir string) []string { - d, err := os.Open(dir) - if err != nil { - log.Warning("Error opening directory %s: %v", dir, err) - return nil - } - defer d.Close() - names, err := d.Readdirnames(0) - if err != nil { - log.Warning("Error reading directory names from %s: %v", dir, err) - return nil - } - return names -} - -func (pi *ProcInfo) loadProcessInfo() bool { - if pi.loaded { - return true - } - - exePath, err := os.Readlink(fmt.Sprintf("/proc/%d/exe", pi.Pid)) - if err != nil { - log.Warning("Error reading exe link for pid %d: %v", pi.Pid, err) - return false - } - bs, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cmdline", pi.Pid)) - if err != nil { - log.Warning("Error reading cmdline for pid %d: %v", pi.Pid, err) - return false - } - for i, b := range bs { - if b == 0 { - bs[i] = byte(' ') - } - } - - finfo, err := os.Stat(fmt.Sprintf("/proc/%d", pi.Pid)) - if err != nil { - log.Warning("Could not stat /proc/%d: %v", pi.Pid, err) - return false - } - sys := finfo.Sys().(*syscall.Stat_t) - pi.Uid = int(sys.Uid) - pi.ExePath = exePath - pi.CmdLine = string(bs) - pi.loaded = true - return true -} diff --git a/proc/socket.go b/proc/socket.go deleted file mode 100644 index 7792ab9..0000000 --- a/proc/socket.go +++ /dev/null @@ -1,99 +0,0 @@ -package proc - -import ( - "errors" - "fmt" - "io/ioutil" - "net" - "strconv" - "strings" -) - -type socketAddr struct { - ip net.IP - port uint16 -} - -func (sa socketAddr) String() string { - return fmt.Sprintf("%v:%d", sa.ip, sa.port) -} - -type socketStatus struct { - local socketAddr - remote socketAddr - uid int - inode uint64 - line string -} - -func (ss *socketStatus) String() string { - return fmt.Sprintf("%s -> %s uid=%d inode=%d", ss.local, ss.remote, ss.uid, ss.inode) -} - -func findUDPSocket(srcPort uint16) *socketStatus { - return findSocket("udp", func(ss socketStatus) bool { - return ss.local.port == srcPort - }) -} - -func findTCPSocket(srcPort uint16, dstAddr net.IP, dstPort uint16) *socketStatus { - return findSocket("tcp", func(ss socketStatus) bool { - return ss.remote.port == dstPort && ss.remote.ip.Equal(dstAddr) && ss.local.port == srcPort - }) -} - -func findSocket(proto string, matcher func(socketStatus) bool) *socketStatus { - var ss socketStatus - for _, line := range getSocketLines(proto) { - if len(line) == 0 { - continue - } - if err := ss.parseLine(line); err != nil { - log.Warning("Unable to parse line from /proc/net/%s [%s]: %v", proto, line, err) - continue - } - if matcher(ss) { - ss.line = line - return &ss - } - } - return nil -} - -func (ss *socketStatus) parseLine(line string) error { - fs := strings.Fields(line) - if len(fs) < 10 { - return errors.New("insufficient fields") - } - if err := ss.local.parse(fs[1]); err != nil { - return err - } - if err := ss.remote.parse(fs[2]); err != nil { - return err - } - uid, err := strconv.ParseUint(fs[7], 10, 32) - if err != nil { - return err - } - ss.uid = int(uid) - inode, err := strconv.ParseUint(fs[9], 10, 64) - if err != nil { - return err - } - ss.inode = inode - return nil -} - -func getSocketLines(proto string) []string { - path := fmt.Sprintf("/proc/net/%s", proto) - data, err := ioutil.ReadFile(path) - if err != nil { - log.Warning("Error reading %s: %v", path, err) - return nil - } - lines := strings.Split(string(data), "\n") - if len(lines) > 0 { - lines = lines[1:] - } - return lines -} diff --git a/prompt.go b/prompt.go index f82ae08..6d52d9c 100644 --- a/prompt.go +++ b/prompt.go @@ -92,7 +92,7 @@ func (p *prompter) processPacket(pp *pendingPkt) { addr, int32(pp.pkt.DstPort), pp.pkt.Dst.String(), - uidToUser(pp.pinfo.Uid), + uidToUser(pp.pinfo.UID), int32(pp.pinfo.Pid)) err := call.Store(&scope, &rule) if err != nil { diff --git a/rules.go b/rules.go index 418264a..6767478 100644 --- a/rules.go +++ b/rules.go @@ -3,16 +3,16 @@ package main import ( "encoding/binary" "fmt" + "io/ioutil" "net" + "os" + "path" + "strconv" "strings" "unicode" "github.com/subgraph/fw-daemon/nfqueue" - "github.com/subgraph/fw-daemon/proc" - "io/ioutil" - "os" - "path" - "strconv" + "github.com/subgraph/go-procsnitch" ) const ( @@ -91,7 +91,7 @@ const ( FILTER_PROMPT ) -func (rl *RuleList) filter(p *nfqueue.Packet, pinfo *proc.ProcInfo, hostname string) FilterResult { +func (rl *RuleList) filter(p *nfqueue.Packet, pinfo *procsnitch.Info, hostname string) FilterResult { if rl == nil { return FILTER_PROMPT } From bb71d8309dbf501c21ec73be705b0aac591e25bf Mon Sep 17 00:00:00 2001 From: David Stainton Date: Fri, 3 Jun 2016 15:05:00 +0000 Subject: [PATCH 16/28] Determine policy for each socks chain connection - WIP --- socks_server_chain.go | 48 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/socks_server_chain.go b/socks_server_chain.go index ded23bf..41969b1 100644 --- a/socks_server_chain.go +++ b/socks_server_chain.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "io" "net" "os" @@ -23,6 +24,10 @@ type socksChain struct { listener net.Listener wg *sync.WaitGroup procInfo procsnitch.ProcInfo + + lock sync.Mutex + policyMap map[string]*Policy + policies []*Policy } type socksChainSession struct { @@ -33,14 +38,16 @@ type socksChainSession struct { bndAddr *socks5.Address optData []byte procInfo procsnitch.ProcInfo + server *socksChain } func NewSocksChain(cfg *socksChainConfig, wg *sync.WaitGroup, dbus *dbusServer) *socksChain { chain := socksChain{ - cfg: cfg, - dbus: dbus, - wg: wg, - procInfo: procsnitch.SystemProcInfo{}, + cfg: cfg, + dbus: dbus, + wg: wg, + procInfo: procsnitch.SystemProcInfo{}, + policyMap: make(map[string]*Policy), } return &chain } @@ -72,7 +79,7 @@ func (s *socksChain) socksAcceptLoop() error { } continue } - session := &socksChainSession{cfg: s.cfg, clientConn: conn, procInfo: s.procInfo} + session := &socksChainSession{cfg: s.cfg, clientConn: conn, procInfo: s.procInfo, server: s} go session.sessionWorker() } } @@ -96,8 +103,14 @@ func (c *socksChainSession) sessionWorker() { return } - // target address of the socks connection - //addr := c.req.Addr.String() + // XXX work-in-progress + // Determine policy for the connection + // if destination not specified in existing policy + // then prompt user for policy ALLOW/DENY for that destination + c.server.lock.Lock() + policy := c.policyForPath(pinfo.ExePath) + c.server.lock.Unlock() + fmt.Printf("policyForPath %s is %s\n", pinfo.ExePath, policy) switch c.req.Cmd { case socks5.CommandTorResolve, socks5.CommandTorResolvePTR: @@ -157,3 +170,24 @@ func (c *socksChainSession) dispatchTorSOCKS() (err error) { } return } + +func (s *socksChainSession) policyForPath(path string) *Policy { + s.server.lock.Lock() + defer s.server.lock.Unlock() + + if _, ok := s.server.policyMap[path]; !ok { + p := new(Policy) + // XXX is fw needed? + // p.fw = fw + p.path = path + p.application = path + entry := entryForPath(path) + if entry != nil { + p.application = entry.name + p.icon = entry.icon + } + s.server.policyMap[path] = p + s.server.policies = append(s.server.policies, p) + } + return s.server.policyMap[path] +} From 68218b4e83be89b8eaab92b6c9fe20326af10e76 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 02:32:15 +0000 Subject: [PATCH 17/28] Refactor to support more than one type of 'connection' Created and interface pendingConnection which represents either a pending packet or socks connection. --- policy.go | 100 ++++++++++++++++++++++++++++++++++++++++-------------- prompt.go | 53 ++++++++++++++--------------- 2 files changed, 100 insertions(+), 53 deletions(-) diff --git a/policy.go b/policy.go index f76f3b5..6ad7898 100644 --- a/policy.go +++ b/policy.go @@ -6,13 +6,57 @@ import ( "github.com/subgraph/fw-daemon/nfqueue" "github.com/subgraph/go-procsnitch" + "net" ) +type pendingConnection interface { + policy() *Policy + procInfo() *procsnitch.Info + hostname() string + dst() net.IP + dstPort() uint16 + accept() + drop() + print() string +} + type pendingPkt struct { - policy *Policy - hostname string - pkt *nfqueue.Packet - pinfo *procsnitch.Info + pol *Policy + name string + pkt *nfqueue.Packet + pinfo *procsnitch.Info +} + +func (pp *pendingPkt) policy() *Policy { + return pp.pol +} + +func (pp *pendingPkt) procInfo() *procsnitch.Info { + return pp.pinfo +} + +func (pp *pendingPkt) hostname() string { + return pp.name +} +func (pp *pendingPkt) dst() net.IP { + return pp.pkt.Dst +} + +func (pp *pendingPkt) dstPort() uint16 { + return pp.pkt.DstPort +} + +func (pp *pendingPkt) accept() { + pp.pkt.Accept() +} + +func (pp *pendingPkt) drop() { + pp.pkt.Mark = 1 + pp.pkt.Accept() +} + +func (pp *pendingPkt) print() string { + return printPacket(pp.pkt, pp.name) } type Policy struct { @@ -21,11 +65,18 @@ type Policy struct { application string icon string rules RuleList - pendingQueue []*pendingPkt + pendingQueue []pendingConnection promptInProgress bool lock sync.Mutex } +func (fw *Firewall) PolicyForPath(path string) *Policy { + fw.lock.Lock() + defer fw.lock.Unlock() + + return fw.policyForPath(path) +} + func (fw *Firewall) policyForPath(path string) *Policy { if _, ok := fw.policyMap[path]; !ok { p := new(Policy) @@ -50,7 +101,7 @@ func (p *Policy) processPacket(pkt *nfqueue.Packet, pinfo *procsnitch.Info) { if !logRedact { log.Info("Lookup(%s): %s", pkt.Dst.String(), name) } - result := p.rules.filter(pkt, pinfo, name) + result := p.rules.filterPacket(pkt, pinfo, name) switch result { case FILTER_DENY: pkt.Mark = 1 @@ -58,21 +109,21 @@ func (p *Policy) processPacket(pkt *nfqueue.Packet, pinfo *procsnitch.Info) { case FILTER_ALLOW: pkt.Accept() case FILTER_PROMPT: - p.processPromptResult(&pendingPkt{policy: p, hostname: name, pkt: pkt, pinfo: pinfo}) + p.processPromptResult(&pendingPkt{pol: p, name: name, pkt: pkt, pinfo: pinfo}) default: log.Warning("Unexpected filter result: %d", result) } } -func (p *Policy) processPromptResult(pp *pendingPkt) { - p.pendingQueue = append(p.pendingQueue, pp) +func (p *Policy) processPromptResult(pc pendingConnection) { + p.pendingQueue = append(p.pendingQueue, pc) if !p.promptInProgress { p.promptInProgress = true go p.fw.dbus.prompt(p) } } -func (p *Policy) nextPending() *pendingPkt { +func (p *Policy) nextPending() pendingConnection { p.lock.Lock() defer p.lock.Unlock() if len(p.pendingQueue) == 0 { @@ -81,14 +132,14 @@ func (p *Policy) nextPending() *pendingPkt { return p.pendingQueue[0] } -func (p *Policy) removePending(pp *pendingPkt) { +func (p *Policy) removePending(pc pendingConnection) { p.lock.Lock() defer p.lock.Unlock() - remaining := []*pendingPkt{} - for _, pkt := range p.pendingQueue { - if pkt != pp { - remaining = append(remaining, pkt) + remaining := []pendingConnection{} + for _, c := range p.pendingQueue { + if c != pc { + remaining = append(remaining, c) } } if len(remaining) != len(p.pendingQueue) { @@ -141,18 +192,17 @@ func (p *Policy) removeRule(r *Rule) { } func (p *Policy) filterPending(rule *Rule) { - remaining := []*pendingPkt{} - for _, pp := range p.pendingQueue { - if rule.match(pp.pkt, pp.hostname) { - log.Info("Also applying %s to %s", rule.getString(logRedact), printPacket(pp.pkt, pp.hostname)) + remaining := []pendingConnection{} + for _, pc := range p.pendingQueue { + if rule.match(pc.dst(), pc.dstPort(), pc.hostname()) { + log.Info("Also applying %s to %s", rule.getString(logRedact), pc.print()) if rule.rtype == RULE_ALLOW { - pp.pkt.Accept() + pc.accept() } else { - pp.pkt.Mark = 1 - pp.pkt.Accept() + pc.drop() } } else { - remaining = append(remaining, pp) + remaining = append(remaining, pc) } } if len(remaining) != len(p.pendingQueue) { @@ -208,9 +258,7 @@ func (fw *Firewall) filterPacket(pkt *nfqueue.Packet) { pkt.Accept() return } - fw.lock.Lock() - policy := fw.policyForPath(pinfo.ExePath) - fw.lock.Unlock() + policy := fw.PolicyForPath(pinfo.ExePath) policy.processPacket(pkt, pinfo) } diff --git a/prompt.go b/prompt.go index 6d52d9c..f13573b 100644 --- a/prompt.go +++ b/prompt.go @@ -53,13 +53,13 @@ func (p *prompter) promptLoop() { } func (p *prompter) processNextPacket() bool { - pp := p.nextPacket() - if pp == nil { + pc := p.nextConnection() + if pc == nil { return false } p.lock.Unlock() defer p.lock.Lock() - p.processPacket(pp) + p.processConnection(pc) return true } @@ -76,65 +76,64 @@ func printScope(scope int32) string { } } -func (p *prompter) processPacket(pp *pendingPkt) { +func (p *prompter) processConnection(pc pendingConnection) { var scope int32 var rule string - addr := pp.hostname + addr := pc.hostname() if addr == "" { - addr = pp.pkt.Dst.String() + addr = pc.dst().String() } + policy := pc.policy() call := p.dbusObj.Call("com.subgraph.FirewallPrompt.RequestPrompt", 0, - pp.policy.application, - pp.policy.icon, - pp.policy.path, + policy.application, + policy.icon, + policy.path, addr, - int32(pp.pkt.DstPort), - pp.pkt.Dst.String(), - uidToUser(pp.pinfo.UID), - int32(pp.pinfo.Pid)) + int32(pc.dstPort()), + pc.dst().String(), + uidToUser(pc.procInfo().UID), + int32(pc.procInfo().Pid)) err := call.Store(&scope, &rule) if err != nil { log.Warning("Error sending dbus RequestPrompt message: %v", err) - pp.policy.removePending(pp) - pp.pkt.Mark = 1 - pp.pkt.Accept() + policy.removePending(pc) + pc.drop() return } - r, err := pp.policy.parseRule(rule, false) + r, err := policy.parseRule(rule, false) if err != nil { log.Warning("Error parsing rule string returned from dbus RequestPrompt: %v", err) - pp.policy.removePending(pp) - pp.pkt.Mark = 1 - pp.pkt.Accept() + policy.removePending(pc) + pc.drop() return } if scope == APPLY_SESSION { r.sessionOnly = true } - if !pp.policy.processNewRule(r, scope) { + if !policy.processNewRule(r, scope) { p.lock.Lock() defer p.lock.Unlock() - p.removePolicy(pp.policy) + p.removePolicy(pc.policy()) } if scope == APPLY_FOREVER { - pp.policy.fw.saveRules() + policy.fw.saveRules() } } -func (p *prompter) nextPacket() *pendingPkt { +func (p *prompter) nextConnection() pendingConnection { for { if len(p.policyQueue) == 0 { return nil } policy := p.policyQueue[0] - pp := policy.nextPending() - if pp == nil { + pc := policy.nextPending() + if pc == nil { p.removePolicy(policy) } else { - return pp + return pc } } } From 3fa78390fc7ae5de030c90a51b3e57dd532c6e06 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 02:33:05 +0000 Subject: [PATCH 18/28] Added methods for filtering which don't require a packet argument --- rules.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/rules.go b/rules.go index 6767478..c1cc9d7 100644 --- a/rules.go +++ b/rules.go @@ -70,17 +70,17 @@ func (r *Rule) AddrString(redact bool) string { type RuleList []*Rule -func (r *Rule) match(pkt *nfqueue.Packet, name string) bool { - if r.port != matchAny && r.port != pkt.DstPort { +func (r *Rule) match(dst net.IP, dstPort uint16, hostname string) bool { + if r.port != matchAny && r.port != dstPort { return false } if r.addr == matchAny { return true } if r.hostname != "" { - return r.hostname == name + return r.hostname == hostname } - return r.addr == binary.BigEndian.Uint32(pkt.Dst) + return r.addr == binary.BigEndian.Uint32(dst) } type FilterResult int @@ -91,18 +91,22 @@ const ( FILTER_PROMPT ) -func (rl *RuleList) filter(p *nfqueue.Packet, pinfo *procsnitch.Info, hostname string) FilterResult { +func (rl *RuleList) filterPacket(p *nfqueue.Packet, pinfo *procsnitch.Info, hostname string) FilterResult { + return rl.filter(p.Dst, p.DstPort, hostname, pinfo) +} + +func (rl *RuleList) filter(dst net.IP, dstPort uint16, hostname string, pinfo *procsnitch.Info) FilterResult { if rl == nil { return FILTER_PROMPT } result := FILTER_PROMPT for _, r := range *rl { - if r.match(p, hostname) { - dst := p.Dst.String() + if r.match(dst, dstPort, hostname) { + dstStr := dst.String() if logRedact { - dst = "[redacted]" + dstStr = "[redacted]" } - log.Info("%s (%s -> %s:%d)", r.getString(logRedact), pinfo.ExePath, dst, p.DstPort) + log.Info("%s (%s -> %s:%d)", r.getString(logRedact), pinfo.ExePath, dstStr, dstPort) if r.rtype == RULE_DENY { return FILTER_DENY } else if r.rtype == RULE_ALLOW { From 5d44cd4e2f989222e146eefe86c05d21ce18b609 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 02:33:55 +0000 Subject: [PATCH 19/28] Save the address type from connect command in Address object --- socks5/common.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/socks5/common.go b/socks5/common.go index aaa82a1..bcaae19 100644 --- a/socks5/common.go +++ b/socks5/common.go @@ -72,6 +72,7 @@ const ( // Address is a SOCKS 5 address + port. type Address struct { + atyp uint8 raw []byte addrStr string portStr string @@ -128,6 +129,12 @@ func (addr *Address) HostPort() (string, string) { return addr.addrStr, addr.portStr } +// Type returns the address type from the connect command this address was +// parsed from +func (addr *Address) Type() uint8 { + return addr.atyp +} + func (addr *Address) read(conn net.Conn) (err error) { // The address looks like: // uint8_t atyp @@ -176,6 +183,7 @@ func (addr *Address) read(conn net.Conn) (err error) { default: return errInvalidAtyp } + addr.atyp = atyp addr.raw = append(addr.raw, rawAddr...) // Read the port. From c779cc6b9bce15e7f6fea09c1032acbc01009ef6 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 02:34:41 +0000 Subject: [PATCH 20/28] Implementation of filtering and prompting for Socks connections --- main.go | 8 +- socks_server_chain.go | 185 +++++++++++++++++++++++++++++------------- 2 files changed, 131 insertions(+), 62 deletions(-) diff --git a/main.go b/main.go index 5e5e6eb..d1948f8 100644 --- a/main.go +++ b/main.go @@ -13,10 +13,10 @@ import ( "time" "unsafe" - "github.com/op/go-logging" "github.com/subgraph/fw-daemon/nfqueue" "github.com/subgraph/go-procsnitch" // "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" + "github.com/op/go-logging" ) var log = logging.MustGetLogger("sgfw") @@ -172,10 +172,10 @@ func loadConfiguration(configFilePath string) (*SocksJsonConfig, error) { func getSocksChainConfig(config *SocksJsonConfig) *socksChainConfig { // XXX - fields := strings.Split(config.TorSocks, ":") + fields := strings.Split(config.TorSocks, "|") torSocksNet := fields[0] torSocksAddr := fields[1] - fields = strings.Split(config.SocksListener, ":") + fields = strings.Split(config.SocksListener, "|") socksListenNet := fields[0] socksListenAddr := fields[1] socksConfig := socksChainConfig{ @@ -233,7 +233,7 @@ func main() { */ wg := sync.WaitGroup{} - chain := NewSocksChain(socksConfig, &wg, ds) + chain := NewSocksChain(socksConfig, &wg, fw) chain.start() fw.runFilter() diff --git a/socks_server_chain.go b/socks_server_chain.go index 41969b1..6c6ce8f 100644 --- a/socks_server_chain.go +++ b/socks_server_chain.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "io" "net" "os" @@ -9,6 +8,7 @@ import ( "github.com/subgraph/fw-daemon/socks5" "github.com/subgraph/go-procsnitch" + "strconv" ) type socksChainConfig struct { @@ -20,14 +20,10 @@ type socksChainConfig struct { type socksChain struct { cfg *socksChainConfig - dbus *dbusServer + fw *Firewall listener net.Listener wg *sync.WaitGroup procInfo procsnitch.ProcInfo - - lock sync.Mutex - policyMap map[string]*Policy - policies []*Policy } type socksChainSession struct { @@ -41,13 +37,56 @@ type socksChainSession struct { server *socksChain } -func NewSocksChain(cfg *socksChainConfig, wg *sync.WaitGroup, dbus *dbusServer) *socksChain { +const ( + socksVerdictDrop = 1 + socksVerdictAccept = 2 +) + +type pendingSocksConnection struct { + pol *Policy + hname string + destIP net.IP + destPort uint16 + pinfo *procsnitch.Info + verdict chan int +} + +func (sc *pendingSocksConnection) policy() *Policy { + return sc.pol +} + +func (sc *pendingSocksConnection) procInfo() *procsnitch.Info { + return sc.pinfo +} + +func (sc *pendingSocksConnection) hostname() string { + return sc.hname +} + +func (sc *pendingSocksConnection) dst() net.IP { + return sc.destIP +} +func (sc *pendingSocksConnection) dstPort() uint16 { + return sc.destPort +} + +func (sc *pendingSocksConnection) deliverVerdict(v int) { + sc.verdict <- v + close(sc.verdict) +} + +func (sc *pendingSocksConnection) accept() { sc.deliverVerdict(socksVerdictAccept) } + +func (sc *pendingSocksConnection) drop() { sc.deliverVerdict(socksVerdictDrop) } + +func (sc *pendingSocksConnection) print() string { return "socks connection" } + +func NewSocksChain(cfg *socksChainConfig, wg *sync.WaitGroup, fw *Firewall) *socksChain { chain := socksChain{ - cfg: cfg, - dbus: dbus, - wg: wg, - procInfo: procsnitch.SystemProcInfo{}, - policyMap: make(map[string]*Policy), + cfg: cfg, + fw: fw, + wg: wg, + procInfo: procsnitch.SystemProcInfo{}, } return &chain } @@ -58,7 +97,7 @@ func (s *socksChain) start() { var err error s.listener, err = net.Listen(s.cfg.ListenSocksNet, s.cfg.ListenSocksAddr) if err != nil { - log.Error("ERR/socks: Failed to listen on the socks address: %v", err) + log.Errorf("ERR/socks: Failed to listen on the socks address: %v", err) os.Exit(1) } @@ -74,7 +113,7 @@ func (s *socksChain) socksAcceptLoop() error { conn, err := s.listener.Accept() if err != nil { if e, ok := err.(net.Error); ok && !e.Temporary() { - log.Info("ERR/socks: Failed to Accept(): %v", err) + log.Infof("ERR/socks: Failed to Accept(): %v", err) return err } continue @@ -88,30 +127,15 @@ func (c *socksChainSession) sessionWorker() { defer c.clientConn.Close() clientAddr := c.clientConn.RemoteAddr() - log.Info("INFO/socks: New connection from: %v", clientAddr) + log.Infof("INFO/socks: New connection from: %v", clientAddr) // Do the SOCKS handshake with the client, and read the command. var err error if c.req, err = socks5.Handshake(c.clientConn); err != nil { - log.Info("ERR/socks: Failed SOCKS5 handshake: %v", err) + log.Infof("ERR/socks: Failed SOCKS5 handshake: %v", err) return } - pinfo := procsnitch.FindProcessForConnection(c.clientConn, c.procInfo) - if pinfo == nil { - log.Warning("No proc found for connection from: %s", c.clientConn.RemoteAddr()) - return - } - - // XXX work-in-progress - // Determine policy for the connection - // if destination not specified in existing policy - // then prompt user for policy ALLOW/DENY for that destination - c.server.lock.Lock() - policy := c.policyForPath(pinfo.ExePath) - c.server.lock.Unlock() - fmt.Printf("policyForPath %s is %s\n", pinfo.ExePath, policy) - switch c.req.Cmd { case socks5.CommandTorResolve, socks5.CommandTorResolvePTR: err = c.dispatchTorSOCKS() @@ -121,16 +145,78 @@ func (c *socksChainSession) sessionWorker() { // Successfully even, send the response back with the addresc. c.req.ReplyAddr(socks5.ReplySucceeded, c.bndAddr) } - return case socks5.CommandConnect: + if !c.filterConnect() { + c.req.Reply(socks5.ReplyConnectionRefused) + return + } + c.handleConnect() default: // Should *NEVER* happen, validated as part of handshake. - log.Info("BUG/socks: Unsupported SOCKS command: 0x%02x", c.req.Cmd) + log.Infof("BUG/socks: Unsupported SOCKS command: 0x%02x", c.req.Cmd) c.req.Reply(socks5.ReplyCommandNotSupported) - return } +} + +func (c *socksChainSession) addressDetails() (string, net.IP, uint16) { + addr := c.req.Addr + host, pstr := addr.HostPort() + port, err := strconv.ParseUint(pstr, 10, 16) + if err != nil || port == 0 || port > 0xFFFF { + log.Warningf("Illegal port value in socks address: %v", addr) + return "", nil, 0 + } + if addr.Type() == 3 { + return host, nil, uint16(port) + } + ip := net.ParseIP(host) + if ip == nil { + log.Warningf("Failed to extract address information from socks address: %v", addr) + } + return "", ip, uint16(port) +} - err = c.dispatchTorSOCKS() +func (c *socksChainSession) filterConnect() bool { + pinfo := procsnitch.FindProcessForConnection(c.clientConn, c.procInfo) + if pinfo == nil { + log.Warningf("No proc found for connection from: %s", c.clientConn.RemoteAddr()) + return false + } + + policy := c.server.fw.PolicyForPath(pinfo.ExePath) + + hostname, ip, port := c.addressDetails() + if ip == nil && hostname == "" { + return false + } + result := policy.rules.filter(ip, port, hostname, pinfo) + switch result { + case FILTER_DENY: + return false + case FILTER_ALLOW: + return true + case FILTER_PROMPT: + pending := &pendingSocksConnection{ + pol: policy, + hname: hostname, + destIP: ip, + destPort: port, + pinfo: pinfo, + verdict: make(chan int), + } + policy.processPromptResult(pending) + v := <-pending.verdict + if v == socksVerdictAccept { + return true + } + } + + return false + +} + +func (c *socksChainSession) handleConnect() { + err := c.dispatchTorSOCKS() if err != nil { return } @@ -139,7 +225,7 @@ func (c *socksChainSession) sessionWorker() { if c.optData != nil { if _, err = c.upstreamConn.Write(c.optData); err != nil { - log.Info("ERR/socks: Failed writing OptData: %v", err) + log.Infof("ERR/socks: Failed writing OptData: %v", err) return } c.optData = nil @@ -147,6 +233,11 @@ func (c *socksChainSession) sessionWorker() { // A upstream connection has been established, push data back and forth // till the session is done. + c.forwardTraffic() + log.Infof("INFO/socks: Closed SOCKS connection from: %v", c.clientConn.RemoteAddr()) +} + +func (c *socksChainSession) forwardTraffic() { var wg sync.WaitGroup wg.Add(2) @@ -160,7 +251,6 @@ func (c *socksChainSession) sessionWorker() { go copyLoop(c.clientConn, c.upstreamConn) wg.Wait() - log.Info("INFO/socks: Closed SOCKS connection from: %v", clientAddr) } func (c *socksChainSession) dispatchTorSOCKS() (err error) { @@ -170,24 +260,3 @@ func (c *socksChainSession) dispatchTorSOCKS() (err error) { } return } - -func (s *socksChainSession) policyForPath(path string) *Policy { - s.server.lock.Lock() - defer s.server.lock.Unlock() - - if _, ok := s.server.policyMap[path]; !ok { - p := new(Policy) - // XXX is fw needed? - // p.fw = fw - p.path = path - p.application = path - entry := entryForPath(path) - if entry != nil { - p.application = entry.name - p.icon = entry.icon - } - s.server.policyMap[path] = p - s.server.policies = append(s.server.policies, p) - } - return s.server.policyMap[path] -} From 3ac218f28866313e59fc0ceb5eb27785b95700ac Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 17:50:03 +0000 Subject: [PATCH 21/28] Migration from /Godeps to /vendor --- Godeps/Godeps.json | 16 +- Godeps/_workspace/.gitignore | 2 - .../src/github.com/godbus/dbus/prop/prop.go | 264 ------------------ .../op/go-logging/examples/example.go | 49 ---- .../op/go-logging/examples/example.png | Bin 17675 -> 0 bytes dbus.go | 5 +- fw-settings/builder.go | 4 +- fw-settings/config.go | 4 +- fw-settings/dbus.go | 2 +- fw-settings/main.go | 4 +- fw-settings/rule_edit.go | 2 +- fw-settings/rules.go | 2 +- main.go | 1 - prompt.go | 2 +- .../github.com/godbus/dbus/CONTRIBUTING.md | 0 .../github.com/godbus/dbus/LICENSE | 0 .../github.com/godbus/dbus/MAINTAINERS | 0 .../github.com/godbus/dbus/README.markdown | 0 .../github.com/godbus/dbus/auth.go | 0 .../github.com/godbus/dbus/auth_external.go | 0 .../github.com/godbus/dbus/auth_sha1.go | 0 .../github.com/godbus/dbus/call.go | 0 .../github.com/godbus/dbus/conn.go | 0 .../github.com/godbus/dbus/conn_darwin.go | 0 .../github.com/godbus/dbus/conn_other.go | 0 .../github.com/godbus/dbus/dbus.go | 0 .../github.com/godbus/dbus/decoder.go | 0 .../github.com/godbus/dbus/doc.go | 0 .../github.com/godbus/dbus/encoder.go | 0 .../github.com/godbus/dbus/export.go | 0 .../github.com/godbus/dbus/homedir.go | 0 .../github.com/godbus/dbus/homedir_dynamic.go | 0 .../github.com/godbus/dbus/homedir_static.go | 0 .../github.com/godbus/dbus/introspect/call.go | 2 +- .../godbus/dbus/introspect/introspect.go | 0 .../godbus/dbus/introspect/introspectable.go | 2 +- .../github.com/godbus/dbus/message.go | 0 .../github.com/godbus/dbus/object.go | 0 .../github.com/godbus/dbus/sig.go | 0 .../godbus/dbus/transport_darwin.go | 0 .../godbus/dbus/transport_generic.go | 0 .../github.com/godbus/dbus/transport_unix.go | 0 .../dbus/transport_unixcred_dragonfly.go | 0 .../godbus/dbus/transport_unixcred_linux.go | 0 .../github.com/godbus/dbus/variant.go | 0 .../github.com/godbus/dbus/variant_lexer.go | 0 .../github.com/godbus/dbus/variant_parser.go | 0 .../github.com/gotk3/gotk3/LICENSE | 0 .../github.com/gotk3/gotk3/cairo/antialias.go | 0 .../github.com/gotk3/gotk3/cairo/cairo.go | 2 +- .../github.com/gotk3/gotk3/cairo/canvas.go | 0 .../github.com/gotk3/gotk3/cairo/errors.go | 0 .../github.com/gotk3/gotk3/cairo/fillrule.go | 0 .../github.com/gotk3/gotk3/cairo/linecap.go | 0 .../github.com/gotk3/gotk3/cairo/linejoin.go | 0 .../github.com/gotk3/gotk3/cairo/mimetype.go | 0 .../github.com/gotk3/gotk3/cairo/operator.go | 0 .../github.com/gotk3/gotk3/cairo/status.go | 0 .../github.com/gotk3/gotk3/cairo/surface.go | 0 .../gotk3/gotk3/cairo/surfacetype.go | 0 .../github.com/gotk3/gotk3/cairo/text.go | 1 - .../gotk3/gotk3/cairo/translations.go | 0 .../github.com/gotk3/gotk3/cairo/util.go | 0 .../github.com/gotk3/gotk3/gdk/gdk.go | 2 +- .../github.com/gotk3/gotk3/gdk/gdk.go.h | 0 .../github.com/gotk3/gotk3/gdk/gdk_3_6-8.go | 0 .../gotk3/gdk/gdk_deprecated_since_3_16.go | 0 .../github.com/gotk3/gotk3/gdk/screen.go | 2 +- .../gotk3/gotk3/gdk/screen_no_x11.go | 0 .../github.com/gotk3/gotk3/gdk/screen_x11.go | 0 .../gotk3/gotk3/gdk/window_no_x11.go | 0 .../github.com/gotk3/gotk3/gdk/window_x11.go | 0 .../gotk3/gotk3/glib/application.go | 0 .../github.com/gotk3/gotk3/glib/connect.go | 0 .../github.com/gotk3/gotk3/glib/glib.go | 0 .../github.com/gotk3/gotk3/glib/glib.go.h | 0 .../gotk3/gotk3/glib/glib_extension.go | 0 .../github.com/gotk3/gotk3/glib/gvariant.go | 0 .../github.com/gotk3/gotk3/glib/gvariant.go.h | 0 .../gotk3/gotk3/glib/gvariantbuilder.go | 0 .../gotk3/gotk3/glib/gvariantclass.go | 0 .../gotk3/gotk3/glib/gvariantdict.go | 0 .../gotk3/gotk3/glib/gvariantiter.go | 0 .../github.com/gotk3/gotk3/glib/list.go | 0 .../github.com/gotk3/gotk3/glib/menu.go | 0 .../gotk3/gotk3/glib/notifications.go | 0 .../github.com/gotk3/gotk3/glib/slist.go | 0 .../github.com/gotk3/gotk3/gtk/aboutdialog.go | 4 +- .../github.com/gotk3/gotk3/gtk/accel.go | 4 +- .../gotk3/gotk3/gtk/actionbar_since_3_12.go | 2 +- .../gotk3/gotk3/gtk/actionbar_since_3_12.go.h | 0 .../github.com/gotk3/gotk3/gtk/app_chooser.go | 2 +- .../github.com/gotk3/gotk3/gtk/application.go | 2 +- .../gotk3/gotk3/gtk/application_since_3_12.go | 0 .../gotk3/gotk3/gtk/application_since_3_14.go | 2 +- .../gotk3/gotk3/gtk/application_window.go | 2 +- .../gotk3/gotk3/gtk/color_chooser.go | 4 +- .../github.com/gotk3/gotk3/gtk/combo_box.go | 2 +- .../github.com/gotk3/gotk3/gtk/gtk.go | 6 +- .../github.com/gotk3/gotk3/gtk/gtk.go.h | 0 .../gotk3/gtk/gtk_deprecated_since_3_10.go | 0 .../gotk3/gtk/gtk_deprecated_since_3_12.go | 0 .../gotk3/gtk/gtk_deprecated_since_3_14.go | 2 +- .../gotk3/gtk/gtk_deprecated_since_3_14.go.h | 0 .../gotk3/gtk/gtk_deprecated_since_3_16.go | 2 +- .../github.com/gotk3/gotk3/gtk/gtk_export.go | 2 +- .../gotk3/gotk3/gtk/gtk_since_3_10.go | 4 +- .../gotk3/gotk3/gtk/gtk_since_3_10.go.h | 0 .../gotk3/gotk3/gtk/gtk_since_3_8.go | 0 .../github.com/gotk3/gotk3/gtk/info_bar.go | 2 +- .../github.com/gotk3/gotk3/gtk/label.go | 4 +- .../github.com/gotk3/gotk3/gtk/level_bar.go | 2 +- .../gotk3/gotk3/gtk/level_bar_since_3_8.go | 0 .../github.com/gotk3/gotk3/gtk/menu_shell.go | 2 +- .../gotk3/gotk3/gtk/popover_since_3_12.go | 2 +- .../gotk3/gotk3/gtk/popover_since_3_12.go.h | 0 .../gotk3/gotk3/gtk/popover_since_3_18.go | 2 +- .../github.com/gotk3/gotk3/gtk/settings.go | 2 +- .../github.com/gotk3/gotk3/gtk/settings.go.h | 0 .../gotk3/gotk3/gtk/stack_since_3_12.go | 0 .../gotk3/gtk/stackswitcher_since_3_10.go | 2 +- .../github.com/gotk3/gotk3/gtk/style.go | 4 +- .../github.com/gotk3/gotk3/gtk/tree_view.go | 4 +- .../gotk3/gotk3/gtk/tree_view_column.go | 2 +- .../github.com/gotk3/gotk3/gtk/version.go | 0 .../github.com/gotk3/gotk3/gtk/widget.go | 4 +- .../gotk3/gotk3/gtk/widget_since_3_12.go | 0 .../gotk3/gotk3/gtk/widget_since_3_8.go | 0 .../github.com/gotk3/gotk3/gtk/window.go | 4 +- .../gotk3/gotk3/gtk/window_since_3_10.go | 0 .../gotk3/gotk3/pango/pango-attributes.go | 2 +- .../gotk3/gotk3/pango/pango-attributes.go.h | 0 .../gotk3/gotk3/pango/pango-context.go | 2 +- .../gotk3/gotk3/pango/pango-font.go | 2 +- .../gotk3/gotk3/pango/pango-glyph-item.go | 0 .../gotk3/gotk3/pango/pango-glyph.go | 2 +- .../gotk3/gotk3/pango/pango-gravity.go | 0 .../gotk3/gotk3/pango/pango-layout.go | 2 +- .../gotk3/gotk3/pango/pango-layout.go.h | 0 .../gotk3/gotk3/pango/pango-types.go | 0 .../github.com/gotk3/gotk3/pango/pango.go | 0 .../github.com/gotk3/gotk3/pango/pango.go.h | 0 .../gotk3/gotk3/pango/pangocairo.go | 2 +- .../gotk3/gotk3/pango/pangocairo.go.h | 0 .../github.com/op/go-logging/.travis.yml | 0 .../github.com/op/go-logging/CONTRIBUTORS | 0 .../github.com/op/go-logging/LICENSE | 0 .../github.com/op/go-logging/README.md | 0 .../github.com/op/go-logging/backend.go | 0 .../github.com/op/go-logging/format.go | 0 .../github.com/op/go-logging/level.go | 0 .../github.com/op/go-logging/log_nix.go | 0 .../github.com/op/go-logging/log_windows.go | 0 .../github.com/op/go-logging/logger.go | 0 .../github.com/op/go-logging/memory.go | 0 .../github.com/op/go-logging/multi.go | 0 .../github.com/op/go-logging/syslog.go | 0 .../op/go-logging/syslog_fallback.go | 0 .../github.com/subgraph/go-procsnitch/LICENSE | 1 + .../subgraph/go-procsnitch/README.md | 8 + .../github.com/subgraph/go-procsnitch/proc.go | 260 +++++++++++++++++ .../subgraph/go-procsnitch/proc_pid.go | 162 +++++++++++ .../subgraph/go-procsnitch/socket.go | 214 ++++++++++++++ vendor/golang.org/x/net/LICENSE | 27 ++ vendor/golang.org/x/net/PATENTS | 22 ++ vendor/golang.org/x/net/proxy/direct.go | 18 ++ vendor/golang.org/x/net/proxy/per_host.go | 140 ++++++++++ vendor/golang.org/x/net/proxy/proxy.go | 94 +++++++ vendor/golang.org/x/net/proxy/socks5.go | 210 ++++++++++++++ 169 files changed, 1232 insertions(+), 380 deletions(-) delete mode 100644 Godeps/_workspace/.gitignore delete mode 100644 Godeps/_workspace/src/github.com/godbus/dbus/prop/prop.go delete mode 100644 Godeps/_workspace/src/github.com/op/go-logging/examples/example.go delete mode 100644 Godeps/_workspace/src/github.com/op/go-logging/examples/example.png rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/CONTRIBUTING.md (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/LICENSE (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/MAINTAINERS (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/README.markdown (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/auth.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/auth_external.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/auth_sha1.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/call.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/conn.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/conn_darwin.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/conn_other.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/dbus.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/decoder.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/doc.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/encoder.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/export.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/homedir.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/homedir_dynamic.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/homedir_static.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/introspect/call.go (87%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/introspect/introspect.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/introspect/introspectable.go (96%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/message.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/object.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/sig.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/transport_darwin.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/transport_generic.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/transport_unix.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/transport_unixcred_dragonfly.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/transport_unixcred_linux.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/variant.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/variant_lexer.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/godbus/dbus/variant_parser.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/LICENSE (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/antialias.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/cairo.go (96%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/canvas.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/errors.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/fillrule.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/linecap.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/linejoin.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/mimetype.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/operator.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/status.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/surface.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/surfacetype.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/text.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/translations.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/cairo/util.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/gdk.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/gdk.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/gdk_3_6-8.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/screen.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/screen_no_x11.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/screen_x11.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/window_no_x11.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gdk/window_x11.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/application.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/connect.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/glib.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/glib.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/glib_extension.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/gvariant.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/gvariant.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/gvariantbuilder.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/gvariantclass.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/gvariantdict.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/gvariantiter.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/list.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/menu.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/notifications.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/glib/slist.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/aboutdialog.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/accel.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go (97%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/app_chooser.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/application.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/application_since_3_12.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/application_since_3_14.go (93%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/application_window.go (95%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/color_chooser.go (96%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/combo_box.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go (90%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_export.go (91%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/info_bar.go (96%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/label.go (97%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/level_bar.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/menu_shell.go (97%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/popover_since_3_12.go (96%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/popover_since_3_12.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/popover_since_3_18.go (89%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/settings.go (92%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/settings.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/stack_since_3_12.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go (95%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/style.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/tree_view.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/tree_view_column.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/version.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/widget.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/widget_since_3_12.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/widget_since_3_8.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/window.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/gtk/window_since_3_10.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-attributes.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-attributes.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-context.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-font.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-glyph-item.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-glyph.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-gravity.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-layout.go (99%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-layout.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango-types.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pango.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pangocairo.go (98%) rename {Godeps/_workspace/src => vendor}/github.com/gotk3/gotk3/pango/pangocairo.go.h (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/.travis.yml (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/CONTRIBUTORS (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/LICENSE (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/README.md (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/backend.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/format.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/level.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/log_nix.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/log_windows.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/logger.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/memory.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/multi.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/syslog.go (100%) rename {Godeps/_workspace/src => vendor}/github.com/op/go-logging/syslog_fallback.go (100%) create mode 100644 vendor/github.com/subgraph/go-procsnitch/LICENSE create mode 100644 vendor/github.com/subgraph/go-procsnitch/README.md create mode 100644 vendor/github.com/subgraph/go-procsnitch/proc.go create mode 100644 vendor/github.com/subgraph/go-procsnitch/proc_pid.go create mode 100644 vendor/github.com/subgraph/go-procsnitch/socket.go create mode 100644 vendor/golang.org/x/net/LICENSE create mode 100644 vendor/golang.org/x/net/PATENTS create mode 100644 vendor/golang.org/x/net/proxy/direct.go create mode 100644 vendor/golang.org/x/net/proxy/per_host.go create mode 100644 vendor/golang.org/x/net/proxy/proxy.go create mode 100644 vendor/golang.org/x/net/proxy/socks5.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index bd70008..9d11187 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,6 +1,7 @@ { "ImportPath": "github.com/subgraph/fw-daemon", - "GoVersion": "go1.5", + "GoVersion": "go1.6", + "GodepVersion": "v74", "Packages": [ "./..." ], @@ -10,6 +11,11 @@ "Comment": "v3-15-g230e4b2", "Rev": "230e4b23db2fd81c53eaa0073f76659d4849ce51" }, + { + "ImportPath": "github.com/godbus/dbus/introspect", + "Comment": "v3-15-g230e4b2", + "Rev": "230e4b23db2fd81c53eaa0073f76659d4849ce51" + }, { "ImportPath": "github.com/gotk3/gotk3/cairo", "Comment": "GOTK3_0_2_0-430-ge68c426", @@ -38,6 +44,14 @@ { "ImportPath": "github.com/op/go-logging", "Rev": "dfaf3dff9b631bc4236201d90d41ee0de9202889" + }, + { + "ImportPath": "github.com/subgraph/go-procsnitch", + "Rev": "84754d9af0ff985a28b3e6be743c7d453fda7322" + }, + { + "ImportPath": "golang.org/x/net/proxy", + "Rev": "2e9cee70ee697e0a2ef894b560dda50dec7dff58" } ] } diff --git a/Godeps/_workspace/.gitignore b/Godeps/_workspace/.gitignore deleted file mode 100644 index f037d68..0000000 --- a/Godeps/_workspace/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/pkg -/bin diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/prop/prop.go b/Godeps/_workspace/src/github.com/godbus/dbus/prop/prop.go deleted file mode 100644 index 317a9a3..0000000 --- a/Godeps/_workspace/src/github.com/godbus/dbus/prop/prop.go +++ /dev/null @@ -1,264 +0,0 @@ -// Package prop provides the Properties struct which can be used to implement -// org.freedesktop.DBus.Properties. -package prop - -import ( - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus/introspect" - "sync" -) - -// EmitType controls how org.freedesktop.DBus.Properties.PropertiesChanged is -// emitted for a property. If it is EmitTrue, the signal is emitted. If it is -// EmitInvalidates, the signal is also emitted, but the new value of the property -// is not disclosed. -type EmitType byte - -const ( - EmitFalse EmitType = iota - EmitTrue - EmitInvalidates -) - -// ErrIfaceNotFound is the error returned to peers who try to access properties -// on interfaces that aren't found. -var ErrIfaceNotFound = dbus.NewError("org.freedesktop.DBus.Properties.Error.InterfaceNotFound", nil) - -// ErrPropNotFound is the error returned to peers trying to access properties -// that aren't found. -var ErrPropNotFound = dbus.NewError("org.freedesktop.DBus.Properties.Error.PropertyNotFound", nil) - -// ErrReadOnly is the error returned to peers trying to set a read-only -// property. -var ErrReadOnly = dbus.NewError("org.freedesktop.DBus.Properties.Error.ReadOnly", nil) - -// ErrInvalidArg is returned to peers if the type of the property that is being -// changed and the argument don't match. -var ErrInvalidArg = dbus.NewError("org.freedesktop.DBus.Properties.Error.InvalidArg", nil) - -// The introspection data for the org.freedesktop.DBus.Properties interface. -var IntrospectData = introspect.Interface{ - Name: "org.freedesktop.DBus.Properties", - Methods: []introspect.Method{ - { - Name: "Get", - Args: []introspect.Arg{ - {"interface", "s", "in"}, - {"property", "s", "in"}, - {"value", "v", "out"}, - }, - }, - { - Name: "GetAll", - Args: []introspect.Arg{ - {"interface", "s", "in"}, - {"props", "a{sv}", "out"}, - }, - }, - { - Name: "Set", - Args: []introspect.Arg{ - {"interface", "s", "in"}, - {"property", "s", "in"}, - {"value", "v", "in"}, - }, - }, - }, - Signals: []introspect.Signal{ - { - Name: "PropertiesChanged", - Args: []introspect.Arg{ - {"interface", "s", "out"}, - {"changed_properties", "a{sv}", "out"}, - {"invalidates_properties", "as", "out"}, - }, - }, - }, -} - -// The introspection data for the org.freedesktop.DBus.Properties interface, as -// a string. -const IntrospectDataString = ` - - - - - - - - - - - - - - - - - - - - - -` - -// Prop represents a single property. It is used for creating a Properties -// value. -type Prop struct { - // Initial value. Must be a DBus-representable type. - Value interface{} - - // If true, the value can be modified by calls to Set. - Writable bool - - // Controls how org.freedesktop.DBus.Properties.PropertiesChanged is - // emitted if this property changes. - Emit EmitType - - // If not nil, anytime this property is changed by Set, this function is - // called with an appropiate Change as its argument. If the returned error - // is not nil, it is sent back to the caller of Set and the property is not - // changed. - Callback func(*Change) *dbus.Error -} - -// Change represents a change of a property by a call to Set. -type Change struct { - Props *Properties - Iface string - Name string - Value interface{} -} - -// Properties is a set of values that can be made available to the message bus -// using the org.freedesktop.DBus.Properties interface. It is safe for -// concurrent use by multiple goroutines. -type Properties struct { - m map[string]map[string]*Prop - mut sync.RWMutex - conn *dbus.Conn - path dbus.ObjectPath -} - -// New returns a new Properties structure that manages the given properties. -// The key for the first-level map of props is the name of the interface; the -// second-level key is the name of the property. The returned structure will be -// exported as org.freedesktop.DBus.Properties on path. -func New(conn *dbus.Conn, path dbus.ObjectPath, props map[string]map[string]*Prop) *Properties { - p := &Properties{m: props, conn: conn, path: path} - conn.Export(p, path, "org.freedesktop.DBus.Properties") - return p -} - -// Get implements org.freedesktop.DBus.Properties.Get. -func (p *Properties) Get(iface, property string) (dbus.Variant, *dbus.Error) { - p.mut.RLock() - defer p.mut.RUnlock() - m, ok := p.m[iface] - if !ok { - return dbus.Variant{}, ErrIfaceNotFound - } - prop, ok := m[property] - if !ok { - return dbus.Variant{}, ErrPropNotFound - } - return dbus.MakeVariant(prop.Value), nil -} - -// GetAll implements org.freedesktop.DBus.Properties.GetAll. -func (p *Properties) GetAll(iface string) (map[string]dbus.Variant, *dbus.Error) { - p.mut.RLock() - defer p.mut.RUnlock() - m, ok := p.m[iface] - if !ok { - return nil, ErrIfaceNotFound - } - rm := make(map[string]dbus.Variant, len(m)) - for k, v := range m { - rm[k] = dbus.MakeVariant(v.Value) - } - return rm, nil -} - -// GetMust returns the value of the given property and panics if either the -// interface or the property name are invalid. -func (p *Properties) GetMust(iface, property string) interface{} { - p.mut.RLock() - defer p.mut.RUnlock() - return p.m[iface][property].Value -} - -// Introspection returns the introspection data that represents the properties -// of iface. -func (p *Properties) Introspection(iface string) []introspect.Property { - p.mut.RLock() - defer p.mut.RUnlock() - m := p.m[iface] - s := make([]introspect.Property, 0, len(m)) - for k, v := range m { - p := introspect.Property{Name: k, Type: dbus.SignatureOf(v.Value).String()} - if v.Writable { - p.Access = "readwrite" - } else { - p.Access = "read" - } - s = append(s, p) - } - return s -} - -// set sets the given property and emits PropertyChanged if appropiate. p.mut -// must already be locked. -func (p *Properties) set(iface, property string, v interface{}) { - prop := p.m[iface][property] - prop.Value = v - switch prop.Emit { - case EmitFalse: - // do nothing - case EmitInvalidates: - p.conn.Emit(p.path, "org.freedesktop.DBus.Properties.PropertiesChanged", - iface, map[string]dbus.Variant{}, []string{property}) - case EmitTrue: - p.conn.Emit(p.path, "org.freedesktop.DBus.Properties.PropertiesChanged", - iface, map[string]dbus.Variant{property: dbus.MakeVariant(v)}, - []string{}) - default: - panic("invalid value for EmitType") - } -} - -// Set implements org.freedesktop.Properties.Set. -func (p *Properties) Set(iface, property string, newv dbus.Variant) *dbus.Error { - p.mut.Lock() - defer p.mut.Unlock() - m, ok := p.m[iface] - if !ok { - return ErrIfaceNotFound - } - prop, ok := m[property] - if !ok { - return ErrPropNotFound - } - if !prop.Writable { - return ErrReadOnly - } - if newv.Signature() != dbus.SignatureOf(prop.Value) { - return ErrInvalidArg - } - if prop.Callback != nil { - err := prop.Callback(&Change{p, iface, property, newv.Value()}) - if err != nil { - return err - } - } - p.set(iface, property, newv.Value()) - return nil -} - -// SetMust sets the value of the given property and panics if the interface or -// the property name are invalid. -func (p *Properties) SetMust(iface, property string, v interface{}) { - p.mut.Lock() - p.set(iface, property, v) - p.mut.Unlock() -} diff --git a/Godeps/_workspace/src/github.com/op/go-logging/examples/example.go b/Godeps/_workspace/src/github.com/op/go-logging/examples/example.go deleted file mode 100644 index b17c00a..0000000 --- a/Godeps/_workspace/src/github.com/op/go-logging/examples/example.go +++ /dev/null @@ -1,49 +0,0 @@ -package main - -import ( - "os" - - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" -) - -var log = logging.MustGetLogger("example") - -// Example format string. Everything except the message has a custom color -// which is dependent on the log level. Many fields have a custom output -// formatting too, eg. the time returns the hour down to the milli second. -var format = logging.MustStringFormatter( - `%{color}%{time:15:04:05.000} %{shortfunc} â–¶ %{level:.4s} %{id:03x}%{color:reset} %{message}`, -) - -// Password is just an example type implementing the Redactor interface. Any -// time this is logged, the Redacted() function will be called. -type Password string - -func (p Password) Redacted() interface{} { - return logging.Redact(string(p)) -} - -func main() { - // For demo purposes, create two backend for os.Stderr. - backend1 := logging.NewLogBackend(os.Stderr, "", 0) - backend2 := logging.NewLogBackend(os.Stderr, "", 0) - - // For messages written to backend2 we want to add some additional - // information to the output, including the used log level and the name of - // the function. - backend2Formatter := logging.NewBackendFormatter(backend2, format) - - // Only errors and more severe messages should be sent to backend1 - backend1Leveled := logging.AddModuleLevel(backend1) - backend1Leveled.SetLevel(logging.ERROR, "") - - // Set the backends to be used. - logging.SetBackend(backend1Leveled, backend2Formatter) - - log.Debugf("debug %s", Password("secret")) - log.Info("info") - log.Notice("notice") - log.Warning("warning") - log.Error("err") - log.Critical("crit") -} diff --git a/Godeps/_workspace/src/github.com/op/go-logging/examples/example.png b/Godeps/_workspace/src/github.com/op/go-logging/examples/example.png deleted file mode 100644 index ff3392b7a5b37a09d44db6a8f5ef293c5c610791..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17675 zcmZsD1yo#3mu+Lg0}1XB+}+*X-QC??g1fuBOK^7$?%ojGA-Kcq@1ObKyqPz(R?E75 zZ&%m3r>geZXP=HxkP}CQ!-fL@0Em(jB1!-Nm@(*mJPbJKS!ph(8T10{Aff3D0KlXC z^8f>6W@Ca5Lc2)Hib8L}Lw}`0xvKW70ssgBk|KgC9_tsnt{y6*E4kiRFJ|nQmqf9U z;3SZ(ge403ZOYXimIVsy9~ST>5{_X)QK*!c=s%H3FE3jXUE3f1{B6F&{Jtc!T#swH z<>NszY|G$%oXl{ao}BIqTIJ?~fC04}fdY6!P*WBFwbB4klK}&@3~*3mf`WvEG=T%1 zHHL}|YVnkWAB_h0n?6Ry@~OGzE!mrkQBXNc;K{K((FSCfJt%w#m$cq(R`x%uE7Es( z&90ox5y)9SlS{Vs{M#gIqjE7XgTBZS>{?8zr1p3@o=dqkSDv7(vh6g6#y%MBblr?% z-~-1}zjZ_(-C?4z(T$B{R*Xf3b2v7}hd}@U!=*E=`VTEue$f=b)}1(!h}g%%^)Q5N z_VwY&pDSgfc~7kE3Sy@%C<<-e{Md{oWw1&~x33l9Y0VyKtq4oCk3OFRDDGCO{^~Rg z5M;O-HneG#u))cx`#QV?c*;d~RIRF24h?g84Q+$H_%mv(eDs4AF2QNv{NG%JYLgdv zdYu(+I(TEg-Awa0vy`Cww`kUqe%-(tf(h*N`&?mynxb`N@+PPGm?Acb4Gqog~+hD9XksQAMWyvCMGK_(Umk04r_T8`LD(OuJXha zr>b}iGO5n?z+7;w5f?lbql0mZl+}MAuCyF2RU+34#bmnSoZT{U z>rtzMZtVFpW-`@D$s=<;A79V1#mxzIZ}Egg0QT#bna{C}pFiQ@7N&DzW)du%u!26K z$Yrnp{ED)t_pkD20$q!n==@{D)F>UXk?CM;F5M;~7NZf1jgo|?i|h1Zf}d*)1CVyW z@9D#7Fz(TtUae8FH7c1xNEG^MNYD0#YY=t)4Yn!SIzm`il4jIv0|sqPo7T} zE7fT-f4$Iex;J)bmhtB`S;#jz>pwh#RlO3)7k|thj~*5EDpc1)cGv#XYt&JvZ!lZU z7kJi6bDreld47BZPHk_TncLs-woc4sQ>eTCJ8HwO((CK5eCy3P z7M^u?s{;&-Ple|x9HaHIjbM(K*%QRF39Xqw$8^9Tk$Qfg=MB@6t1d$`m3L;iiFiqZ z^S7O%=b#JO3cTMPu##>Kt6f<=kKh17h187qzx|tuE3V^mQ1NX3ZX+|cGfL6G(I4jIC^56gIRF><$GFyIB{6R5x>i04h)-i z(It+N{4})|`-9}})A7_ut?^`Xl%AtKb7&>|>%@-PZ?n~O2ZmjRk{s{L%-Y@F?2GThH~wQQB5KL#8;*L5xuL!bQJ-zsn{!DLZ>$|s5@PCFrC%WvMhXG?%`X96B%J4DC)5)(=QAo5Ln zCCM5MQo%%r|Do;krC&}RuA!MJ$5%h@Wdo-W{u%Oyt5gM7ON~;^nxG1;{ix?@yu|xB zofF6tKykeoay5goObrJ3)IadYQAS=$K*A}KNOrp}m>Dr(_Oi0P^$1@v&3&S5T%wQ2 zz2ZnVIKkv|pWXd9$h?PAs!2s1(u=7=i9dcfFRb%QpWh|%It4?`0wZ2QK+XZaGL@OW z#9?zIwp96hi50rne`7vrG2ppBec0Bks2-su=>FwD9DArKljTNLOcgtr{@fxaZ+AYU z>hx+%6`^I1E)EWW3AAV*Fvh`UGH%NXBZYth?04CXcFF!A2LOt-Vu&rE)eqBCiIPUv zvv4=P+I`&PF0^IAJM>YigIzo z-?GDRE=goWoZw-qGr1TBrlnlEZhqkt1}aa!zIE*L;>Y|9{?2XI^4>@9_-E~!_=KRm zAfZO*k93m7!tp?F`H~*{h8m}YIMV8r_ zN*ZF>@?QMP=BOG%dR>7(yW?duAPRbxGqpF&LJy2B26d&)^0SMe}#viww41h{s)IMs9Jw zNNj5n0iTPS7mi!yHoIJJ@XeP`71@$Mw{LnQD3L=Si(x0iRxy>oO^y-yz>u@I4Evz% zaYg6wc~n2*%oypEIqr4iA~HnVqOtY0dHM>freuNhklits&P97avQx-ZuPDbw9G%xk zdyf__kk%Xnn9qTE+Niplvs6ObD@BK@@U&g8t4fR=mI?%eFK=SrO>2^Ds9QdiMr&Fc zzskw{`jhaeFG;1j5Se`^_o!1YeqaZiVKDtA zPTIu5x^d%;tM3L!G)+;G{ZU#yM$LG|IUOe~h};qKy04i12B~XV3tCK5^3Y1YQC9cw zb!N@B=L&~)%x>?4$0fDxkwIrDe*;j6Ac@5CVU5& zib~Zi#T!V&ja1Wco6GfwHib=gpIZk#O{0((H$zl8~stW z^x1phzi=L;vM*{1DTnat#F8c|!9=jleXk|eblk|s>(vnyy7-C}lORHYeVW0W>dQNn z{Da!(`R$LgpK)bfb&t=V;qzw{|BrYY|K~S>LJ@Ob)X|;yH(AVF9CV*@O_s^F&TEYb zvlgNHI~c~wp3Eh&{MHt6-4u_fj=5cV47t+ZQAR(I*w>1dZO1y!T+Bg(rgw^M>ONR&>{`KVNe7S=s-+-EP7~WRJ zu20^SL?=l3VmhXNRQMXxt&$0#x? z+6~l;yJC}(LUNAEVNYZ8JFXx^N)1hTc)Z#KPUF{3<>~I5D`h^PC4@IiKj5krZ^lv} zd$X|?k-Vqru9#16blH=IR*8rv^y10eoGU@G*TQ_Me)WtYE+V?!iO^-ASONgL9@gs5 z^rU-v7&6mt7=Ea4egfCgw*HqQl*yJd)qo8{J zq_Djp%dVQa26(L=NT#s2(FzULGD_hs_6 z?5nP%{cMH2Av%lYWw9U7Mq~F}-2Cf%u0q|Kh2iI19KVc@^K`rfu-!yETVvFl5%@P0Uz`?s*qrcy6IvK@a)Y@$N zOD^($JWMcq!T}hFuM!%~!XDjBqNEq}fjtg8o)JAjiS@TNv-VWCD)u$Hio1H__ODU-sV&P$5eHJ}=*kH?F@!F-av16FeLFCyZPD zjigtPp;>h)(m@0WAbQj5eADqVIHaq@bE&IjnnvftBZzON10crrPzAC zA>PaZIGx{Cm;cng_4-P1xqAM_pxw$BvKLl0N`%q-LDJISv>ixWMP^#}PO4uqC>OkB zdpHt@mDZz|8xBePd>Y017Bjj~qFW=c=yPzi%daf>)RaJqlv}*i>@5yO8M)ofr6&wY zy^Rfu3NVQ+woLMpjVrEjozqOuwYF{~0~mPuKCEK2H+SqYN+M%;pr>D4_LP=JfO9+- zF%?sJwrLQy7h548#cTHsb-oR~GJ@YDqp8D~3}TmvN)=Fn93H5@ygK5n`%x(-!V6L< zxbj~_U>5SkK%q*xOn6P!`b0L|_!1yL6e!MFoX4F#Cjd~0U(BcfMQS56{E3>A0o%8VPGjk(*qzvC?c@ZNPK~!@OWyh##%o1y>!(@- z8R`UO#pfW@S2CHVC7=G!-De^|rPLs0&owL%2Dh0D4$_tyDMEO&tM*v zpY(UTAGnI+?!&MZ(tB>`8tsCm%gdWsY1Bn!J?CuK9~`d1*t2#36jQb$;X1xrI{8ne zXQizF5Xs{Ind8#=3>NGJa52ox20&b_qneig)bx_=J78l0VWwQwZ)?EuRFFR zm~MCd1~jFV5*H2rhFa??^ao`?2om zrUJ+)1QMb(uSwE>Jb4Zdlx$oP7pYGnS`?THkDZNAj8{F;#u?<72C)-tbz8>j|GvV| zXaD+4u`ssU9_P53t6Jqh{WrJuS8KwD7fS-0$B9rUMj3&6g?6kRP~5eu=doIc{(_p? zsHh}0O&Pnrtse#36LN{<#< zydeS{h^z9@-7N~nMw5hLGOFUJE%kC0RUvhs;s1?6d74B_jgT$7j#EbaROnn&UF+p_ z!{@sB21W~$ebIfn2paf@*UoO;hIpni2!|O;C`WE_&B#!YT189F?GV_0EFPKDUThUm z>RJ2mrmXO1ak;C9k{BOto+y`9Ka~iq@uk|^eNN(jU%p3=Wan65I%gjM- z`<7D^;H?%tD?S~cPxWsjI24k0uieG2@bEuP-7d3ydQ4QSv;8EX(QPwQSZ0s2as`oZ*DSEy70g-%hE$AUZn4e{%po;Bl4e#}P$YiRxlfqu^AnrIm?qctHNJc1a z&Op~M&v*Ee*C9mfG^ELwL&b&k)zTceg7I1Zfij@X<;O2-<#9X_#fW?SdveL|0C4g? z?W2)z9q$1d&ZA%48`%WF09dW}aTiKIWs2krhQQVZGtJw-W?yF{olGJgaj_CoMA_&1 zVLhBo>h<qw4FyDwA1v?~lZF!Tu|4M0noDmr9nh50wVD5vE$w|I{_mBcO;C)&4zOr zM_k)&^VQokCZ1CteId2f{L)nHCm1GzmU`}P7j|@G3nfz}Q+ey})kQ$=H>HcmGA$KS zW+z*zaf*=^T+3#dTIHtRFA%*M+RL#IOa%q$j(tyxWSVosv@WF4;AAu!EdATZF}1;p ze}*U_vN=(s_xMc8Wp8k7w8GYx1F$Hon7IIwhdZ{v+Y%{Ev)ntU>?$-eiT z1DYBdjiOkvYbiqWb`EXadv#XEh~hLlokurSOlx_k8o>-7tefqae^ zfr7PUHnB0=<)l$O&b6YddmUD`8+q&FuFbFdu%_4D-i2V!gS_n&<8Jtj*1vYIi+&vV zhfsdJod?D5^Z3mhzifWW{xaFSw{-XC`%Z3AKyA3c#@$Ab%-5DPU+ye9c6zF@r+%en zBWF1l$I*S{mo#7UFKTdkrXHsQO~ry)SCd+Uqd5LZ}u9fQ>L~l6wgQOR~gpVvZq|Ox{1xM4vDdH=F13w zcKo=EgHN*`ZH^;kh$_J8Nk1NAG-J+jze-yazgYJw_>+?x0GhL&u0!m6Tzsmj&W2}5 zfosmo?{Bc$N{RTl8;=-9kinNGCAR)8y0ulnW=PMKCzNvPtBbW6ttO8ZM&%}=qqzv( z)`<^hN+=%bm#dJtJX=Ap_UM4z{~)lhku=NxFPZ&6*zE9Lc)Se|jAVn&`NP@LdU|*I z#J+97JehiVauSyilVxqv9L6UtwcttxZ`jH0!vp+18d*tE)8@wWs(Ral8+^*PZoh1S zBCL~p%dwZ1#gl`BrjT@Lr#!0NsjXP-S%M*dSo&820LaITelPWJQ@u4dIqWI(PIAfl zVYIp?pL2w5AliRseU&TYuT-9(GiygKARE+mC|}kKF$p*Frua_4YgdzD^waZ^=npx6c$J z1XM!IF95k+z}S3Z@47avU^$p{pt;99C$0>UlGHfd!zESia$}iZ7XJp#${d|8Wa#6( zeQ58Kl{^j;wSTYO7=Ik4#b!UjIzttt&_KRuZ|DOvprJB8`Eh6+d*+Nw#CMnpk9`NNfqD$_O5|49Zgjdt-%n#p z-md{#KF)jZS(z)1&cLp%zn-~T?s>S)i&*V1r;Q>dj`rKl(wjHElk?}@3r6GyUS2iX z!N8{-PdF>a*G4^MNP531CHH1N(ZLI1ME}yjf+XCDyj0VrJv;`4L2&anZ?j@ksjX91 zyIkuuEV4YWW@I z2kYx4XG*rE8CY5Khn9i-H8?i}25_c>?E-977tp$mN)eRsLAFxzc z<%vQgTM?ql0e}J8W3s<0X~l*^3Zzrbt4B3`wBp@o-l}oNMOq8f)>M?x&IB3823=T0 zP-_0j$$=_LXIvU4bwU$dK7tJ{H(Ur=Uq3H?j%BRtL{Cx(Bi7N0V0w*Z?9A0Ixff1H zw|09CP|DU+`wQL-d(SG6r0kYkgOUVbW+PzVuFB&Tr9~CVmhMa|n%`#{dGD;tvN0M* z$Je@6lQ-6?ex5s7g4O#Y;_Y7gbTYTX-k{2*H)&hGQao2Hs`$K8*P2DYpZFwo8#jp9 zs{5U7o=@uWvro%~_RuR40a_qc&*O#Vu?m*$@ES^&E#CT;eD)BuhZiDpxlpXnW(mj+ zEc=MN{V7(f|5kSrm2A z`GT5W(0tNoNteCYkSGR(E)A=w>|c013mSB{y}vYFj`hkM$g{LI8arC)E|NDiV5%nn z*sWK{;|uxwfH&NS#s}d;D?Zau(VnYL2!fM8>zaR1YD>-|e4)Q)@ljN=H8ra^VrZp$ z)gof-TVSR==)7`D;l;z2r!LCBR2&#lo$2`u!sJ-_-ICBM>F2UrI-~5QwIR!njb7Z= z&AXd5A#$u!=2lLukR#Nk_JP@Am}|_w;I>I4OYxl^JzTgOdYuL8OUi{YX_Ry-`@M*g zl8W}|L8e;)LlB$)>4Wo`+Z=0_h4M;~Y&UG+qt9r=!7CF9mUkMx)}1G_EZ~9*BmLl4 zN>vcGKd{N?BhZz96!R<2=@7^dBW0f|J(m^vYxTQrrs{9v51f58VV;nfp$g&;%G7|| z-@EN>-;#ip?>d2*?O|+ix#hN46dxF0GHuVU{=`w(~|?#o9*m z(~pv^LFc~kqkUr9;n&~?>(3W(>@91(T`8_3yM!Rv6is((1eMFZz)awNU>rS zD{wI!v%W2(<8NJ}>v&sEtrb^4k)6dA4{^@J?@gdnND8ign(Mbcy4?ra#?^v?cGt?M z8yh)s6B;QPD1>YAsZn|i?hDt|akp47@+>)2GVr0lx;|&UZDF-LpGL0NZNuvNhc`|$ zq3;3fg5S7acPn<@3m1^6A_du6rJewC#wT-RrB1&8n0q_N@BVDI@>ha>}cbi+f zRE4@vEQuswEcFF7z|NZ6vBOy&i46w|@E8BY+_YIi4jdrCDo7{+?M=NzIb>Y{VLZHS zlM}jY`pAUx0xbhKDGUaHq*GFyT!pdd;K3|VV$cDmR55A2gW?n0=BQdsTj{XEsyi}@ zP&S(DBz8wJWNhLJvgwxCpPkb(c79Ar!e9c|GbWL>%Vi2XkbzBAN{K2FL%$!RtZOD~ zSaIX1txa8^jZpytyKUIVS1{=jQ*X^*@5_woNvXG&${3n)4VI8owqoy5sK{s464DF$ z98EtO6S1kCaVq7w(GsJr)Fj-m>qaN69s8V^*emvyT*UGMnVl-aM7@^d&T^}@k`l?S z^TN0{M6bs)wV{hv{BvqPiA~;cFd*#+IyvUS6e5(Vu>^V3r+C8;Z0yKTmtA+pd;fFN zoRn|7oXW-nn$jYc0+}i@dhzyvqms>CM4zkk8Omic_HT`>ayJCIzJxaRb*vM(z-UHD zV~;pDrs*mg>jG-QNBliz<7lkMm|94nd$#y5;+Q~1-7l-!H_tIl^p33`G&KrGB{vganQLfA6{cw_KDm)v@vZaJnW{VZp;NMaAaT+7S^1%>lhM?!hCEkWR6& z?_2>P5K=^R{ zM+2b=oRh6%W@$u&>vV@H`fJtQ<~nL&8>jX5SE6>fP>-8`fJ786Ee=)vq#k9AiOK!* zl+}K??>e1i$LeiuB}b_z72Zw{g?0@YohmhjHJa7H zbjHCuljxtXNKaPxH1U?JpU##B0VKMWEjqklw{BR`op0N(-^J%% z^xUm4!x?x-|K>ffh9k-TKcU6HBpGkR0u(<##Kd4+hWt_g!K{0jF=tmyGt%$Cg5>f; z-3peytJJ4^d(fo)%Z4uw<0`*NHU2tD<9N~rR=m7Dj-#zeIL zTheoT6vpM!LWmZKtNzdk!%z@DPW=F+j$FnC^sU|=-eudq9kxI5>(x#zG;@bp+I3qM z8<#Vd+WpDtPV+92a^}o+;|8<3IC(h`a5g9O{+{scT-tR;A6|etiEsI`tLJ#R?OXym zqQ|kI>_>b;gM^7WCm5t7!}xMzJh5@qn3N34M>0g0J+^u(QFLwij0f6vn77NjLjnLQ zLR%FZnn%=&!KFSKX-{sO>T6Ouw=<$GX>mPh47RKw&Bf^r^VH_`*k~wu>~Zb$)j+Rq zYay|WAZt3RkzpUoGRisnJAP3^i7K_+QE}6TI7Os5Q2tFH(eP;7c12_3+__{J)DNSZ z`}Qv7n%fUrD2Ko{C*b1+q08l+-lDntceY#P&ksNSFluz&%JLt8K2madk?h5En?nz$ zhW>lF=1V?K>ug@^XD^}L@y!L}D~-`b_#yP=SDjPSK1kMrW!`Z*Duo1XF9{iMgH;im$POStmmZnlSKr_9o!ysn>^=3dxZ zyMpMIwERo!nVL&5rONL1!u<+e=I4Bcj1DjXkB_9c>68&<`T4hwOk`zhI0`lJ zfZ0HAOcK5sxkPY)2;O`rJMc4;OO8x^3@Xe8)}(uCIx6Li6rfsT z=js+IAe)$qLLeQm;At${ng5bBb(v=-`uWR&a{v?1#;344weCXrxYRqfEeLxczjmL_ zigP(31l^?0V+bV?u$NAQdBQf1t1OLO%Rl|xEYnDf$M|@?Mqp+!jBLyGcR4_k9oRT_ zxuYv+Q7#LR^}2T(iC{|kN_T&C(or2}tfqBck8!aB-&Lq(Ybsc_{OijG){a`T`FC_( zh3)hOBGga2WbQbsppGof(iHWkHOGFVS%;UL9>~U z{JJVI`b)3i>QRNqO<F(}owOq1Y&W4rR*HSgS4m%bX!%b@m)@-oV|wbIa1qaE%Fhyj+| z-Pmo(d5r4uQ0DqbSOSk|ccv`X$%Z>o#Z0BvoJj*^QIU+u{9k0Tu8gvE6s(N(E3)my zFRm_>J4fr?4Awi(KSDa2(+(9-0#(RL<@oNL=HPdOzPU}uh%1h*-!)N^H>@My6*-l8 zRm$my=b%Ky;aMJ4<{eS$_0;my!twFUw_so_wT}rbs!_&NpNOHCiZx4-Bef(DDXT7| zUl1b{ff%Zwu1fN9&vc@BE2yC5sg3bk!M}%>yh_(^nh||7zJZq9;4)eK&97K{8Z@^l zc-~82v6YrhZV`Z!XZETknR?g{E14>RI8RR3m^*Jj5|`>0 z$QLA*p)Kcj<}h43oU$4`-W%+p*NY%8@mRv@Q`&=4L^~J`uDPFOv5CrxJc3D=L9kgU zW(uwMBIoQSp;e(7tuT!(XJ7z8N5nnGpk`d2N@_Rp&mAKiLYiLXy2rohiiz4uV$8WL zi_WnXccS$|B`b1NYXQnH2sik8Ik&c53K9kNuH1)#)U~vy_ccy0o~?c#gpbo;=_#w|4*W@PeGGSj@0opwmmy4aYUkZNt}~vfq?z*8 zFi^dxl8x+ZW@V?WrB(i&TbuyVtzkb|jAN_K_-C#1PY~~-`IUNd?|~(2uhWdR%esOz zb+?$+ZP~JumPESjU{oTiDEEzqkdjs;=SCyeS0JtAZO_kA7h#;xd>v;}TD`O)RIybjIQKA;yA{j{B}%v$#rzR9c4mESu5>OXJGQ*?jaO%i{;y6hMEW}SAY}&) zMHOn*_N(lpu0xybRNbaqV?tjYKRx2->Uhk6w8f=u@cAWh#a$b*ft6Bn(0R?*%exl7 zRc@}D9=TX&>#wwlZEo<;cdAPB%yt7-`wq{Id(c`pwH&d$6sHuIR-vr`E_H^{N9UEJ zTa`wk@KUZQH(6fHsTnM1rI2U$^UJ|m9XzQGb);5_`;930 zcffb@{*4z@8RjZd;qxzR4Q&(v0SC#?F4-yNM3DA@d{IK&GI#gj?4=vZcaGyPA0Uxr-#hX?lA5JsN}}R3n$x6wSstQZz=ZW{?fL(R;ZJ!HAF5E2me zB=jlxHMgU)i4DXJ#y&%9wtIW&Ycv0OhReHjDYB*ZqHme~HWJ)aEpdU0xjzsW5i!n+ zaB?+qaIjPb20;BE47Oc8U1(MFkgWK<;JQaH@(96}SE1qNL(!<4tmqZ4uS&&-JOk8# zs|%2MYdJ5dkb<{7F2~bT7Jtjg<_hn;o^N#((pUNW=89)AX-cG0*L%%H)(Xbrd>PdK z><9W+mC62v@xn?reRp^bE-hi-M)uREk@kv*R#x1F^1zGM8C4{q29zjI&drZx->cR&2EQ50 zn`TcZ9BXY1A7~1>%E<+#lSth{HG?M{Mj=7qP`eAts_lVUKPTb-7@7%~E3AsDHBlv`khQU0nBQ8Mf7qCdtoGcIgcvOJtP-?%#+=GiS0^R`0C1z3wBr(EwWx`1L4!ane{(AP|0eQyh~v220I`^bk>eY5bkt>> z>+^!Lk|*p)rye3vxhF?e$OG($FLug}aZe?4;>37plH#td@=J6QWy4Ky z$?2hevO*bO&xW@{^>O-9m!7;m=_SQQav?M9Vpm6_;&7T1>HGsEaYS0mbzX9%17N?| z)iFhc7YrbDeSM%}e!wmX{>^mFbzD*{_Z#AGd-}WL)LS!-(2-JJ5Akoo@!P&CJcgMG zm-5SpGj!L?lr`h_0*JfLL&4R5Mfv97_g6rkDUj=YV)VPC?g0^P>0s1Uo$7)c7y-f% z$C)XM;Wp+M9GtKK9Ti;fgVp-ikoiaL7MxtJ&y~V3V(Kaps*o4dE8wvW%EzPyRvE%5172>hYIY%!F`gbimK$g+|L_PnU6m9_EB4;&x?F6WwJW*%#r0`p}<3 zMg5oL^2)c9FI4_9yTkQ4dw~9Hsf1)c=ZwC$*GgzN8cQ8RTpz|+b!AH{M( zK~s3u^}UsVgcC?A=mzg-!8KQRz|*_z1o~P2)^dWZjxDYTo33U~&XQzd-~r$k{4;em z|LSl8wODH_-rr_ndDIrSe%UQo|BTcBpQ}#Jg%$5OBDn3G;yKa40*v;t_Kn4U;s*x= za1L{GhWszGnPAX|PxOFX(vX0FWq1Q0%ad9<^-g%@$ zYy`Xc>2|oQ#4tpTQ#tyT9alf}$xpdz0tp?h*Z7$}?UMmAEm&y>jGaDJ<7Z3GGA zjg5tJ^)j33^T-#Q(QsK?9dwVa4yH;aAWcUXZgyGRKMKAOJf3ksPx+pkIL+VIaFxVm z;C6=e(D`bhHg{b*X^q$x9PSETxPdPYj627amGH)k9Tel&CA)V2Vj9mlx5iIXQ+R6C zg%GTNa&rh^k6_9TD>nXW-i-0(-iXwPf z_>JPh+8fXQcm{a{$|_>u0Ayk5D^|5#-h?`4F!FdxlrtX2K!s>BuDL>GeY>>$Ej!-j z=ZTfkv}I%f^6sr7(u{R^%w9t$#$&F4Ic~vb9C-FzS6lm%6f^aeJ%kQ(Q6uY0zGXei zuV~(0r_t$Au@Ry}>Oe0#g(2KS*L%FC;A5r8;~5o(X<$KH6OU-Ddmlq~>-)2|u>kX8 z*Hs?*(2fdwSznzG-k$zG28z~1h8X?^cw624-r;gpOtj4r)SZ^((0O_CnE{XOhfO1{ z3lC__dZm3hwI!txks)Q$@TCG3E?fnlaNDf{aGnPstvrCrs`6};mWDy0^b4Ti-sw-V zSy>sSBmn#So$i@brDvG2XJ+1lv{dCe&Bg3|>f^Lw?L$j+=Auc7+@3-tlxWU2p?ac8 zv%r`*0#-Oaw|7VS(*AHy{7yh9HS!@cM&tIAs@4KQ$}npk&!>(a^s`XbpropwsAooF2_;-4EbRda@7R=7I>xJY3@8Dh zq~F9I^V*oztg31l!Uo^;jMAh_cj?e2sGIU=oC97m%i(fM>IhWidZ#wqM2Q?C_QC7^86K6SNr+(%qk?_pJ1^R%EK5wSr@4i)y{<@Lv z2!W*Q)Th0~FT53XS{@Y&e3hM#Fw9YLJ~mXhw+%}j7bcG^3SIluu+h9^eS>XXO@X#n zRig=&O(^;i4yp&S%B*RtTJ#Z+mbdi;tuH=Slhe$N6gj1u=(3qonC($T zh|H=vQrj4L`=MFOYh9M^!)T(hH`6e%r05y*z>+p$El-l#eeHba1j#IP{bg5H8o5m> zM4_DPt!N3P$vTT@Wz!qyVo64?C-2ci4B&d~huB$0hSrKalsXi9NBu6bkT=wG&%HiQ zr2Gb3USjHvW8bK{HA9EJJ~{$hBW)Qgru0I>dMQ~IUq>C4qcnB7bKW_$O()#gBajG} z@<+)|wIEO=O3M0GldDkGhxZ<2BR^gG&h_YEXCK!ny`b5kb52rHOINSg@8g)~N7G}z z%?*)%T~2!XXXu!Fno>cDSVBlh+S%dlFvU09@A^`$CCF4EdVHi{fPHRfKSmva%zBS)C@Y=13arG##y78Oj(-L9&i2@VZY`>BhD|M@nv!`rAi#<#3N)!ziq0P*UNl%nqZABp{;^*b^{aPNsKih?- zmD#J>6*pdwmE=^&3cdO0zDtK~NHeLX7+t~DB-}P7Imz{RuX55xPZ%SdOl_)QR<2Az z5G}fMPN*gCJgGlFAU8%Az8IjwUMEpigF* zp_w9LFA6VaiKen@MROn=slzYlyP=Otwq=K*>f`;WrCt7JhA?=0b;VImY$liFr19V` zxDM+-tvlOJ(PaJ38$77~ZhoAVgBq zalCV7)i>vLiM^F^{xVuTgXKO|Xb6m(qm(=y5p4i#xy$bIQal6L4&wj5Pv*h-#5d<* zR1_Yr*iQrrz}I0(?lrTRdDYzs7!VUgj>z!K6ckY}Sp18E z*E?N4=YLuY7PN)lMag-(286k164MD%LaJptFaJm$rmq6=c5pA<+=X1!oh#>+5cH$`1HsCwdA;4hLT-Q3y-xW z?OqLMBJ?RN@W%Xi#b3ITs^`Ypkvh;QGozjo=8hk7h#vxP(=)`0M{GJ1<Q=eBiN8mEc@R{Qb7#$K6Cl{8_@D%Yp?K&aq58zkhA zH{#^%Slc_2_E-H!(cS@+4Y$0fcSrQ*t1v&;`U)P_C9?Cu`U1Io_lHX!hf7Ds5Hbpy zG-OcOrrO)?<(|{kj$OO^4{Gcgr=*76V{Rnr?l7!e?T@vDPD^kPRA>80T|7e3~8eNP{@+(iHQtxV-VTXC4&eEqF|(#|#9$<-`J!O3dsOvK7qE{WLRNJk;zVQ5Tbd zG6jDLUWZ-0Yr&#w<0Fe*-5=gR+A{My5w|-wXJDW(L%{|9Z~$%wiuCnm=POV_8hx#C zZglb-aFBN=;=_j3qICnC5UxtL5&W;0a#xtfP&<6g`58#khbJ(;x6r;|jhIR3pYyqL z)d7J}!zPrEy`0K5Opp3^Cv8Ne=2vRp0D#~-_p0qw*g=#(C2t7fgfPF2&8-m49&KN`A#<~b1H!c6tYz0YDtJ5 zhD2p#MsYc#5Uf1k|0?A>!0Bf! zE_-1;tso6oh@aD=Pc{dV*z`!R1bb#OM8=-`SC!3yuEj@pC#N>(BV^YazTF73OO?V}JO(RZ@5DhwCl^@pbUW0o4^B7w(P z-fl8Dwzpp?3tVa=)K~w^eSu0KtsH^u11iiL@Vifp5AsjvZY>}$=*t^F5z8T$Sl4r((P$UgRGrcv{|D&!irIe#LGVfUJ<;Y<&Lnf;Tq~MjW=m(!VMMy zF=24w|CV|iMGF4Sz0zp$(FduFuWm%6_&#TT)4PHxBUg3=4z#_tw%BoW9dTl|7=+jL zZxBgRc-*5cfeTJZk187Xx^BPPY-~7teQL+E0 zWRn$(!MaU$U@trs!-^O;t>7|nl>YR7q`85Ly)@vE+v50bt~8~Bl&2Y=8%w8BE3mN( znjWr_&zXx(TZqx<*o}mU1_S0`e7?=-rxsDNv5V{%X_jJR)LiU0gBKpagf<+CV#6=tm11#jL;AiawWI0ve!aF%-bJTHd7m&@mA&Y9Qv zB`~i1V%PO1b{*R4pPjb7_Y zMmTqi5ap$Yx8#WXyz9P2)d#o`tPk)_bw0jI`Rvt-Nj*hmv&60M^wJ0O?gs;NM9YnV8L=v>f?q`X>0D|q7?FZt&@t#+&QUC~F>-F@L z8oq$QIiVw3Y(8E#eIu?fxxbNN!|5cc?E)v`G=rg$z?PL&!5E*DiTcll#1uMt{Uxdn z4^goy{^pc_{K;r@Hk8y4+*S2s+c`2dC^u1n;sX0rLWs0RBGy~SeAm8ahgwLfjG>7= z-|7Q}{QgYcAo~v|0b*tE=fc5Ts5=bUo*NP?WenZ-Q-V*57O=y>Vk0oY@Y|%k<;*8d zWta7e%JF^eJ9lb+fAY#$0gcp;ksRqU#*Ljl{w9i^zY7UV)<}3W>P>apu9>r*lC5?2 z?{8`UXWqB2FI;8Jx@_;=vs+E%HT7yD5{#FLZ(p7428_h1BC%b|T`=*m-0g{XBi0e65M?ojHCVyyfQYnSUjz#+^6zPW4xoLmfZ9 z94iVsmz}^T|9$_*G#(&v&&j8s)XvVzf%_=zc*XxFstV(4#=eHwGOLSMQ zsohgcMXS diff --git a/dbus.go b/dbus.go index 9d024de..16b6abd 100644 --- a/dbus.go +++ b/dbus.go @@ -6,10 +6,9 @@ import ( "path" "strings" + "github.com/godbus/dbus" + "github.com/godbus/dbus/introspect" "github.com/op/go-logging" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus/introspect" - // "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" ) const introspectXml = ` diff --git a/fw-settings/builder.go b/fw-settings/builder.go index a82d878..c66bca2 100644 --- a/fw-settings/builder.go +++ b/fw-settings/builder.go @@ -7,8 +7,8 @@ import ( "path/filepath" "reflect" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gtk" "github.com/subgraph/fw-daemon/fw-settings/definitions" ) diff --git a/fw-settings/config.go b/fw-settings/config.go index 6e82d22..6aa2542 100644 --- a/fw-settings/config.go +++ b/fw-settings/config.go @@ -1,8 +1,8 @@ package main import ( - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" + "github.com/gotk3/gotk3/gtk" + "github.com/op/go-logging" ) var levelToId = map[int32]string{ diff --git a/fw-settings/dbus.go b/fw-settings/dbus.go index a4b9efe..5010ce7 100644 --- a/fw-settings/dbus.go +++ b/fw-settings/dbus.go @@ -1,7 +1,7 @@ package main import ( - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus" + "github.com/godbus/dbus" ) type dbusObject struct { diff --git a/fw-settings/main.go b/fw-settings/main.go index 72edc65..50017eb 100644 --- a/fw-settings/main.go +++ b/fw-settings/main.go @@ -4,8 +4,8 @@ import ( "os" "fmt" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gtk" ) func failDialog(parent *gtk.Window, format string, args ...interface{}) { diff --git a/fw-settings/rule_edit.go b/fw-settings/rule_edit.go index c312470..a491c2f 100644 --- a/fw-settings/rule_edit.go +++ b/fw-settings/rule_edit.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk" + "github.com/gotk3/gotk3/gtk" "net" "strconv" "strings" diff --git a/fw-settings/rules.go b/fw-settings/rules.go index 78d32a0..341c648 100644 --- a/fw-settings/rules.go +++ b/fw-settings/rules.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk" + "github.com/gotk3/gotk3/gtk" "strings" ) diff --git a/main.go b/main.go index d1948f8..4ce5107 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,6 @@ import ( "github.com/subgraph/fw-daemon/nfqueue" "github.com/subgraph/go-procsnitch" - // "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/op/go-logging" "github.com/op/go-logging" ) diff --git a/prompt.go b/prompt.go index f13573b..d0bafdd 100644 --- a/prompt.go +++ b/prompt.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus" + "github.com/godbus/dbus" "os/user" "strconv" "sync" diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/CONTRIBUTING.md b/vendor/github.com/godbus/dbus/CONTRIBUTING.md similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/CONTRIBUTING.md rename to vendor/github.com/godbus/dbus/CONTRIBUTING.md diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE b/vendor/github.com/godbus/dbus/LICENSE similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/LICENSE rename to vendor/github.com/godbus/dbus/LICENSE diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/MAINTAINERS b/vendor/github.com/godbus/dbus/MAINTAINERS similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/MAINTAINERS rename to vendor/github.com/godbus/dbus/MAINTAINERS diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/README.markdown b/vendor/github.com/godbus/dbus/README.markdown similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/README.markdown rename to vendor/github.com/godbus/dbus/README.markdown diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/auth.go b/vendor/github.com/godbus/dbus/auth.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/auth.go rename to vendor/github.com/godbus/dbus/auth.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/auth_external.go b/vendor/github.com/godbus/dbus/auth_external.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/auth_external.go rename to vendor/github.com/godbus/dbus/auth_external.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/auth_sha1.go b/vendor/github.com/godbus/dbus/auth_sha1.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/auth_sha1.go rename to vendor/github.com/godbus/dbus/auth_sha1.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/call.go b/vendor/github.com/godbus/dbus/call.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/call.go rename to vendor/github.com/godbus/dbus/call.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/conn.go b/vendor/github.com/godbus/dbus/conn.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/conn.go rename to vendor/github.com/godbus/dbus/conn.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/conn_darwin.go b/vendor/github.com/godbus/dbus/conn_darwin.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/conn_darwin.go rename to vendor/github.com/godbus/dbus/conn_darwin.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/conn_other.go b/vendor/github.com/godbus/dbus/conn_other.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/conn_other.go rename to vendor/github.com/godbus/dbus/conn_other.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/dbus.go b/vendor/github.com/godbus/dbus/dbus.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/dbus.go rename to vendor/github.com/godbus/dbus/dbus.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/decoder.go b/vendor/github.com/godbus/dbus/decoder.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/decoder.go rename to vendor/github.com/godbus/dbus/decoder.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/doc.go b/vendor/github.com/godbus/dbus/doc.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/doc.go rename to vendor/github.com/godbus/dbus/doc.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/encoder.go b/vendor/github.com/godbus/dbus/encoder.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/encoder.go rename to vendor/github.com/godbus/dbus/encoder.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/export.go b/vendor/github.com/godbus/dbus/export.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/export.go rename to vendor/github.com/godbus/dbus/export.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/homedir.go b/vendor/github.com/godbus/dbus/homedir.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/homedir.go rename to vendor/github.com/godbus/dbus/homedir.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/homedir_dynamic.go b/vendor/github.com/godbus/dbus/homedir_dynamic.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/homedir_dynamic.go rename to vendor/github.com/godbus/dbus/homedir_dynamic.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/homedir_static.go b/vendor/github.com/godbus/dbus/homedir_static.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/homedir_static.go rename to vendor/github.com/godbus/dbus/homedir_static.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/introspect/call.go b/vendor/github.com/godbus/dbus/introspect/call.go similarity index 87% rename from Godeps/_workspace/src/github.com/godbus/dbus/introspect/call.go rename to vendor/github.com/godbus/dbus/introspect/call.go index e646d88..790a23e 100644 --- a/Godeps/_workspace/src/github.com/godbus/dbus/introspect/call.go +++ b/vendor/github.com/godbus/dbus/introspect/call.go @@ -2,7 +2,7 @@ package introspect import ( "encoding/xml" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus" + "github.com/godbus/dbus" "strings" ) diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/introspect/introspect.go b/vendor/github.com/godbus/dbus/introspect/introspect.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/introspect/introspect.go rename to vendor/github.com/godbus/dbus/introspect/introspect.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/introspect/introspectable.go b/vendor/github.com/godbus/dbus/introspect/introspectable.go similarity index 96% rename from Godeps/_workspace/src/github.com/godbus/dbus/introspect/introspectable.go rename to vendor/github.com/godbus/dbus/introspect/introspectable.go index 09a0dc5..2f16690 100644 --- a/Godeps/_workspace/src/github.com/godbus/dbus/introspect/introspectable.go +++ b/vendor/github.com/godbus/dbus/introspect/introspectable.go @@ -2,7 +2,7 @@ package introspect import ( "encoding/xml" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/godbus/dbus" + "github.com/godbus/dbus" "reflect" "strings" ) diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/message.go b/vendor/github.com/godbus/dbus/message.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/message.go rename to vendor/github.com/godbus/dbus/message.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/object.go b/vendor/github.com/godbus/dbus/object.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/object.go rename to vendor/github.com/godbus/dbus/object.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/sig.go b/vendor/github.com/godbus/dbus/sig.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/sig.go rename to vendor/github.com/godbus/dbus/sig.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/transport_darwin.go b/vendor/github.com/godbus/dbus/transport_darwin.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/transport_darwin.go rename to vendor/github.com/godbus/dbus/transport_darwin.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/transport_generic.go b/vendor/github.com/godbus/dbus/transport_generic.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/transport_generic.go rename to vendor/github.com/godbus/dbus/transport_generic.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/transport_unix.go b/vendor/github.com/godbus/dbus/transport_unix.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/transport_unix.go rename to vendor/github.com/godbus/dbus/transport_unix.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/transport_unixcred_dragonfly.go b/vendor/github.com/godbus/dbus/transport_unixcred_dragonfly.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/transport_unixcred_dragonfly.go rename to vendor/github.com/godbus/dbus/transport_unixcred_dragonfly.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/transport_unixcred_linux.go b/vendor/github.com/godbus/dbus/transport_unixcred_linux.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/transport_unixcred_linux.go rename to vendor/github.com/godbus/dbus/transport_unixcred_linux.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/variant.go b/vendor/github.com/godbus/dbus/variant.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/variant.go rename to vendor/github.com/godbus/dbus/variant.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/variant_lexer.go b/vendor/github.com/godbus/dbus/variant_lexer.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/variant_lexer.go rename to vendor/github.com/godbus/dbus/variant_lexer.go diff --git a/Godeps/_workspace/src/github.com/godbus/dbus/variant_parser.go b/vendor/github.com/godbus/dbus/variant_parser.go similarity index 100% rename from Godeps/_workspace/src/github.com/godbus/dbus/variant_parser.go rename to vendor/github.com/godbus/dbus/variant_parser.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/LICENSE b/vendor/github.com/gotk3/gotk3/LICENSE similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/LICENSE rename to vendor/github.com/gotk3/gotk3/LICENSE diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/antialias.go b/vendor/github.com/gotk3/gotk3/cairo/antialias.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/antialias.go rename to vendor/github.com/gotk3/gotk3/cairo/antialias.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/cairo.go b/vendor/github.com/gotk3/gotk3/cairo/cairo.go similarity index 96% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/cairo.go rename to vendor/github.com/gotk3/gotk3/cairo/cairo.go index dd6b0ba..f5df44f 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/cairo.go +++ b/vendor/github.com/gotk3/gotk3/cairo/cairo.go @@ -26,7 +26,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/canvas.go b/vendor/github.com/gotk3/gotk3/cairo/canvas.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/canvas.go rename to vendor/github.com/gotk3/gotk3/cairo/canvas.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/errors.go b/vendor/github.com/gotk3/gotk3/cairo/errors.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/errors.go rename to vendor/github.com/gotk3/gotk3/cairo/errors.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/fillrule.go b/vendor/github.com/gotk3/gotk3/cairo/fillrule.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/fillrule.go rename to vendor/github.com/gotk3/gotk3/cairo/fillrule.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/linecap.go b/vendor/github.com/gotk3/gotk3/cairo/linecap.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/linecap.go rename to vendor/github.com/gotk3/gotk3/cairo/linecap.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/linejoin.go b/vendor/github.com/gotk3/gotk3/cairo/linejoin.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/linejoin.go rename to vendor/github.com/gotk3/gotk3/cairo/linejoin.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/mimetype.go b/vendor/github.com/gotk3/gotk3/cairo/mimetype.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/mimetype.go rename to vendor/github.com/gotk3/gotk3/cairo/mimetype.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/operator.go b/vendor/github.com/gotk3/gotk3/cairo/operator.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/operator.go rename to vendor/github.com/gotk3/gotk3/cairo/operator.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/status.go b/vendor/github.com/gotk3/gotk3/cairo/status.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/status.go rename to vendor/github.com/gotk3/gotk3/cairo/status.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/surface.go b/vendor/github.com/gotk3/gotk3/cairo/surface.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/surface.go rename to vendor/github.com/gotk3/gotk3/cairo/surface.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/surfacetype.go b/vendor/github.com/gotk3/gotk3/cairo/surfacetype.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/surfacetype.go rename to vendor/github.com/gotk3/gotk3/cairo/surfacetype.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/text.go b/vendor/github.com/gotk3/gotk3/cairo/text.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/text.go rename to vendor/github.com/gotk3/gotk3/cairo/text.go index a14f6ef..45fe298 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/text.go +++ b/vendor/github.com/gotk3/gotk3/cairo/text.go @@ -124,4 +124,3 @@ func (v *Context) TextExtents(utf8 string) TextExtents { // TODO: cairo_text_cluster_allocate // TODO: cairo_text_cluster_free - diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/translations.go b/vendor/github.com/gotk3/gotk3/cairo/translations.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/translations.go rename to vendor/github.com/gotk3/gotk3/cairo/translations.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/util.go b/vendor/github.com/gotk3/gotk3/cairo/util.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/cairo/util.go rename to vendor/github.com/gotk3/gotk3/cairo/util.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk.go b/vendor/github.com/gotk3/gotk3/gdk/gdk.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk.go rename to vendor/github.com/gotk3/gotk3/gdk/gdk.go index d38ef78..51b7f57 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk.go +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk.go @@ -28,7 +28,7 @@ import ( "strconv" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk.go.h b/vendor/github.com/gotk3/gotk3/gdk/gdk.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk.go.h rename to vendor/github.com/gotk3/gotk3/gdk/gdk.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk_3_6-8.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_3_6-8.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk_3_6-8.go rename to vendor/github.com/gotk3/gotk3/gdk/gdk_3_6-8.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go rename to vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/screen.go b/vendor/github.com/gotk3/gotk3/gdk/screen.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/screen.go rename to vendor/github.com/gotk3/gotk3/gdk/screen.go index b639631..6164731 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/screen.go +++ b/vendor/github.com/gotk3/gotk3/gdk/screen.go @@ -8,7 +8,7 @@ import ( "runtime" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/screen_no_x11.go b/vendor/github.com/gotk3/gotk3/gdk/screen_no_x11.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/screen_no_x11.go rename to vendor/github.com/gotk3/gotk3/gdk/screen_no_x11.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/screen_x11.go b/vendor/github.com/gotk3/gotk3/gdk/screen_x11.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/screen_x11.go rename to vendor/github.com/gotk3/gotk3/gdk/screen_x11.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/window_no_x11.go b/vendor/github.com/gotk3/gotk3/gdk/window_no_x11.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/window_no_x11.go rename to vendor/github.com/gotk3/gotk3/gdk/window_no_x11.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/window_x11.go b/vendor/github.com/gotk3/gotk3/gdk/window_x11.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gdk/window_x11.go rename to vendor/github.com/gotk3/gotk3/gdk/window_x11.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/application.go b/vendor/github.com/gotk3/gotk3/glib/application.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/application.go rename to vendor/github.com/gotk3/gotk3/glib/application.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/connect.go b/vendor/github.com/gotk3/gotk3/glib/connect.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/connect.go rename to vendor/github.com/gotk3/gotk3/glib/connect.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/glib.go b/vendor/github.com/gotk3/gotk3/glib/glib.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/glib.go rename to vendor/github.com/gotk3/gotk3/glib/glib.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/glib.go.h b/vendor/github.com/gotk3/gotk3/glib/glib.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/glib.go.h rename to vendor/github.com/gotk3/gotk3/glib/glib.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/glib_extension.go b/vendor/github.com/gotk3/gotk3/glib/glib_extension.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/glib_extension.go rename to vendor/github.com/gotk3/gotk3/glib/glib_extension.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariant.go b/vendor/github.com/gotk3/gotk3/glib/gvariant.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariant.go rename to vendor/github.com/gotk3/gotk3/glib/gvariant.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariant.go.h b/vendor/github.com/gotk3/gotk3/glib/gvariant.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariant.go.h rename to vendor/github.com/gotk3/gotk3/glib/gvariant.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantbuilder.go b/vendor/github.com/gotk3/gotk3/glib/gvariantbuilder.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantbuilder.go rename to vendor/github.com/gotk3/gotk3/glib/gvariantbuilder.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantclass.go b/vendor/github.com/gotk3/gotk3/glib/gvariantclass.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantclass.go rename to vendor/github.com/gotk3/gotk3/glib/gvariantclass.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantdict.go b/vendor/github.com/gotk3/gotk3/glib/gvariantdict.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantdict.go rename to vendor/github.com/gotk3/gotk3/glib/gvariantdict.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantiter.go b/vendor/github.com/gotk3/gotk3/glib/gvariantiter.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/gvariantiter.go rename to vendor/github.com/gotk3/gotk3/glib/gvariantiter.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/list.go b/vendor/github.com/gotk3/gotk3/glib/list.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/list.go rename to vendor/github.com/gotk3/gotk3/glib/list.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/menu.go b/vendor/github.com/gotk3/gotk3/glib/menu.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/menu.go rename to vendor/github.com/gotk3/gotk3/glib/menu.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/notifications.go b/vendor/github.com/gotk3/gotk3/glib/notifications.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/notifications.go rename to vendor/github.com/gotk3/gotk3/glib/notifications.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/glib/slist.go b/vendor/github.com/gotk3/gotk3/glib/slist.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/glib/slist.go rename to vendor/github.com/gotk3/gotk3/glib/slist.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/aboutdialog.go b/vendor/github.com/gotk3/gotk3/gtk/aboutdialog.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/aboutdialog.go rename to vendor/github.com/gotk3/gotk3/gtk/aboutdialog.go index 7c491e6..a648fed 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/aboutdialog.go +++ b/vendor/github.com/gotk3/gotk3/gtk/aboutdialog.go @@ -6,8 +6,8 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/accel.go b/vendor/github.com/gotk3/gotk3/gtk/accel.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/accel.go rename to vendor/github.com/gotk3/gotk3/gtk/accel.go index a600ca1..cbd138d 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/accel.go +++ b/vendor/github.com/gotk3/gotk3/gtk/accel.go @@ -9,8 +9,8 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) // AccelFlags is a representation of GTK's GtkAccelFlags diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go similarity index 97% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go rename to vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go index 929ecc9..4d1a2f2 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go +++ b/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go @@ -32,7 +32,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h b/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h rename to vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/app_chooser.go b/vendor/github.com/gotk3/gotk3/gtk/app_chooser.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/app_chooser.go rename to vendor/github.com/gotk3/gotk3/gtk/app_chooser.go index 63b0b0a..3793886 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/app_chooser.go +++ b/vendor/github.com/gotk3/gotk3/gtk/app_chooser.go @@ -6,7 +6,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application.go b/vendor/github.com/gotk3/gotk3/gtk/application.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application.go rename to vendor/github.com/gotk3/gotk3/gtk/application.go index c144f34..dbdeefe 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application.go +++ b/vendor/github.com/gotk3/gotk3/gtk/application.go @@ -10,7 +10,7 @@ import ( "runtime" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) // ApplicationInhibitFlags is a representation of GTK's GtkApplicationInhibitFlags. diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/application_since_3_12.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_since_3_12.go rename to vendor/github.com/gotk3/gotk3/gtk/application_since_3_12.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/application_since_3_14.go similarity index 93% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_since_3_14.go rename to vendor/github.com/gotk3/gotk3/gtk/application_since_3_14.go index 7fee467..b783911 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_since_3_14.go +++ b/vendor/github.com/gotk3/gotk3/gtk/application_since_3_14.go @@ -10,7 +10,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) // PrefersAppMenu is a wrapper around gtk_application_prefers_app_menu(). diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_window.go b/vendor/github.com/gotk3/gotk3/gtk/application_window.go similarity index 95% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_window.go rename to vendor/github.com/gotk3/gotk3/gtk/application_window.go index 32b1d1e..da8bca8 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/application_window.go +++ b/vendor/github.com/gotk3/gotk3/gtk/application_window.go @@ -9,7 +9,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/color_chooser.go b/vendor/github.com/gotk3/gotk3/gtk/color_chooser.go similarity index 96% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/color_chooser.go rename to vendor/github.com/gotk3/gotk3/gtk/color_chooser.go index 6419903..e649e60 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/color_chooser.go +++ b/vendor/github.com/gotk3/gotk3/gtk/color_chooser.go @@ -6,8 +6,8 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/combo_box.go b/vendor/github.com/gotk3/gotk3/gtk/combo_box.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/combo_box.go rename to vendor/github.com/gotk3/gotk3/gtk/combo_box.go index 0dc7097..3438b45 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/combo_box.go +++ b/vendor/github.com/gotk3/gotk3/gtk/combo_box.go @@ -7,7 +7,7 @@ import ( "errors" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk.go b/vendor/github.com/gotk3/gotk3/gtk/gtk.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk.go index 5b57160..e36e00b 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk.go +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk.go @@ -56,9 +56,9 @@ import ( "sync" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk.go.h rename to vendor/github.com/gotk3/gotk3/gtk/gtk.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go index dd9f7ee..9d4a4ae 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go @@ -10,7 +10,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h rename to vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go similarity index 90% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go index e0dd8de..6f4e994 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go @@ -10,7 +10,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gdk" ) // OverrideColor is a wrapper around gtk_widget_override_color(). diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_export.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_export.go similarity index 91% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_export.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk_export.go index 59e595f..cf3e3c4 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_export.go +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_export.go @@ -6,7 +6,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) //export goBuilderConnect diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go index 7dbb6e8..99ded8b 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go @@ -14,8 +14,8 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h rename to vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go rename to vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/info_bar.go b/vendor/github.com/gotk3/gotk3/gtk/info_bar.go similarity index 96% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/info_bar.go rename to vendor/github.com/gotk3/gotk3/gtk/info_bar.go index b33c1e8..f6aa336 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/info_bar.go +++ b/vendor/github.com/gotk3/gotk3/gtk/info_bar.go @@ -6,7 +6,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/label.go b/vendor/github.com/gotk3/gotk3/gtk/label.go similarity index 97% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/label.go rename to vendor/github.com/gotk3/gotk3/gtk/label.go index 0a649c6..39ffb29 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/label.go +++ b/vendor/github.com/gotk3/gotk3/gtk/label.go @@ -9,9 +9,9 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/pango" + "github.com/gotk3/gotk3/pango" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/level_bar.go b/vendor/github.com/gotk3/gotk3/gtk/level_bar.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/level_bar.go rename to vendor/github.com/gotk3/gotk3/gtk/level_bar.go index b0d4af4..74ddcf0 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/level_bar.go +++ b/vendor/github.com/gotk3/gotk3/gtk/level_bar.go @@ -6,7 +6,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go rename to vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/menu_shell.go b/vendor/github.com/gotk3/gotk3/gtk/menu_shell.go similarity index 97% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/menu_shell.go rename to vendor/github.com/gotk3/gotk3/gtk/menu_shell.go index d9759fe..295fa34 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/menu_shell.go +++ b/vendor/github.com/gotk3/gotk3/gtk/menu_shell.go @@ -9,7 +9,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/popover_since_3_12.go similarity index 96% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_12.go rename to vendor/github.com/gotk3/gotk3/gtk/popover_since_3_12.go index cd307e5..4252ad0 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_12.go +++ b/vendor/github.com/gotk3/gotk3/gtk/popover_since_3_12.go @@ -31,7 +31,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_12.go.h b/vendor/github.com/gotk3/gotk3/gtk/popover_since_3_12.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_12.go.h rename to vendor/github.com/gotk3/gotk3/gtk/popover_since_3_12.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_18.go b/vendor/github.com/gotk3/gotk3/gtk/popover_since_3_18.go similarity index 89% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_18.go rename to vendor/github.com/gotk3/gotk3/gtk/popover_since_3_18.go index ca1b5dd..71b64da 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/popover_since_3_18.go +++ b/vendor/github.com/gotk3/gotk3/gtk/popover_since_3_18.go @@ -10,7 +10,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) //void diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/settings.go b/vendor/github.com/gotk3/gotk3/gtk/settings.go similarity index 92% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/settings.go rename to vendor/github.com/gotk3/gotk3/gtk/settings.go index 1deea98..15841b7 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/settings.go +++ b/vendor/github.com/gotk3/gotk3/gtk/settings.go @@ -6,7 +6,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/settings.go.h b/vendor/github.com/gotk3/gotk3/gtk/settings.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/settings.go.h rename to vendor/github.com/gotk3/gotk3/gtk/settings.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/stack_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/stack_since_3_12.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/stack_since_3_12.go rename to vendor/github.com/gotk3/gotk3/gtk/stack_since_3_12.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go similarity index 95% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go rename to vendor/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go index d8845c4..773b45a 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go +++ b/vendor/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go @@ -14,7 +14,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/style.go b/vendor/github.com/gotk3/gotk3/gtk/style.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/style.go rename to vendor/github.com/gotk3/gotk3/gtk/style.go index 538fe90..47fb2da 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/style.go +++ b/vendor/github.com/gotk3/gotk3/gtk/style.go @@ -9,8 +9,8 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) type StyleProviderPriority int diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/tree_view.go b/vendor/github.com/gotk3/gotk3/gtk/tree_view.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/tree_view.go rename to vendor/github.com/gotk3/gotk3/gtk/tree_view.go index cdfa985..17ba324 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/tree_view.go +++ b/vendor/github.com/gotk3/gotk3/gtk/tree_view.go @@ -10,8 +10,8 @@ import ( "runtime" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/tree_view_column.go b/vendor/github.com/gotk3/gotk3/gtk/tree_view_column.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/tree_view_column.go rename to vendor/github.com/gotk3/gotk3/gtk/tree_view_column.go index 7e6fde7..24182e8 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/tree_view_column.go +++ b/vendor/github.com/gotk3/gotk3/gtk/tree_view_column.go @@ -9,7 +9,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/version.go b/vendor/github.com/gotk3/gotk3/gtk/version.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/version.go rename to vendor/github.com/gotk3/gotk3/gtk/version.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/widget.go b/vendor/github.com/gotk3/gotk3/gtk/widget.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/widget.go rename to vendor/github.com/gotk3/gotk3/gtk/widget.go index 2cfd2ce..a0108a3 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/widget.go +++ b/vendor/github.com/gotk3/gotk3/gtk/widget.go @@ -10,8 +10,8 @@ import ( "errors" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/widget_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_12.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/widget_since_3_12.go rename to vendor/github.com/gotk3/gotk3/gtk/widget_since_3_12.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/widget_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/widget_since_3_8.go rename to vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/window.go b/vendor/github.com/gotk3/gotk3/gtk/window.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/window.go rename to vendor/github.com/gotk3/gotk3/gtk/window.go index 6b8d0ca..497796d 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/window.go +++ b/vendor/github.com/gotk3/gotk3/gtk/window.go @@ -10,8 +10,8 @@ import ( "errors" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/gdk" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" ) /* diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/window_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_10.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/gtk/window_since_3_10.go rename to vendor/github.com/gotk3/gotk3/gtk/window_since_3_10.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-attributes.go b/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-attributes.go rename to vendor/github.com/gotk3/gotk3/pango/pango-attributes.go index 3964f42..fa06356 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-attributes.go +++ b/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go @@ -25,7 +25,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-attributes.go.h b/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-attributes.go.h rename to vendor/github.com/gotk3/gotk3/pango/pango-attributes.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-context.go b/vendor/github.com/gotk3/gotk3/pango/pango-context.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-context.go rename to vendor/github.com/gotk3/gotk3/pango/pango-context.go index 66462fe..51c6db6 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-context.go +++ b/vendor/github.com/gotk3/gotk3/pango/pango-context.go @@ -25,7 +25,7 @@ import "C" import ( "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-font.go b/vendor/github.com/gotk3/gotk3/pango/pango-font.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-font.go rename to vendor/github.com/gotk3/gotk3/pango/pango-font.go index d0f5820..4e4f599 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-font.go +++ b/vendor/github.com/gotk3/gotk3/pango/pango-font.go @@ -27,7 +27,7 @@ import ( // "github.com/andre-hub/gotk3/cairo" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-glyph-item.go b/vendor/github.com/gotk3/gotk3/pango/pango-glyph-item.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-glyph-item.go rename to vendor/github.com/gotk3/gotk3/pango/pango-glyph-item.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-glyph.go b/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-glyph.go rename to vendor/github.com/gotk3/gotk3/pango/pango-glyph.go index d41e6da..5d33de5 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-glyph.go +++ b/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + package pango // #cgo pkg-config: pango diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-gravity.go b/vendor/github.com/gotk3/gotk3/pango/pango-gravity.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-gravity.go rename to vendor/github.com/gotk3/gotk3/pango/pango-gravity.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-layout.go b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go similarity index 99% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-layout.go rename to vendor/github.com/gotk3/gotk3/pango/pango-layout.go index 19bdae6..66f993e 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-layout.go +++ b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go @@ -23,7 +23,7 @@ package pango // #include "pango.go.h" import "C" import ( - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/glib" "unsafe" ) diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-layout.go.h b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-layout.go.h rename to vendor/github.com/gotk3/gotk3/pango/pango-layout.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-types.go b/vendor/github.com/gotk3/gotk3/pango/pango-types.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango-types.go rename to vendor/github.com/gotk3/gotk3/pango/pango-types.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango.go b/vendor/github.com/gotk3/gotk3/pango/pango.go similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango.go rename to vendor/github.com/gotk3/gotk3/pango/pango.go diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango.go.h b/vendor/github.com/gotk3/gotk3/pango/pango.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pango.go.h rename to vendor/github.com/gotk3/gotk3/pango/pango.go.h diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pangocairo.go b/vendor/github.com/gotk3/gotk3/pango/pangocairo.go similarity index 98% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pangocairo.go rename to vendor/github.com/gotk3/gotk3/pango/pangocairo.go index e843668..3de012a 100644 --- a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pangocairo.go +++ b/vendor/github.com/gotk3/gotk3/pango/pangocairo.go @@ -28,7 +28,7 @@ import ( // "github.com/gotk3/gotk3/glib" "unsafe" - "github.com/subgraph/fw-daemon/Godeps/_workspace/src/github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/cairo" ) func init() { diff --git a/Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pangocairo.go.h b/vendor/github.com/gotk3/gotk3/pango/pangocairo.go.h similarity index 100% rename from Godeps/_workspace/src/github.com/gotk3/gotk3/pango/pangocairo.go.h rename to vendor/github.com/gotk3/gotk3/pango/pangocairo.go.h diff --git a/Godeps/_workspace/src/github.com/op/go-logging/.travis.yml b/vendor/github.com/op/go-logging/.travis.yml similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/.travis.yml rename to vendor/github.com/op/go-logging/.travis.yml diff --git a/Godeps/_workspace/src/github.com/op/go-logging/CONTRIBUTORS b/vendor/github.com/op/go-logging/CONTRIBUTORS similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/CONTRIBUTORS rename to vendor/github.com/op/go-logging/CONTRIBUTORS diff --git a/Godeps/_workspace/src/github.com/op/go-logging/LICENSE b/vendor/github.com/op/go-logging/LICENSE similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/LICENSE rename to vendor/github.com/op/go-logging/LICENSE diff --git a/Godeps/_workspace/src/github.com/op/go-logging/README.md b/vendor/github.com/op/go-logging/README.md similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/README.md rename to vendor/github.com/op/go-logging/README.md diff --git a/Godeps/_workspace/src/github.com/op/go-logging/backend.go b/vendor/github.com/op/go-logging/backend.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/backend.go rename to vendor/github.com/op/go-logging/backend.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/format.go b/vendor/github.com/op/go-logging/format.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/format.go rename to vendor/github.com/op/go-logging/format.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/level.go b/vendor/github.com/op/go-logging/level.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/level.go rename to vendor/github.com/op/go-logging/level.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/log_nix.go b/vendor/github.com/op/go-logging/log_nix.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/log_nix.go rename to vendor/github.com/op/go-logging/log_nix.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/log_windows.go b/vendor/github.com/op/go-logging/log_windows.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/log_windows.go rename to vendor/github.com/op/go-logging/log_windows.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/logger.go b/vendor/github.com/op/go-logging/logger.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/logger.go rename to vendor/github.com/op/go-logging/logger.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/memory.go b/vendor/github.com/op/go-logging/memory.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/memory.go rename to vendor/github.com/op/go-logging/memory.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/multi.go b/vendor/github.com/op/go-logging/multi.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/multi.go rename to vendor/github.com/op/go-logging/multi.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/syslog.go b/vendor/github.com/op/go-logging/syslog.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/syslog.go rename to vendor/github.com/op/go-logging/syslog.go diff --git a/Godeps/_workspace/src/github.com/op/go-logging/syslog_fallback.go b/vendor/github.com/op/go-logging/syslog_fallback.go similarity index 100% rename from Godeps/_workspace/src/github.com/op/go-logging/syslog_fallback.go rename to vendor/github.com/op/go-logging/syslog_fallback.go diff --git a/vendor/github.com/subgraph/go-procsnitch/LICENSE b/vendor/github.com/subgraph/go-procsnitch/LICENSE new file mode 100644 index 0000000..6df9810 --- /dev/null +++ b/vendor/github.com/subgraph/go-procsnitch/LICENSE @@ -0,0 +1 @@ + diff --git a/vendor/github.com/subgraph/go-procsnitch/README.md b/vendor/github.com/subgraph/go-procsnitch/README.md new file mode 100644 index 0000000..38e4e70 --- /dev/null +++ b/vendor/github.com/subgraph/go-procsnitch/README.md @@ -0,0 +1,8 @@ +# procsnitch + +procsnitch is a library of utility functions for performing higher-level +operations on data in the Linux /proc filesystem. + +## Use cases + +It currently allows finding information about an executable given a source port, and destination address and port. diff --git a/vendor/github.com/subgraph/go-procsnitch/proc.go b/vendor/github.com/subgraph/go-procsnitch/proc.go new file mode 100644 index 0000000..a2c7445 --- /dev/null +++ b/vendor/github.com/subgraph/go-procsnitch/proc.go @@ -0,0 +1,260 @@ +package procsnitch + +import ( + "encoding/hex" + "errors" + "fmt" + "github.com/op/go-logging" + "io/ioutil" + "net" + "strconv" + "strings" +) + +var log = logging.MustGetLogger("go-procsockets") + +// SetLogger allows setting a custom go-logging instance +func SetLogger(logger *logging.Logger) { + log = logger +} + +var pcache = &pidCache{} + +// ProcInfo represents an api that can be used to query process information about +// the far side of a network connection +// Note: this can aid in the construction of unit tests. +type ProcInfo interface { + LookupTCPSocketProcess(srcPort uint16, dstAddr net.IP, dstPort uint16) *Info + LookupUNIXSocketProcess(socketFile string) *Info + LookupUDPSocketProcess(srcPort uint16) *Info +} + +// SystemProcInfo represents our real system ProcInfo api. +type SystemProcInfo struct { +} + +// LookupTCPSocketProcess returns the process information for a given TCP connection. +func (r SystemProcInfo) LookupTCPSocketProcess(srcPort uint16, dstAddr net.IP, dstPort uint16) *Info { + return LookupTCPSocketProcess(srcPort, dstAddr, dstPort) +} + +// LookupUNIXSocketProcess returns the process information for a given UNIX socket connection. +func (r SystemProcInfo) LookupUNIXSocketProcess(socketFile string) *Info { + return LookupUNIXSocketProcess(socketFile) +} + +// LookupUDPSocketProcess returns the process information for a given UDP socket connection. +func (r SystemProcInfo) LookupUDPSocketProcess(srcPort uint16) *Info { + return LookupUDPSocketProcess(srcPort) +} + +// FindProcessForConnection returns the process information for a given connection. +// So far only TCP and UNIX domain socket connections are supported. +func FindProcessForConnection(conn net.Conn, procInfo ProcInfo) *Info { + var info *Info + if conn.LocalAddr().Network() == "tcp" { + fields := strings.Split(conn.RemoteAddr().String(), ":") + dstPortStr := fields[1] + fields = strings.Split(conn.LocalAddr().String(), ":") + dstIP := net.ParseIP(fields[0]) + srcP, _ := strconv.ParseUint(dstPortStr, 10, 16) + dstP, _ := strconv.ParseUint(fields[1], 10, 16) + info = procInfo.LookupTCPSocketProcess(uint16(srcP), dstIP, uint16(dstP)) + } else if conn.LocalAddr().Network() == "unix" { + info = procInfo.LookupUNIXSocketProcess(conn.LocalAddr().String()) + } + return info +} + +// LookupUDPSocketProcess searches for a UDP socket with a source port +func LookupUDPSocketProcess(srcPort uint16) *Info { + ss := findUDPSocket(srcPort) + if ss == nil { + return nil + } + return pcache.lookup(ss.inode) +} + +// LookupTCPSocketProcess searches for a TCP socket with a given source port, destination IP, and destination port +func LookupTCPSocketProcess(srcPort uint16, dstAddr net.IP, dstPort uint16) *Info { + ss := findTCPSocket(srcPort, dstAddr, dstPort) + if ss == nil { + return nil + } + return pcache.lookup(ss.inode) +} + +// LookupUNIXSocketProcess searches for a UNIX domain socket with a given filename +func LookupUNIXSocketProcess(socketFile string) *Info { + ss := findUNIXSocket(socketFile) + if ss == nil { + return nil + } + return pcache.lookup(ss.inode) +} + +type connectionInfo struct { + pinfo *Info + local *socketAddr + remote *socketAddr +} + +func (ci *connectionInfo) String() string { + return fmt.Sprintf("%v %s %s", ci.pinfo, ci.local, ci.remote) +} + +func (sa *socketAddr) parse(s string) error { + ipPort := strings.Split(s, ":") + if len(ipPort) != 2 { + return fmt.Errorf("badly formatted socket address field: %s", s) + } + ip, err := ParseIP(ipPort[0]) + if err != nil { + return fmt.Errorf("error parsing ip field [%s]: %v", ipPort[0], err) + } + port, err := ParsePort(ipPort[1]) + if err != nil { + return fmt.Errorf("error parsing port field [%s]: %v", ipPort[1], err) + } + sa.ip = ip + sa.port = port + return nil +} + +// ParseIP parses a string ip to a net.IP +func ParseIP(ip string) (net.IP, error) { + var result net.IP + dst, err := hex.DecodeString(ip) + if err != nil { + return result, fmt.Errorf("Error parsing IP: %s", err) + } + // Reverse byte order -- /proc/net/tcp etc. is little-endian + // TODO: Does this vary by architecture? + for i, j := 0, len(dst)-1; i < j; i, j = i+1, j-1 { + dst[i], dst[j] = dst[j], dst[i] + } + result = net.IP(dst) + return result, nil +} + +// ParsePort parses a base16 port represented as a string to a uint16 +func ParsePort(port string) (uint16, error) { + p64, err := strconv.ParseInt(port, 16, 32) + if err != nil { + return 0, fmt.Errorf("Error parsing port: %s", err) + } + return uint16(p64), nil +} + +func getConnections() ([]*connectionInfo, error) { + conns, err := readConntrack() + if err != nil { + return nil, err + } + resolveProcinfo(conns) + return conns, nil +} + +func resolveProcinfo(conns []*connectionInfo) { + var sockets []*socketStatus + for _, line := range getSocketLines("tcp") { + if len(strings.TrimSpace(line)) == 0 { + continue + } + ss := new(socketStatus) + if err := ss.parseLine(line); err != nil { + log.Warning("Unable to parse line [%s]: %v", line, err) + } /* else { + /* + pid := findPidForInode(ss.inode) + if pid > 0 { + ss.pid = pid + fmt.Println("Socket", ss) + sockets = append(sockets, ss) + } + + }*/ + } + for _, ci := range conns { + ss := findContrackSocket(ci, sockets) + if ss == nil { + continue + } + pinfo := pcache.lookup(ss.inode) + if pinfo != nil { + ci.pinfo = pinfo + } + } +} + +func findContrackSocket(ci *connectionInfo, sockets []*socketStatus) *socketStatus { + for _, ss := range sockets { + if ss.local.port == ci.local.port && ss.remote.ip.Equal(ci.remote.ip) && ss.remote.port == ci.remote.port { + return ss + } + } + return nil +} + +func readConntrack() ([]*connectionInfo, error) { + path := fmt.Sprintf("/proc/net/ip_conntrack") + data, err := ioutil.ReadFile(path) + if err != nil { + return nil, err + } + var result []*connectionInfo + lines := strings.Split(string(data), "\n") + for _, line := range lines { + ci, err := parseConntrackLine(line) + if err != nil { + return nil, err + } + if ci != nil { + result = append(result, ci) + } + } + return result, nil +} + +func parseConntrackLine(line string) (*connectionInfo, error) { + parts := strings.Fields(line) + if len(parts) < 8 || parts[0] != "tcp" || parts[3] != "ESTABLISHED" { + return nil, nil + } + + local, err := conntrackAddr(parts[4], parts[6]) + if err != nil { + return nil, err + } + remote, err := conntrackAddr(parts[5], parts[7]) + if err != nil { + return nil, err + } + return &connectionInfo{ + local: local, + remote: remote, + }, nil +} + +func conntrackAddr(ipStr, portStr string) (*socketAddr, error) { + ip := net.ParseIP(stripLabel(ipStr)) + if ip == nil { + return nil, errors.New("Could not parse IP: " + ipStr) + } + i64, err := strconv.Atoi(stripLabel(portStr)) + if err != nil { + return nil, err + } + return &socketAddr{ + ip: ip, + port: uint16(i64), + }, nil +} + +func stripLabel(s string) string { + idx := strings.Index(s, "=") + if idx == -1 { + return s + } + return s[idx+1:] +} diff --git a/vendor/github.com/subgraph/go-procsnitch/proc_pid.go b/vendor/github.com/subgraph/go-procsnitch/proc_pid.go new file mode 100644 index 0000000..845d82b --- /dev/null +++ b/vendor/github.com/subgraph/go-procsnitch/proc_pid.go @@ -0,0 +1,162 @@ +package procsnitch + +import ( + "fmt" + "io/ioutil" + "os" + "path" + "strconv" + "strings" + "sync" + "syscall" +) + +// Info is a struct containing the result of a socket proc query +type Info struct { + UID int + Pid int + ParentPid int + loaded bool + ExePath string + CmdLine string +} + +type pidCache struct { + cacheMap map[uint64]*Info + lock sync.Mutex +} + +func (pc *pidCache) lookup(inode uint64) *Info { + pc.lock.Lock() + defer pc.lock.Unlock() + pi, ok := pc.cacheMap[inode] + if ok && pi.loadProcessInfo() { + return pi + } + pc.cacheMap = loadCache() + pi, ok = pc.cacheMap[inode] + if ok && pi.loadProcessInfo() { + return pi + } + return nil +} + +func loadCache() map[uint64]*Info { + cmap := make(map[uint64]*Info) + for _, n := range readdir("/proc") { + pid := toPid(n) + if pid != 0 { + pinfo := &Info{Pid: pid} + for _, inode := range inodesFromPid(pid) { + cmap[inode] = pinfo + } + } + } + return cmap +} + +func toPid(name string) int { + pid, err := strconv.ParseUint(name, 10, 32) + if err != nil { + return 0 + } + fdpath := fmt.Sprintf("/proc/%d/fd", pid) + fi, err := os.Stat(fdpath) + if err != nil { + return 0 + } + if !fi.IsDir() { + return 0 + } + return (int)(pid) +} + +func inodesFromPid(pid int) []uint64 { + var inodes []uint64 + fdpath := fmt.Sprintf("/proc/%d/fd", pid) + for _, n := range readdir(fdpath) { + if link, err := os.Readlink(path.Join(fdpath, n)); err != nil { + if !os.IsNotExist(err) { + log.Warning("Error reading link %s: %v", n, err) + } + } else { + if inode := extractSocket(link); inode > 0 { + inodes = append(inodes, inode) + } + } + } + return inodes +} + +func extractSocket(name string) uint64 { + if !strings.HasPrefix(name, "socket:[") || !strings.HasSuffix(name, "]") { + return 0 + } + val := name[8 : len(name)-1] + inode, err := strconv.ParseUint(val, 10, 64) + if err != nil { + log.Warning("Error parsing inode value from %s: %v", name, err) + return 0 + } + return inode +} + +func readdir(dir string) []string { + d, err := os.Open(dir) + if err != nil { + log.Warning("Error opening directory %s: %v", dir, err) + return nil + } + defer d.Close() + names, err := d.Readdirnames(0) + if err != nil { + log.Warning("Error reading directory names from %s: %v", dir, err) + return nil + } + return names +} + +func (pi *Info) loadProcessInfo() bool { + if pi.loaded { + return true + } + + exePath, err := os.Readlink(fmt.Sprintf("/proc/%d/exe", pi.Pid)) + if err != nil { + log.Warning("Error reading exe link for pid %d: %v", pi.Pid, err) + return false + } + bs, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cmdline", pi.Pid)) + if err != nil { + log.Warning("Error reading cmdline for pid %d: %v", pi.Pid, err) + return false + } + for i, b := range bs { + if b == 0 { + bs[i] = byte(' ') + } + } + + bs, err = ioutil.ReadFile(fmt.Sprintf("/proc/%d/stat", pi.Pid)) + if err != nil { + log.Warning("Error reading cmdline for pid %d: %v", pi.Pid, err) + return false + } + fs := strings.Fields(string(bs)) + if len(fs) < 50 { + log.Warning("Unable to parse stat for pid %d: ", pi.Pid) + return false + } + + finfo, err := os.Stat(fmt.Sprintf("/proc/%d", pi.Pid)) + if err != nil { + log.Warning("Could not stat /proc/%d: %v", pi.Pid, err) + return false + } + sys := finfo.Sys().(*syscall.Stat_t) + pi.UID = int(sys.Uid) + pi.ExePath = exePath + pi.CmdLine = string(bs) + pi.loaded = true + return true +} diff --git a/vendor/github.com/subgraph/go-procsnitch/socket.go b/vendor/github.com/subgraph/go-procsnitch/socket.go new file mode 100644 index 0000000..aef64aa --- /dev/null +++ b/vendor/github.com/subgraph/go-procsnitch/socket.go @@ -0,0 +1,214 @@ +package procsnitch + +import ( + "errors" + "fmt" + "io/ioutil" + "net" + "strconv" + "strings" +) + +type socketAddr struct { + ip net.IP + port uint16 +} + +func (sa socketAddr) String() string { + return fmt.Sprintf("%v:%d", sa.ip, sa.port) +} + +type socketStatus struct { + local socketAddr + remote socketAddr + //status ConnectionStatus + uid int + inode uint64 + remoteInode uint64 + line string + path string +} + +type ConnectionStatus int + +const ( + ESTABLISHED ConnectionStatus = iota + SYN_SENT + SYN_RECV + FIN_WAIT1 + FIN_WAIT2 + TIME_WAIT + CLOSE + CLOSE_WAIT + LAST_ACK + LISTEN + CLOSING +) + +func (c ConnectionStatus) String() string { + switch c { + case ESTABLISHED: + return "ESTABLISHED" + case SYN_SENT: + return "SYN_SENT" + case SYN_RECV: + return "SYN_RECV" + case FIN_WAIT1: + return "FIN_WAIT1" + case FIN_WAIT2: + return "FIN_WAIT2" + case TIME_WAIT: + return "TIME_WAIT" + case CLOSE: + return "CLOSE" + case CLOSE_WAIT: + return "CLOSE_WAIT" + case LAST_ACK: + return "LAST_ACK" + case LISTEN: + return "LISTEN" + case CLOSING: + return "CLOSING" + default: + return "Invalid Connection Status" + } +} + +func (ss *socketStatus) String() string { + return fmt.Sprintf("%s -> %s uid=%d inode=%d", ss.local, ss.remote, ss.uid, ss.inode) +} + +func findUDPSocket(srcPort uint16) *socketStatus { + return findSocket("udp", func(ss socketStatus) bool { + return ss.local.port == srcPort + }) +} + +func findTCPSocket(srcPort uint16, dstAddr net.IP, dstPort uint16) *socketStatus { + return findSocket("tcp", func(ss socketStatus) bool { + return ss.remote.port == dstPort && ss.remote.ip.Equal(dstAddr) && ss.local.port == srcPort + }) +} + +func findUNIXSocket(socketFile string) *socketStatus { + proto := "unix" + + // /proc/net/unix + // Num RefCount Protocol Flags Type St Inode Path + // 0000000000000000: 00000003 00000000 00000000 0001 03 10893 P13838 + // local_inode -> remote_inode + // 13838 -> 10893 + var candidateInodes []uint64 + inodeMap := make(map[uint64]uint64) + for _, line := range getSocketLines(proto) { + if len(line) == 0 { + continue + } + ss := socketStatus{} + if err := ss.parseUnixProcLine(line); err != nil { + log.Warning("Unable to parse line from /proc/net/%s [%s]: %v", proto, line, err) + continue + } + if ss.remoteInode != 0 { + inodeMap[ss.remoteInode] = ss.inode + } + if ss.path == socketFile { + candidateInodes = append(candidateInodes, ss.inode) + } + } + for i := 0; i < len(candidateInodes); i++ { + remoteInode, ok := inodeMap[candidateInodes[i]] + if ok { + ss := socketStatus{} + ss.inode = remoteInode + return &ss + } + } + return nil +} + +func findSocket(proto string, matcher func(socketStatus) bool) *socketStatus { + var ss socketStatus + for _, line := range getSocketLines(proto) { + if len(line) == 0 { + continue + } + if err := ss.parseLine(line); err != nil { + log.Warning("Unable to parse line from /proc/net/%s [%s]: %v", proto, line, err) + continue + } + if matcher(ss) { + ss.line = line + return &ss + } + } + return nil +} + +func (ss *socketStatus) parseLine(line string) error { + fs := strings.Fields(line) + if len(fs) < 10 { + return errors.New("insufficient fields") + } + if err := ss.local.parse(fs[1]); err != nil { + return err + } + /* + st64, err := strconv.ParseInt(fmt.Sprintf("0x%s", fs[3]), 0, 32) + if err != nil { + return fmt.Errorf("Error parsing ConnectionStatus: %s", err) + } + ss.status = ConnectionStatus(st64) + */ + if err := ss.remote.parse(fs[2]); err != nil { + return err + } + uid, err := strconv.ParseUint(fs[7], 10, 32) + if err != nil { + return err + } + ss.uid = int(uid) + inode, err := strconv.ParseUint(fs[9], 10, 64) + if err != nil { + return err + } + ss.inode = inode + return nil +} + +// parseUnixProcLine parses lines in /proc/net/unix +func (ss *socketStatus) parseUnixProcLine(line string) error { + var err error + fs := strings.Fields(line) + if len(fs) < 7 || len(fs) > 8 { + return errors.New("number of fields don't match parser") + } + ss.inode, err = strconv.ParseUint(fs[6], 10, 64) + if err != nil { + return err + } + if len(fs) == 8 { + ss.path = fs[7] + if strings.HasPrefix(ss.path, "P") { + ss.remoteInode, err = strconv.ParseUint(ss.path[1:], 10, 64) + if err != nil { + return err + } + } + } + return nil +} + +func getSocketLines(proto string) []string { + path := fmt.Sprintf("/proc/net/%s", proto) + data, err := ioutil.ReadFile(path) + if err != nil { + log.Warning("Error reading %s: %v", path, err) + return nil + } + lines := strings.Split(string(data), "\n") + if len(lines) > 0 { + lines = lines[1:] + } + return lines +} diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/vendor/golang.org/x/net/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/net/PATENTS b/vendor/golang.org/x/net/PATENTS new file mode 100644 index 0000000..7330990 --- /dev/null +++ b/vendor/golang.org/x/net/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/net/proxy/direct.go b/vendor/golang.org/x/net/proxy/direct.go new file mode 100644 index 0000000..4c5ad88 --- /dev/null +++ b/vendor/golang.org/x/net/proxy/direct.go @@ -0,0 +1,18 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package proxy + +import ( + "net" +) + +type direct struct{} + +// Direct is a direct proxy: one that makes network connections directly. +var Direct = direct{} + +func (direct) Dial(network, addr string) (net.Conn, error) { + return net.Dial(network, addr) +} diff --git a/vendor/golang.org/x/net/proxy/per_host.go b/vendor/golang.org/x/net/proxy/per_host.go new file mode 100644 index 0000000..f540b19 --- /dev/null +++ b/vendor/golang.org/x/net/proxy/per_host.go @@ -0,0 +1,140 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package proxy + +import ( + "net" + "strings" +) + +// A PerHost directs connections to a default Dialer unless the hostname +// requested matches one of a number of exceptions. +type PerHost struct { + def, bypass Dialer + + bypassNetworks []*net.IPNet + bypassIPs []net.IP + bypassZones []string + bypassHosts []string +} + +// NewPerHost returns a PerHost Dialer that directs connections to either +// defaultDialer or bypass, depending on whether the connection matches one of +// the configured rules. +func NewPerHost(defaultDialer, bypass Dialer) *PerHost { + return &PerHost{ + def: defaultDialer, + bypass: bypass, + } +} + +// Dial connects to the address addr on the given network through either +// defaultDialer or bypass. +func (p *PerHost) Dial(network, addr string) (c net.Conn, err error) { + host, _, err := net.SplitHostPort(addr) + if err != nil { + return nil, err + } + + return p.dialerForRequest(host).Dial(network, addr) +} + +func (p *PerHost) dialerForRequest(host string) Dialer { + if ip := net.ParseIP(host); ip != nil { + for _, net := range p.bypassNetworks { + if net.Contains(ip) { + return p.bypass + } + } + for _, bypassIP := range p.bypassIPs { + if bypassIP.Equal(ip) { + return p.bypass + } + } + return p.def + } + + for _, zone := range p.bypassZones { + if strings.HasSuffix(host, zone) { + return p.bypass + } + if host == zone[1:] { + // For a zone "example.com", we match "example.com" + // too. + return p.bypass + } + } + for _, bypassHost := range p.bypassHosts { + if bypassHost == host { + return p.bypass + } + } + return p.def +} + +// AddFromString parses a string that contains comma-separated values +// specifying hosts that should use the bypass proxy. Each value is either an +// IP address, a CIDR range, a zone (*.example.com) or a hostname +// (localhost). A best effort is made to parse the string and errors are +// ignored. +func (p *PerHost) AddFromString(s string) { + hosts := strings.Split(s, ",") + for _, host := range hosts { + host = strings.TrimSpace(host) + if len(host) == 0 { + continue + } + if strings.Contains(host, "/") { + // We assume that it's a CIDR address like 127.0.0.0/8 + if _, net, err := net.ParseCIDR(host); err == nil { + p.AddNetwork(net) + } + continue + } + if ip := net.ParseIP(host); ip != nil { + p.AddIP(ip) + continue + } + if strings.HasPrefix(host, "*.") { + p.AddZone(host[1:]) + continue + } + p.AddHost(host) + } +} + +// AddIP specifies an IP address that will use the bypass proxy. Note that +// this will only take effect if a literal IP address is dialed. A connection +// to a named host will never match an IP. +func (p *PerHost) AddIP(ip net.IP) { + p.bypassIPs = append(p.bypassIPs, ip) +} + +// AddNetwork specifies an IP range that will use the bypass proxy. Note that +// this will only take effect if a literal IP address is dialed. A connection +// to a named host will never match. +func (p *PerHost) AddNetwork(net *net.IPNet) { + p.bypassNetworks = append(p.bypassNetworks, net) +} + +// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of +// "example.com" matches "example.com" and all of its subdomains. +func (p *PerHost) AddZone(zone string) { + if strings.HasSuffix(zone, ".") { + zone = zone[:len(zone)-1] + } + if !strings.HasPrefix(zone, ".") { + zone = "." + zone + } + p.bypassZones = append(p.bypassZones, zone) +} + +// AddHost specifies a hostname that will use the bypass proxy. +func (p *PerHost) AddHost(host string) { + if strings.HasSuffix(host, ".") { + host = host[:len(host)-1] + } + p.bypassHosts = append(p.bypassHosts, host) +} diff --git a/vendor/golang.org/x/net/proxy/proxy.go b/vendor/golang.org/x/net/proxy/proxy.go new file mode 100644 index 0000000..8ccb0c5 --- /dev/null +++ b/vendor/golang.org/x/net/proxy/proxy.go @@ -0,0 +1,94 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package proxy provides support for a variety of protocols to proxy network +// data. +package proxy + +import ( + "errors" + "net" + "net/url" + "os" +) + +// A Dialer is a means to establish a connection. +type Dialer interface { + // Dial connects to the given address via the proxy. + Dial(network, addr string) (c net.Conn, err error) +} + +// Auth contains authentication parameters that specific Dialers may require. +type Auth struct { + User, Password string +} + +// FromEnvironment returns the dialer specified by the proxy related variables in +// the environment. +func FromEnvironment() Dialer { + allProxy := os.Getenv("all_proxy") + if len(allProxy) == 0 { + return Direct + } + + proxyURL, err := url.Parse(allProxy) + if err != nil { + return Direct + } + proxy, err := FromURL(proxyURL, Direct) + if err != nil { + return Direct + } + + noProxy := os.Getenv("no_proxy") + if len(noProxy) == 0 { + return proxy + } + + perHost := NewPerHost(proxy, Direct) + perHost.AddFromString(noProxy) + return perHost +} + +// proxySchemes is a map from URL schemes to a function that creates a Dialer +// from a URL with such a scheme. +var proxySchemes map[string]func(*url.URL, Dialer) (Dialer, error) + +// RegisterDialerType takes a URL scheme and a function to generate Dialers from +// a URL with that scheme and a forwarding Dialer. Registered schemes are used +// by FromURL. +func RegisterDialerType(scheme string, f func(*url.URL, Dialer) (Dialer, error)) { + if proxySchemes == nil { + proxySchemes = make(map[string]func(*url.URL, Dialer) (Dialer, error)) + } + proxySchemes[scheme] = f +} + +// FromURL returns a Dialer given a URL specification and an underlying +// Dialer for it to make network requests. +func FromURL(u *url.URL, forward Dialer) (Dialer, error) { + var auth *Auth + if u.User != nil { + auth = new(Auth) + auth.User = u.User.Username() + if p, ok := u.User.Password(); ok { + auth.Password = p + } + } + + switch u.Scheme { + case "socks5": + return SOCKS5("tcp", u.Host, auth, forward) + } + + // If the scheme doesn't match any of the built-in schemes, see if it + // was registered by another package. + if proxySchemes != nil { + if f, ok := proxySchemes[u.Scheme]; ok { + return f(u, forward) + } + } + + return nil, errors.New("proxy: unknown scheme: " + u.Scheme) +} diff --git a/vendor/golang.org/x/net/proxy/socks5.go b/vendor/golang.org/x/net/proxy/socks5.go new file mode 100644 index 0000000..9b96282 --- /dev/null +++ b/vendor/golang.org/x/net/proxy/socks5.go @@ -0,0 +1,210 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package proxy + +import ( + "errors" + "io" + "net" + "strconv" +) + +// SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address +// with an optional username and password. See RFC 1928. +func SOCKS5(network, addr string, auth *Auth, forward Dialer) (Dialer, error) { + s := &socks5{ + network: network, + addr: addr, + forward: forward, + } + if auth != nil { + s.user = auth.User + s.password = auth.Password + } + + return s, nil +} + +type socks5 struct { + user, password string + network, addr string + forward Dialer +} + +const socks5Version = 5 + +const ( + socks5AuthNone = 0 + socks5AuthPassword = 2 +) + +const socks5Connect = 1 + +const ( + socks5IP4 = 1 + socks5Domain = 3 + socks5IP6 = 4 +) + +var socks5Errors = []string{ + "", + "general failure", + "connection forbidden", + "network unreachable", + "host unreachable", + "connection refused", + "TTL expired", + "command not supported", + "address type not supported", +} + +// Dial connects to the address addr on the network net via the SOCKS5 proxy. +func (s *socks5) Dial(network, addr string) (net.Conn, error) { + switch network { + case "tcp", "tcp6", "tcp4": + default: + return nil, errors.New("proxy: no support for SOCKS5 proxy connections of type " + network) + } + + conn, err := s.forward.Dial(s.network, s.addr) + if err != nil { + return nil, err + } + closeConn := &conn + defer func() { + if closeConn != nil { + (*closeConn).Close() + } + }() + + host, portStr, err := net.SplitHostPort(addr) + if err != nil { + return nil, err + } + + port, err := strconv.Atoi(portStr) + if err != nil { + return nil, errors.New("proxy: failed to parse port number: " + portStr) + } + if port < 1 || port > 0xffff { + return nil, errors.New("proxy: port number out of range: " + portStr) + } + + // the size here is just an estimate + buf := make([]byte, 0, 6+len(host)) + + buf = append(buf, socks5Version) + if len(s.user) > 0 && len(s.user) < 256 && len(s.password) < 256 { + buf = append(buf, 2 /* num auth methods */, socks5AuthNone, socks5AuthPassword) + } else { + buf = append(buf, 1 /* num auth methods */, socks5AuthNone) + } + + if _, err := conn.Write(buf); err != nil { + return nil, errors.New("proxy: failed to write greeting to SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + + if _, err := io.ReadFull(conn, buf[:2]); err != nil { + return nil, errors.New("proxy: failed to read greeting from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + if buf[0] != 5 { + return nil, errors.New("proxy: SOCKS5 proxy at " + s.addr + " has unexpected version " + strconv.Itoa(int(buf[0]))) + } + if buf[1] == 0xff { + return nil, errors.New("proxy: SOCKS5 proxy at " + s.addr + " requires authentication") + } + + if buf[1] == socks5AuthPassword { + buf = buf[:0] + buf = append(buf, 1 /* password protocol version */) + buf = append(buf, uint8(len(s.user))) + buf = append(buf, s.user...) + buf = append(buf, uint8(len(s.password))) + buf = append(buf, s.password...) + + if _, err := conn.Write(buf); err != nil { + return nil, errors.New("proxy: failed to write authentication request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + + if _, err := io.ReadFull(conn, buf[:2]); err != nil { + return nil, errors.New("proxy: failed to read authentication reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + + if buf[1] != 0 { + return nil, errors.New("proxy: SOCKS5 proxy at " + s.addr + " rejected username/password") + } + } + + buf = buf[:0] + buf = append(buf, socks5Version, socks5Connect, 0 /* reserved */) + + if ip := net.ParseIP(host); ip != nil { + if ip4 := ip.To4(); ip4 != nil { + buf = append(buf, socks5IP4) + ip = ip4 + } else { + buf = append(buf, socks5IP6) + } + buf = append(buf, ip...) + } else { + if len(host) > 255 { + return nil, errors.New("proxy: destination hostname too long: " + host) + } + buf = append(buf, socks5Domain) + buf = append(buf, byte(len(host))) + buf = append(buf, host...) + } + buf = append(buf, byte(port>>8), byte(port)) + + if _, err := conn.Write(buf); err != nil { + return nil, errors.New("proxy: failed to write connect request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + + if _, err := io.ReadFull(conn, buf[:4]); err != nil { + return nil, errors.New("proxy: failed to read connect reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + + failure := "unknown error" + if int(buf[1]) < len(socks5Errors) { + failure = socks5Errors[buf[1]] + } + + if len(failure) > 0 { + return nil, errors.New("proxy: SOCKS5 proxy at " + s.addr + " failed to connect: " + failure) + } + + bytesToDiscard := 0 + switch buf[3] { + case socks5IP4: + bytesToDiscard = net.IPv4len + case socks5IP6: + bytesToDiscard = net.IPv6len + case socks5Domain: + _, err := io.ReadFull(conn, buf[:1]) + if err != nil { + return nil, errors.New("proxy: failed to read domain length from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + bytesToDiscard = int(buf[0]) + default: + return nil, errors.New("proxy: got unknown address type " + strconv.Itoa(int(buf[3])) + " from SOCKS5 proxy at " + s.addr) + } + + if cap(buf) < bytesToDiscard { + buf = make([]byte, bytesToDiscard) + } else { + buf = buf[:bytesToDiscard] + } + if _, err := io.ReadFull(conn, buf); err != nil { + return nil, errors.New("proxy: failed to read address from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + + // Also need to discard the port number + if _, err := io.ReadFull(conn, buf[:2]); err != nil { + return nil, errors.New("proxy: failed to read port from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + } + + closeConn = nil + return conn, nil +} From 6a5a6f08e7e78f33f3360f9d45a9a9b026da8a65 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 18:12:08 +0000 Subject: [PATCH 22/28] Updated dependency github.com/godbus/dbus --- Godeps/Godeps.json | 8 ++-- vendor/github.com/godbus/dbus/conn.go | 30 +++++++------ vendor/github.com/godbus/dbus/conn_other.go | 6 ++- vendor/github.com/godbus/dbus/export.go | 23 ++++++++++ vendor/github.com/godbus/dbus/message.go | 9 +++- .../github.com/godbus/dbus/transport_tcp.go | 43 +++++++++++++++++++ .../godbus/dbus/transport_unixcred_openbsd.go | 14 ++++++ 7 files changed, 114 insertions(+), 19 deletions(-) create mode 100644 vendor/github.com/godbus/dbus/transport_tcp.go create mode 100644 vendor/github.com/godbus/dbus/transport_unixcred_openbsd.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 9d11187..a69eae1 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -8,13 +8,13 @@ "Deps": [ { "ImportPath": "github.com/godbus/dbus", - "Comment": "v3-15-g230e4b2", - "Rev": "230e4b23db2fd81c53eaa0073f76659d4849ce51" + "Comment": "v4.0.0-5-g32c6cc2", + "Rev": "32c6cc29c14570de4cf6d7e7737d68fb2d01ad15" }, { "ImportPath": "github.com/godbus/dbus/introspect", - "Comment": "v3-15-g230e4b2", - "Rev": "230e4b23db2fd81c53eaa0073f76659d4849ce51" + "Comment": "v4.0.0-5-g32c6cc2", + "Rev": "32c6cc29c14570de4cf6d7e7737d68fb2d01ad15" }, { "ImportPath": "github.com/gotk3/gotk3/cairo", diff --git a/vendor/github.com/godbus/dbus/conn.go b/vendor/github.com/godbus/dbus/conn.go index 62bcbed..e07753a 100644 --- a/vendor/github.com/godbus/dbus/conn.go +++ b/vendor/github.com/godbus/dbus/conn.go @@ -16,6 +16,7 @@ var ( systemBusLck sync.Mutex sessionBus *Conn sessionBusLck sync.Mutex + sessionEnvLck sync.Mutex ) // ErrClosed is the error returned by calls on a closed connection. @@ -53,8 +54,9 @@ type Conn struct { closed bool outLck sync.RWMutex - signals []chan<- *Signal - signalsLck sync.Mutex + signals []chan<- *Signal + signalsClosed bool + signalsLck sync.Mutex eavesdropped chan<- *Message eavesdroppedLck sync.Mutex @@ -91,6 +93,8 @@ func SessionBus() (conn *Conn, err error) { // SessionBusPrivate returns a new private connection to the session bus. func SessionBusPrivate() (*Conn, error) { + sessionEnvLck.Lock() + defer sessionEnvLck.Unlock() address := os.Getenv("DBUS_SESSION_BUS_ADDRESS") if address != "" && address != "autolaunch:" { return Dial(address) @@ -186,6 +190,7 @@ func (conn *Conn) Close() error { conn.closed = true conn.outLck.Unlock() conn.signalsLck.Lock() + conn.signalsClosed = true for _, ch := range conn.signals { close(ch) } @@ -338,6 +343,10 @@ func (conn *Conn) inWorker() { Body: msg.Body, } conn.signalsLck.Lock() + if conn.signalsClosed { + conn.signalsLck.Unlock() + return + } for _, ch := range conn.signals { ch <- signal } @@ -621,16 +630,11 @@ func dereferenceAll(vs []interface{}) []interface{} { // getKey gets a key from a the list of keys. Returns "" on error / not found... func getKey(s, key string) string { - i := strings.Index(s, key) - if i == -1 { - return "" - } - if i+len(key)+1 >= len(s) || s[i+len(key)] != '=' { - return "" - } - j := strings.Index(s, ",") - if j == -1 { - j = len(s) + for _, keyEqualsValue := range strings.Split(s, ",") { + keyValue := strings.SplitN(keyEqualsValue, "=", 2) + if len(keyValue) == 2 && keyValue[0] == key { + return keyValue[1] + } } - return s[i+len(key)+1 : j] + return "" } diff --git a/vendor/github.com/godbus/dbus/conn_other.go b/vendor/github.com/godbus/dbus/conn_other.go index f74b875..289e8c5 100644 --- a/vendor/github.com/godbus/dbus/conn_other.go +++ b/vendor/github.com/godbus/dbus/conn_other.go @@ -5,6 +5,7 @@ package dbus import ( "bytes" "errors" + "os" "os/exec" ) @@ -23,5 +24,8 @@ func sessionBusPlatform() (*Conn, error) { return nil, errors.New("dbus: couldn't determine address of session bus") } - return Dial(string(b[i+1 : j])) + env, addr := string(b[0:i]), string(b[i+1:j]) + os.Setenv(env, addr) + + return Dial(addr) } diff --git a/vendor/github.com/godbus/dbus/export.go b/vendor/github.com/godbus/dbus/export.go index c0d37b1..6c33522 100644 --- a/vendor/github.com/godbus/dbus/export.go +++ b/vendor/github.com/godbus/dbus/export.go @@ -1,6 +1,7 @@ package dbus import ( + "bytes" "errors" "fmt" "reflect" @@ -126,6 +127,28 @@ func (conn *Conn) handleCall(msg *Message) { conn.sendError(errmsgUnknownMethod, sender, serial) } return + } else if ifaceName == "org.freedesktop.DBus.Introspectable" && name == "Introspect" { + if _, ok := conn.handlers[path]; !ok { + subpath := make(map[string]struct{}) + var xml bytes.Buffer + xml.WriteString("") + for h, _ := range conn.handlers { + p := string(path) + if p != "/" { + p += "/" + } + if strings.HasPrefix(string(h), p) { + node_name := strings.Split(string(h[len(p):]), "/")[0] + subpath[node_name] = struct{}{} + } + } + for s, _ := range subpath { + xml.WriteString("\n\t") + } + xml.WriteString("\n") + conn.sendReply(sender, serial, xml.String()) + return + } } if len(name) == 0 { conn.sendError(errmsgUnknownMethod, sender, serial) diff --git a/vendor/github.com/godbus/dbus/message.go b/vendor/github.com/godbus/dbus/message.go index 075d6e3..6a92536 100644 --- a/vendor/github.com/godbus/dbus/message.go +++ b/vendor/github.com/godbus/dbus/message.go @@ -22,6 +22,13 @@ const ( // FlagNoAutoStart signals that the message bus should not automatically // start an application when handling this message. FlagNoAutoStart + // FlagAllowInteractiveAuthorization may be set on a method call + // message to inform the receiving side that the caller is prepared + // to wait for interactive authorization, which might take a + // considerable time to complete. For instance, if this flag is set, + // it would be appropriate to query the user for passwords or + // confirmation via Polkit or a similar framework. + FlagAllowInteractiveAuthorization ) // Type represents the possible types of a D-Bus message. @@ -248,7 +255,7 @@ func (msg *Message) EncodeTo(out io.Writer, order binary.ByteOrder) error { // IsValid checks whether msg is a valid message and returns an // InvalidMessageError if it is not. func (msg *Message) IsValid() error { - if msg.Flags & ^(FlagNoAutoStart|FlagNoReplyExpected) != 0 { + if msg.Flags & ^(FlagNoAutoStart|FlagNoReplyExpected|FlagAllowInteractiveAuthorization) != 0 { return InvalidMessageError("invalid flags") } if msg.Type == 0 || msg.Type >= typeMax { diff --git a/vendor/github.com/godbus/dbus/transport_tcp.go b/vendor/github.com/godbus/dbus/transport_tcp.go new file mode 100644 index 0000000..dd1c8e5 --- /dev/null +++ b/vendor/github.com/godbus/dbus/transport_tcp.go @@ -0,0 +1,43 @@ +//+build !windows + +package dbus + +import ( + "errors" + "net" +) + +func init() { + transports["tcp"] = newTcpTransport +} + +func tcpFamily(keys string) (string, error) { + switch getKey(keys, "family") { + case "": + return "tcp", nil + case "ipv4": + return "tcp4", nil + case "ipv6": + return "tcp6", nil + default: + return "", errors.New("dbus: invalid tcp family (must be ipv4 or ipv6)") + } +} + +func newTcpTransport(keys string) (transport, error) { + host := getKey(keys, "host") + port := getKey(keys, "port") + if host == "" || port == "" { + return nil, errors.New("dbus: unsupported address (must set host and port)") + } + + protocol, err := tcpFamily(keys) + if err != nil { + return nil, err + } + socket, err := net.Dial(protocol, net.JoinHostPort(host, port)) + if err != nil { + return nil, err + } + return NewConn(socket) +} diff --git a/vendor/github.com/godbus/dbus/transport_unixcred_openbsd.go b/vendor/github.com/godbus/dbus/transport_unixcred_openbsd.go new file mode 100644 index 0000000..af7bafd --- /dev/null +++ b/vendor/github.com/godbus/dbus/transport_unixcred_openbsd.go @@ -0,0 +1,14 @@ +package dbus + +import "io" + +func (t *unixTransport) SendNullByte() error { + n, _, err := t.UnixConn.WriteMsgUnix([]byte{0}, nil, nil) + if err != nil { + return err + } + if n != 1 { + return io.ErrShortWrite + } + return nil +} From 807d18770a3b39850e587bba771920637fd07e22 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 18:25:50 +0000 Subject: [PATCH 23/28] No longer need to manually handle introspection subpaths --- dbus.go | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/dbus.go b/dbus.go index 16b6abd..074edf9 100644 --- a/dbus.go +++ b/dbus.go @@ -2,9 +2,7 @@ package main import ( "errors" - "fmt" "path" - "strings" "github.com/godbus/dbus" "github.com/godbus/dbus/introspect" @@ -82,44 +80,15 @@ func newDbusServer() (*dbusServer, error) { if err := conn.Export(ds, objectPath, interfaceName); err != nil { return nil, err } - - ps := strings.Split(objectPath, "/") - path := "/" - for _, p := range ps { - if len(path) > 1 { - path += "/" - } - path += p - - if err := conn.Export(ds, dbus.ObjectPath(path), "org.freedesktop.DBus.Introspectable"); err != nil { - return nil, err - } + if err := conn.Export(introspect.Introspectable(introspectXml), objectPath, "org.freedesktop.DBus.Introspectable"); err != nil { + return nil, err } + ds.conn = conn ds.prompter = newPrompter(conn) return ds, nil } -func (ds *dbusServer) Introspect(msg dbus.Message) (string, *dbus.Error) { - path := string(msg.Headers[dbus.FieldPath].Value().(dbus.ObjectPath)) - if path == objectPath { - return introspectXml, nil - } - parts := strings.Split(objectPath, "/") - current := "/" - for i := 0; i < len(parts)-1; i++ { - if len(current) > 1 { - current += "/" - } - current += parts[i] - if path == current { - next := parts[i+1] - return fmt.Sprintf("", next), nil - } - } - return "", nil -} - func (ds *dbusServer) SetEnabled(flag bool) *dbus.Error { log.Debug("SetEnabled(%v) called", flag) ds.fw.setEnabled(flag) From 4208f93f94421541876dfe6a7b2ccca27ced4207 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 18:32:16 +0000 Subject: [PATCH 24/28] gotk3 dependency update --- Godeps/Godeps.json | 20 +- vendor/github.com/gotk3/gotk3/cairo/format.go | 28 + .../github.com/gotk3/gotk3/cairo/surface.go | 9 + vendor/github.com/gotk3/gotk3/cairo/text.go | 1 + vendor/github.com/gotk3/gotk3/gdk/gdk.go | 34 + vendor/github.com/gotk3/gotk3/gdk/keys.go | 2279 +++++++++++++++++ vendor/github.com/gotk3/gotk3/glib/glib.go | 8 + vendor/github.com/gotk3/gotk3/glib/glib.go.h | 328 +-- .../gotk3/gotk3/glib/gmain_context.go | 32 + vendor/github.com/gotk3/gotk3/glib/gsource.go | 27 + .../github.com/gotk3/gotk3/glib/settings.go | 277 ++ .../gotk3/gotk3/glib/settings_backend.go | 71 + .../gotk3/gotk3/glib/settings_schema.go | 96 + .../gotk3/glib/settings_schema_source.go | 70 + vendor/github.com/gotk3/gotk3/gtk/gtk.go | 249 +- vendor/github.com/gotk3/gotk3/gtk/label.go | 9 + .../github.com/gotk3/gotk3/gtk/text_iter.go | 404 +++ .../github.com/gotk3/gotk3/gtk/text_mark.go | 29 + .../github.com/gotk3/gotk3/gtk/text_view.go | 420 +++ vendor/github.com/gotk3/gotk3/gtk/window.go | 7 +- .../gotk3/gotk3/pango/pango-glyph.go | 2 +- .../gotk3/gotk3/pango/pango-layout.go | 2 +- 22 files changed, 4010 insertions(+), 392 deletions(-) create mode 100644 vendor/github.com/gotk3/gotk3/cairo/format.go create mode 100644 vendor/github.com/gotk3/gotk3/gdk/keys.go create mode 100644 vendor/github.com/gotk3/gotk3/glib/gmain_context.go create mode 100644 vendor/github.com/gotk3/gotk3/glib/gsource.go create mode 100644 vendor/github.com/gotk3/gotk3/glib/settings.go create mode 100644 vendor/github.com/gotk3/gotk3/glib/settings_backend.go create mode 100644 vendor/github.com/gotk3/gotk3/glib/settings_schema.go create mode 100644 vendor/github.com/gotk3/gotk3/glib/settings_schema_source.go create mode 100644 vendor/github.com/gotk3/gotk3/gtk/text_iter.go create mode 100644 vendor/github.com/gotk3/gotk3/gtk/text_mark.go create mode 100644 vendor/github.com/gotk3/gotk3/gtk/text_view.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a69eae1..8f3ebcf 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -18,28 +18,28 @@ }, { "ImportPath": "github.com/gotk3/gotk3/cairo", - "Comment": "GOTK3_0_2_0-430-ge68c426", - "Rev": "e68c42636533041787e09741c5027ea670ad6f84" + "Comment": "GOTK3_0_2_0-467-gefaac8f", + "Rev": "efaac8f907aac2f965675d64fd163097db109f95" }, { "ImportPath": "github.com/gotk3/gotk3/gdk", - "Comment": "GOTK3_0_2_0-430-ge68c426", - "Rev": "e68c42636533041787e09741c5027ea670ad6f84" + "Comment": "GOTK3_0_2_0-467-gefaac8f", + "Rev": "efaac8f907aac2f965675d64fd163097db109f95" }, { "ImportPath": "github.com/gotk3/gotk3/glib", - "Comment": "GOTK3_0_2_0-430-ge68c426", - "Rev": "e68c42636533041787e09741c5027ea670ad6f84" + "Comment": "GOTK3_0_2_0-467-gefaac8f", + "Rev": "efaac8f907aac2f965675d64fd163097db109f95" }, { "ImportPath": "github.com/gotk3/gotk3/gtk", - "Comment": "GOTK3_0_2_0-430-ge68c426", - "Rev": "e68c42636533041787e09741c5027ea670ad6f84" + "Comment": "GOTK3_0_2_0-467-gefaac8f", + "Rev": "efaac8f907aac2f965675d64fd163097db109f95" }, { "ImportPath": "github.com/gotk3/gotk3/pango", - "Comment": "GOTK3_0_2_0-430-ge68c426", - "Rev": "e68c42636533041787e09741c5027ea670ad6f84" + "Comment": "GOTK3_0_2_0-467-gefaac8f", + "Rev": "efaac8f907aac2f965675d64fd163097db109f95" }, { "ImportPath": "github.com/op/go-logging", diff --git a/vendor/github.com/gotk3/gotk3/cairo/format.go b/vendor/github.com/gotk3/gotk3/cairo/format.go new file mode 100644 index 0000000..e1853b8 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/format.go @@ -0,0 +1,28 @@ +package cairo + +// #cgo pkg-config: cairo cairo-gobject +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// Format is a representation of Cairo's cairo_format_t. +type Format int + +const ( + FORMAT_INVALID Format = C.CAIRO_FORMAT_INVALID + FORMAT_ARGB32 Format = C.CAIRO_FORMAT_ARGB32 + FORMAT_RGB24 Format = C.CAIRO_FORMAT_RGB24 + FORMAT_A8 Format = C.CAIRO_FORMAT_A8 + FORMAT_A1 Format = C.CAIRO_FORMAT_A1 + FORMAT_RGB16_565 Format = C.CAIRO_FORMAT_RGB16_565 + FORMAT_RGB30 Format = C.CAIRO_FORMAT_RGB30 +) + +func marshalFormat(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Format(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/surface.go b/vendor/github.com/gotk3/gotk3/cairo/surface.go index c3acaa1..3b8a6d6 100644 --- a/vendor/github.com/gotk3/gotk3/cairo/surface.go +++ b/vendor/github.com/gotk3/gotk3/cairo/surface.go @@ -39,6 +39,15 @@ func NewSurfaceFromPNG(fileName string) (*Surface, error) { return &Surface{surfaceNative}, nil } +// CreateImageSurface is a wrapper around cairo_image_surface_create(). +func CreateImageSurface(format Format, width, height int) *Surface { + c := C.cairo_image_surface_create(C.cairo_format_t(format), + C.int(width), C.int(height)) + s := wrapSurface(c) + runtime.SetFinalizer(s, (*Surface).destroy) + return s +} + // native returns a pointer to the underlying cairo_surface_t. func (v *Surface) native() *C.cairo_surface_t { if v == nil { diff --git a/vendor/github.com/gotk3/gotk3/cairo/text.go b/vendor/github.com/gotk3/gotk3/cairo/text.go index 45fe298..a14f6ef 100644 --- a/vendor/github.com/gotk3/gotk3/cairo/text.go +++ b/vendor/github.com/gotk3/gotk3/cairo/text.go @@ -124,3 +124,4 @@ func (v *Context) TextExtents(utf8 string) TextExtents { // TODO: cairo_text_cluster_allocate // TODO: cairo_text_cluster_free + diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk.go b/vendor/github.com/gotk3/gotk3/gdk/gdk.go index 51b7f57..9b7da4b 100644 --- a/vendor/github.com/gotk3/gotk3/gdk/gdk.go +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk.go @@ -1077,6 +1077,29 @@ func (v *EventScroll) Type() EventType { return EventType(c) } +func (v *EventScroll) Direction() ScrollDirection { + c := v.native().direction + return ScrollDirection(c) +} + +/* + * GdkGravity + */ +type GdkGravity int + +const ( + GDK_GRAVITY_NORTH_WEST = C.GDK_GRAVITY_NORTH_WEST + GDK_GRAVITY_NORTH = C.GDK_GRAVITY_NORTH + GDK_GRAVITY_NORTH_EAST = C.GDK_GRAVITY_NORTH_EAST + GDK_GRAVITY_WEST = C.GDK_GRAVITY_WEST + GDK_GRAVITY_CENTER = C.GDK_GRAVITY_CENTER + GDK_GRAVITY_EAST = C.GDK_GRAVITY_EAST + GDK_GRAVITY_SOUTH_WEST = C.GDK_GRAVITY_SOUTH_WEST + GDK_GRAVITY_SOUTH = C.GDK_GRAVITY_SOUTH + GDK_GRAVITY_SOUTH_EAST = C.GDK_GRAVITY_SOUTH_EAST + GDK_GRAVITY_STATIC = C.GDK_GRAVITY_STATIC +) + /* * GdkPixbuf */ @@ -1517,6 +1540,17 @@ type Rectangle struct { GdkRectangle C.GdkRectangle } +func WrapRectangle(p uintptr) *Rectangle { + return wrapRectangle((*C.GdkRectangle)(unsafe.Pointer(p))) +} + +func wrapRectangle(obj *C.GdkRectangle) *Rectangle { + if obj == nil { + return nil + } + return &Rectangle{*obj} +} + // Native() returns a pointer to the underlying GdkRectangle. func (r *Rectangle) native() *C.GdkRectangle { return &r.GdkRectangle diff --git a/vendor/github.com/gotk3/gotk3/gdk/keys.go b/vendor/github.com/gotk3/gotk3/gdk/keys.go new file mode 100644 index 0000000..3f52a90 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/keys.go @@ -0,0 +1,2279 @@ +package gdk + +// #cgo pkg-config: gdk-3.0 +// #include +// #include "gdk.go.h" +import "C" + +const ( + KEY_VoidSymbol = uint(C.GDK_KEY_VoidSymbol) + KEY_BackSpace = uint(C.GDK_KEY_BackSpace) + KEY_Tab = uint(C.GDK_KEY_Tab) + KEY_Linefeed = uint(C.GDK_KEY_Linefeed) + KEY_Clear = uint(C.GDK_KEY_Clear) + KEY_Return = uint(C.GDK_KEY_Return) + KEY_Pause = uint(C.GDK_KEY_Pause) + KEY_Scroll_Lock = uint(C.GDK_KEY_Scroll_Lock) + KEY_Sys_Req = uint(C.GDK_KEY_Sys_Req) + KEY_Escape = uint(C.GDK_KEY_Escape) + KEY_Delete = uint(C.GDK_KEY_Delete) + KEY_Multi_key = uint(C.GDK_KEY_Multi_key) + KEY_Codeinput = uint(C.GDK_KEY_Codeinput) + KEY_SingleCandidate = uint(C.GDK_KEY_SingleCandidate) + KEY_MultipleCandidate = uint(C.GDK_KEY_MultipleCandidate) + KEY_PreviousCandidate = uint(C.GDK_KEY_PreviousCandidate) + KEY_Kanji = uint(C.GDK_KEY_Kanji) + KEY_Muhenkan = uint(C.GDK_KEY_Muhenkan) + KEY_Henkan_Mode = uint(C.GDK_KEY_Henkan_Mode) + KEY_Henkan = uint(C.GDK_KEY_Henkan) + KEY_Romaji = uint(C.GDK_KEY_Romaji) + KEY_Hiragana = uint(C.GDK_KEY_Hiragana) + KEY_Katakana = uint(C.GDK_KEY_Katakana) + KEY_Hiragana_Katakana = uint(C.GDK_KEY_Hiragana_Katakana) + KEY_Zenkaku = uint(C.GDK_KEY_Zenkaku) + KEY_Hankaku = uint(C.GDK_KEY_Hankaku) + KEY_Zenkaku_Hankaku = uint(C.GDK_KEY_Zenkaku_Hankaku) + KEY_Touroku = uint(C.GDK_KEY_Touroku) + KEY_Massyo = uint(C.GDK_KEY_Massyo) + KEY_Kana_Lock = uint(C.GDK_KEY_Kana_Lock) + KEY_Kana_Shift = uint(C.GDK_KEY_Kana_Shift) + KEY_Eisu_Shift = uint(C.GDK_KEY_Eisu_Shift) + KEY_Eisu_toggle = uint(C.GDK_KEY_Eisu_toggle) + KEY_Kanji_Bangou = uint(C.GDK_KEY_Kanji_Bangou) + KEY_Zen_Koho = uint(C.GDK_KEY_Zen_Koho) + KEY_Mae_Koho = uint(C.GDK_KEY_Mae_Koho) + KEY_Home = uint(C.GDK_KEY_Home) + KEY_Left = uint(C.GDK_KEY_Left) + KEY_Up = uint(C.GDK_KEY_Up) + KEY_Right = uint(C.GDK_KEY_Right) + KEY_Down = uint(C.GDK_KEY_Down) + KEY_Prior = uint(C.GDK_KEY_Prior) + KEY_Page_Up = uint(C.GDK_KEY_Page_Up) + KEY_Next = uint(C.GDK_KEY_Next) + KEY_Page_Down = uint(C.GDK_KEY_Page_Down) + KEY_End = uint(C.GDK_KEY_End) + KEY_Begin = uint(C.GDK_KEY_Begin) + KEY_Select = uint(C.GDK_KEY_Select) + KEY_Print = uint(C.GDK_KEY_Print) + KEY_Execute = uint(C.GDK_KEY_Execute) + KEY_Insert = uint(C.GDK_KEY_Insert) + KEY_Undo = uint(C.GDK_KEY_Undo) + KEY_Redo = uint(C.GDK_KEY_Redo) + KEY_Menu = uint(C.GDK_KEY_Menu) + KEY_Find = uint(C.GDK_KEY_Find) + KEY_Cancel = uint(C.GDK_KEY_Cancel) + KEY_Help = uint(C.GDK_KEY_Help) + KEY_Break = uint(C.GDK_KEY_Break) + KEY_Mode_switch = uint(C.GDK_KEY_Mode_switch) + KEY_script_switch = uint(C.GDK_KEY_script_switch) + KEY_Num_Lock = uint(C.GDK_KEY_Num_Lock) + KEY_KP_Space = uint(C.GDK_KEY_KP_Space) + KEY_KP_Tab = uint(C.GDK_KEY_KP_Tab) + KEY_KP_Enter = uint(C.GDK_KEY_KP_Enter) + KEY_KP_F1 = uint(C.GDK_KEY_KP_F1) + KEY_KP_F2 = uint(C.GDK_KEY_KP_F2) + KEY_KP_F3 = uint(C.GDK_KEY_KP_F3) + KEY_KP_F4 = uint(C.GDK_KEY_KP_F4) + KEY_KP_Home = uint(C.GDK_KEY_KP_Home) + KEY_KP_Left = uint(C.GDK_KEY_KP_Left) + KEY_KP_Up = uint(C.GDK_KEY_KP_Up) + KEY_KP_Right = uint(C.GDK_KEY_KP_Right) + KEY_KP_Down = uint(C.GDK_KEY_KP_Down) + KEY_KP_Prior = uint(C.GDK_KEY_KP_Prior) + KEY_KP_Page_Up = uint(C.GDK_KEY_KP_Page_Up) + KEY_KP_Next = uint(C.GDK_KEY_KP_Next) + KEY_KP_Page_Down = uint(C.GDK_KEY_KP_Page_Down) + KEY_KP_End = uint(C.GDK_KEY_KP_End) + KEY_KP_Begin = uint(C.GDK_KEY_KP_Begin) + KEY_KP_Insert = uint(C.GDK_KEY_KP_Insert) + KEY_KP_Delete = uint(C.GDK_KEY_KP_Delete) + KEY_KP_Equal = uint(C.GDK_KEY_KP_Equal) + KEY_KP_Multiply = uint(C.GDK_KEY_KP_Multiply) + KEY_KP_Add = uint(C.GDK_KEY_KP_Add) + KEY_KP_Separator = uint(C.GDK_KEY_KP_Separator) + KEY_KP_Subtract = uint(C.GDK_KEY_KP_Subtract) + KEY_KP_Decimal = uint(C.GDK_KEY_KP_Decimal) + KEY_KP_Divide = uint(C.GDK_KEY_KP_Divide) + KEY_KP_0 = uint(C.GDK_KEY_KP_0) + KEY_KP_1 = uint(C.GDK_KEY_KP_1) + KEY_KP_2 = uint(C.GDK_KEY_KP_2) + KEY_KP_3 = uint(C.GDK_KEY_KP_3) + KEY_KP_4 = uint(C.GDK_KEY_KP_4) + KEY_KP_5 = uint(C.GDK_KEY_KP_5) + KEY_KP_6 = uint(C.GDK_KEY_KP_6) + KEY_KP_7 = uint(C.GDK_KEY_KP_7) + KEY_KP_8 = uint(C.GDK_KEY_KP_8) + KEY_KP_9 = uint(C.GDK_KEY_KP_9) + KEY_F1 = uint(C.GDK_KEY_F1) + KEY_F2 = uint(C.GDK_KEY_F2) + KEY_F3 = uint(C.GDK_KEY_F3) + KEY_F4 = uint(C.GDK_KEY_F4) + KEY_F5 = uint(C.GDK_KEY_F5) + KEY_F6 = uint(C.GDK_KEY_F6) + KEY_F7 = uint(C.GDK_KEY_F7) + KEY_F8 = uint(C.GDK_KEY_F8) + KEY_F9 = uint(C.GDK_KEY_F9) + KEY_F10 = uint(C.GDK_KEY_F10) + KEY_F11 = uint(C.GDK_KEY_F11) + KEY_L1 = uint(C.GDK_KEY_L1) + KEY_F12 = uint(C.GDK_KEY_F12) + KEY_L2 = uint(C.GDK_KEY_L2) + KEY_F13 = uint(C.GDK_KEY_F13) + KEY_L3 = uint(C.GDK_KEY_L3) + KEY_F14 = uint(C.GDK_KEY_F14) + KEY_L4 = uint(C.GDK_KEY_L4) + KEY_F15 = uint(C.GDK_KEY_F15) + KEY_L5 = uint(C.GDK_KEY_L5) + KEY_F16 = uint(C.GDK_KEY_F16) + KEY_L6 = uint(C.GDK_KEY_L6) + KEY_F17 = uint(C.GDK_KEY_F17) + KEY_L7 = uint(C.GDK_KEY_L7) + KEY_F18 = uint(C.GDK_KEY_F18) + KEY_L8 = uint(C.GDK_KEY_L8) + KEY_F19 = uint(C.GDK_KEY_F19) + KEY_L9 = uint(C.GDK_KEY_L9) + KEY_F20 = uint(C.GDK_KEY_F20) + KEY_L10 = uint(C.GDK_KEY_L10) + KEY_F21 = uint(C.GDK_KEY_F21) + KEY_R1 = uint(C.GDK_KEY_R1) + KEY_F22 = uint(C.GDK_KEY_F22) + KEY_R2 = uint(C.GDK_KEY_R2) + KEY_F23 = uint(C.GDK_KEY_F23) + KEY_R3 = uint(C.GDK_KEY_R3) + KEY_F24 = uint(C.GDK_KEY_F24) + KEY_R4 = uint(C.GDK_KEY_R4) + KEY_F25 = uint(C.GDK_KEY_F25) + KEY_R5 = uint(C.GDK_KEY_R5) + KEY_F26 = uint(C.GDK_KEY_F26) + KEY_R6 = uint(C.GDK_KEY_R6) + KEY_F27 = uint(C.GDK_KEY_F27) + KEY_R7 = uint(C.GDK_KEY_R7) + KEY_F28 = uint(C.GDK_KEY_F28) + KEY_R8 = uint(C.GDK_KEY_R8) + KEY_F29 = uint(C.GDK_KEY_F29) + KEY_R9 = uint(C.GDK_KEY_R9) + KEY_F30 = uint(C.GDK_KEY_F30) + KEY_R10 = uint(C.GDK_KEY_R10) + KEY_F31 = uint(C.GDK_KEY_F31) + KEY_R11 = uint(C.GDK_KEY_R11) + KEY_F32 = uint(C.GDK_KEY_F32) + KEY_R12 = uint(C.GDK_KEY_R12) + KEY_F33 = uint(C.GDK_KEY_F33) + KEY_R13 = uint(C.GDK_KEY_R13) + KEY_F34 = uint(C.GDK_KEY_F34) + KEY_R14 = uint(C.GDK_KEY_R14) + KEY_F35 = uint(C.GDK_KEY_F35) + KEY_R15 = uint(C.GDK_KEY_R15) + KEY_Shift_L = uint(C.GDK_KEY_Shift_L) + KEY_Shift_R = uint(C.GDK_KEY_Shift_R) + KEY_Control_L = uint(C.GDK_KEY_Control_L) + KEY_Control_R = uint(C.GDK_KEY_Control_R) + KEY_Caps_Lock = uint(C.GDK_KEY_Caps_Lock) + KEY_Shift_Lock = uint(C.GDK_KEY_Shift_Lock) + KEY_Meta_L = uint(C.GDK_KEY_Meta_L) + KEY_Meta_R = uint(C.GDK_KEY_Meta_R) + KEY_Alt_L = uint(C.GDK_KEY_Alt_L) + KEY_Alt_R = uint(C.GDK_KEY_Alt_R) + KEY_Super_L = uint(C.GDK_KEY_Super_L) + KEY_Super_R = uint(C.GDK_KEY_Super_R) + KEY_Hyper_L = uint(C.GDK_KEY_Hyper_L) + KEY_Hyper_R = uint(C.GDK_KEY_Hyper_R) + KEY_ISO_Lock = uint(C.GDK_KEY_ISO_Lock) + KEY_ISO_Level2_Latch = uint(C.GDK_KEY_ISO_Level2_Latch) + KEY_ISO_Level3_Shift = uint(C.GDK_KEY_ISO_Level3_Shift) + KEY_ISO_Level3_Latch = uint(C.GDK_KEY_ISO_Level3_Latch) + KEY_ISO_Level3_Lock = uint(C.GDK_KEY_ISO_Level3_Lock) + KEY_ISO_Level5_Shift = uint(C.GDK_KEY_ISO_Level5_Shift) + KEY_ISO_Level5_Latch = uint(C.GDK_KEY_ISO_Level5_Latch) + KEY_ISO_Level5_Lock = uint(C.GDK_KEY_ISO_Level5_Lock) + KEY_ISO_Group_Shift = uint(C.GDK_KEY_ISO_Group_Shift) + KEY_ISO_Group_Latch = uint(C.GDK_KEY_ISO_Group_Latch) + KEY_ISO_Group_Lock = uint(C.GDK_KEY_ISO_Group_Lock) + KEY_ISO_Next_Group = uint(C.GDK_KEY_ISO_Next_Group) + KEY_ISO_Next_Group_Lock = uint(C.GDK_KEY_ISO_Next_Group_Lock) + KEY_ISO_Prev_Group = uint(C.GDK_KEY_ISO_Prev_Group) + KEY_ISO_Prev_Group_Lock = uint(C.GDK_KEY_ISO_Prev_Group_Lock) + KEY_ISO_First_Group = uint(C.GDK_KEY_ISO_First_Group) + KEY_ISO_First_Group_Lock = uint(C.GDK_KEY_ISO_First_Group_Lock) + KEY_ISO_Last_Group = uint(C.GDK_KEY_ISO_Last_Group) + KEY_ISO_Last_Group_Lock = uint(C.GDK_KEY_ISO_Last_Group_Lock) + KEY_ISO_Left_Tab = uint(C.GDK_KEY_ISO_Left_Tab) + KEY_ISO_Move_Line_Up = uint(C.GDK_KEY_ISO_Move_Line_Up) + KEY_ISO_Move_Line_Down = uint(C.GDK_KEY_ISO_Move_Line_Down) + KEY_ISO_Partial_Line_Up = uint(C.GDK_KEY_ISO_Partial_Line_Up) + KEY_ISO_Partial_Line_Down = uint(C.GDK_KEY_ISO_Partial_Line_Down) + KEY_ISO_Partial_Space_Left = uint(C.GDK_KEY_ISO_Partial_Space_Left) + KEY_ISO_Partial_Space_Right = uint(C.GDK_KEY_ISO_Partial_Space_Right) + KEY_ISO_Set_Margin_Left = uint(C.GDK_KEY_ISO_Set_Margin_Left) + KEY_ISO_Set_Margin_Right = uint(C.GDK_KEY_ISO_Set_Margin_Right) + KEY_ISO_Release_Margin_Left = uint(C.GDK_KEY_ISO_Release_Margin_Left) + KEY_ISO_Release_Margin_Right = uint(C.GDK_KEY_ISO_Release_Margin_Right) + KEY_ISO_Release_Both_Margins = uint(C.GDK_KEY_ISO_Release_Both_Margins) + KEY_ISO_Fast_Cursor_Left = uint(C.GDK_KEY_ISO_Fast_Cursor_Left) + KEY_ISO_Fast_Cursor_Right = uint(C.GDK_KEY_ISO_Fast_Cursor_Right) + KEY_ISO_Fast_Cursor_Up = uint(C.GDK_KEY_ISO_Fast_Cursor_Up) + KEY_ISO_Fast_Cursor_Down = uint(C.GDK_KEY_ISO_Fast_Cursor_Down) + KEY_ISO_Continuous_Underline = uint(C.GDK_KEY_ISO_Continuous_Underline) + KEY_ISO_Discontinuous_Underline = uint(C.GDK_KEY_ISO_Discontinuous_Underline) + KEY_ISO_Emphasize = uint(C.GDK_KEY_ISO_Emphasize) + KEY_ISO_Center_Object = uint(C.GDK_KEY_ISO_Center_Object) + KEY_ISO_Enter = uint(C.GDK_KEY_ISO_Enter) + KEY_dead_grave = uint(C.GDK_KEY_dead_grave) + KEY_dead_acute = uint(C.GDK_KEY_dead_acute) + KEY_dead_circumflex = uint(C.GDK_KEY_dead_circumflex) + KEY_dead_tilde = uint(C.GDK_KEY_dead_tilde) + KEY_dead_perispomeni = uint(C.GDK_KEY_dead_perispomeni) + KEY_dead_macron = uint(C.GDK_KEY_dead_macron) + KEY_dead_breve = uint(C.GDK_KEY_dead_breve) + KEY_dead_abovedot = uint(C.GDK_KEY_dead_abovedot) + KEY_dead_diaeresis = uint(C.GDK_KEY_dead_diaeresis) + KEY_dead_abovering = uint(C.GDK_KEY_dead_abovering) + KEY_dead_doubleacute = uint(C.GDK_KEY_dead_doubleacute) + KEY_dead_caron = uint(C.GDK_KEY_dead_caron) + KEY_dead_cedilla = uint(C.GDK_KEY_dead_cedilla) + KEY_dead_ogonek = uint(C.GDK_KEY_dead_ogonek) + KEY_dead_iota = uint(C.GDK_KEY_dead_iota) + KEY_dead_voiced_sound = uint(C.GDK_KEY_dead_voiced_sound) + KEY_dead_semivoiced_sound = uint(C.GDK_KEY_dead_semivoiced_sound) + KEY_dead_belowdot = uint(C.GDK_KEY_dead_belowdot) + KEY_dead_hook = uint(C.GDK_KEY_dead_hook) + KEY_dead_horn = uint(C.GDK_KEY_dead_horn) + KEY_dead_stroke = uint(C.GDK_KEY_dead_stroke) + KEY_dead_abovecomma = uint(C.GDK_KEY_dead_abovecomma) + KEY_dead_psili = uint(C.GDK_KEY_dead_psili) + KEY_dead_abovereversedcomma = uint(C.GDK_KEY_dead_abovereversedcomma) + KEY_dead_dasia = uint(C.GDK_KEY_dead_dasia) + KEY_dead_doublegrave = uint(C.GDK_KEY_dead_doublegrave) + KEY_dead_belowring = uint(C.GDK_KEY_dead_belowring) + KEY_dead_belowmacron = uint(C.GDK_KEY_dead_belowmacron) + KEY_dead_belowcircumflex = uint(C.GDK_KEY_dead_belowcircumflex) + KEY_dead_belowtilde = uint(C.GDK_KEY_dead_belowtilde) + KEY_dead_belowbreve = uint(C.GDK_KEY_dead_belowbreve) + KEY_dead_belowdiaeresis = uint(C.GDK_KEY_dead_belowdiaeresis) + KEY_dead_invertedbreve = uint(C.GDK_KEY_dead_invertedbreve) + KEY_dead_belowcomma = uint(C.GDK_KEY_dead_belowcomma) + KEY_dead_currency = uint(C.GDK_KEY_dead_currency) + KEY_dead_a = uint(C.GDK_KEY_dead_a) + KEY_dead_A = uint(C.GDK_KEY_dead_A) + KEY_dead_e = uint(C.GDK_KEY_dead_e) + KEY_dead_E = uint(C.GDK_KEY_dead_E) + KEY_dead_i = uint(C.GDK_KEY_dead_i) + KEY_dead_I = uint(C.GDK_KEY_dead_I) + KEY_dead_o = uint(C.GDK_KEY_dead_o) + KEY_dead_O = uint(C.GDK_KEY_dead_O) + KEY_dead_u = uint(C.GDK_KEY_dead_u) + KEY_dead_U = uint(C.GDK_KEY_dead_U) + KEY_dead_small_schwa = uint(C.GDK_KEY_dead_small_schwa) + KEY_dead_capital_schwa = uint(C.GDK_KEY_dead_capital_schwa) + KEY_dead_greek = uint(C.GDK_KEY_dead_greek) + KEY_First_Virtual_Screen = uint(C.GDK_KEY_First_Virtual_Screen) + KEY_Prev_Virtual_Screen = uint(C.GDK_KEY_Prev_Virtual_Screen) + KEY_Next_Virtual_Screen = uint(C.GDK_KEY_Next_Virtual_Screen) + KEY_Last_Virtual_Screen = uint(C.GDK_KEY_Last_Virtual_Screen) + KEY_Terminate_Server = uint(C.GDK_KEY_Terminate_Server) + KEY_AccessX_Enable = uint(C.GDK_KEY_AccessX_Enable) + KEY_AccessX_Feedback_Enable = uint(C.GDK_KEY_AccessX_Feedback_Enable) + KEY_RepeatKeys_Enable = uint(C.GDK_KEY_RepeatKeys_Enable) + KEY_SlowKeys_Enable = uint(C.GDK_KEY_SlowKeys_Enable) + KEY_BounceKeys_Enable = uint(C.GDK_KEY_BounceKeys_Enable) + KEY_StickyKeys_Enable = uint(C.GDK_KEY_StickyKeys_Enable) + KEY_MouseKeys_Enable = uint(C.GDK_KEY_MouseKeys_Enable) + KEY_MouseKeys_Accel_Enable = uint(C.GDK_KEY_MouseKeys_Accel_Enable) + KEY_Overlay1_Enable = uint(C.GDK_KEY_Overlay1_Enable) + KEY_Overlay2_Enable = uint(C.GDK_KEY_Overlay2_Enable) + KEY_AudibleBell_Enable = uint(C.GDK_KEY_AudibleBell_Enable) + KEY_Pointer_Left = uint(C.GDK_KEY_Pointer_Left) + KEY_Pointer_Right = uint(C.GDK_KEY_Pointer_Right) + KEY_Pointer_Up = uint(C.GDK_KEY_Pointer_Up) + KEY_Pointer_Down = uint(C.GDK_KEY_Pointer_Down) + KEY_Pointer_UpLeft = uint(C.GDK_KEY_Pointer_UpLeft) + KEY_Pointer_UpRight = uint(C.GDK_KEY_Pointer_UpRight) + KEY_Pointer_DownLeft = uint(C.GDK_KEY_Pointer_DownLeft) + KEY_Pointer_DownRight = uint(C.GDK_KEY_Pointer_DownRight) + KEY_Pointer_Button_Dflt = uint(C.GDK_KEY_Pointer_Button_Dflt) + KEY_Pointer_Button1 = uint(C.GDK_KEY_Pointer_Button1) + KEY_Pointer_Button2 = uint(C.GDK_KEY_Pointer_Button2) + KEY_Pointer_Button3 = uint(C.GDK_KEY_Pointer_Button3) + KEY_Pointer_Button4 = uint(C.GDK_KEY_Pointer_Button4) + KEY_Pointer_Button5 = uint(C.GDK_KEY_Pointer_Button5) + KEY_Pointer_DblClick_Dflt = uint(C.GDK_KEY_Pointer_DblClick_Dflt) + KEY_Pointer_DblClick1 = uint(C.GDK_KEY_Pointer_DblClick1) + KEY_Pointer_DblClick2 = uint(C.GDK_KEY_Pointer_DblClick2) + KEY_Pointer_DblClick3 = uint(C.GDK_KEY_Pointer_DblClick3) + KEY_Pointer_DblClick4 = uint(C.GDK_KEY_Pointer_DblClick4) + KEY_Pointer_DblClick5 = uint(C.GDK_KEY_Pointer_DblClick5) + KEY_Pointer_Drag_Dflt = uint(C.GDK_KEY_Pointer_Drag_Dflt) + KEY_Pointer_Drag1 = uint(C.GDK_KEY_Pointer_Drag1) + KEY_Pointer_Drag2 = uint(C.GDK_KEY_Pointer_Drag2) + KEY_Pointer_Drag3 = uint(C.GDK_KEY_Pointer_Drag3) + KEY_Pointer_Drag4 = uint(C.GDK_KEY_Pointer_Drag4) + KEY_Pointer_Drag5 = uint(C.GDK_KEY_Pointer_Drag5) + KEY_Pointer_EnableKeys = uint(C.GDK_KEY_Pointer_EnableKeys) + KEY_Pointer_Accelerate = uint(C.GDK_KEY_Pointer_Accelerate) + KEY_Pointer_DfltBtnNext = uint(C.GDK_KEY_Pointer_DfltBtnNext) + KEY_Pointer_DfltBtnPrev = uint(C.GDK_KEY_Pointer_DfltBtnPrev) + KEY_ch = uint(C.GDK_KEY_ch) + KEY_Ch = uint(C.GDK_KEY_Ch) + KEY_CH = uint(C.GDK_KEY_CH) + KEY_c_h = uint(C.GDK_KEY_c_h) + KEY_C_h = uint(C.GDK_KEY_C_h) + KEY_C_H = uint(C.GDK_KEY_C_H) + KEY_3270_Duplicate = uint(C.GDK_KEY_3270_Duplicate) + KEY_3270_FieldMark = uint(C.GDK_KEY_3270_FieldMark) + KEY_3270_Right2 = uint(C.GDK_KEY_3270_Right2) + KEY_3270_Left2 = uint(C.GDK_KEY_3270_Left2) + KEY_3270_BackTab = uint(C.GDK_KEY_3270_BackTab) + KEY_3270_EraseEOF = uint(C.GDK_KEY_3270_EraseEOF) + KEY_3270_EraseInput = uint(C.GDK_KEY_3270_EraseInput) + KEY_3270_Reset = uint(C.GDK_KEY_3270_Reset) + KEY_3270_Quit = uint(C.GDK_KEY_3270_Quit) + KEY_3270_PA1 = uint(C.GDK_KEY_3270_PA1) + KEY_3270_PA2 = uint(C.GDK_KEY_3270_PA2) + KEY_3270_PA3 = uint(C.GDK_KEY_3270_PA3) + KEY_3270_Test = uint(C.GDK_KEY_3270_Test) + KEY_3270_Attn = uint(C.GDK_KEY_3270_Attn) + KEY_3270_CursorBlink = uint(C.GDK_KEY_3270_CursorBlink) + KEY_3270_AltCursor = uint(C.GDK_KEY_3270_AltCursor) + KEY_3270_KeyClick = uint(C.GDK_KEY_3270_KeyClick) + KEY_3270_Jump = uint(C.GDK_KEY_3270_Jump) + KEY_3270_Ident = uint(C.GDK_KEY_3270_Ident) + KEY_3270_Rule = uint(C.GDK_KEY_3270_Rule) + KEY_3270_Copy = uint(C.GDK_KEY_3270_Copy) + KEY_3270_Play = uint(C.GDK_KEY_3270_Play) + KEY_3270_Setup = uint(C.GDK_KEY_3270_Setup) + KEY_3270_Record = uint(C.GDK_KEY_3270_Record) + KEY_3270_ChangeScreen = uint(C.GDK_KEY_3270_ChangeScreen) + KEY_3270_DeleteWord = uint(C.GDK_KEY_3270_DeleteWord) + KEY_3270_ExSelect = uint(C.GDK_KEY_3270_ExSelect) + KEY_3270_CursorSelect = uint(C.GDK_KEY_3270_CursorSelect) + KEY_3270_PrintScreen = uint(C.GDK_KEY_3270_PrintScreen) + KEY_3270_Enter = uint(C.GDK_KEY_3270_Enter) + KEY_space = uint(C.GDK_KEY_space) + KEY_exclam = uint(C.GDK_KEY_exclam) + KEY_quotedbl = uint(C.GDK_KEY_quotedbl) + KEY_numbersign = uint(C.GDK_KEY_numbersign) + KEY_dollar = uint(C.GDK_KEY_dollar) + KEY_percent = uint(C.GDK_KEY_percent) + KEY_ampersand = uint(C.GDK_KEY_ampersand) + KEY_apostrophe = uint(C.GDK_KEY_apostrophe) + KEY_quoteright = uint(C.GDK_KEY_quoteright) + KEY_parenleft = uint(C.GDK_KEY_parenleft) + KEY_parenright = uint(C.GDK_KEY_parenright) + KEY_asterisk = uint(C.GDK_KEY_asterisk) + KEY_plus = uint(C.GDK_KEY_plus) + KEY_comma = uint(C.GDK_KEY_comma) + KEY_minus = uint(C.GDK_KEY_minus) + KEY_period = uint(C.GDK_KEY_period) + KEY_slash = uint(C.GDK_KEY_slash) + KEY_0 = uint(C.GDK_KEY_0) + KEY_1 = uint(C.GDK_KEY_1) + KEY_2 = uint(C.GDK_KEY_2) + KEY_3 = uint(C.GDK_KEY_3) + KEY_4 = uint(C.GDK_KEY_4) + KEY_5 = uint(C.GDK_KEY_5) + KEY_6 = uint(C.GDK_KEY_6) + KEY_7 = uint(C.GDK_KEY_7) + KEY_8 = uint(C.GDK_KEY_8) + KEY_9 = uint(C.GDK_KEY_9) + KEY_colon = uint(C.GDK_KEY_colon) + KEY_semicolon = uint(C.GDK_KEY_semicolon) + KEY_less = uint(C.GDK_KEY_less) + KEY_equal = uint(C.GDK_KEY_equal) + KEY_greater = uint(C.GDK_KEY_greater) + KEY_question = uint(C.GDK_KEY_question) + KEY_at = uint(C.GDK_KEY_at) + KEY_A = uint(C.GDK_KEY_A) + KEY_B = uint(C.GDK_KEY_B) + KEY_C = uint(C.GDK_KEY_C) + KEY_D = uint(C.GDK_KEY_D) + KEY_E = uint(C.GDK_KEY_E) + KEY_F = uint(C.GDK_KEY_F) + KEY_G = uint(C.GDK_KEY_G) + KEY_H = uint(C.GDK_KEY_H) + KEY_I = uint(C.GDK_KEY_I) + KEY_J = uint(C.GDK_KEY_J) + KEY_K = uint(C.GDK_KEY_K) + KEY_L = uint(C.GDK_KEY_L) + KEY_M = uint(C.GDK_KEY_M) + KEY_N = uint(C.GDK_KEY_N) + KEY_O = uint(C.GDK_KEY_O) + KEY_P = uint(C.GDK_KEY_P) + KEY_Q = uint(C.GDK_KEY_Q) + KEY_R = uint(C.GDK_KEY_R) + KEY_S = uint(C.GDK_KEY_S) + KEY_T = uint(C.GDK_KEY_T) + KEY_U = uint(C.GDK_KEY_U) + KEY_V = uint(C.GDK_KEY_V) + KEY_W = uint(C.GDK_KEY_W) + KEY_X = uint(C.GDK_KEY_X) + KEY_Y = uint(C.GDK_KEY_Y) + KEY_Z = uint(C.GDK_KEY_Z) + KEY_bracketleft = uint(C.GDK_KEY_bracketleft) + KEY_backslash = uint(C.GDK_KEY_backslash) + KEY_bracketright = uint(C.GDK_KEY_bracketright) + KEY_asciicircum = uint(C.GDK_KEY_asciicircum) + KEY_underscore = uint(C.GDK_KEY_underscore) + KEY_grave = uint(C.GDK_KEY_grave) + KEY_quoteleft = uint(C.GDK_KEY_quoteleft) + KEY_a = uint(C.GDK_KEY_a) + KEY_b = uint(C.GDK_KEY_b) + KEY_c = uint(C.GDK_KEY_c) + KEY_d = uint(C.GDK_KEY_d) + KEY_e = uint(C.GDK_KEY_e) + KEY_f = uint(C.GDK_KEY_f) + KEY_g = uint(C.GDK_KEY_g) + KEY_h = uint(C.GDK_KEY_h) + KEY_i = uint(C.GDK_KEY_i) + KEY_j = uint(C.GDK_KEY_j) + KEY_k = uint(C.GDK_KEY_k) + KEY_l = uint(C.GDK_KEY_l) + KEY_m = uint(C.GDK_KEY_m) + KEY_n = uint(C.GDK_KEY_n) + KEY_o = uint(C.GDK_KEY_o) + KEY_p = uint(C.GDK_KEY_p) + KEY_q = uint(C.GDK_KEY_q) + KEY_r = uint(C.GDK_KEY_r) + KEY_s = uint(C.GDK_KEY_s) + KEY_t = uint(C.GDK_KEY_t) + KEY_u = uint(C.GDK_KEY_u) + KEY_v = uint(C.GDK_KEY_v) + KEY_w = uint(C.GDK_KEY_w) + KEY_x = uint(C.GDK_KEY_x) + KEY_y = uint(C.GDK_KEY_y) + KEY_z = uint(C.GDK_KEY_z) + KEY_braceleft = uint(C.GDK_KEY_braceleft) + KEY_bar = uint(C.GDK_KEY_bar) + KEY_braceright = uint(C.GDK_KEY_braceright) + KEY_asciitilde = uint(C.GDK_KEY_asciitilde) + KEY_nobreakspace = uint(C.GDK_KEY_nobreakspace) + KEY_exclamdown = uint(C.GDK_KEY_exclamdown) + KEY_cent = uint(C.GDK_KEY_cent) + KEY_sterling = uint(C.GDK_KEY_sterling) + KEY_currency = uint(C.GDK_KEY_currency) + KEY_yen = uint(C.GDK_KEY_yen) + KEY_brokenbar = uint(C.GDK_KEY_brokenbar) + KEY_section = uint(C.GDK_KEY_section) + KEY_diaeresis = uint(C.GDK_KEY_diaeresis) + KEY_copyright = uint(C.GDK_KEY_copyright) + KEY_ordfeminine = uint(C.GDK_KEY_ordfeminine) + KEY_guillemotleft = uint(C.GDK_KEY_guillemotleft) + KEY_notsign = uint(C.GDK_KEY_notsign) + KEY_hyphen = uint(C.GDK_KEY_hyphen) + KEY_registered = uint(C.GDK_KEY_registered) + KEY_macron = uint(C.GDK_KEY_macron) + KEY_degree = uint(C.GDK_KEY_degree) + KEY_plusminus = uint(C.GDK_KEY_plusminus) + KEY_twosuperior = uint(C.GDK_KEY_twosuperior) + KEY_threesuperior = uint(C.GDK_KEY_threesuperior) + KEY_acute = uint(C.GDK_KEY_acute) + KEY_mu = uint(C.GDK_KEY_mu) + KEY_paragraph = uint(C.GDK_KEY_paragraph) + KEY_periodcentered = uint(C.GDK_KEY_periodcentered) + KEY_cedilla = uint(C.GDK_KEY_cedilla) + KEY_onesuperior = uint(C.GDK_KEY_onesuperior) + KEY_masculine = uint(C.GDK_KEY_masculine) + KEY_guillemotright = uint(C.GDK_KEY_guillemotright) + KEY_onequarter = uint(C.GDK_KEY_onequarter) + KEY_onehalf = uint(C.GDK_KEY_onehalf) + KEY_threequarters = uint(C.GDK_KEY_threequarters) + KEY_questiondown = uint(C.GDK_KEY_questiondown) + KEY_Agrave = uint(C.GDK_KEY_Agrave) + KEY_Aacute = uint(C.GDK_KEY_Aacute) + KEY_Acircumflex = uint(C.GDK_KEY_Acircumflex) + KEY_Atilde = uint(C.GDK_KEY_Atilde) + KEY_Adiaeresis = uint(C.GDK_KEY_Adiaeresis) + KEY_Aring = uint(C.GDK_KEY_Aring) + KEY_AE = uint(C.GDK_KEY_AE) + KEY_Ccedilla = uint(C.GDK_KEY_Ccedilla) + KEY_Egrave = uint(C.GDK_KEY_Egrave) + KEY_Eacute = uint(C.GDK_KEY_Eacute) + KEY_Ecircumflex = uint(C.GDK_KEY_Ecircumflex) + KEY_Ediaeresis = uint(C.GDK_KEY_Ediaeresis) + KEY_Igrave = uint(C.GDK_KEY_Igrave) + KEY_Iacute = uint(C.GDK_KEY_Iacute) + KEY_Icircumflex = uint(C.GDK_KEY_Icircumflex) + KEY_Idiaeresis = uint(C.GDK_KEY_Idiaeresis) + KEY_ETH = uint(C.GDK_KEY_ETH) + KEY_Eth = uint(C.GDK_KEY_Eth) + KEY_Ntilde = uint(C.GDK_KEY_Ntilde) + KEY_Ograve = uint(C.GDK_KEY_Ograve) + KEY_Oacute = uint(C.GDK_KEY_Oacute) + KEY_Ocircumflex = uint(C.GDK_KEY_Ocircumflex) + KEY_Otilde = uint(C.GDK_KEY_Otilde) + KEY_Odiaeresis = uint(C.GDK_KEY_Odiaeresis) + KEY_multiply = uint(C.GDK_KEY_multiply) + KEY_Oslash = uint(C.GDK_KEY_Oslash) + KEY_Ooblique = uint(C.GDK_KEY_Ooblique) + KEY_Ugrave = uint(C.GDK_KEY_Ugrave) + KEY_Uacute = uint(C.GDK_KEY_Uacute) + KEY_Ucircumflex = uint(C.GDK_KEY_Ucircumflex) + KEY_Udiaeresis = uint(C.GDK_KEY_Udiaeresis) + KEY_Yacute = uint(C.GDK_KEY_Yacute) + KEY_THORN = uint(C.GDK_KEY_THORN) + KEY_Thorn = uint(C.GDK_KEY_Thorn) + KEY_ssharp = uint(C.GDK_KEY_ssharp) + KEY_agrave = uint(C.GDK_KEY_agrave) + KEY_aacute = uint(C.GDK_KEY_aacute) + KEY_acircumflex = uint(C.GDK_KEY_acircumflex) + KEY_atilde = uint(C.GDK_KEY_atilde) + KEY_adiaeresis = uint(C.GDK_KEY_adiaeresis) + KEY_aring = uint(C.GDK_KEY_aring) + KEY_ae = uint(C.GDK_KEY_ae) + KEY_ccedilla = uint(C.GDK_KEY_ccedilla) + KEY_egrave = uint(C.GDK_KEY_egrave) + KEY_eacute = uint(C.GDK_KEY_eacute) + KEY_ecircumflex = uint(C.GDK_KEY_ecircumflex) + KEY_ediaeresis = uint(C.GDK_KEY_ediaeresis) + KEY_igrave = uint(C.GDK_KEY_igrave) + KEY_iacute = uint(C.GDK_KEY_iacute) + KEY_icircumflex = uint(C.GDK_KEY_icircumflex) + KEY_idiaeresis = uint(C.GDK_KEY_idiaeresis) + KEY_eth = uint(C.GDK_KEY_eth) + KEY_ntilde = uint(C.GDK_KEY_ntilde) + KEY_ograve = uint(C.GDK_KEY_ograve) + KEY_oacute = uint(C.GDK_KEY_oacute) + KEY_ocircumflex = uint(C.GDK_KEY_ocircumflex) + KEY_otilde = uint(C.GDK_KEY_otilde) + KEY_odiaeresis = uint(C.GDK_KEY_odiaeresis) + KEY_division = uint(C.GDK_KEY_division) + KEY_oslash = uint(C.GDK_KEY_oslash) + KEY_ooblique = uint(C.GDK_KEY_ooblique) + KEY_ugrave = uint(C.GDK_KEY_ugrave) + KEY_uacute = uint(C.GDK_KEY_uacute) + KEY_ucircumflex = uint(C.GDK_KEY_ucircumflex) + KEY_udiaeresis = uint(C.GDK_KEY_udiaeresis) + KEY_yacute = uint(C.GDK_KEY_yacute) + KEY_thorn = uint(C.GDK_KEY_thorn) + KEY_ydiaeresis = uint(C.GDK_KEY_ydiaeresis) + KEY_Aogonek = uint(C.GDK_KEY_Aogonek) + KEY_breve = uint(C.GDK_KEY_breve) + KEY_Lstroke = uint(C.GDK_KEY_Lstroke) + KEY_Lcaron = uint(C.GDK_KEY_Lcaron) + KEY_Sacute = uint(C.GDK_KEY_Sacute) + KEY_Scaron = uint(C.GDK_KEY_Scaron) + KEY_Scedilla = uint(C.GDK_KEY_Scedilla) + KEY_Tcaron = uint(C.GDK_KEY_Tcaron) + KEY_Zacute = uint(C.GDK_KEY_Zacute) + KEY_Zcaron = uint(C.GDK_KEY_Zcaron) + KEY_Zabovedot = uint(C.GDK_KEY_Zabovedot) + KEY_aogonek = uint(C.GDK_KEY_aogonek) + KEY_ogonek = uint(C.GDK_KEY_ogonek) + KEY_lstroke = uint(C.GDK_KEY_lstroke) + KEY_lcaron = uint(C.GDK_KEY_lcaron) + KEY_sacute = uint(C.GDK_KEY_sacute) + KEY_caron = uint(C.GDK_KEY_caron) + KEY_scaron = uint(C.GDK_KEY_scaron) + KEY_scedilla = uint(C.GDK_KEY_scedilla) + KEY_tcaron = uint(C.GDK_KEY_tcaron) + KEY_zacute = uint(C.GDK_KEY_zacute) + KEY_doubleacute = uint(C.GDK_KEY_doubleacute) + KEY_zcaron = uint(C.GDK_KEY_zcaron) + KEY_zabovedot = uint(C.GDK_KEY_zabovedot) + KEY_Racute = uint(C.GDK_KEY_Racute) + KEY_Abreve = uint(C.GDK_KEY_Abreve) + KEY_Lacute = uint(C.GDK_KEY_Lacute) + KEY_Cacute = uint(C.GDK_KEY_Cacute) + KEY_Ccaron = uint(C.GDK_KEY_Ccaron) + KEY_Eogonek = uint(C.GDK_KEY_Eogonek) + KEY_Ecaron = uint(C.GDK_KEY_Ecaron) + KEY_Dcaron = uint(C.GDK_KEY_Dcaron) + KEY_Dstroke = uint(C.GDK_KEY_Dstroke) + KEY_Nacute = uint(C.GDK_KEY_Nacute) + KEY_Ncaron = uint(C.GDK_KEY_Ncaron) + KEY_Odoubleacute = uint(C.GDK_KEY_Odoubleacute) + KEY_Rcaron = uint(C.GDK_KEY_Rcaron) + KEY_Uring = uint(C.GDK_KEY_Uring) + KEY_Udoubleacute = uint(C.GDK_KEY_Udoubleacute) + KEY_Tcedilla = uint(C.GDK_KEY_Tcedilla) + KEY_racute = uint(C.GDK_KEY_racute) + KEY_abreve = uint(C.GDK_KEY_abreve) + KEY_lacute = uint(C.GDK_KEY_lacute) + KEY_cacute = uint(C.GDK_KEY_cacute) + KEY_ccaron = uint(C.GDK_KEY_ccaron) + KEY_eogonek = uint(C.GDK_KEY_eogonek) + KEY_ecaron = uint(C.GDK_KEY_ecaron) + KEY_dcaron = uint(C.GDK_KEY_dcaron) + KEY_dstroke = uint(C.GDK_KEY_dstroke) + KEY_nacute = uint(C.GDK_KEY_nacute) + KEY_ncaron = uint(C.GDK_KEY_ncaron) + KEY_odoubleacute = uint(C.GDK_KEY_odoubleacute) + KEY_rcaron = uint(C.GDK_KEY_rcaron) + KEY_uring = uint(C.GDK_KEY_uring) + KEY_udoubleacute = uint(C.GDK_KEY_udoubleacute) + KEY_tcedilla = uint(C.GDK_KEY_tcedilla) + KEY_abovedot = uint(C.GDK_KEY_abovedot) + KEY_Hstroke = uint(C.GDK_KEY_Hstroke) + KEY_Hcircumflex = uint(C.GDK_KEY_Hcircumflex) + KEY_Iabovedot = uint(C.GDK_KEY_Iabovedot) + KEY_Gbreve = uint(C.GDK_KEY_Gbreve) + KEY_Jcircumflex = uint(C.GDK_KEY_Jcircumflex) + KEY_hstroke = uint(C.GDK_KEY_hstroke) + KEY_hcircumflex = uint(C.GDK_KEY_hcircumflex) + KEY_idotless = uint(C.GDK_KEY_idotless) + KEY_gbreve = uint(C.GDK_KEY_gbreve) + KEY_jcircumflex = uint(C.GDK_KEY_jcircumflex) + KEY_Cabovedot = uint(C.GDK_KEY_Cabovedot) + KEY_Ccircumflex = uint(C.GDK_KEY_Ccircumflex) + KEY_Gabovedot = uint(C.GDK_KEY_Gabovedot) + KEY_Gcircumflex = uint(C.GDK_KEY_Gcircumflex) + KEY_Ubreve = uint(C.GDK_KEY_Ubreve) + KEY_Scircumflex = uint(C.GDK_KEY_Scircumflex) + KEY_cabovedot = uint(C.GDK_KEY_cabovedot) + KEY_ccircumflex = uint(C.GDK_KEY_ccircumflex) + KEY_gabovedot = uint(C.GDK_KEY_gabovedot) + KEY_gcircumflex = uint(C.GDK_KEY_gcircumflex) + KEY_ubreve = uint(C.GDK_KEY_ubreve) + KEY_scircumflex = uint(C.GDK_KEY_scircumflex) + KEY_kra = uint(C.GDK_KEY_kra) + KEY_kappa = uint(C.GDK_KEY_kappa) + KEY_Rcedilla = uint(C.GDK_KEY_Rcedilla) + KEY_Itilde = uint(C.GDK_KEY_Itilde) + KEY_Lcedilla = uint(C.GDK_KEY_Lcedilla) + KEY_Emacron = uint(C.GDK_KEY_Emacron) + KEY_Gcedilla = uint(C.GDK_KEY_Gcedilla) + KEY_Tslash = uint(C.GDK_KEY_Tslash) + KEY_rcedilla = uint(C.GDK_KEY_rcedilla) + KEY_itilde = uint(C.GDK_KEY_itilde) + KEY_lcedilla = uint(C.GDK_KEY_lcedilla) + KEY_emacron = uint(C.GDK_KEY_emacron) + KEY_gcedilla = uint(C.GDK_KEY_gcedilla) + KEY_tslash = uint(C.GDK_KEY_tslash) + KEY_ENG = uint(C.GDK_KEY_ENG) + KEY_eng = uint(C.GDK_KEY_eng) + KEY_Amacron = uint(C.GDK_KEY_Amacron) + KEY_Iogonek = uint(C.GDK_KEY_Iogonek) + KEY_Eabovedot = uint(C.GDK_KEY_Eabovedot) + KEY_Imacron = uint(C.GDK_KEY_Imacron) + KEY_Ncedilla = uint(C.GDK_KEY_Ncedilla) + KEY_Omacron = uint(C.GDK_KEY_Omacron) + KEY_Kcedilla = uint(C.GDK_KEY_Kcedilla) + KEY_Uogonek = uint(C.GDK_KEY_Uogonek) + KEY_Utilde = uint(C.GDK_KEY_Utilde) + KEY_Umacron = uint(C.GDK_KEY_Umacron) + KEY_amacron = uint(C.GDK_KEY_amacron) + KEY_iogonek = uint(C.GDK_KEY_iogonek) + KEY_eabovedot = uint(C.GDK_KEY_eabovedot) + KEY_imacron = uint(C.GDK_KEY_imacron) + KEY_ncedilla = uint(C.GDK_KEY_ncedilla) + KEY_omacron = uint(C.GDK_KEY_omacron) + KEY_kcedilla = uint(C.GDK_KEY_kcedilla) + KEY_uogonek = uint(C.GDK_KEY_uogonek) + KEY_utilde = uint(C.GDK_KEY_utilde) + KEY_umacron = uint(C.GDK_KEY_umacron) + KEY_Wcircumflex = uint(C.GDK_KEY_Wcircumflex) + KEY_wcircumflex = uint(C.GDK_KEY_wcircumflex) + KEY_Ycircumflex = uint(C.GDK_KEY_Ycircumflex) + KEY_ycircumflex = uint(C.GDK_KEY_ycircumflex) + KEY_Babovedot = uint(C.GDK_KEY_Babovedot) + KEY_babovedot = uint(C.GDK_KEY_babovedot) + KEY_Dabovedot = uint(C.GDK_KEY_Dabovedot) + KEY_dabovedot = uint(C.GDK_KEY_dabovedot) + KEY_Fabovedot = uint(C.GDK_KEY_Fabovedot) + KEY_fabovedot = uint(C.GDK_KEY_fabovedot) + KEY_Mabovedot = uint(C.GDK_KEY_Mabovedot) + KEY_mabovedot = uint(C.GDK_KEY_mabovedot) + KEY_Pabovedot = uint(C.GDK_KEY_Pabovedot) + KEY_pabovedot = uint(C.GDK_KEY_pabovedot) + KEY_Sabovedot = uint(C.GDK_KEY_Sabovedot) + KEY_sabovedot = uint(C.GDK_KEY_sabovedot) + KEY_Tabovedot = uint(C.GDK_KEY_Tabovedot) + KEY_tabovedot = uint(C.GDK_KEY_tabovedot) + KEY_Wgrave = uint(C.GDK_KEY_Wgrave) + KEY_wgrave = uint(C.GDK_KEY_wgrave) + KEY_Wacute = uint(C.GDK_KEY_Wacute) + KEY_wacute = uint(C.GDK_KEY_wacute) + KEY_Wdiaeresis = uint(C.GDK_KEY_Wdiaeresis) + KEY_wdiaeresis = uint(C.GDK_KEY_wdiaeresis) + KEY_Ygrave = uint(C.GDK_KEY_Ygrave) + KEY_ygrave = uint(C.GDK_KEY_ygrave) + KEY_OE = uint(C.GDK_KEY_OE) + KEY_oe = uint(C.GDK_KEY_oe) + KEY_Ydiaeresis = uint(C.GDK_KEY_Ydiaeresis) + KEY_overline = uint(C.GDK_KEY_overline) + KEY_kana_fullstop = uint(C.GDK_KEY_kana_fullstop) + KEY_kana_openingbracket = uint(C.GDK_KEY_kana_openingbracket) + KEY_kana_closingbracket = uint(C.GDK_KEY_kana_closingbracket) + KEY_kana_comma = uint(C.GDK_KEY_kana_comma) + KEY_kana_conjunctive = uint(C.GDK_KEY_kana_conjunctive) + KEY_kana_middledot = uint(C.GDK_KEY_kana_middledot) + KEY_kana_WO = uint(C.GDK_KEY_kana_WO) + KEY_kana_a = uint(C.GDK_KEY_kana_a) + KEY_kana_i = uint(C.GDK_KEY_kana_i) + KEY_kana_u = uint(C.GDK_KEY_kana_u) + KEY_kana_e = uint(C.GDK_KEY_kana_e) + KEY_kana_o = uint(C.GDK_KEY_kana_o) + KEY_kana_ya = uint(C.GDK_KEY_kana_ya) + KEY_kana_yu = uint(C.GDK_KEY_kana_yu) + KEY_kana_yo = uint(C.GDK_KEY_kana_yo) + KEY_kana_tsu = uint(C.GDK_KEY_kana_tsu) + KEY_kana_tu = uint(C.GDK_KEY_kana_tu) + KEY_prolongedsound = uint(C.GDK_KEY_prolongedsound) + KEY_kana_A = uint(C.GDK_KEY_kana_A) + KEY_kana_I = uint(C.GDK_KEY_kana_I) + KEY_kana_U = uint(C.GDK_KEY_kana_U) + KEY_kana_E = uint(C.GDK_KEY_kana_E) + KEY_kana_O = uint(C.GDK_KEY_kana_O) + KEY_kana_KA = uint(C.GDK_KEY_kana_KA) + KEY_kana_KI = uint(C.GDK_KEY_kana_KI) + KEY_kana_KU = uint(C.GDK_KEY_kana_KU) + KEY_kana_KE = uint(C.GDK_KEY_kana_KE) + KEY_kana_KO = uint(C.GDK_KEY_kana_KO) + KEY_kana_SA = uint(C.GDK_KEY_kana_SA) + KEY_kana_SHI = uint(C.GDK_KEY_kana_SHI) + KEY_kana_SU = uint(C.GDK_KEY_kana_SU) + KEY_kana_SE = uint(C.GDK_KEY_kana_SE) + KEY_kana_SO = uint(C.GDK_KEY_kana_SO) + KEY_kana_TA = uint(C.GDK_KEY_kana_TA) + KEY_kana_CHI = uint(C.GDK_KEY_kana_CHI) + KEY_kana_TI = uint(C.GDK_KEY_kana_TI) + KEY_kana_TSU = uint(C.GDK_KEY_kana_TSU) + KEY_kana_TU = uint(C.GDK_KEY_kana_TU) + KEY_kana_TE = uint(C.GDK_KEY_kana_TE) + KEY_kana_TO = uint(C.GDK_KEY_kana_TO) + KEY_kana_NA = uint(C.GDK_KEY_kana_NA) + KEY_kana_NI = uint(C.GDK_KEY_kana_NI) + KEY_kana_NU = uint(C.GDK_KEY_kana_NU) + KEY_kana_NE = uint(C.GDK_KEY_kana_NE) + KEY_kana_NO = uint(C.GDK_KEY_kana_NO) + KEY_kana_HA = uint(C.GDK_KEY_kana_HA) + KEY_kana_HI = uint(C.GDK_KEY_kana_HI) + KEY_kana_FU = uint(C.GDK_KEY_kana_FU) + KEY_kana_HU = uint(C.GDK_KEY_kana_HU) + KEY_kana_HE = uint(C.GDK_KEY_kana_HE) + KEY_kana_HO = uint(C.GDK_KEY_kana_HO) + KEY_kana_MA = uint(C.GDK_KEY_kana_MA) + KEY_kana_MI = uint(C.GDK_KEY_kana_MI) + KEY_kana_MU = uint(C.GDK_KEY_kana_MU) + KEY_kana_ME = uint(C.GDK_KEY_kana_ME) + KEY_kana_MO = uint(C.GDK_KEY_kana_MO) + KEY_kana_YA = uint(C.GDK_KEY_kana_YA) + KEY_kana_YU = uint(C.GDK_KEY_kana_YU) + KEY_kana_YO = uint(C.GDK_KEY_kana_YO) + KEY_kana_RA = uint(C.GDK_KEY_kana_RA) + KEY_kana_RI = uint(C.GDK_KEY_kana_RI) + KEY_kana_RU = uint(C.GDK_KEY_kana_RU) + KEY_kana_RE = uint(C.GDK_KEY_kana_RE) + KEY_kana_RO = uint(C.GDK_KEY_kana_RO) + KEY_kana_WA = uint(C.GDK_KEY_kana_WA) + KEY_kana_N = uint(C.GDK_KEY_kana_N) + KEY_voicedsound = uint(C.GDK_KEY_voicedsound) + KEY_semivoicedsound = uint(C.GDK_KEY_semivoicedsound) + KEY_kana_switch = uint(C.GDK_KEY_kana_switch) + KEY_Farsi_0 = uint(C.GDK_KEY_Farsi_0) + KEY_Farsi_1 = uint(C.GDK_KEY_Farsi_1) + KEY_Farsi_2 = uint(C.GDK_KEY_Farsi_2) + KEY_Farsi_3 = uint(C.GDK_KEY_Farsi_3) + KEY_Farsi_4 = uint(C.GDK_KEY_Farsi_4) + KEY_Farsi_5 = uint(C.GDK_KEY_Farsi_5) + KEY_Farsi_6 = uint(C.GDK_KEY_Farsi_6) + KEY_Farsi_7 = uint(C.GDK_KEY_Farsi_7) + KEY_Farsi_8 = uint(C.GDK_KEY_Farsi_8) + KEY_Farsi_9 = uint(C.GDK_KEY_Farsi_9) + KEY_Arabic_percent = uint(C.GDK_KEY_Arabic_percent) + KEY_Arabic_superscript_alef = uint(C.GDK_KEY_Arabic_superscript_alef) + KEY_Arabic_tteh = uint(C.GDK_KEY_Arabic_tteh) + KEY_Arabic_peh = uint(C.GDK_KEY_Arabic_peh) + KEY_Arabic_tcheh = uint(C.GDK_KEY_Arabic_tcheh) + KEY_Arabic_ddal = uint(C.GDK_KEY_Arabic_ddal) + KEY_Arabic_rreh = uint(C.GDK_KEY_Arabic_rreh) + KEY_Arabic_comma = uint(C.GDK_KEY_Arabic_comma) + KEY_Arabic_fullstop = uint(C.GDK_KEY_Arabic_fullstop) + KEY_Arabic_0 = uint(C.GDK_KEY_Arabic_0) + KEY_Arabic_1 = uint(C.GDK_KEY_Arabic_1) + KEY_Arabic_2 = uint(C.GDK_KEY_Arabic_2) + KEY_Arabic_3 = uint(C.GDK_KEY_Arabic_3) + KEY_Arabic_4 = uint(C.GDK_KEY_Arabic_4) + KEY_Arabic_5 = uint(C.GDK_KEY_Arabic_5) + KEY_Arabic_6 = uint(C.GDK_KEY_Arabic_6) + KEY_Arabic_7 = uint(C.GDK_KEY_Arabic_7) + KEY_Arabic_8 = uint(C.GDK_KEY_Arabic_8) + KEY_Arabic_9 = uint(C.GDK_KEY_Arabic_9) + KEY_Arabic_semicolon = uint(C.GDK_KEY_Arabic_semicolon) + KEY_Arabic_question_mark = uint(C.GDK_KEY_Arabic_question_mark) + KEY_Arabic_hamza = uint(C.GDK_KEY_Arabic_hamza) + KEY_Arabic_maddaonalef = uint(C.GDK_KEY_Arabic_maddaonalef) + KEY_Arabic_hamzaonalef = uint(C.GDK_KEY_Arabic_hamzaonalef) + KEY_Arabic_hamzaonwaw = uint(C.GDK_KEY_Arabic_hamzaonwaw) + KEY_Arabic_hamzaunderalef = uint(C.GDK_KEY_Arabic_hamzaunderalef) + KEY_Arabic_hamzaonyeh = uint(C.GDK_KEY_Arabic_hamzaonyeh) + KEY_Arabic_alef = uint(C.GDK_KEY_Arabic_alef) + KEY_Arabic_beh = uint(C.GDK_KEY_Arabic_beh) + KEY_Arabic_tehmarbuta = uint(C.GDK_KEY_Arabic_tehmarbuta) + KEY_Arabic_teh = uint(C.GDK_KEY_Arabic_teh) + KEY_Arabic_theh = uint(C.GDK_KEY_Arabic_theh) + KEY_Arabic_jeem = uint(C.GDK_KEY_Arabic_jeem) + KEY_Arabic_hah = uint(C.GDK_KEY_Arabic_hah) + KEY_Arabic_khah = uint(C.GDK_KEY_Arabic_khah) + KEY_Arabic_dal = uint(C.GDK_KEY_Arabic_dal) + KEY_Arabic_thal = uint(C.GDK_KEY_Arabic_thal) + KEY_Arabic_ra = uint(C.GDK_KEY_Arabic_ra) + KEY_Arabic_zain = uint(C.GDK_KEY_Arabic_zain) + KEY_Arabic_seen = uint(C.GDK_KEY_Arabic_seen) + KEY_Arabic_sheen = uint(C.GDK_KEY_Arabic_sheen) + KEY_Arabic_sad = uint(C.GDK_KEY_Arabic_sad) + KEY_Arabic_dad = uint(C.GDK_KEY_Arabic_dad) + KEY_Arabic_tah = uint(C.GDK_KEY_Arabic_tah) + KEY_Arabic_zah = uint(C.GDK_KEY_Arabic_zah) + KEY_Arabic_ain = uint(C.GDK_KEY_Arabic_ain) + KEY_Arabic_ghain = uint(C.GDK_KEY_Arabic_ghain) + KEY_Arabic_tatweel = uint(C.GDK_KEY_Arabic_tatweel) + KEY_Arabic_feh = uint(C.GDK_KEY_Arabic_feh) + KEY_Arabic_qaf = uint(C.GDK_KEY_Arabic_qaf) + KEY_Arabic_kaf = uint(C.GDK_KEY_Arabic_kaf) + KEY_Arabic_lam = uint(C.GDK_KEY_Arabic_lam) + KEY_Arabic_meem = uint(C.GDK_KEY_Arabic_meem) + KEY_Arabic_noon = uint(C.GDK_KEY_Arabic_noon) + KEY_Arabic_ha = uint(C.GDK_KEY_Arabic_ha) + KEY_Arabic_heh = uint(C.GDK_KEY_Arabic_heh) + KEY_Arabic_waw = uint(C.GDK_KEY_Arabic_waw) + KEY_Arabic_alefmaksura = uint(C.GDK_KEY_Arabic_alefmaksura) + KEY_Arabic_yeh = uint(C.GDK_KEY_Arabic_yeh) + KEY_Arabic_fathatan = uint(C.GDK_KEY_Arabic_fathatan) + KEY_Arabic_dammatan = uint(C.GDK_KEY_Arabic_dammatan) + KEY_Arabic_kasratan = uint(C.GDK_KEY_Arabic_kasratan) + KEY_Arabic_fatha = uint(C.GDK_KEY_Arabic_fatha) + KEY_Arabic_damma = uint(C.GDK_KEY_Arabic_damma) + KEY_Arabic_kasra = uint(C.GDK_KEY_Arabic_kasra) + KEY_Arabic_shadda = uint(C.GDK_KEY_Arabic_shadda) + KEY_Arabic_sukun = uint(C.GDK_KEY_Arabic_sukun) + KEY_Arabic_madda_above = uint(C.GDK_KEY_Arabic_madda_above) + KEY_Arabic_hamza_above = uint(C.GDK_KEY_Arabic_hamza_above) + KEY_Arabic_hamza_below = uint(C.GDK_KEY_Arabic_hamza_below) + KEY_Arabic_jeh = uint(C.GDK_KEY_Arabic_jeh) + KEY_Arabic_veh = uint(C.GDK_KEY_Arabic_veh) + KEY_Arabic_keheh = uint(C.GDK_KEY_Arabic_keheh) + KEY_Arabic_gaf = uint(C.GDK_KEY_Arabic_gaf) + KEY_Arabic_noon_ghunna = uint(C.GDK_KEY_Arabic_noon_ghunna) + KEY_Arabic_heh_doachashmee = uint(C.GDK_KEY_Arabic_heh_doachashmee) + KEY_Farsi_yeh = uint(C.GDK_KEY_Farsi_yeh) + KEY_Arabic_farsi_yeh = uint(C.GDK_KEY_Arabic_farsi_yeh) + KEY_Arabic_yeh_baree = uint(C.GDK_KEY_Arabic_yeh_baree) + KEY_Arabic_heh_goal = uint(C.GDK_KEY_Arabic_heh_goal) + KEY_Arabic_switch = uint(C.GDK_KEY_Arabic_switch) + KEY_Cyrillic_GHE_bar = uint(C.GDK_KEY_Cyrillic_GHE_bar) + KEY_Cyrillic_ghe_bar = uint(C.GDK_KEY_Cyrillic_ghe_bar) + KEY_Cyrillic_ZHE_descender = uint(C.GDK_KEY_Cyrillic_ZHE_descender) + KEY_Cyrillic_zhe_descender = uint(C.GDK_KEY_Cyrillic_zhe_descender) + KEY_Cyrillic_KA_descender = uint(C.GDK_KEY_Cyrillic_KA_descender) + KEY_Cyrillic_ka_descender = uint(C.GDK_KEY_Cyrillic_ka_descender) + KEY_Cyrillic_KA_vertstroke = uint(C.GDK_KEY_Cyrillic_KA_vertstroke) + KEY_Cyrillic_ka_vertstroke = uint(C.GDK_KEY_Cyrillic_ka_vertstroke) + KEY_Cyrillic_EN_descender = uint(C.GDK_KEY_Cyrillic_EN_descender) + KEY_Cyrillic_en_descender = uint(C.GDK_KEY_Cyrillic_en_descender) + KEY_Cyrillic_U_straight = uint(C.GDK_KEY_Cyrillic_U_straight) + KEY_Cyrillic_u_straight = uint(C.GDK_KEY_Cyrillic_u_straight) + KEY_Cyrillic_U_straight_bar = uint(C.GDK_KEY_Cyrillic_U_straight_bar) + KEY_Cyrillic_u_straight_bar = uint(C.GDK_KEY_Cyrillic_u_straight_bar) + KEY_Cyrillic_HA_descender = uint(C.GDK_KEY_Cyrillic_HA_descender) + KEY_Cyrillic_ha_descender = uint(C.GDK_KEY_Cyrillic_ha_descender) + KEY_Cyrillic_CHE_descender = uint(C.GDK_KEY_Cyrillic_CHE_descender) + KEY_Cyrillic_che_descender = uint(C.GDK_KEY_Cyrillic_che_descender) + KEY_Cyrillic_CHE_vertstroke = uint(C.GDK_KEY_Cyrillic_CHE_vertstroke) + KEY_Cyrillic_che_vertstroke = uint(C.GDK_KEY_Cyrillic_che_vertstroke) + KEY_Cyrillic_SHHA = uint(C.GDK_KEY_Cyrillic_SHHA) + KEY_Cyrillic_shha = uint(C.GDK_KEY_Cyrillic_shha) + KEY_Cyrillic_SCHWA = uint(C.GDK_KEY_Cyrillic_SCHWA) + KEY_Cyrillic_schwa = uint(C.GDK_KEY_Cyrillic_schwa) + KEY_Cyrillic_I_macron = uint(C.GDK_KEY_Cyrillic_I_macron) + KEY_Cyrillic_i_macron = uint(C.GDK_KEY_Cyrillic_i_macron) + KEY_Cyrillic_O_bar = uint(C.GDK_KEY_Cyrillic_O_bar) + KEY_Cyrillic_o_bar = uint(C.GDK_KEY_Cyrillic_o_bar) + KEY_Cyrillic_U_macron = uint(C.GDK_KEY_Cyrillic_U_macron) + KEY_Cyrillic_u_macron = uint(C.GDK_KEY_Cyrillic_u_macron) + KEY_Serbian_dje = uint(C.GDK_KEY_Serbian_dje) + KEY_Macedonia_gje = uint(C.GDK_KEY_Macedonia_gje) + KEY_Cyrillic_io = uint(C.GDK_KEY_Cyrillic_io) + KEY_Ukrainian_ie = uint(C.GDK_KEY_Ukrainian_ie) + KEY_Ukranian_je = uint(C.GDK_KEY_Ukranian_je) + KEY_Macedonia_dse = uint(C.GDK_KEY_Macedonia_dse) + KEY_Ukrainian_i = uint(C.GDK_KEY_Ukrainian_i) + KEY_Ukranian_i = uint(C.GDK_KEY_Ukranian_i) + KEY_Ukrainian_yi = uint(C.GDK_KEY_Ukrainian_yi) + KEY_Ukranian_yi = uint(C.GDK_KEY_Ukranian_yi) + KEY_Cyrillic_je = uint(C.GDK_KEY_Cyrillic_je) + KEY_Serbian_je = uint(C.GDK_KEY_Serbian_je) + KEY_Cyrillic_lje = uint(C.GDK_KEY_Cyrillic_lje) + KEY_Serbian_lje = uint(C.GDK_KEY_Serbian_lje) + KEY_Cyrillic_nje = uint(C.GDK_KEY_Cyrillic_nje) + KEY_Serbian_nje = uint(C.GDK_KEY_Serbian_nje) + KEY_Serbian_tshe = uint(C.GDK_KEY_Serbian_tshe) + KEY_Macedonia_kje = uint(C.GDK_KEY_Macedonia_kje) + KEY_Ukrainian_ghe_with_upturn = uint(C.GDK_KEY_Ukrainian_ghe_with_upturn) + KEY_Byelorussian_shortu = uint(C.GDK_KEY_Byelorussian_shortu) + KEY_Cyrillic_dzhe = uint(C.GDK_KEY_Cyrillic_dzhe) + KEY_Serbian_dze = uint(C.GDK_KEY_Serbian_dze) + KEY_numerosign = uint(C.GDK_KEY_numerosign) + KEY_Serbian_DJE = uint(C.GDK_KEY_Serbian_DJE) + KEY_Macedonia_GJE = uint(C.GDK_KEY_Macedonia_GJE) + KEY_Cyrillic_IO = uint(C.GDK_KEY_Cyrillic_IO) + KEY_Ukrainian_IE = uint(C.GDK_KEY_Ukrainian_IE) + KEY_Ukranian_JE = uint(C.GDK_KEY_Ukranian_JE) + KEY_Macedonia_DSE = uint(C.GDK_KEY_Macedonia_DSE) + KEY_Ukrainian_I = uint(C.GDK_KEY_Ukrainian_I) + KEY_Ukranian_I = uint(C.GDK_KEY_Ukranian_I) + KEY_Ukrainian_YI = uint(C.GDK_KEY_Ukrainian_YI) + KEY_Ukranian_YI = uint(C.GDK_KEY_Ukranian_YI) + KEY_Cyrillic_JE = uint(C.GDK_KEY_Cyrillic_JE) + KEY_Serbian_JE = uint(C.GDK_KEY_Serbian_JE) + KEY_Cyrillic_LJE = uint(C.GDK_KEY_Cyrillic_LJE) + KEY_Serbian_LJE = uint(C.GDK_KEY_Serbian_LJE) + KEY_Cyrillic_NJE = uint(C.GDK_KEY_Cyrillic_NJE) + KEY_Serbian_NJE = uint(C.GDK_KEY_Serbian_NJE) + KEY_Serbian_TSHE = uint(C.GDK_KEY_Serbian_TSHE) + KEY_Macedonia_KJE = uint(C.GDK_KEY_Macedonia_KJE) + KEY_Ukrainian_GHE_WITH_UPTURN = uint(C.GDK_KEY_Ukrainian_GHE_WITH_UPTURN) + KEY_Byelorussian_SHORTU = uint(C.GDK_KEY_Byelorussian_SHORTU) + KEY_Cyrillic_DZHE = uint(C.GDK_KEY_Cyrillic_DZHE) + KEY_Serbian_DZE = uint(C.GDK_KEY_Serbian_DZE) + KEY_Cyrillic_yu = uint(C.GDK_KEY_Cyrillic_yu) + KEY_Cyrillic_a = uint(C.GDK_KEY_Cyrillic_a) + KEY_Cyrillic_be = uint(C.GDK_KEY_Cyrillic_be) + KEY_Cyrillic_tse = uint(C.GDK_KEY_Cyrillic_tse) + KEY_Cyrillic_de = uint(C.GDK_KEY_Cyrillic_de) + KEY_Cyrillic_ie = uint(C.GDK_KEY_Cyrillic_ie) + KEY_Cyrillic_ef = uint(C.GDK_KEY_Cyrillic_ef) + KEY_Cyrillic_ghe = uint(C.GDK_KEY_Cyrillic_ghe) + KEY_Cyrillic_ha = uint(C.GDK_KEY_Cyrillic_ha) + KEY_Cyrillic_i = uint(C.GDK_KEY_Cyrillic_i) + KEY_Cyrillic_shorti = uint(C.GDK_KEY_Cyrillic_shorti) + KEY_Cyrillic_ka = uint(C.GDK_KEY_Cyrillic_ka) + KEY_Cyrillic_el = uint(C.GDK_KEY_Cyrillic_el) + KEY_Cyrillic_em = uint(C.GDK_KEY_Cyrillic_em) + KEY_Cyrillic_en = uint(C.GDK_KEY_Cyrillic_en) + KEY_Cyrillic_o = uint(C.GDK_KEY_Cyrillic_o) + KEY_Cyrillic_pe = uint(C.GDK_KEY_Cyrillic_pe) + KEY_Cyrillic_ya = uint(C.GDK_KEY_Cyrillic_ya) + KEY_Cyrillic_er = uint(C.GDK_KEY_Cyrillic_er) + KEY_Cyrillic_es = uint(C.GDK_KEY_Cyrillic_es) + KEY_Cyrillic_te = uint(C.GDK_KEY_Cyrillic_te) + KEY_Cyrillic_u = uint(C.GDK_KEY_Cyrillic_u) + KEY_Cyrillic_zhe = uint(C.GDK_KEY_Cyrillic_zhe) + KEY_Cyrillic_ve = uint(C.GDK_KEY_Cyrillic_ve) + KEY_Cyrillic_softsign = uint(C.GDK_KEY_Cyrillic_softsign) + KEY_Cyrillic_yeru = uint(C.GDK_KEY_Cyrillic_yeru) + KEY_Cyrillic_ze = uint(C.GDK_KEY_Cyrillic_ze) + KEY_Cyrillic_sha = uint(C.GDK_KEY_Cyrillic_sha) + KEY_Cyrillic_e = uint(C.GDK_KEY_Cyrillic_e) + KEY_Cyrillic_shcha = uint(C.GDK_KEY_Cyrillic_shcha) + KEY_Cyrillic_che = uint(C.GDK_KEY_Cyrillic_che) + KEY_Cyrillic_hardsign = uint(C.GDK_KEY_Cyrillic_hardsign) + KEY_Cyrillic_YU = uint(C.GDK_KEY_Cyrillic_YU) + KEY_Cyrillic_A = uint(C.GDK_KEY_Cyrillic_A) + KEY_Cyrillic_BE = uint(C.GDK_KEY_Cyrillic_BE) + KEY_Cyrillic_TSE = uint(C.GDK_KEY_Cyrillic_TSE) + KEY_Cyrillic_DE = uint(C.GDK_KEY_Cyrillic_DE) + KEY_Cyrillic_IE = uint(C.GDK_KEY_Cyrillic_IE) + KEY_Cyrillic_EF = uint(C.GDK_KEY_Cyrillic_EF) + KEY_Cyrillic_GHE = uint(C.GDK_KEY_Cyrillic_GHE) + KEY_Cyrillic_HA = uint(C.GDK_KEY_Cyrillic_HA) + KEY_Cyrillic_I = uint(C.GDK_KEY_Cyrillic_I) + KEY_Cyrillic_SHORTI = uint(C.GDK_KEY_Cyrillic_SHORTI) + KEY_Cyrillic_KA = uint(C.GDK_KEY_Cyrillic_KA) + KEY_Cyrillic_EL = uint(C.GDK_KEY_Cyrillic_EL) + KEY_Cyrillic_EM = uint(C.GDK_KEY_Cyrillic_EM) + KEY_Cyrillic_EN = uint(C.GDK_KEY_Cyrillic_EN) + KEY_Cyrillic_O = uint(C.GDK_KEY_Cyrillic_O) + KEY_Cyrillic_PE = uint(C.GDK_KEY_Cyrillic_PE) + KEY_Cyrillic_YA = uint(C.GDK_KEY_Cyrillic_YA) + KEY_Cyrillic_ER = uint(C.GDK_KEY_Cyrillic_ER) + KEY_Cyrillic_ES = uint(C.GDK_KEY_Cyrillic_ES) + KEY_Cyrillic_TE = uint(C.GDK_KEY_Cyrillic_TE) + KEY_Cyrillic_U = uint(C.GDK_KEY_Cyrillic_U) + KEY_Cyrillic_ZHE = uint(C.GDK_KEY_Cyrillic_ZHE) + KEY_Cyrillic_VE = uint(C.GDK_KEY_Cyrillic_VE) + KEY_Cyrillic_SOFTSIGN = uint(C.GDK_KEY_Cyrillic_SOFTSIGN) + KEY_Cyrillic_YERU = uint(C.GDK_KEY_Cyrillic_YERU) + KEY_Cyrillic_ZE = uint(C.GDK_KEY_Cyrillic_ZE) + KEY_Cyrillic_SHA = uint(C.GDK_KEY_Cyrillic_SHA) + KEY_Cyrillic_E = uint(C.GDK_KEY_Cyrillic_E) + KEY_Cyrillic_SHCHA = uint(C.GDK_KEY_Cyrillic_SHCHA) + KEY_Cyrillic_CHE = uint(C.GDK_KEY_Cyrillic_CHE) + KEY_Cyrillic_HARDSIGN = uint(C.GDK_KEY_Cyrillic_HARDSIGN) + KEY_Greek_ALPHAaccent = uint(C.GDK_KEY_Greek_ALPHAaccent) + KEY_Greek_EPSILONaccent = uint(C.GDK_KEY_Greek_EPSILONaccent) + KEY_Greek_ETAaccent = uint(C.GDK_KEY_Greek_ETAaccent) + KEY_Greek_IOTAaccent = uint(C.GDK_KEY_Greek_IOTAaccent) + KEY_Greek_IOTAdieresis = uint(C.GDK_KEY_Greek_IOTAdieresis) + KEY_Greek_IOTAdiaeresis = uint(C.GDK_KEY_Greek_IOTAdiaeresis) + KEY_Greek_OMICRONaccent = uint(C.GDK_KEY_Greek_OMICRONaccent) + KEY_Greek_UPSILONaccent = uint(C.GDK_KEY_Greek_UPSILONaccent) + KEY_Greek_UPSILONdieresis = uint(C.GDK_KEY_Greek_UPSILONdieresis) + KEY_Greek_OMEGAaccent = uint(C.GDK_KEY_Greek_OMEGAaccent) + KEY_Greek_accentdieresis = uint(C.GDK_KEY_Greek_accentdieresis) + KEY_Greek_horizbar = uint(C.GDK_KEY_Greek_horizbar) + KEY_Greek_alphaaccent = uint(C.GDK_KEY_Greek_alphaaccent) + KEY_Greek_epsilonaccent = uint(C.GDK_KEY_Greek_epsilonaccent) + KEY_Greek_etaaccent = uint(C.GDK_KEY_Greek_etaaccent) + KEY_Greek_iotaaccent = uint(C.GDK_KEY_Greek_iotaaccent) + KEY_Greek_iotadieresis = uint(C.GDK_KEY_Greek_iotadieresis) + KEY_Greek_iotaaccentdieresis = uint(C.GDK_KEY_Greek_iotaaccentdieresis) + KEY_Greek_omicronaccent = uint(C.GDK_KEY_Greek_omicronaccent) + KEY_Greek_upsilonaccent = uint(C.GDK_KEY_Greek_upsilonaccent) + KEY_Greek_upsilondieresis = uint(C.GDK_KEY_Greek_upsilondieresis) + KEY_Greek_upsilonaccentdieresis = uint(C.GDK_KEY_Greek_upsilonaccentdieresis) + KEY_Greek_omegaaccent = uint(C.GDK_KEY_Greek_omegaaccent) + KEY_Greek_ALPHA = uint(C.GDK_KEY_Greek_ALPHA) + KEY_Greek_BETA = uint(C.GDK_KEY_Greek_BETA) + KEY_Greek_GAMMA = uint(C.GDK_KEY_Greek_GAMMA) + KEY_Greek_DELTA = uint(C.GDK_KEY_Greek_DELTA) + KEY_Greek_EPSILON = uint(C.GDK_KEY_Greek_EPSILON) + KEY_Greek_ZETA = uint(C.GDK_KEY_Greek_ZETA) + KEY_Greek_ETA = uint(C.GDK_KEY_Greek_ETA) + KEY_Greek_THETA = uint(C.GDK_KEY_Greek_THETA) + KEY_Greek_IOTA = uint(C.GDK_KEY_Greek_IOTA) + KEY_Greek_KAPPA = uint(C.GDK_KEY_Greek_KAPPA) + KEY_Greek_LAMDA = uint(C.GDK_KEY_Greek_LAMDA) + KEY_Greek_LAMBDA = uint(C.GDK_KEY_Greek_LAMBDA) + KEY_Greek_MU = uint(C.GDK_KEY_Greek_MU) + KEY_Greek_NU = uint(C.GDK_KEY_Greek_NU) + KEY_Greek_XI = uint(C.GDK_KEY_Greek_XI) + KEY_Greek_OMICRON = uint(C.GDK_KEY_Greek_OMICRON) + KEY_Greek_PI = uint(C.GDK_KEY_Greek_PI) + KEY_Greek_RHO = uint(C.GDK_KEY_Greek_RHO) + KEY_Greek_SIGMA = uint(C.GDK_KEY_Greek_SIGMA) + KEY_Greek_TAU = uint(C.GDK_KEY_Greek_TAU) + KEY_Greek_UPSILON = uint(C.GDK_KEY_Greek_UPSILON) + KEY_Greek_PHI = uint(C.GDK_KEY_Greek_PHI) + KEY_Greek_CHI = uint(C.GDK_KEY_Greek_CHI) + KEY_Greek_PSI = uint(C.GDK_KEY_Greek_PSI) + KEY_Greek_OMEGA = uint(C.GDK_KEY_Greek_OMEGA) + KEY_Greek_alpha = uint(C.GDK_KEY_Greek_alpha) + KEY_Greek_beta = uint(C.GDK_KEY_Greek_beta) + KEY_Greek_gamma = uint(C.GDK_KEY_Greek_gamma) + KEY_Greek_delta = uint(C.GDK_KEY_Greek_delta) + KEY_Greek_epsilon = uint(C.GDK_KEY_Greek_epsilon) + KEY_Greek_zeta = uint(C.GDK_KEY_Greek_zeta) + KEY_Greek_eta = uint(C.GDK_KEY_Greek_eta) + KEY_Greek_theta = uint(C.GDK_KEY_Greek_theta) + KEY_Greek_iota = uint(C.GDK_KEY_Greek_iota) + KEY_Greek_kappa = uint(C.GDK_KEY_Greek_kappa) + KEY_Greek_lamda = uint(C.GDK_KEY_Greek_lamda) + KEY_Greek_lambda = uint(C.GDK_KEY_Greek_lambda) + KEY_Greek_mu = uint(C.GDK_KEY_Greek_mu) + KEY_Greek_nu = uint(C.GDK_KEY_Greek_nu) + KEY_Greek_xi = uint(C.GDK_KEY_Greek_xi) + KEY_Greek_omicron = uint(C.GDK_KEY_Greek_omicron) + KEY_Greek_pi = uint(C.GDK_KEY_Greek_pi) + KEY_Greek_rho = uint(C.GDK_KEY_Greek_rho) + KEY_Greek_sigma = uint(C.GDK_KEY_Greek_sigma) + KEY_Greek_finalsmallsigma = uint(C.GDK_KEY_Greek_finalsmallsigma) + KEY_Greek_tau = uint(C.GDK_KEY_Greek_tau) + KEY_Greek_upsilon = uint(C.GDK_KEY_Greek_upsilon) + KEY_Greek_phi = uint(C.GDK_KEY_Greek_phi) + KEY_Greek_chi = uint(C.GDK_KEY_Greek_chi) + KEY_Greek_psi = uint(C.GDK_KEY_Greek_psi) + KEY_Greek_omega = uint(C.GDK_KEY_Greek_omega) + KEY_Greek_switch = uint(C.GDK_KEY_Greek_switch) + KEY_leftradical = uint(C.GDK_KEY_leftradical) + KEY_topleftradical = uint(C.GDK_KEY_topleftradical) + KEY_horizconnector = uint(C.GDK_KEY_horizconnector) + KEY_topintegral = uint(C.GDK_KEY_topintegral) + KEY_botintegral = uint(C.GDK_KEY_botintegral) + KEY_vertconnector = uint(C.GDK_KEY_vertconnector) + KEY_topleftsqbracket = uint(C.GDK_KEY_topleftsqbracket) + KEY_botleftsqbracket = uint(C.GDK_KEY_botleftsqbracket) + KEY_toprightsqbracket = uint(C.GDK_KEY_toprightsqbracket) + KEY_botrightsqbracket = uint(C.GDK_KEY_botrightsqbracket) + KEY_topleftparens = uint(C.GDK_KEY_topleftparens) + KEY_botleftparens = uint(C.GDK_KEY_botleftparens) + KEY_toprightparens = uint(C.GDK_KEY_toprightparens) + KEY_botrightparens = uint(C.GDK_KEY_botrightparens) + KEY_leftmiddlecurlybrace = uint(C.GDK_KEY_leftmiddlecurlybrace) + KEY_rightmiddlecurlybrace = uint(C.GDK_KEY_rightmiddlecurlybrace) + KEY_topleftsummation = uint(C.GDK_KEY_topleftsummation) + KEY_botleftsummation = uint(C.GDK_KEY_botleftsummation) + KEY_topvertsummationconnector = uint(C.GDK_KEY_topvertsummationconnector) + KEY_botvertsummationconnector = uint(C.GDK_KEY_botvertsummationconnector) + KEY_toprightsummation = uint(C.GDK_KEY_toprightsummation) + KEY_botrightsummation = uint(C.GDK_KEY_botrightsummation) + KEY_rightmiddlesummation = uint(C.GDK_KEY_rightmiddlesummation) + KEY_lessthanequal = uint(C.GDK_KEY_lessthanequal) + KEY_notequal = uint(C.GDK_KEY_notequal) + KEY_greaterthanequal = uint(C.GDK_KEY_greaterthanequal) + KEY_integral = uint(C.GDK_KEY_integral) + KEY_therefore = uint(C.GDK_KEY_therefore) + KEY_variation = uint(C.GDK_KEY_variation) + KEY_infinity = uint(C.GDK_KEY_infinity) + KEY_nabla = uint(C.GDK_KEY_nabla) + KEY_approximate = uint(C.GDK_KEY_approximate) + KEY_similarequal = uint(C.GDK_KEY_similarequal) + KEY_ifonlyif = uint(C.GDK_KEY_ifonlyif) + KEY_implies = uint(C.GDK_KEY_implies) + KEY_identical = uint(C.GDK_KEY_identical) + KEY_radical = uint(C.GDK_KEY_radical) + KEY_includedin = uint(C.GDK_KEY_includedin) + KEY_includes = uint(C.GDK_KEY_includes) + KEY_intersection = uint(C.GDK_KEY_intersection) + KEY_union = uint(C.GDK_KEY_union) + KEY_logicaland = uint(C.GDK_KEY_logicaland) + KEY_logicalor = uint(C.GDK_KEY_logicalor) + KEY_partialderivative = uint(C.GDK_KEY_partialderivative) + KEY_function = uint(C.GDK_KEY_function) + KEY_leftarrow = uint(C.GDK_KEY_leftarrow) + KEY_uparrow = uint(C.GDK_KEY_uparrow) + KEY_rightarrow = uint(C.GDK_KEY_rightarrow) + KEY_downarrow = uint(C.GDK_KEY_downarrow) + KEY_blank = uint(C.GDK_KEY_blank) + KEY_soliddiamond = uint(C.GDK_KEY_soliddiamond) + KEY_checkerboard = uint(C.GDK_KEY_checkerboard) + KEY_ht = uint(C.GDK_KEY_ht) + KEY_ff = uint(C.GDK_KEY_ff) + KEY_cr = uint(C.GDK_KEY_cr) + KEY_lf = uint(C.GDK_KEY_lf) + KEY_nl = uint(C.GDK_KEY_nl) + KEY_vt = uint(C.GDK_KEY_vt) + KEY_lowrightcorner = uint(C.GDK_KEY_lowrightcorner) + KEY_uprightcorner = uint(C.GDK_KEY_uprightcorner) + KEY_upleftcorner = uint(C.GDK_KEY_upleftcorner) + KEY_lowleftcorner = uint(C.GDK_KEY_lowleftcorner) + KEY_crossinglines = uint(C.GDK_KEY_crossinglines) + KEY_horizlinescan1 = uint(C.GDK_KEY_horizlinescan1) + KEY_horizlinescan3 = uint(C.GDK_KEY_horizlinescan3) + KEY_horizlinescan5 = uint(C.GDK_KEY_horizlinescan5) + KEY_horizlinescan7 = uint(C.GDK_KEY_horizlinescan7) + KEY_horizlinescan9 = uint(C.GDK_KEY_horizlinescan9) + KEY_leftt = uint(C.GDK_KEY_leftt) + KEY_rightt = uint(C.GDK_KEY_rightt) + KEY_bott = uint(C.GDK_KEY_bott) + KEY_topt = uint(C.GDK_KEY_topt) + KEY_vertbar = uint(C.GDK_KEY_vertbar) + KEY_emspace = uint(C.GDK_KEY_emspace) + KEY_enspace = uint(C.GDK_KEY_enspace) + KEY_em3space = uint(C.GDK_KEY_em3space) + KEY_em4space = uint(C.GDK_KEY_em4space) + KEY_digitspace = uint(C.GDK_KEY_digitspace) + KEY_punctspace = uint(C.GDK_KEY_punctspace) + KEY_thinspace = uint(C.GDK_KEY_thinspace) + KEY_hairspace = uint(C.GDK_KEY_hairspace) + KEY_emdash = uint(C.GDK_KEY_emdash) + KEY_endash = uint(C.GDK_KEY_endash) + KEY_signifblank = uint(C.GDK_KEY_signifblank) + KEY_ellipsis = uint(C.GDK_KEY_ellipsis) + KEY_doubbaselinedot = uint(C.GDK_KEY_doubbaselinedot) + KEY_onethird = uint(C.GDK_KEY_onethird) + KEY_twothirds = uint(C.GDK_KEY_twothirds) + KEY_onefifth = uint(C.GDK_KEY_onefifth) + KEY_twofifths = uint(C.GDK_KEY_twofifths) + KEY_threefifths = uint(C.GDK_KEY_threefifths) + KEY_fourfifths = uint(C.GDK_KEY_fourfifths) + KEY_onesixth = uint(C.GDK_KEY_onesixth) + KEY_fivesixths = uint(C.GDK_KEY_fivesixths) + KEY_careof = uint(C.GDK_KEY_careof) + KEY_figdash = uint(C.GDK_KEY_figdash) + KEY_leftanglebracket = uint(C.GDK_KEY_leftanglebracket) + KEY_decimalpoint = uint(C.GDK_KEY_decimalpoint) + KEY_rightanglebracket = uint(C.GDK_KEY_rightanglebracket) + KEY_marker = uint(C.GDK_KEY_marker) + KEY_oneeighth = uint(C.GDK_KEY_oneeighth) + KEY_threeeighths = uint(C.GDK_KEY_threeeighths) + KEY_fiveeighths = uint(C.GDK_KEY_fiveeighths) + KEY_seveneighths = uint(C.GDK_KEY_seveneighths) + KEY_trademark = uint(C.GDK_KEY_trademark) + KEY_signaturemark = uint(C.GDK_KEY_signaturemark) + KEY_trademarkincircle = uint(C.GDK_KEY_trademarkincircle) + KEY_leftopentriangle = uint(C.GDK_KEY_leftopentriangle) + KEY_rightopentriangle = uint(C.GDK_KEY_rightopentriangle) + KEY_emopencircle = uint(C.GDK_KEY_emopencircle) + KEY_emopenrectangle = uint(C.GDK_KEY_emopenrectangle) + KEY_leftsinglequotemark = uint(C.GDK_KEY_leftsinglequotemark) + KEY_rightsinglequotemark = uint(C.GDK_KEY_rightsinglequotemark) + KEY_leftdoublequotemark = uint(C.GDK_KEY_leftdoublequotemark) + KEY_rightdoublequotemark = uint(C.GDK_KEY_rightdoublequotemark) + KEY_prescription = uint(C.GDK_KEY_prescription) + KEY_permille = uint(C.GDK_KEY_permille) + KEY_minutes = uint(C.GDK_KEY_minutes) + KEY_seconds = uint(C.GDK_KEY_seconds) + KEY_latincross = uint(C.GDK_KEY_latincross) + KEY_hexagram = uint(C.GDK_KEY_hexagram) + KEY_filledrectbullet = uint(C.GDK_KEY_filledrectbullet) + KEY_filledlefttribullet = uint(C.GDK_KEY_filledlefttribullet) + KEY_filledrighttribullet = uint(C.GDK_KEY_filledrighttribullet) + KEY_emfilledcircle = uint(C.GDK_KEY_emfilledcircle) + KEY_emfilledrect = uint(C.GDK_KEY_emfilledrect) + KEY_enopencircbullet = uint(C.GDK_KEY_enopencircbullet) + KEY_enopensquarebullet = uint(C.GDK_KEY_enopensquarebullet) + KEY_openrectbullet = uint(C.GDK_KEY_openrectbullet) + KEY_opentribulletup = uint(C.GDK_KEY_opentribulletup) + KEY_opentribulletdown = uint(C.GDK_KEY_opentribulletdown) + KEY_openstar = uint(C.GDK_KEY_openstar) + KEY_enfilledcircbullet = uint(C.GDK_KEY_enfilledcircbullet) + KEY_enfilledsqbullet = uint(C.GDK_KEY_enfilledsqbullet) + KEY_filledtribulletup = uint(C.GDK_KEY_filledtribulletup) + KEY_filledtribulletdown = uint(C.GDK_KEY_filledtribulletdown) + KEY_leftpointer = uint(C.GDK_KEY_leftpointer) + KEY_rightpointer = uint(C.GDK_KEY_rightpointer) + KEY_club = uint(C.GDK_KEY_club) + KEY_diamond = uint(C.GDK_KEY_diamond) + KEY_heart = uint(C.GDK_KEY_heart) + KEY_maltesecross = uint(C.GDK_KEY_maltesecross) + KEY_dagger = uint(C.GDK_KEY_dagger) + KEY_doubledagger = uint(C.GDK_KEY_doubledagger) + KEY_checkmark = uint(C.GDK_KEY_checkmark) + KEY_ballotcross = uint(C.GDK_KEY_ballotcross) + KEY_musicalsharp = uint(C.GDK_KEY_musicalsharp) + KEY_musicalflat = uint(C.GDK_KEY_musicalflat) + KEY_malesymbol = uint(C.GDK_KEY_malesymbol) + KEY_femalesymbol = uint(C.GDK_KEY_femalesymbol) + KEY_telephone = uint(C.GDK_KEY_telephone) + KEY_telephonerecorder = uint(C.GDK_KEY_telephonerecorder) + KEY_phonographcopyright = uint(C.GDK_KEY_phonographcopyright) + KEY_caret = uint(C.GDK_KEY_caret) + KEY_singlelowquotemark = uint(C.GDK_KEY_singlelowquotemark) + KEY_doublelowquotemark = uint(C.GDK_KEY_doublelowquotemark) + KEY_cursor = uint(C.GDK_KEY_cursor) + KEY_leftcaret = uint(C.GDK_KEY_leftcaret) + KEY_rightcaret = uint(C.GDK_KEY_rightcaret) + KEY_downcaret = uint(C.GDK_KEY_downcaret) + KEY_upcaret = uint(C.GDK_KEY_upcaret) + KEY_overbar = uint(C.GDK_KEY_overbar) + KEY_downtack = uint(C.GDK_KEY_downtack) + KEY_upshoe = uint(C.GDK_KEY_upshoe) + KEY_downstile = uint(C.GDK_KEY_downstile) + KEY_underbar = uint(C.GDK_KEY_underbar) + KEY_jot = uint(C.GDK_KEY_jot) + KEY_quad = uint(C.GDK_KEY_quad) + KEY_uptack = uint(C.GDK_KEY_uptack) + KEY_circle = uint(C.GDK_KEY_circle) + KEY_upstile = uint(C.GDK_KEY_upstile) + KEY_downshoe = uint(C.GDK_KEY_downshoe) + KEY_rightshoe = uint(C.GDK_KEY_rightshoe) + KEY_leftshoe = uint(C.GDK_KEY_leftshoe) + KEY_lefttack = uint(C.GDK_KEY_lefttack) + KEY_righttack = uint(C.GDK_KEY_righttack) + KEY_hebrew_doublelowline = uint(C.GDK_KEY_hebrew_doublelowline) + KEY_hebrew_aleph = uint(C.GDK_KEY_hebrew_aleph) + KEY_hebrew_bet = uint(C.GDK_KEY_hebrew_bet) + KEY_hebrew_beth = uint(C.GDK_KEY_hebrew_beth) + KEY_hebrew_gimel = uint(C.GDK_KEY_hebrew_gimel) + KEY_hebrew_gimmel = uint(C.GDK_KEY_hebrew_gimmel) + KEY_hebrew_dalet = uint(C.GDK_KEY_hebrew_dalet) + KEY_hebrew_daleth = uint(C.GDK_KEY_hebrew_daleth) + KEY_hebrew_he = uint(C.GDK_KEY_hebrew_he) + KEY_hebrew_waw = uint(C.GDK_KEY_hebrew_waw) + KEY_hebrew_zain = uint(C.GDK_KEY_hebrew_zain) + KEY_hebrew_zayin = uint(C.GDK_KEY_hebrew_zayin) + KEY_hebrew_chet = uint(C.GDK_KEY_hebrew_chet) + KEY_hebrew_het = uint(C.GDK_KEY_hebrew_het) + KEY_hebrew_tet = uint(C.GDK_KEY_hebrew_tet) + KEY_hebrew_teth = uint(C.GDK_KEY_hebrew_teth) + KEY_hebrew_yod = uint(C.GDK_KEY_hebrew_yod) + KEY_hebrew_finalkaph = uint(C.GDK_KEY_hebrew_finalkaph) + KEY_hebrew_kaph = uint(C.GDK_KEY_hebrew_kaph) + KEY_hebrew_lamed = uint(C.GDK_KEY_hebrew_lamed) + KEY_hebrew_finalmem = uint(C.GDK_KEY_hebrew_finalmem) + KEY_hebrew_mem = uint(C.GDK_KEY_hebrew_mem) + KEY_hebrew_finalnun = uint(C.GDK_KEY_hebrew_finalnun) + KEY_hebrew_nun = uint(C.GDK_KEY_hebrew_nun) + KEY_hebrew_samech = uint(C.GDK_KEY_hebrew_samech) + KEY_hebrew_samekh = uint(C.GDK_KEY_hebrew_samekh) + KEY_hebrew_ayin = uint(C.GDK_KEY_hebrew_ayin) + KEY_hebrew_finalpe = uint(C.GDK_KEY_hebrew_finalpe) + KEY_hebrew_pe = uint(C.GDK_KEY_hebrew_pe) + KEY_hebrew_finalzade = uint(C.GDK_KEY_hebrew_finalzade) + KEY_hebrew_finalzadi = uint(C.GDK_KEY_hebrew_finalzadi) + KEY_hebrew_zade = uint(C.GDK_KEY_hebrew_zade) + KEY_hebrew_zadi = uint(C.GDK_KEY_hebrew_zadi) + KEY_hebrew_qoph = uint(C.GDK_KEY_hebrew_qoph) + KEY_hebrew_kuf = uint(C.GDK_KEY_hebrew_kuf) + KEY_hebrew_resh = uint(C.GDK_KEY_hebrew_resh) + KEY_hebrew_shin = uint(C.GDK_KEY_hebrew_shin) + KEY_hebrew_taw = uint(C.GDK_KEY_hebrew_taw) + KEY_hebrew_taf = uint(C.GDK_KEY_hebrew_taf) + KEY_Hebrew_switch = uint(C.GDK_KEY_Hebrew_switch) + KEY_Thai_kokai = uint(C.GDK_KEY_Thai_kokai) + KEY_Thai_khokhai = uint(C.GDK_KEY_Thai_khokhai) + KEY_Thai_khokhuat = uint(C.GDK_KEY_Thai_khokhuat) + KEY_Thai_khokhwai = uint(C.GDK_KEY_Thai_khokhwai) + KEY_Thai_khokhon = uint(C.GDK_KEY_Thai_khokhon) + KEY_Thai_khorakhang = uint(C.GDK_KEY_Thai_khorakhang) + KEY_Thai_ngongu = uint(C.GDK_KEY_Thai_ngongu) + KEY_Thai_chochan = uint(C.GDK_KEY_Thai_chochan) + KEY_Thai_choching = uint(C.GDK_KEY_Thai_choching) + KEY_Thai_chochang = uint(C.GDK_KEY_Thai_chochang) + KEY_Thai_soso = uint(C.GDK_KEY_Thai_soso) + KEY_Thai_chochoe = uint(C.GDK_KEY_Thai_chochoe) + KEY_Thai_yoying = uint(C.GDK_KEY_Thai_yoying) + KEY_Thai_dochada = uint(C.GDK_KEY_Thai_dochada) + KEY_Thai_topatak = uint(C.GDK_KEY_Thai_topatak) + KEY_Thai_thothan = uint(C.GDK_KEY_Thai_thothan) + KEY_Thai_thonangmontho = uint(C.GDK_KEY_Thai_thonangmontho) + KEY_Thai_thophuthao = uint(C.GDK_KEY_Thai_thophuthao) + KEY_Thai_nonen = uint(C.GDK_KEY_Thai_nonen) + KEY_Thai_dodek = uint(C.GDK_KEY_Thai_dodek) + KEY_Thai_totao = uint(C.GDK_KEY_Thai_totao) + KEY_Thai_thothung = uint(C.GDK_KEY_Thai_thothung) + KEY_Thai_thothahan = uint(C.GDK_KEY_Thai_thothahan) + KEY_Thai_thothong = uint(C.GDK_KEY_Thai_thothong) + KEY_Thai_nonu = uint(C.GDK_KEY_Thai_nonu) + KEY_Thai_bobaimai = uint(C.GDK_KEY_Thai_bobaimai) + KEY_Thai_popla = uint(C.GDK_KEY_Thai_popla) + KEY_Thai_phophung = uint(C.GDK_KEY_Thai_phophung) + KEY_Thai_fofa = uint(C.GDK_KEY_Thai_fofa) + KEY_Thai_phophan = uint(C.GDK_KEY_Thai_phophan) + KEY_Thai_fofan = uint(C.GDK_KEY_Thai_fofan) + KEY_Thai_phosamphao = uint(C.GDK_KEY_Thai_phosamphao) + KEY_Thai_moma = uint(C.GDK_KEY_Thai_moma) + KEY_Thai_yoyak = uint(C.GDK_KEY_Thai_yoyak) + KEY_Thai_rorua = uint(C.GDK_KEY_Thai_rorua) + KEY_Thai_ru = uint(C.GDK_KEY_Thai_ru) + KEY_Thai_loling = uint(C.GDK_KEY_Thai_loling) + KEY_Thai_lu = uint(C.GDK_KEY_Thai_lu) + KEY_Thai_wowaen = uint(C.GDK_KEY_Thai_wowaen) + KEY_Thai_sosala = uint(C.GDK_KEY_Thai_sosala) + KEY_Thai_sorusi = uint(C.GDK_KEY_Thai_sorusi) + KEY_Thai_sosua = uint(C.GDK_KEY_Thai_sosua) + KEY_Thai_hohip = uint(C.GDK_KEY_Thai_hohip) + KEY_Thai_lochula = uint(C.GDK_KEY_Thai_lochula) + KEY_Thai_oang = uint(C.GDK_KEY_Thai_oang) + KEY_Thai_honokhuk = uint(C.GDK_KEY_Thai_honokhuk) + KEY_Thai_paiyannoi = uint(C.GDK_KEY_Thai_paiyannoi) + KEY_Thai_saraa = uint(C.GDK_KEY_Thai_saraa) + KEY_Thai_maihanakat = uint(C.GDK_KEY_Thai_maihanakat) + KEY_Thai_saraaa = uint(C.GDK_KEY_Thai_saraaa) + KEY_Thai_saraam = uint(C.GDK_KEY_Thai_saraam) + KEY_Thai_sarai = uint(C.GDK_KEY_Thai_sarai) + KEY_Thai_saraii = uint(C.GDK_KEY_Thai_saraii) + KEY_Thai_saraue = uint(C.GDK_KEY_Thai_saraue) + KEY_Thai_sarauee = uint(C.GDK_KEY_Thai_sarauee) + KEY_Thai_sarau = uint(C.GDK_KEY_Thai_sarau) + KEY_Thai_sarauu = uint(C.GDK_KEY_Thai_sarauu) + KEY_Thai_phinthu = uint(C.GDK_KEY_Thai_phinthu) + KEY_Thai_maihanakat_maitho = uint(C.GDK_KEY_Thai_maihanakat_maitho) + KEY_Thai_baht = uint(C.GDK_KEY_Thai_baht) + KEY_Thai_sarae = uint(C.GDK_KEY_Thai_sarae) + KEY_Thai_saraae = uint(C.GDK_KEY_Thai_saraae) + KEY_Thai_sarao = uint(C.GDK_KEY_Thai_sarao) + KEY_Thai_saraaimaimuan = uint(C.GDK_KEY_Thai_saraaimaimuan) + KEY_Thai_saraaimaimalai = uint(C.GDK_KEY_Thai_saraaimaimalai) + KEY_Thai_lakkhangyao = uint(C.GDK_KEY_Thai_lakkhangyao) + KEY_Thai_maiyamok = uint(C.GDK_KEY_Thai_maiyamok) + KEY_Thai_maitaikhu = uint(C.GDK_KEY_Thai_maitaikhu) + KEY_Thai_maiek = uint(C.GDK_KEY_Thai_maiek) + KEY_Thai_maitho = uint(C.GDK_KEY_Thai_maitho) + KEY_Thai_maitri = uint(C.GDK_KEY_Thai_maitri) + KEY_Thai_maichattawa = uint(C.GDK_KEY_Thai_maichattawa) + KEY_Thai_thanthakhat = uint(C.GDK_KEY_Thai_thanthakhat) + KEY_Thai_nikhahit = uint(C.GDK_KEY_Thai_nikhahit) + KEY_Thai_leksun = uint(C.GDK_KEY_Thai_leksun) + KEY_Thai_leknung = uint(C.GDK_KEY_Thai_leknung) + KEY_Thai_leksong = uint(C.GDK_KEY_Thai_leksong) + KEY_Thai_leksam = uint(C.GDK_KEY_Thai_leksam) + KEY_Thai_leksi = uint(C.GDK_KEY_Thai_leksi) + KEY_Thai_lekha = uint(C.GDK_KEY_Thai_lekha) + KEY_Thai_lekhok = uint(C.GDK_KEY_Thai_lekhok) + KEY_Thai_lekchet = uint(C.GDK_KEY_Thai_lekchet) + KEY_Thai_lekpaet = uint(C.GDK_KEY_Thai_lekpaet) + KEY_Thai_lekkao = uint(C.GDK_KEY_Thai_lekkao) + KEY_Hangul = uint(C.GDK_KEY_Hangul) + KEY_Hangul_Start = uint(C.GDK_KEY_Hangul_Start) + KEY_Hangul_End = uint(C.GDK_KEY_Hangul_End) + KEY_Hangul_Hanja = uint(C.GDK_KEY_Hangul_Hanja) + KEY_Hangul_Jamo = uint(C.GDK_KEY_Hangul_Jamo) + KEY_Hangul_Romaja = uint(C.GDK_KEY_Hangul_Romaja) + KEY_Hangul_Codeinput = uint(C.GDK_KEY_Hangul_Codeinput) + KEY_Hangul_Jeonja = uint(C.GDK_KEY_Hangul_Jeonja) + KEY_Hangul_Banja = uint(C.GDK_KEY_Hangul_Banja) + KEY_Hangul_PreHanja = uint(C.GDK_KEY_Hangul_PreHanja) + KEY_Hangul_PostHanja = uint(C.GDK_KEY_Hangul_PostHanja) + KEY_Hangul_SingleCandidate = uint(C.GDK_KEY_Hangul_SingleCandidate) + KEY_Hangul_MultipleCandidate = uint(C.GDK_KEY_Hangul_MultipleCandidate) + KEY_Hangul_PreviousCandidate = uint(C.GDK_KEY_Hangul_PreviousCandidate) + KEY_Hangul_Special = uint(C.GDK_KEY_Hangul_Special) + KEY_Hangul_switch = uint(C.GDK_KEY_Hangul_switch) + KEY_Hangul_Kiyeog = uint(C.GDK_KEY_Hangul_Kiyeog) + KEY_Hangul_SsangKiyeog = uint(C.GDK_KEY_Hangul_SsangKiyeog) + KEY_Hangul_KiyeogSios = uint(C.GDK_KEY_Hangul_KiyeogSios) + KEY_Hangul_Nieun = uint(C.GDK_KEY_Hangul_Nieun) + KEY_Hangul_NieunJieuj = uint(C.GDK_KEY_Hangul_NieunJieuj) + KEY_Hangul_NieunHieuh = uint(C.GDK_KEY_Hangul_NieunHieuh) + KEY_Hangul_Dikeud = uint(C.GDK_KEY_Hangul_Dikeud) + KEY_Hangul_SsangDikeud = uint(C.GDK_KEY_Hangul_SsangDikeud) + KEY_Hangul_Rieul = uint(C.GDK_KEY_Hangul_Rieul) + KEY_Hangul_RieulKiyeog = uint(C.GDK_KEY_Hangul_RieulKiyeog) + KEY_Hangul_RieulMieum = uint(C.GDK_KEY_Hangul_RieulMieum) + KEY_Hangul_RieulPieub = uint(C.GDK_KEY_Hangul_RieulPieub) + KEY_Hangul_RieulSios = uint(C.GDK_KEY_Hangul_RieulSios) + KEY_Hangul_RieulTieut = uint(C.GDK_KEY_Hangul_RieulTieut) + KEY_Hangul_RieulPhieuf = uint(C.GDK_KEY_Hangul_RieulPhieuf) + KEY_Hangul_RieulHieuh = uint(C.GDK_KEY_Hangul_RieulHieuh) + KEY_Hangul_Mieum = uint(C.GDK_KEY_Hangul_Mieum) + KEY_Hangul_Pieub = uint(C.GDK_KEY_Hangul_Pieub) + KEY_Hangul_SsangPieub = uint(C.GDK_KEY_Hangul_SsangPieub) + KEY_Hangul_PieubSios = uint(C.GDK_KEY_Hangul_PieubSios) + KEY_Hangul_Sios = uint(C.GDK_KEY_Hangul_Sios) + KEY_Hangul_SsangSios = uint(C.GDK_KEY_Hangul_SsangSios) + KEY_Hangul_Ieung = uint(C.GDK_KEY_Hangul_Ieung) + KEY_Hangul_Jieuj = uint(C.GDK_KEY_Hangul_Jieuj) + KEY_Hangul_SsangJieuj = uint(C.GDK_KEY_Hangul_SsangJieuj) + KEY_Hangul_Cieuc = uint(C.GDK_KEY_Hangul_Cieuc) + KEY_Hangul_Khieuq = uint(C.GDK_KEY_Hangul_Khieuq) + KEY_Hangul_Tieut = uint(C.GDK_KEY_Hangul_Tieut) + KEY_Hangul_Phieuf = uint(C.GDK_KEY_Hangul_Phieuf) + KEY_Hangul_Hieuh = uint(C.GDK_KEY_Hangul_Hieuh) + KEY_Hangul_A = uint(C.GDK_KEY_Hangul_A) + KEY_Hangul_AE = uint(C.GDK_KEY_Hangul_AE) + KEY_Hangul_YA = uint(C.GDK_KEY_Hangul_YA) + KEY_Hangul_YAE = uint(C.GDK_KEY_Hangul_YAE) + KEY_Hangul_EO = uint(C.GDK_KEY_Hangul_EO) + KEY_Hangul_E = uint(C.GDK_KEY_Hangul_E) + KEY_Hangul_YEO = uint(C.GDK_KEY_Hangul_YEO) + KEY_Hangul_YE = uint(C.GDK_KEY_Hangul_YE) + KEY_Hangul_O = uint(C.GDK_KEY_Hangul_O) + KEY_Hangul_WA = uint(C.GDK_KEY_Hangul_WA) + KEY_Hangul_WAE = uint(C.GDK_KEY_Hangul_WAE) + KEY_Hangul_OE = uint(C.GDK_KEY_Hangul_OE) + KEY_Hangul_YO = uint(C.GDK_KEY_Hangul_YO) + KEY_Hangul_U = uint(C.GDK_KEY_Hangul_U) + KEY_Hangul_WEO = uint(C.GDK_KEY_Hangul_WEO) + KEY_Hangul_WE = uint(C.GDK_KEY_Hangul_WE) + KEY_Hangul_WI = uint(C.GDK_KEY_Hangul_WI) + KEY_Hangul_YU = uint(C.GDK_KEY_Hangul_YU) + KEY_Hangul_EU = uint(C.GDK_KEY_Hangul_EU) + KEY_Hangul_YI = uint(C.GDK_KEY_Hangul_YI) + KEY_Hangul_I = uint(C.GDK_KEY_Hangul_I) + KEY_Hangul_J_Kiyeog = uint(C.GDK_KEY_Hangul_J_Kiyeog) + KEY_Hangul_J_SsangKiyeog = uint(C.GDK_KEY_Hangul_J_SsangKiyeog) + KEY_Hangul_J_KiyeogSios = uint(C.GDK_KEY_Hangul_J_KiyeogSios) + KEY_Hangul_J_Nieun = uint(C.GDK_KEY_Hangul_J_Nieun) + KEY_Hangul_J_NieunJieuj = uint(C.GDK_KEY_Hangul_J_NieunJieuj) + KEY_Hangul_J_NieunHieuh = uint(C.GDK_KEY_Hangul_J_NieunHieuh) + KEY_Hangul_J_Dikeud = uint(C.GDK_KEY_Hangul_J_Dikeud) + KEY_Hangul_J_Rieul = uint(C.GDK_KEY_Hangul_J_Rieul) + KEY_Hangul_J_RieulKiyeog = uint(C.GDK_KEY_Hangul_J_RieulKiyeog) + KEY_Hangul_J_RieulMieum = uint(C.GDK_KEY_Hangul_J_RieulMieum) + KEY_Hangul_J_RieulPieub = uint(C.GDK_KEY_Hangul_J_RieulPieub) + KEY_Hangul_J_RieulSios = uint(C.GDK_KEY_Hangul_J_RieulSios) + KEY_Hangul_J_RieulTieut = uint(C.GDK_KEY_Hangul_J_RieulTieut) + KEY_Hangul_J_RieulPhieuf = uint(C.GDK_KEY_Hangul_J_RieulPhieuf) + KEY_Hangul_J_RieulHieuh = uint(C.GDK_KEY_Hangul_J_RieulHieuh) + KEY_Hangul_J_Mieum = uint(C.GDK_KEY_Hangul_J_Mieum) + KEY_Hangul_J_Pieub = uint(C.GDK_KEY_Hangul_J_Pieub) + KEY_Hangul_J_PieubSios = uint(C.GDK_KEY_Hangul_J_PieubSios) + KEY_Hangul_J_Sios = uint(C.GDK_KEY_Hangul_J_Sios) + KEY_Hangul_J_SsangSios = uint(C.GDK_KEY_Hangul_J_SsangSios) + KEY_Hangul_J_Ieung = uint(C.GDK_KEY_Hangul_J_Ieung) + KEY_Hangul_J_Jieuj = uint(C.GDK_KEY_Hangul_J_Jieuj) + KEY_Hangul_J_Cieuc = uint(C.GDK_KEY_Hangul_J_Cieuc) + KEY_Hangul_J_Khieuq = uint(C.GDK_KEY_Hangul_J_Khieuq) + KEY_Hangul_J_Tieut = uint(C.GDK_KEY_Hangul_J_Tieut) + KEY_Hangul_J_Phieuf = uint(C.GDK_KEY_Hangul_J_Phieuf) + KEY_Hangul_J_Hieuh = uint(C.GDK_KEY_Hangul_J_Hieuh) + KEY_Hangul_RieulYeorinHieuh = uint(C.GDK_KEY_Hangul_RieulYeorinHieuh) + KEY_Hangul_SunkyeongeumMieum = uint(C.GDK_KEY_Hangul_SunkyeongeumMieum) + KEY_Hangul_SunkyeongeumPieub = uint(C.GDK_KEY_Hangul_SunkyeongeumPieub) + KEY_Hangul_PanSios = uint(C.GDK_KEY_Hangul_PanSios) + KEY_Hangul_KkogjiDalrinIeung = uint(C.GDK_KEY_Hangul_KkogjiDalrinIeung) + KEY_Hangul_SunkyeongeumPhieuf = uint(C.GDK_KEY_Hangul_SunkyeongeumPhieuf) + KEY_Hangul_YeorinHieuh = uint(C.GDK_KEY_Hangul_YeorinHieuh) + KEY_Hangul_AraeA = uint(C.GDK_KEY_Hangul_AraeA) + KEY_Hangul_AraeAE = uint(C.GDK_KEY_Hangul_AraeAE) + KEY_Hangul_J_PanSios = uint(C.GDK_KEY_Hangul_J_PanSios) + KEY_Hangul_J_KkogjiDalrinIeung = uint(C.GDK_KEY_Hangul_J_KkogjiDalrinIeung) + KEY_Hangul_J_YeorinHieuh = uint(C.GDK_KEY_Hangul_J_YeorinHieuh) + KEY_Korean_Won = uint(C.GDK_KEY_Korean_Won) + KEY_Armenian_ligature_ew = uint(C.GDK_KEY_Armenian_ligature_ew) + KEY_Armenian_full_stop = uint(C.GDK_KEY_Armenian_full_stop) + KEY_Armenian_verjaket = uint(C.GDK_KEY_Armenian_verjaket) + KEY_Armenian_separation_mark = uint(C.GDK_KEY_Armenian_separation_mark) + KEY_Armenian_but = uint(C.GDK_KEY_Armenian_but) + KEY_Armenian_hyphen = uint(C.GDK_KEY_Armenian_hyphen) + KEY_Armenian_yentamna = uint(C.GDK_KEY_Armenian_yentamna) + KEY_Armenian_exclam = uint(C.GDK_KEY_Armenian_exclam) + KEY_Armenian_amanak = uint(C.GDK_KEY_Armenian_amanak) + KEY_Armenian_accent = uint(C.GDK_KEY_Armenian_accent) + KEY_Armenian_shesht = uint(C.GDK_KEY_Armenian_shesht) + KEY_Armenian_question = uint(C.GDK_KEY_Armenian_question) + KEY_Armenian_paruyk = uint(C.GDK_KEY_Armenian_paruyk) + KEY_Armenian_AYB = uint(C.GDK_KEY_Armenian_AYB) + KEY_Armenian_ayb = uint(C.GDK_KEY_Armenian_ayb) + KEY_Armenian_BEN = uint(C.GDK_KEY_Armenian_BEN) + KEY_Armenian_ben = uint(C.GDK_KEY_Armenian_ben) + KEY_Armenian_GIM = uint(C.GDK_KEY_Armenian_GIM) + KEY_Armenian_gim = uint(C.GDK_KEY_Armenian_gim) + KEY_Armenian_DA = uint(C.GDK_KEY_Armenian_DA) + KEY_Armenian_da = uint(C.GDK_KEY_Armenian_da) + KEY_Armenian_YECH = uint(C.GDK_KEY_Armenian_YECH) + KEY_Armenian_yech = uint(C.GDK_KEY_Armenian_yech) + KEY_Armenian_ZA = uint(C.GDK_KEY_Armenian_ZA) + KEY_Armenian_za = uint(C.GDK_KEY_Armenian_za) + KEY_Armenian_E = uint(C.GDK_KEY_Armenian_E) + KEY_Armenian_e = uint(C.GDK_KEY_Armenian_e) + KEY_Armenian_AT = uint(C.GDK_KEY_Armenian_AT) + KEY_Armenian_at = uint(C.GDK_KEY_Armenian_at) + KEY_Armenian_TO = uint(C.GDK_KEY_Armenian_TO) + KEY_Armenian_to = uint(C.GDK_KEY_Armenian_to) + KEY_Armenian_ZHE = uint(C.GDK_KEY_Armenian_ZHE) + KEY_Armenian_zhe = uint(C.GDK_KEY_Armenian_zhe) + KEY_Armenian_INI = uint(C.GDK_KEY_Armenian_INI) + KEY_Armenian_ini = uint(C.GDK_KEY_Armenian_ini) + KEY_Armenian_LYUN = uint(C.GDK_KEY_Armenian_LYUN) + KEY_Armenian_lyun = uint(C.GDK_KEY_Armenian_lyun) + KEY_Armenian_KHE = uint(C.GDK_KEY_Armenian_KHE) + KEY_Armenian_khe = uint(C.GDK_KEY_Armenian_khe) + KEY_Armenian_TSA = uint(C.GDK_KEY_Armenian_TSA) + KEY_Armenian_tsa = uint(C.GDK_KEY_Armenian_tsa) + KEY_Armenian_KEN = uint(C.GDK_KEY_Armenian_KEN) + KEY_Armenian_ken = uint(C.GDK_KEY_Armenian_ken) + KEY_Armenian_HO = uint(C.GDK_KEY_Armenian_HO) + KEY_Armenian_ho = uint(C.GDK_KEY_Armenian_ho) + KEY_Armenian_DZA = uint(C.GDK_KEY_Armenian_DZA) + KEY_Armenian_dza = uint(C.GDK_KEY_Armenian_dza) + KEY_Armenian_GHAT = uint(C.GDK_KEY_Armenian_GHAT) + KEY_Armenian_ghat = uint(C.GDK_KEY_Armenian_ghat) + KEY_Armenian_TCHE = uint(C.GDK_KEY_Armenian_TCHE) + KEY_Armenian_tche = uint(C.GDK_KEY_Armenian_tche) + KEY_Armenian_MEN = uint(C.GDK_KEY_Armenian_MEN) + KEY_Armenian_men = uint(C.GDK_KEY_Armenian_men) + KEY_Armenian_HI = uint(C.GDK_KEY_Armenian_HI) + KEY_Armenian_hi = uint(C.GDK_KEY_Armenian_hi) + KEY_Armenian_NU = uint(C.GDK_KEY_Armenian_NU) + KEY_Armenian_nu = uint(C.GDK_KEY_Armenian_nu) + KEY_Armenian_SHA = uint(C.GDK_KEY_Armenian_SHA) + KEY_Armenian_sha = uint(C.GDK_KEY_Armenian_sha) + KEY_Armenian_VO = uint(C.GDK_KEY_Armenian_VO) + KEY_Armenian_vo = uint(C.GDK_KEY_Armenian_vo) + KEY_Armenian_CHA = uint(C.GDK_KEY_Armenian_CHA) + KEY_Armenian_cha = uint(C.GDK_KEY_Armenian_cha) + KEY_Armenian_PE = uint(C.GDK_KEY_Armenian_PE) + KEY_Armenian_pe = uint(C.GDK_KEY_Armenian_pe) + KEY_Armenian_JE = uint(C.GDK_KEY_Armenian_JE) + KEY_Armenian_je = uint(C.GDK_KEY_Armenian_je) + KEY_Armenian_RA = uint(C.GDK_KEY_Armenian_RA) + KEY_Armenian_ra = uint(C.GDK_KEY_Armenian_ra) + KEY_Armenian_SE = uint(C.GDK_KEY_Armenian_SE) + KEY_Armenian_se = uint(C.GDK_KEY_Armenian_se) + KEY_Armenian_VEV = uint(C.GDK_KEY_Armenian_VEV) + KEY_Armenian_vev = uint(C.GDK_KEY_Armenian_vev) + KEY_Armenian_TYUN = uint(C.GDK_KEY_Armenian_TYUN) + KEY_Armenian_tyun = uint(C.GDK_KEY_Armenian_tyun) + KEY_Armenian_RE = uint(C.GDK_KEY_Armenian_RE) + KEY_Armenian_re = uint(C.GDK_KEY_Armenian_re) + KEY_Armenian_TSO = uint(C.GDK_KEY_Armenian_TSO) + KEY_Armenian_tso = uint(C.GDK_KEY_Armenian_tso) + KEY_Armenian_VYUN = uint(C.GDK_KEY_Armenian_VYUN) + KEY_Armenian_vyun = uint(C.GDK_KEY_Armenian_vyun) + KEY_Armenian_PYUR = uint(C.GDK_KEY_Armenian_PYUR) + KEY_Armenian_pyur = uint(C.GDK_KEY_Armenian_pyur) + KEY_Armenian_KE = uint(C.GDK_KEY_Armenian_KE) + KEY_Armenian_ke = uint(C.GDK_KEY_Armenian_ke) + KEY_Armenian_O = uint(C.GDK_KEY_Armenian_O) + KEY_Armenian_o = uint(C.GDK_KEY_Armenian_o) + KEY_Armenian_FE = uint(C.GDK_KEY_Armenian_FE) + KEY_Armenian_fe = uint(C.GDK_KEY_Armenian_fe) + KEY_Armenian_apostrophe = uint(C.GDK_KEY_Armenian_apostrophe) + KEY_Georgian_an = uint(C.GDK_KEY_Georgian_an) + KEY_Georgian_ban = uint(C.GDK_KEY_Georgian_ban) + KEY_Georgian_gan = uint(C.GDK_KEY_Georgian_gan) + KEY_Georgian_don = uint(C.GDK_KEY_Georgian_don) + KEY_Georgian_en = uint(C.GDK_KEY_Georgian_en) + KEY_Georgian_vin = uint(C.GDK_KEY_Georgian_vin) + KEY_Georgian_zen = uint(C.GDK_KEY_Georgian_zen) + KEY_Georgian_tan = uint(C.GDK_KEY_Georgian_tan) + KEY_Georgian_in = uint(C.GDK_KEY_Georgian_in) + KEY_Georgian_kan = uint(C.GDK_KEY_Georgian_kan) + KEY_Georgian_las = uint(C.GDK_KEY_Georgian_las) + KEY_Georgian_man = uint(C.GDK_KEY_Georgian_man) + KEY_Georgian_nar = uint(C.GDK_KEY_Georgian_nar) + KEY_Georgian_on = uint(C.GDK_KEY_Georgian_on) + KEY_Georgian_par = uint(C.GDK_KEY_Georgian_par) + KEY_Georgian_zhar = uint(C.GDK_KEY_Georgian_zhar) + KEY_Georgian_rae = uint(C.GDK_KEY_Georgian_rae) + KEY_Georgian_san = uint(C.GDK_KEY_Georgian_san) + KEY_Georgian_tar = uint(C.GDK_KEY_Georgian_tar) + KEY_Georgian_un = uint(C.GDK_KEY_Georgian_un) + KEY_Georgian_phar = uint(C.GDK_KEY_Georgian_phar) + KEY_Georgian_khar = uint(C.GDK_KEY_Georgian_khar) + KEY_Georgian_ghan = uint(C.GDK_KEY_Georgian_ghan) + KEY_Georgian_qar = uint(C.GDK_KEY_Georgian_qar) + KEY_Georgian_shin = uint(C.GDK_KEY_Georgian_shin) + KEY_Georgian_chin = uint(C.GDK_KEY_Georgian_chin) + KEY_Georgian_can = uint(C.GDK_KEY_Georgian_can) + KEY_Georgian_jil = uint(C.GDK_KEY_Georgian_jil) + KEY_Georgian_cil = uint(C.GDK_KEY_Georgian_cil) + KEY_Georgian_char = uint(C.GDK_KEY_Georgian_char) + KEY_Georgian_xan = uint(C.GDK_KEY_Georgian_xan) + KEY_Georgian_jhan = uint(C.GDK_KEY_Georgian_jhan) + KEY_Georgian_hae = uint(C.GDK_KEY_Georgian_hae) + KEY_Georgian_he = uint(C.GDK_KEY_Georgian_he) + KEY_Georgian_hie = uint(C.GDK_KEY_Georgian_hie) + KEY_Georgian_we = uint(C.GDK_KEY_Georgian_we) + KEY_Georgian_har = uint(C.GDK_KEY_Georgian_har) + KEY_Georgian_hoe = uint(C.GDK_KEY_Georgian_hoe) + KEY_Georgian_fi = uint(C.GDK_KEY_Georgian_fi) + KEY_Xabovedot = uint(C.GDK_KEY_Xabovedot) + KEY_Ibreve = uint(C.GDK_KEY_Ibreve) + KEY_Zstroke = uint(C.GDK_KEY_Zstroke) + KEY_Gcaron = uint(C.GDK_KEY_Gcaron) + KEY_Ocaron = uint(C.GDK_KEY_Ocaron) + KEY_Obarred = uint(C.GDK_KEY_Obarred) + KEY_xabovedot = uint(C.GDK_KEY_xabovedot) + KEY_ibreve = uint(C.GDK_KEY_ibreve) + KEY_zstroke = uint(C.GDK_KEY_zstroke) + KEY_gcaron = uint(C.GDK_KEY_gcaron) + KEY_ocaron = uint(C.GDK_KEY_ocaron) + KEY_obarred = uint(C.GDK_KEY_obarred) + KEY_SCHWA = uint(C.GDK_KEY_SCHWA) + KEY_schwa = uint(C.GDK_KEY_schwa) + KEY_EZH = uint(C.GDK_KEY_EZH) + KEY_ezh = uint(C.GDK_KEY_ezh) + KEY_Lbelowdot = uint(C.GDK_KEY_Lbelowdot) + KEY_lbelowdot = uint(C.GDK_KEY_lbelowdot) + KEY_Abelowdot = uint(C.GDK_KEY_Abelowdot) + KEY_abelowdot = uint(C.GDK_KEY_abelowdot) + KEY_Ahook = uint(C.GDK_KEY_Ahook) + KEY_ahook = uint(C.GDK_KEY_ahook) + KEY_Acircumflexacute = uint(C.GDK_KEY_Acircumflexacute) + KEY_acircumflexacute = uint(C.GDK_KEY_acircumflexacute) + KEY_Acircumflexgrave = uint(C.GDK_KEY_Acircumflexgrave) + KEY_acircumflexgrave = uint(C.GDK_KEY_acircumflexgrave) + KEY_Acircumflexhook = uint(C.GDK_KEY_Acircumflexhook) + KEY_acircumflexhook = uint(C.GDK_KEY_acircumflexhook) + KEY_Acircumflextilde = uint(C.GDK_KEY_Acircumflextilde) + KEY_acircumflextilde = uint(C.GDK_KEY_acircumflextilde) + KEY_Acircumflexbelowdot = uint(C.GDK_KEY_Acircumflexbelowdot) + KEY_acircumflexbelowdot = uint(C.GDK_KEY_acircumflexbelowdot) + KEY_Abreveacute = uint(C.GDK_KEY_Abreveacute) + KEY_abreveacute = uint(C.GDK_KEY_abreveacute) + KEY_Abrevegrave = uint(C.GDK_KEY_Abrevegrave) + KEY_abrevegrave = uint(C.GDK_KEY_abrevegrave) + KEY_Abrevehook = uint(C.GDK_KEY_Abrevehook) + KEY_abrevehook = uint(C.GDK_KEY_abrevehook) + KEY_Abrevetilde = uint(C.GDK_KEY_Abrevetilde) + KEY_abrevetilde = uint(C.GDK_KEY_abrevetilde) + KEY_Abrevebelowdot = uint(C.GDK_KEY_Abrevebelowdot) + KEY_abrevebelowdot = uint(C.GDK_KEY_abrevebelowdot) + KEY_Ebelowdot = uint(C.GDK_KEY_Ebelowdot) + KEY_ebelowdot = uint(C.GDK_KEY_ebelowdot) + KEY_Ehook = uint(C.GDK_KEY_Ehook) + KEY_ehook = uint(C.GDK_KEY_ehook) + KEY_Etilde = uint(C.GDK_KEY_Etilde) + KEY_etilde = uint(C.GDK_KEY_etilde) + KEY_Ecircumflexacute = uint(C.GDK_KEY_Ecircumflexacute) + KEY_ecircumflexacute = uint(C.GDK_KEY_ecircumflexacute) + KEY_Ecircumflexgrave = uint(C.GDK_KEY_Ecircumflexgrave) + KEY_ecircumflexgrave = uint(C.GDK_KEY_ecircumflexgrave) + KEY_Ecircumflexhook = uint(C.GDK_KEY_Ecircumflexhook) + KEY_ecircumflexhook = uint(C.GDK_KEY_ecircumflexhook) + KEY_Ecircumflextilde = uint(C.GDK_KEY_Ecircumflextilde) + KEY_ecircumflextilde = uint(C.GDK_KEY_ecircumflextilde) + KEY_Ecircumflexbelowdot = uint(C.GDK_KEY_Ecircumflexbelowdot) + KEY_ecircumflexbelowdot = uint(C.GDK_KEY_ecircumflexbelowdot) + KEY_Ihook = uint(C.GDK_KEY_Ihook) + KEY_ihook = uint(C.GDK_KEY_ihook) + KEY_Ibelowdot = uint(C.GDK_KEY_Ibelowdot) + KEY_ibelowdot = uint(C.GDK_KEY_ibelowdot) + KEY_Obelowdot = uint(C.GDK_KEY_Obelowdot) + KEY_obelowdot = uint(C.GDK_KEY_obelowdot) + KEY_Ohook = uint(C.GDK_KEY_Ohook) + KEY_ohook = uint(C.GDK_KEY_ohook) + KEY_Ocircumflexacute = uint(C.GDK_KEY_Ocircumflexacute) + KEY_ocircumflexacute = uint(C.GDK_KEY_ocircumflexacute) + KEY_Ocircumflexgrave = uint(C.GDK_KEY_Ocircumflexgrave) + KEY_ocircumflexgrave = uint(C.GDK_KEY_ocircumflexgrave) + KEY_Ocircumflexhook = uint(C.GDK_KEY_Ocircumflexhook) + KEY_ocircumflexhook = uint(C.GDK_KEY_ocircumflexhook) + KEY_Ocircumflextilde = uint(C.GDK_KEY_Ocircumflextilde) + KEY_ocircumflextilde = uint(C.GDK_KEY_ocircumflextilde) + KEY_Ocircumflexbelowdot = uint(C.GDK_KEY_Ocircumflexbelowdot) + KEY_ocircumflexbelowdot = uint(C.GDK_KEY_ocircumflexbelowdot) + KEY_Ohornacute = uint(C.GDK_KEY_Ohornacute) + KEY_ohornacute = uint(C.GDK_KEY_ohornacute) + KEY_Ohorngrave = uint(C.GDK_KEY_Ohorngrave) + KEY_ohorngrave = uint(C.GDK_KEY_ohorngrave) + KEY_Ohornhook = uint(C.GDK_KEY_Ohornhook) + KEY_ohornhook = uint(C.GDK_KEY_ohornhook) + KEY_Ohorntilde = uint(C.GDK_KEY_Ohorntilde) + KEY_ohorntilde = uint(C.GDK_KEY_ohorntilde) + KEY_Ohornbelowdot = uint(C.GDK_KEY_Ohornbelowdot) + KEY_ohornbelowdot = uint(C.GDK_KEY_ohornbelowdot) + KEY_Ubelowdot = uint(C.GDK_KEY_Ubelowdot) + KEY_ubelowdot = uint(C.GDK_KEY_ubelowdot) + KEY_Uhook = uint(C.GDK_KEY_Uhook) + KEY_uhook = uint(C.GDK_KEY_uhook) + KEY_Uhornacute = uint(C.GDK_KEY_Uhornacute) + KEY_uhornacute = uint(C.GDK_KEY_uhornacute) + KEY_Uhorngrave = uint(C.GDK_KEY_Uhorngrave) + KEY_uhorngrave = uint(C.GDK_KEY_uhorngrave) + KEY_Uhornhook = uint(C.GDK_KEY_Uhornhook) + KEY_uhornhook = uint(C.GDK_KEY_uhornhook) + KEY_Uhorntilde = uint(C.GDK_KEY_Uhorntilde) + KEY_uhorntilde = uint(C.GDK_KEY_uhorntilde) + KEY_Uhornbelowdot = uint(C.GDK_KEY_Uhornbelowdot) + KEY_uhornbelowdot = uint(C.GDK_KEY_uhornbelowdot) + KEY_Ybelowdot = uint(C.GDK_KEY_Ybelowdot) + KEY_ybelowdot = uint(C.GDK_KEY_ybelowdot) + KEY_Yhook = uint(C.GDK_KEY_Yhook) + KEY_yhook = uint(C.GDK_KEY_yhook) + KEY_Ytilde = uint(C.GDK_KEY_Ytilde) + KEY_ytilde = uint(C.GDK_KEY_ytilde) + KEY_Ohorn = uint(C.GDK_KEY_Ohorn) + KEY_ohorn = uint(C.GDK_KEY_ohorn) + KEY_Uhorn = uint(C.GDK_KEY_Uhorn) + KEY_uhorn = uint(C.GDK_KEY_uhorn) + KEY_EcuSign = uint(C.GDK_KEY_EcuSign) + KEY_ColonSign = uint(C.GDK_KEY_ColonSign) + KEY_CruzeiroSign = uint(C.GDK_KEY_CruzeiroSign) + KEY_FFrancSign = uint(C.GDK_KEY_FFrancSign) + KEY_LiraSign = uint(C.GDK_KEY_LiraSign) + KEY_MillSign = uint(C.GDK_KEY_MillSign) + KEY_NairaSign = uint(C.GDK_KEY_NairaSign) + KEY_PesetaSign = uint(C.GDK_KEY_PesetaSign) + KEY_RupeeSign = uint(C.GDK_KEY_RupeeSign) + KEY_WonSign = uint(C.GDK_KEY_WonSign) + KEY_NewSheqelSign = uint(C.GDK_KEY_NewSheqelSign) + KEY_DongSign = uint(C.GDK_KEY_DongSign) + KEY_EuroSign = uint(C.GDK_KEY_EuroSign) + KEY_zerosuperior = uint(C.GDK_KEY_zerosuperior) + KEY_foursuperior = uint(C.GDK_KEY_foursuperior) + KEY_fivesuperior = uint(C.GDK_KEY_fivesuperior) + KEY_sixsuperior = uint(C.GDK_KEY_sixsuperior) + KEY_sevensuperior = uint(C.GDK_KEY_sevensuperior) + KEY_eightsuperior = uint(C.GDK_KEY_eightsuperior) + KEY_ninesuperior = uint(C.GDK_KEY_ninesuperior) + KEY_zerosubscript = uint(C.GDK_KEY_zerosubscript) + KEY_onesubscript = uint(C.GDK_KEY_onesubscript) + KEY_twosubscript = uint(C.GDK_KEY_twosubscript) + KEY_threesubscript = uint(C.GDK_KEY_threesubscript) + KEY_foursubscript = uint(C.GDK_KEY_foursubscript) + KEY_fivesubscript = uint(C.GDK_KEY_fivesubscript) + KEY_sixsubscript = uint(C.GDK_KEY_sixsubscript) + KEY_sevensubscript = uint(C.GDK_KEY_sevensubscript) + KEY_eightsubscript = uint(C.GDK_KEY_eightsubscript) + KEY_ninesubscript = uint(C.GDK_KEY_ninesubscript) + KEY_partdifferential = uint(C.GDK_KEY_partdifferential) + KEY_emptyset = uint(C.GDK_KEY_emptyset) + KEY_elementof = uint(C.GDK_KEY_elementof) + KEY_notelementof = uint(C.GDK_KEY_notelementof) + KEY_containsas = uint(C.GDK_KEY_containsas) + KEY_squareroot = uint(C.GDK_KEY_squareroot) + KEY_cuberoot = uint(C.GDK_KEY_cuberoot) + KEY_fourthroot = uint(C.GDK_KEY_fourthroot) + KEY_dintegral = uint(C.GDK_KEY_dintegral) + KEY_tintegral = uint(C.GDK_KEY_tintegral) + KEY_because = uint(C.GDK_KEY_because) + KEY_approxeq = uint(C.GDK_KEY_approxeq) + KEY_notapproxeq = uint(C.GDK_KEY_notapproxeq) + KEY_notidentical = uint(C.GDK_KEY_notidentical) + KEY_stricteq = uint(C.GDK_KEY_stricteq) + KEY_braille_dot_1 = uint(C.GDK_KEY_braille_dot_1) + KEY_braille_dot_2 = uint(C.GDK_KEY_braille_dot_2) + KEY_braille_dot_3 = uint(C.GDK_KEY_braille_dot_3) + KEY_braille_dot_4 = uint(C.GDK_KEY_braille_dot_4) + KEY_braille_dot_5 = uint(C.GDK_KEY_braille_dot_5) + KEY_braille_dot_6 = uint(C.GDK_KEY_braille_dot_6) + KEY_braille_dot_7 = uint(C.GDK_KEY_braille_dot_7) + KEY_braille_dot_8 = uint(C.GDK_KEY_braille_dot_8) + KEY_braille_dot_9 = uint(C.GDK_KEY_braille_dot_9) + KEY_braille_dot_10 = uint(C.GDK_KEY_braille_dot_10) + KEY_braille_blank = uint(C.GDK_KEY_braille_blank) + KEY_braille_dots_1 = uint(C.GDK_KEY_braille_dots_1) + KEY_braille_dots_2 = uint(C.GDK_KEY_braille_dots_2) + KEY_braille_dots_12 = uint(C.GDK_KEY_braille_dots_12) + KEY_braille_dots_3 = uint(C.GDK_KEY_braille_dots_3) + KEY_braille_dots_13 = uint(C.GDK_KEY_braille_dots_13) + KEY_braille_dots_23 = uint(C.GDK_KEY_braille_dots_23) + KEY_braille_dots_123 = uint(C.GDK_KEY_braille_dots_123) + KEY_braille_dots_4 = uint(C.GDK_KEY_braille_dots_4) + KEY_braille_dots_14 = uint(C.GDK_KEY_braille_dots_14) + KEY_braille_dots_24 = uint(C.GDK_KEY_braille_dots_24) + KEY_braille_dots_124 = uint(C.GDK_KEY_braille_dots_124) + KEY_braille_dots_34 = uint(C.GDK_KEY_braille_dots_34) + KEY_braille_dots_134 = uint(C.GDK_KEY_braille_dots_134) + KEY_braille_dots_234 = uint(C.GDK_KEY_braille_dots_234) + KEY_braille_dots_1234 = uint(C.GDK_KEY_braille_dots_1234) + KEY_braille_dots_5 = uint(C.GDK_KEY_braille_dots_5) + KEY_braille_dots_15 = uint(C.GDK_KEY_braille_dots_15) + KEY_braille_dots_25 = uint(C.GDK_KEY_braille_dots_25) + KEY_braille_dots_125 = uint(C.GDK_KEY_braille_dots_125) + KEY_braille_dots_35 = uint(C.GDK_KEY_braille_dots_35) + KEY_braille_dots_135 = uint(C.GDK_KEY_braille_dots_135) + KEY_braille_dots_235 = uint(C.GDK_KEY_braille_dots_235) + KEY_braille_dots_1235 = uint(C.GDK_KEY_braille_dots_1235) + KEY_braille_dots_45 = uint(C.GDK_KEY_braille_dots_45) + KEY_braille_dots_145 = uint(C.GDK_KEY_braille_dots_145) + KEY_braille_dots_245 = uint(C.GDK_KEY_braille_dots_245) + KEY_braille_dots_1245 = uint(C.GDK_KEY_braille_dots_1245) + KEY_braille_dots_345 = uint(C.GDK_KEY_braille_dots_345) + KEY_braille_dots_1345 = uint(C.GDK_KEY_braille_dots_1345) + KEY_braille_dots_2345 = uint(C.GDK_KEY_braille_dots_2345) + KEY_braille_dots_12345 = uint(C.GDK_KEY_braille_dots_12345) + KEY_braille_dots_6 = uint(C.GDK_KEY_braille_dots_6) + KEY_braille_dots_16 = uint(C.GDK_KEY_braille_dots_16) + KEY_braille_dots_26 = uint(C.GDK_KEY_braille_dots_26) + KEY_braille_dots_126 = uint(C.GDK_KEY_braille_dots_126) + KEY_braille_dots_36 = uint(C.GDK_KEY_braille_dots_36) + KEY_braille_dots_136 = uint(C.GDK_KEY_braille_dots_136) + KEY_braille_dots_236 = uint(C.GDK_KEY_braille_dots_236) + KEY_braille_dots_1236 = uint(C.GDK_KEY_braille_dots_1236) + KEY_braille_dots_46 = uint(C.GDK_KEY_braille_dots_46) + KEY_braille_dots_146 = uint(C.GDK_KEY_braille_dots_146) + KEY_braille_dots_246 = uint(C.GDK_KEY_braille_dots_246) + KEY_braille_dots_1246 = uint(C.GDK_KEY_braille_dots_1246) + KEY_braille_dots_346 = uint(C.GDK_KEY_braille_dots_346) + KEY_braille_dots_1346 = uint(C.GDK_KEY_braille_dots_1346) + KEY_braille_dots_2346 = uint(C.GDK_KEY_braille_dots_2346) + KEY_braille_dots_12346 = uint(C.GDK_KEY_braille_dots_12346) + KEY_braille_dots_56 = uint(C.GDK_KEY_braille_dots_56) + KEY_braille_dots_156 = uint(C.GDK_KEY_braille_dots_156) + KEY_braille_dots_256 = uint(C.GDK_KEY_braille_dots_256) + KEY_braille_dots_1256 = uint(C.GDK_KEY_braille_dots_1256) + KEY_braille_dots_356 = uint(C.GDK_KEY_braille_dots_356) + KEY_braille_dots_1356 = uint(C.GDK_KEY_braille_dots_1356) + KEY_braille_dots_2356 = uint(C.GDK_KEY_braille_dots_2356) + KEY_braille_dots_12356 = uint(C.GDK_KEY_braille_dots_12356) + KEY_braille_dots_456 = uint(C.GDK_KEY_braille_dots_456) + KEY_braille_dots_1456 = uint(C.GDK_KEY_braille_dots_1456) + KEY_braille_dots_2456 = uint(C.GDK_KEY_braille_dots_2456) + KEY_braille_dots_12456 = uint(C.GDK_KEY_braille_dots_12456) + KEY_braille_dots_3456 = uint(C.GDK_KEY_braille_dots_3456) + KEY_braille_dots_13456 = uint(C.GDK_KEY_braille_dots_13456) + KEY_braille_dots_23456 = uint(C.GDK_KEY_braille_dots_23456) + KEY_braille_dots_123456 = uint(C.GDK_KEY_braille_dots_123456) + KEY_braille_dots_7 = uint(C.GDK_KEY_braille_dots_7) + KEY_braille_dots_17 = uint(C.GDK_KEY_braille_dots_17) + KEY_braille_dots_27 = uint(C.GDK_KEY_braille_dots_27) + KEY_braille_dots_127 = uint(C.GDK_KEY_braille_dots_127) + KEY_braille_dots_37 = uint(C.GDK_KEY_braille_dots_37) + KEY_braille_dots_137 = uint(C.GDK_KEY_braille_dots_137) + KEY_braille_dots_237 = uint(C.GDK_KEY_braille_dots_237) + KEY_braille_dots_1237 = uint(C.GDK_KEY_braille_dots_1237) + KEY_braille_dots_47 = uint(C.GDK_KEY_braille_dots_47) + KEY_braille_dots_147 = uint(C.GDK_KEY_braille_dots_147) + KEY_braille_dots_247 = uint(C.GDK_KEY_braille_dots_247) + KEY_braille_dots_1247 = uint(C.GDK_KEY_braille_dots_1247) + KEY_braille_dots_347 = uint(C.GDK_KEY_braille_dots_347) + KEY_braille_dots_1347 = uint(C.GDK_KEY_braille_dots_1347) + KEY_braille_dots_2347 = uint(C.GDK_KEY_braille_dots_2347) + KEY_braille_dots_12347 = uint(C.GDK_KEY_braille_dots_12347) + KEY_braille_dots_57 = uint(C.GDK_KEY_braille_dots_57) + KEY_braille_dots_157 = uint(C.GDK_KEY_braille_dots_157) + KEY_braille_dots_257 = uint(C.GDK_KEY_braille_dots_257) + KEY_braille_dots_1257 = uint(C.GDK_KEY_braille_dots_1257) + KEY_braille_dots_357 = uint(C.GDK_KEY_braille_dots_357) + KEY_braille_dots_1357 = uint(C.GDK_KEY_braille_dots_1357) + KEY_braille_dots_2357 = uint(C.GDK_KEY_braille_dots_2357) + KEY_braille_dots_12357 = uint(C.GDK_KEY_braille_dots_12357) + KEY_braille_dots_457 = uint(C.GDK_KEY_braille_dots_457) + KEY_braille_dots_1457 = uint(C.GDK_KEY_braille_dots_1457) + KEY_braille_dots_2457 = uint(C.GDK_KEY_braille_dots_2457) + KEY_braille_dots_12457 = uint(C.GDK_KEY_braille_dots_12457) + KEY_braille_dots_3457 = uint(C.GDK_KEY_braille_dots_3457) + KEY_braille_dots_13457 = uint(C.GDK_KEY_braille_dots_13457) + KEY_braille_dots_23457 = uint(C.GDK_KEY_braille_dots_23457) + KEY_braille_dots_123457 = uint(C.GDK_KEY_braille_dots_123457) + KEY_braille_dots_67 = uint(C.GDK_KEY_braille_dots_67) + KEY_braille_dots_167 = uint(C.GDK_KEY_braille_dots_167) + KEY_braille_dots_267 = uint(C.GDK_KEY_braille_dots_267) + KEY_braille_dots_1267 = uint(C.GDK_KEY_braille_dots_1267) + KEY_braille_dots_367 = uint(C.GDK_KEY_braille_dots_367) + KEY_braille_dots_1367 = uint(C.GDK_KEY_braille_dots_1367) + KEY_braille_dots_2367 = uint(C.GDK_KEY_braille_dots_2367) + KEY_braille_dots_12367 = uint(C.GDK_KEY_braille_dots_12367) + KEY_braille_dots_467 = uint(C.GDK_KEY_braille_dots_467) + KEY_braille_dots_1467 = uint(C.GDK_KEY_braille_dots_1467) + KEY_braille_dots_2467 = uint(C.GDK_KEY_braille_dots_2467) + KEY_braille_dots_12467 = uint(C.GDK_KEY_braille_dots_12467) + KEY_braille_dots_3467 = uint(C.GDK_KEY_braille_dots_3467) + KEY_braille_dots_13467 = uint(C.GDK_KEY_braille_dots_13467) + KEY_braille_dots_23467 = uint(C.GDK_KEY_braille_dots_23467) + KEY_braille_dots_123467 = uint(C.GDK_KEY_braille_dots_123467) + KEY_braille_dots_567 = uint(C.GDK_KEY_braille_dots_567) + KEY_braille_dots_1567 = uint(C.GDK_KEY_braille_dots_1567) + KEY_braille_dots_2567 = uint(C.GDK_KEY_braille_dots_2567) + KEY_braille_dots_12567 = uint(C.GDK_KEY_braille_dots_12567) + KEY_braille_dots_3567 = uint(C.GDK_KEY_braille_dots_3567) + KEY_braille_dots_13567 = uint(C.GDK_KEY_braille_dots_13567) + KEY_braille_dots_23567 = uint(C.GDK_KEY_braille_dots_23567) + KEY_braille_dots_123567 = uint(C.GDK_KEY_braille_dots_123567) + KEY_braille_dots_4567 = uint(C.GDK_KEY_braille_dots_4567) + KEY_braille_dots_14567 = uint(C.GDK_KEY_braille_dots_14567) + KEY_braille_dots_24567 = uint(C.GDK_KEY_braille_dots_24567) + KEY_braille_dots_124567 = uint(C.GDK_KEY_braille_dots_124567) + KEY_braille_dots_34567 = uint(C.GDK_KEY_braille_dots_34567) + KEY_braille_dots_134567 = uint(C.GDK_KEY_braille_dots_134567) + KEY_braille_dots_234567 = uint(C.GDK_KEY_braille_dots_234567) + KEY_braille_dots_1234567 = uint(C.GDK_KEY_braille_dots_1234567) + KEY_braille_dots_8 = uint(C.GDK_KEY_braille_dots_8) + KEY_braille_dots_18 = uint(C.GDK_KEY_braille_dots_18) + KEY_braille_dots_28 = uint(C.GDK_KEY_braille_dots_28) + KEY_braille_dots_128 = uint(C.GDK_KEY_braille_dots_128) + KEY_braille_dots_38 = uint(C.GDK_KEY_braille_dots_38) + KEY_braille_dots_138 = uint(C.GDK_KEY_braille_dots_138) + KEY_braille_dots_238 = uint(C.GDK_KEY_braille_dots_238) + KEY_braille_dots_1238 = uint(C.GDK_KEY_braille_dots_1238) + KEY_braille_dots_48 = uint(C.GDK_KEY_braille_dots_48) + KEY_braille_dots_148 = uint(C.GDK_KEY_braille_dots_148) + KEY_braille_dots_248 = uint(C.GDK_KEY_braille_dots_248) + KEY_braille_dots_1248 = uint(C.GDK_KEY_braille_dots_1248) + KEY_braille_dots_348 = uint(C.GDK_KEY_braille_dots_348) + KEY_braille_dots_1348 = uint(C.GDK_KEY_braille_dots_1348) + KEY_braille_dots_2348 = uint(C.GDK_KEY_braille_dots_2348) + KEY_braille_dots_12348 = uint(C.GDK_KEY_braille_dots_12348) + KEY_braille_dots_58 = uint(C.GDK_KEY_braille_dots_58) + KEY_braille_dots_158 = uint(C.GDK_KEY_braille_dots_158) + KEY_braille_dots_258 = uint(C.GDK_KEY_braille_dots_258) + KEY_braille_dots_1258 = uint(C.GDK_KEY_braille_dots_1258) + KEY_braille_dots_358 = uint(C.GDK_KEY_braille_dots_358) + KEY_braille_dots_1358 = uint(C.GDK_KEY_braille_dots_1358) + KEY_braille_dots_2358 = uint(C.GDK_KEY_braille_dots_2358) + KEY_braille_dots_12358 = uint(C.GDK_KEY_braille_dots_12358) + KEY_braille_dots_458 = uint(C.GDK_KEY_braille_dots_458) + KEY_braille_dots_1458 = uint(C.GDK_KEY_braille_dots_1458) + KEY_braille_dots_2458 = uint(C.GDK_KEY_braille_dots_2458) + KEY_braille_dots_12458 = uint(C.GDK_KEY_braille_dots_12458) + KEY_braille_dots_3458 = uint(C.GDK_KEY_braille_dots_3458) + KEY_braille_dots_13458 = uint(C.GDK_KEY_braille_dots_13458) + KEY_braille_dots_23458 = uint(C.GDK_KEY_braille_dots_23458) + KEY_braille_dots_123458 = uint(C.GDK_KEY_braille_dots_123458) + KEY_braille_dots_68 = uint(C.GDK_KEY_braille_dots_68) + KEY_braille_dots_168 = uint(C.GDK_KEY_braille_dots_168) + KEY_braille_dots_268 = uint(C.GDK_KEY_braille_dots_268) + KEY_braille_dots_1268 = uint(C.GDK_KEY_braille_dots_1268) + KEY_braille_dots_368 = uint(C.GDK_KEY_braille_dots_368) + KEY_braille_dots_1368 = uint(C.GDK_KEY_braille_dots_1368) + KEY_braille_dots_2368 = uint(C.GDK_KEY_braille_dots_2368) + KEY_braille_dots_12368 = uint(C.GDK_KEY_braille_dots_12368) + KEY_braille_dots_468 = uint(C.GDK_KEY_braille_dots_468) + KEY_braille_dots_1468 = uint(C.GDK_KEY_braille_dots_1468) + KEY_braille_dots_2468 = uint(C.GDK_KEY_braille_dots_2468) + KEY_braille_dots_12468 = uint(C.GDK_KEY_braille_dots_12468) + KEY_braille_dots_3468 = uint(C.GDK_KEY_braille_dots_3468) + KEY_braille_dots_13468 = uint(C.GDK_KEY_braille_dots_13468) + KEY_braille_dots_23468 = uint(C.GDK_KEY_braille_dots_23468) + KEY_braille_dots_123468 = uint(C.GDK_KEY_braille_dots_123468) + KEY_braille_dots_568 = uint(C.GDK_KEY_braille_dots_568) + KEY_braille_dots_1568 = uint(C.GDK_KEY_braille_dots_1568) + KEY_braille_dots_2568 = uint(C.GDK_KEY_braille_dots_2568) + KEY_braille_dots_12568 = uint(C.GDK_KEY_braille_dots_12568) + KEY_braille_dots_3568 = uint(C.GDK_KEY_braille_dots_3568) + KEY_braille_dots_13568 = uint(C.GDK_KEY_braille_dots_13568) + KEY_braille_dots_23568 = uint(C.GDK_KEY_braille_dots_23568) + KEY_braille_dots_123568 = uint(C.GDK_KEY_braille_dots_123568) + KEY_braille_dots_4568 = uint(C.GDK_KEY_braille_dots_4568) + KEY_braille_dots_14568 = uint(C.GDK_KEY_braille_dots_14568) + KEY_braille_dots_24568 = uint(C.GDK_KEY_braille_dots_24568) + KEY_braille_dots_124568 = uint(C.GDK_KEY_braille_dots_124568) + KEY_braille_dots_34568 = uint(C.GDK_KEY_braille_dots_34568) + KEY_braille_dots_134568 = uint(C.GDK_KEY_braille_dots_134568) + KEY_braille_dots_234568 = uint(C.GDK_KEY_braille_dots_234568) + KEY_braille_dots_1234568 = uint(C.GDK_KEY_braille_dots_1234568) + KEY_braille_dots_78 = uint(C.GDK_KEY_braille_dots_78) + KEY_braille_dots_178 = uint(C.GDK_KEY_braille_dots_178) + KEY_braille_dots_278 = uint(C.GDK_KEY_braille_dots_278) + KEY_braille_dots_1278 = uint(C.GDK_KEY_braille_dots_1278) + KEY_braille_dots_378 = uint(C.GDK_KEY_braille_dots_378) + KEY_braille_dots_1378 = uint(C.GDK_KEY_braille_dots_1378) + KEY_braille_dots_2378 = uint(C.GDK_KEY_braille_dots_2378) + KEY_braille_dots_12378 = uint(C.GDK_KEY_braille_dots_12378) + KEY_braille_dots_478 = uint(C.GDK_KEY_braille_dots_478) + KEY_braille_dots_1478 = uint(C.GDK_KEY_braille_dots_1478) + KEY_braille_dots_2478 = uint(C.GDK_KEY_braille_dots_2478) + KEY_braille_dots_12478 = uint(C.GDK_KEY_braille_dots_12478) + KEY_braille_dots_3478 = uint(C.GDK_KEY_braille_dots_3478) + KEY_braille_dots_13478 = uint(C.GDK_KEY_braille_dots_13478) + KEY_braille_dots_23478 = uint(C.GDK_KEY_braille_dots_23478) + KEY_braille_dots_123478 = uint(C.GDK_KEY_braille_dots_123478) + KEY_braille_dots_578 = uint(C.GDK_KEY_braille_dots_578) + KEY_braille_dots_1578 = uint(C.GDK_KEY_braille_dots_1578) + KEY_braille_dots_2578 = uint(C.GDK_KEY_braille_dots_2578) + KEY_braille_dots_12578 = uint(C.GDK_KEY_braille_dots_12578) + KEY_braille_dots_3578 = uint(C.GDK_KEY_braille_dots_3578) + KEY_braille_dots_13578 = uint(C.GDK_KEY_braille_dots_13578) + KEY_braille_dots_23578 = uint(C.GDK_KEY_braille_dots_23578) + KEY_braille_dots_123578 = uint(C.GDK_KEY_braille_dots_123578) + KEY_braille_dots_4578 = uint(C.GDK_KEY_braille_dots_4578) + KEY_braille_dots_14578 = uint(C.GDK_KEY_braille_dots_14578) + KEY_braille_dots_24578 = uint(C.GDK_KEY_braille_dots_24578) + KEY_braille_dots_124578 = uint(C.GDK_KEY_braille_dots_124578) + KEY_braille_dots_34578 = uint(C.GDK_KEY_braille_dots_34578) + KEY_braille_dots_134578 = uint(C.GDK_KEY_braille_dots_134578) + KEY_braille_dots_234578 = uint(C.GDK_KEY_braille_dots_234578) + KEY_braille_dots_1234578 = uint(C.GDK_KEY_braille_dots_1234578) + KEY_braille_dots_678 = uint(C.GDK_KEY_braille_dots_678) + KEY_braille_dots_1678 = uint(C.GDK_KEY_braille_dots_1678) + KEY_braille_dots_2678 = uint(C.GDK_KEY_braille_dots_2678) + KEY_braille_dots_12678 = uint(C.GDK_KEY_braille_dots_12678) + KEY_braille_dots_3678 = uint(C.GDK_KEY_braille_dots_3678) + KEY_braille_dots_13678 = uint(C.GDK_KEY_braille_dots_13678) + KEY_braille_dots_23678 = uint(C.GDK_KEY_braille_dots_23678) + KEY_braille_dots_123678 = uint(C.GDK_KEY_braille_dots_123678) + KEY_braille_dots_4678 = uint(C.GDK_KEY_braille_dots_4678) + KEY_braille_dots_14678 = uint(C.GDK_KEY_braille_dots_14678) + KEY_braille_dots_24678 = uint(C.GDK_KEY_braille_dots_24678) + KEY_braille_dots_124678 = uint(C.GDK_KEY_braille_dots_124678) + KEY_braille_dots_34678 = uint(C.GDK_KEY_braille_dots_34678) + KEY_braille_dots_134678 = uint(C.GDK_KEY_braille_dots_134678) + KEY_braille_dots_234678 = uint(C.GDK_KEY_braille_dots_234678) + KEY_braille_dots_1234678 = uint(C.GDK_KEY_braille_dots_1234678) + KEY_braille_dots_5678 = uint(C.GDK_KEY_braille_dots_5678) + KEY_braille_dots_15678 = uint(C.GDK_KEY_braille_dots_15678) + KEY_braille_dots_25678 = uint(C.GDK_KEY_braille_dots_25678) + KEY_braille_dots_125678 = uint(C.GDK_KEY_braille_dots_125678) + KEY_braille_dots_35678 = uint(C.GDK_KEY_braille_dots_35678) + KEY_braille_dots_135678 = uint(C.GDK_KEY_braille_dots_135678) + KEY_braille_dots_235678 = uint(C.GDK_KEY_braille_dots_235678) + KEY_braille_dots_1235678 = uint(C.GDK_KEY_braille_dots_1235678) + KEY_braille_dots_45678 = uint(C.GDK_KEY_braille_dots_45678) + KEY_braille_dots_145678 = uint(C.GDK_KEY_braille_dots_145678) + KEY_braille_dots_245678 = uint(C.GDK_KEY_braille_dots_245678) + KEY_braille_dots_1245678 = uint(C.GDK_KEY_braille_dots_1245678) + KEY_braille_dots_345678 = uint(C.GDK_KEY_braille_dots_345678) + KEY_braille_dots_1345678 = uint(C.GDK_KEY_braille_dots_1345678) + KEY_braille_dots_2345678 = uint(C.GDK_KEY_braille_dots_2345678) + KEY_braille_dots_12345678 = uint(C.GDK_KEY_braille_dots_12345678) + KEY_Sinh_ng = uint(C.GDK_KEY_Sinh_ng) + KEY_Sinh_h2 = uint(C.GDK_KEY_Sinh_h2) + KEY_Sinh_a = uint(C.GDK_KEY_Sinh_a) + KEY_Sinh_aa = uint(C.GDK_KEY_Sinh_aa) + KEY_Sinh_ae = uint(C.GDK_KEY_Sinh_ae) + KEY_Sinh_aee = uint(C.GDK_KEY_Sinh_aee) + KEY_Sinh_i = uint(C.GDK_KEY_Sinh_i) + KEY_Sinh_ii = uint(C.GDK_KEY_Sinh_ii) + KEY_Sinh_u = uint(C.GDK_KEY_Sinh_u) + KEY_Sinh_uu = uint(C.GDK_KEY_Sinh_uu) + KEY_Sinh_ri = uint(C.GDK_KEY_Sinh_ri) + KEY_Sinh_rii = uint(C.GDK_KEY_Sinh_rii) + KEY_Sinh_lu = uint(C.GDK_KEY_Sinh_lu) + KEY_Sinh_luu = uint(C.GDK_KEY_Sinh_luu) + KEY_Sinh_e = uint(C.GDK_KEY_Sinh_e) + KEY_Sinh_ee = uint(C.GDK_KEY_Sinh_ee) + KEY_Sinh_ai = uint(C.GDK_KEY_Sinh_ai) + KEY_Sinh_o = uint(C.GDK_KEY_Sinh_o) + KEY_Sinh_oo = uint(C.GDK_KEY_Sinh_oo) + KEY_Sinh_au = uint(C.GDK_KEY_Sinh_au) + KEY_Sinh_ka = uint(C.GDK_KEY_Sinh_ka) + KEY_Sinh_kha = uint(C.GDK_KEY_Sinh_kha) + KEY_Sinh_ga = uint(C.GDK_KEY_Sinh_ga) + KEY_Sinh_gha = uint(C.GDK_KEY_Sinh_gha) + KEY_Sinh_ng2 = uint(C.GDK_KEY_Sinh_ng2) + KEY_Sinh_nga = uint(C.GDK_KEY_Sinh_nga) + KEY_Sinh_ca = uint(C.GDK_KEY_Sinh_ca) + KEY_Sinh_cha = uint(C.GDK_KEY_Sinh_cha) + KEY_Sinh_ja = uint(C.GDK_KEY_Sinh_ja) + KEY_Sinh_jha = uint(C.GDK_KEY_Sinh_jha) + KEY_Sinh_nya = uint(C.GDK_KEY_Sinh_nya) + KEY_Sinh_jnya = uint(C.GDK_KEY_Sinh_jnya) + KEY_Sinh_nja = uint(C.GDK_KEY_Sinh_nja) + KEY_Sinh_tta = uint(C.GDK_KEY_Sinh_tta) + KEY_Sinh_ttha = uint(C.GDK_KEY_Sinh_ttha) + KEY_Sinh_dda = uint(C.GDK_KEY_Sinh_dda) + KEY_Sinh_ddha = uint(C.GDK_KEY_Sinh_ddha) + KEY_Sinh_nna = uint(C.GDK_KEY_Sinh_nna) + KEY_Sinh_ndda = uint(C.GDK_KEY_Sinh_ndda) + KEY_Sinh_tha = uint(C.GDK_KEY_Sinh_tha) + KEY_Sinh_thha = uint(C.GDK_KEY_Sinh_thha) + KEY_Sinh_dha = uint(C.GDK_KEY_Sinh_dha) + KEY_Sinh_dhha = uint(C.GDK_KEY_Sinh_dhha) + KEY_Sinh_na = uint(C.GDK_KEY_Sinh_na) + KEY_Sinh_ndha = uint(C.GDK_KEY_Sinh_ndha) + KEY_Sinh_pa = uint(C.GDK_KEY_Sinh_pa) + KEY_Sinh_pha = uint(C.GDK_KEY_Sinh_pha) + KEY_Sinh_ba = uint(C.GDK_KEY_Sinh_ba) + KEY_Sinh_bha = uint(C.GDK_KEY_Sinh_bha) + KEY_Sinh_ma = uint(C.GDK_KEY_Sinh_ma) + KEY_Sinh_mba = uint(C.GDK_KEY_Sinh_mba) + KEY_Sinh_ya = uint(C.GDK_KEY_Sinh_ya) + KEY_Sinh_ra = uint(C.GDK_KEY_Sinh_ra) + KEY_Sinh_la = uint(C.GDK_KEY_Sinh_la) + KEY_Sinh_va = uint(C.GDK_KEY_Sinh_va) + KEY_Sinh_sha = uint(C.GDK_KEY_Sinh_sha) + KEY_Sinh_ssha = uint(C.GDK_KEY_Sinh_ssha) + KEY_Sinh_sa = uint(C.GDK_KEY_Sinh_sa) + KEY_Sinh_ha = uint(C.GDK_KEY_Sinh_ha) + KEY_Sinh_lla = uint(C.GDK_KEY_Sinh_lla) + KEY_Sinh_fa = uint(C.GDK_KEY_Sinh_fa) + KEY_Sinh_al = uint(C.GDK_KEY_Sinh_al) + KEY_Sinh_aa2 = uint(C.GDK_KEY_Sinh_aa2) + KEY_Sinh_ae2 = uint(C.GDK_KEY_Sinh_ae2) + KEY_Sinh_aee2 = uint(C.GDK_KEY_Sinh_aee2) + KEY_Sinh_i2 = uint(C.GDK_KEY_Sinh_i2) + KEY_Sinh_ii2 = uint(C.GDK_KEY_Sinh_ii2) + KEY_Sinh_u2 = uint(C.GDK_KEY_Sinh_u2) + KEY_Sinh_uu2 = uint(C.GDK_KEY_Sinh_uu2) + KEY_Sinh_ru2 = uint(C.GDK_KEY_Sinh_ru2) + KEY_Sinh_e2 = uint(C.GDK_KEY_Sinh_e2) + KEY_Sinh_ee2 = uint(C.GDK_KEY_Sinh_ee2) + KEY_Sinh_ai2 = uint(C.GDK_KEY_Sinh_ai2) + KEY_Sinh_o2 = uint(C.GDK_KEY_Sinh_o2) + KEY_Sinh_oo2 = uint(C.GDK_KEY_Sinh_oo2) + KEY_Sinh_au2 = uint(C.GDK_KEY_Sinh_au2) + KEY_Sinh_lu2 = uint(C.GDK_KEY_Sinh_lu2) + KEY_Sinh_ruu2 = uint(C.GDK_KEY_Sinh_ruu2) + KEY_Sinh_luu2 = uint(C.GDK_KEY_Sinh_luu2) + KEY_Sinh_kunddaliya = uint(C.GDK_KEY_Sinh_kunddaliya) + KEY_ModeLock = uint(C.GDK_KEY_ModeLock) + KEY_MonBrightnessUp = uint(C.GDK_KEY_MonBrightnessUp) + KEY_MonBrightnessDown = uint(C.GDK_KEY_MonBrightnessDown) + KEY_KbdLightOnOff = uint(C.GDK_KEY_KbdLightOnOff) + KEY_KbdBrightnessUp = uint(C.GDK_KEY_KbdBrightnessUp) + KEY_KbdBrightnessDown = uint(C.GDK_KEY_KbdBrightnessDown) + KEY_Standby = uint(C.GDK_KEY_Standby) + KEY_AudioLowerVolume = uint(C.GDK_KEY_AudioLowerVolume) + KEY_AudioMute = uint(C.GDK_KEY_AudioMute) + KEY_AudioRaiseVolume = uint(C.GDK_KEY_AudioRaiseVolume) + KEY_AudioPlay = uint(C.GDK_KEY_AudioPlay) + KEY_AudioStop = uint(C.GDK_KEY_AudioStop) + KEY_AudioPrev = uint(C.GDK_KEY_AudioPrev) + KEY_AudioNext = uint(C.GDK_KEY_AudioNext) + KEY_HomePage = uint(C.GDK_KEY_HomePage) + KEY_Mail = uint(C.GDK_KEY_Mail) + KEY_Start = uint(C.GDK_KEY_Start) + KEY_Search = uint(C.GDK_KEY_Search) + KEY_AudioRecord = uint(C.GDK_KEY_AudioRecord) + KEY_Calculator = uint(C.GDK_KEY_Calculator) + KEY_Memo = uint(C.GDK_KEY_Memo) + KEY_ToDoList = uint(C.GDK_KEY_ToDoList) + KEY_Calendar = uint(C.GDK_KEY_Calendar) + KEY_PowerDown = uint(C.GDK_KEY_PowerDown) + KEY_ContrastAdjust = uint(C.GDK_KEY_ContrastAdjust) + KEY_RockerUp = uint(C.GDK_KEY_RockerUp) + KEY_RockerDown = uint(C.GDK_KEY_RockerDown) + KEY_RockerEnter = uint(C.GDK_KEY_RockerEnter) + KEY_Back = uint(C.GDK_KEY_Back) + KEY_Forward = uint(C.GDK_KEY_Forward) + KEY_Stop = uint(C.GDK_KEY_Stop) + KEY_Refresh = uint(C.GDK_KEY_Refresh) + KEY_PowerOff = uint(C.GDK_KEY_PowerOff) + KEY_WakeUp = uint(C.GDK_KEY_WakeUp) + KEY_Eject = uint(C.GDK_KEY_Eject) + KEY_ScreenSaver = uint(C.GDK_KEY_ScreenSaver) + KEY_WWW = uint(C.GDK_KEY_WWW) + KEY_Sleep = uint(C.GDK_KEY_Sleep) + KEY_Favorites = uint(C.GDK_KEY_Favorites) + KEY_AudioPause = uint(C.GDK_KEY_AudioPause) + KEY_AudioMedia = uint(C.GDK_KEY_AudioMedia) + KEY_MyComputer = uint(C.GDK_KEY_MyComputer) + KEY_VendorHome = uint(C.GDK_KEY_VendorHome) + KEY_LightBulb = uint(C.GDK_KEY_LightBulb) + KEY_Shop = uint(C.GDK_KEY_Shop) + KEY_History = uint(C.GDK_KEY_History) + KEY_OpenURL = uint(C.GDK_KEY_OpenURL) + KEY_AddFavorite = uint(C.GDK_KEY_AddFavorite) + KEY_HotLinks = uint(C.GDK_KEY_HotLinks) + KEY_BrightnessAdjust = uint(C.GDK_KEY_BrightnessAdjust) + KEY_Finance = uint(C.GDK_KEY_Finance) + KEY_Community = uint(C.GDK_KEY_Community) + KEY_AudioRewind = uint(C.GDK_KEY_AudioRewind) + KEY_BackForward = uint(C.GDK_KEY_BackForward) + KEY_Launch0 = uint(C.GDK_KEY_Launch0) + KEY_Launch1 = uint(C.GDK_KEY_Launch1) + KEY_Launch2 = uint(C.GDK_KEY_Launch2) + KEY_Launch3 = uint(C.GDK_KEY_Launch3) + KEY_Launch4 = uint(C.GDK_KEY_Launch4) + KEY_Launch5 = uint(C.GDK_KEY_Launch5) + KEY_Launch6 = uint(C.GDK_KEY_Launch6) + KEY_Launch7 = uint(C.GDK_KEY_Launch7) + KEY_Launch8 = uint(C.GDK_KEY_Launch8) + KEY_Launch9 = uint(C.GDK_KEY_Launch9) + KEY_LaunchA = uint(C.GDK_KEY_LaunchA) + KEY_LaunchB = uint(C.GDK_KEY_LaunchB) + KEY_LaunchC = uint(C.GDK_KEY_LaunchC) + KEY_LaunchD = uint(C.GDK_KEY_LaunchD) + KEY_LaunchE = uint(C.GDK_KEY_LaunchE) + KEY_LaunchF = uint(C.GDK_KEY_LaunchF) + KEY_ApplicationLeft = uint(C.GDK_KEY_ApplicationLeft) + KEY_ApplicationRight = uint(C.GDK_KEY_ApplicationRight) + KEY_Book = uint(C.GDK_KEY_Book) + KEY_CD = uint(C.GDK_KEY_CD) + KEY_WindowClear = uint(C.GDK_KEY_WindowClear) + KEY_Close = uint(C.GDK_KEY_Close) + KEY_Copy = uint(C.GDK_KEY_Copy) + KEY_Cut = uint(C.GDK_KEY_Cut) + KEY_Display = uint(C.GDK_KEY_Display) + KEY_DOS = uint(C.GDK_KEY_DOS) + KEY_Documents = uint(C.GDK_KEY_Documents) + KEY_Excel = uint(C.GDK_KEY_Excel) + KEY_Explorer = uint(C.GDK_KEY_Explorer) + KEY_Game = uint(C.GDK_KEY_Game) + KEY_Go = uint(C.GDK_KEY_Go) + KEY_iTouch = uint(C.GDK_KEY_iTouch) + KEY_LogOff = uint(C.GDK_KEY_LogOff) + KEY_Market = uint(C.GDK_KEY_Market) + KEY_Meeting = uint(C.GDK_KEY_Meeting) + KEY_MenuKB = uint(C.GDK_KEY_MenuKB) + KEY_MenuPB = uint(C.GDK_KEY_MenuPB) + KEY_MySites = uint(C.GDK_KEY_MySites) + KEY_New = uint(C.GDK_KEY_New) + KEY_News = uint(C.GDK_KEY_News) + KEY_OfficeHome = uint(C.GDK_KEY_OfficeHome) + KEY_Open = uint(C.GDK_KEY_Open) + KEY_Option = uint(C.GDK_KEY_Option) + KEY_Paste = uint(C.GDK_KEY_Paste) + KEY_Phone = uint(C.GDK_KEY_Phone) + KEY_Reply = uint(C.GDK_KEY_Reply) + KEY_Reload = uint(C.GDK_KEY_Reload) + KEY_RotateWindows = uint(C.GDK_KEY_RotateWindows) + KEY_RotationPB = uint(C.GDK_KEY_RotationPB) + KEY_RotationKB = uint(C.GDK_KEY_RotationKB) + KEY_Save = uint(C.GDK_KEY_Save) + KEY_ScrollUp = uint(C.GDK_KEY_ScrollUp) + KEY_ScrollDown = uint(C.GDK_KEY_ScrollDown) + KEY_ScrollClick = uint(C.GDK_KEY_ScrollClick) + KEY_Send = uint(C.GDK_KEY_Send) + KEY_Spell = uint(C.GDK_KEY_Spell) + KEY_SplitScreen = uint(C.GDK_KEY_SplitScreen) + KEY_Support = uint(C.GDK_KEY_Support) + KEY_TaskPane = uint(C.GDK_KEY_TaskPane) + KEY_Terminal = uint(C.GDK_KEY_Terminal) + KEY_Tools = uint(C.GDK_KEY_Tools) + KEY_Travel = uint(C.GDK_KEY_Travel) + KEY_UserPB = uint(C.GDK_KEY_UserPB) + KEY_User1KB = uint(C.GDK_KEY_User1KB) + KEY_User2KB = uint(C.GDK_KEY_User2KB) + KEY_Video = uint(C.GDK_KEY_Video) + KEY_WheelButton = uint(C.GDK_KEY_WheelButton) + KEY_Word = uint(C.GDK_KEY_Word) + KEY_Xfer = uint(C.GDK_KEY_Xfer) + KEY_ZoomIn = uint(C.GDK_KEY_ZoomIn) + KEY_ZoomOut = uint(C.GDK_KEY_ZoomOut) + KEY_Away = uint(C.GDK_KEY_Away) + KEY_Messenger = uint(C.GDK_KEY_Messenger) + KEY_WebCam = uint(C.GDK_KEY_WebCam) + KEY_MailForward = uint(C.GDK_KEY_MailForward) + KEY_Pictures = uint(C.GDK_KEY_Pictures) + KEY_Music = uint(C.GDK_KEY_Music) + KEY_Battery = uint(C.GDK_KEY_Battery) + KEY_Bluetooth = uint(C.GDK_KEY_Bluetooth) + KEY_WLAN = uint(C.GDK_KEY_WLAN) + KEY_UWB = uint(C.GDK_KEY_UWB) + KEY_AudioForward = uint(C.GDK_KEY_AudioForward) + KEY_AudioRepeat = uint(C.GDK_KEY_AudioRepeat) + KEY_AudioRandomPlay = uint(C.GDK_KEY_AudioRandomPlay) + KEY_Subtitle = uint(C.GDK_KEY_Subtitle) + KEY_AudioCycleTrack = uint(C.GDK_KEY_AudioCycleTrack) + KEY_CycleAngle = uint(C.GDK_KEY_CycleAngle) + KEY_FrameBack = uint(C.GDK_KEY_FrameBack) + KEY_FrameForward = uint(C.GDK_KEY_FrameForward) + KEY_Time = uint(C.GDK_KEY_Time) + KEY_SelectButton = uint(C.GDK_KEY_SelectButton) + KEY_View = uint(C.GDK_KEY_View) + KEY_TopMenu = uint(C.GDK_KEY_TopMenu) + KEY_Red = uint(C.GDK_KEY_Red) + KEY_Green = uint(C.GDK_KEY_Green) + KEY_Yellow = uint(C.GDK_KEY_Yellow) + KEY_Blue = uint(C.GDK_KEY_Blue) + KEY_Suspend = uint(C.GDK_KEY_Suspend) + KEY_Hibernate = uint(C.GDK_KEY_Hibernate) + KEY_TouchpadToggle = uint(C.GDK_KEY_TouchpadToggle) + KEY_TouchpadOn = uint(C.GDK_KEY_TouchpadOn) + KEY_TouchpadOff = uint(C.GDK_KEY_TouchpadOff) + KEY_AudioMicMute = uint(C.GDK_KEY_AudioMicMute) + KEY_Switch_VT_1 = uint(C.GDK_KEY_Switch_VT_1) + KEY_Switch_VT_2 = uint(C.GDK_KEY_Switch_VT_2) + KEY_Switch_VT_3 = uint(C.GDK_KEY_Switch_VT_3) + KEY_Switch_VT_4 = uint(C.GDK_KEY_Switch_VT_4) + KEY_Switch_VT_5 = uint(C.GDK_KEY_Switch_VT_5) + KEY_Switch_VT_6 = uint(C.GDK_KEY_Switch_VT_6) + KEY_Switch_VT_7 = uint(C.GDK_KEY_Switch_VT_7) + KEY_Switch_VT_8 = uint(C.GDK_KEY_Switch_VT_8) + KEY_Switch_VT_9 = uint(C.GDK_KEY_Switch_VT_9) + KEY_Switch_VT_10 = uint(C.GDK_KEY_Switch_VT_10) + KEY_Switch_VT_11 = uint(C.GDK_KEY_Switch_VT_11) + KEY_Switch_VT_12 = uint(C.GDK_KEY_Switch_VT_12) + KEY_Ungrab = uint(C.GDK_KEY_Ungrab) + KEY_ClearGrab = uint(C.GDK_KEY_ClearGrab) + KEY_Next_VMode = uint(C.GDK_KEY_Next_VMode) + KEY_Prev_VMode = uint(C.GDK_KEY_Prev_VMode) + KEY_LogWindowTree = uint(C.GDK_KEY_LogWindowTree) + KEY_LogGrabInfo = uint(C.GDK_KEY_LogGrabInfo) +) diff --git a/vendor/github.com/gotk3/gotk3/glib/glib.go b/vendor/github.com/gotk3/gotk3/glib/glib.go index 26e98f8..891d9d7 100644 --- a/vendor/github.com/gotk3/gotk3/glib/glib.go +++ b/vendor/github.com/gotk3/gotk3/glib/glib.go @@ -1333,3 +1333,11 @@ func InitI18n(domain string, dir string) { C.init_i18n(domainStr, dirStr) } + +// Local localizes a string using gettext +func Local(input string) string { + cstr := C.CString(input) + defer C.free(unsafe.Pointer(cstr)) + + return C.GoString(C.localize(cstr)) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib.go.h b/vendor/github.com/gotk3/gotk3/glib/glib.go.h index 40dea65..a4e2605 100644 --- a/vendor/github.com/gotk3/gotk3/glib/glib.go.h +++ b/vendor/github.com/gotk3/gotk3/glib/glib.go.h @@ -1,166 +1,180 @@ -/* - * Copyright (c) 2013-2014 Conformal Systems - * - * This file originated from: http://opensource.conformal.com/ - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + #ifndef __GLIB_GO_H__ #define __GLIB_GO_H__ -#include -#include -#include +#include +#include +#include #include +#define G_SETTINGS_ENABLE_BACKEND +#include #include #include #include #include - -/* GObject Type Casting */ -static GObject * -toGObject(void *p) -{ - return (G_OBJECT(p)); -} - -static GMenuModel * -toGMenuModel(void *p) -{ - return (G_MENU_MODEL(p)); -} - -static GMenu * -toGMenu(void *p) -{ - return (G_MENU(p)); -} - -static GMenuItem * -toGMenuItem(void *p) -{ - return (G_MENU_ITEM(p)); -} - -static GNotification * -toGNotification(void *p) -{ - return (G_NOTIFICATION(p)); -} - -static GApplication * -toGApplication(void *p) -{ - return (G_APPLICATION(p)); -} - - -static GType -_g_type_from_instance(gpointer instance) -{ - return (G_TYPE_FROM_INSTANCE(instance)); -} - -/* Wrapper to avoid variable arg list */ -static void -_g_object_set_one(gpointer object, const gchar *property_name, void *val) -{ - g_object_set(object, property_name, *(gpointer **)val, NULL); -} - -static GValue * -alloc_gvalue_list(int n) -{ - GValue *valv; - - valv = g_new0(GValue, n); - return (valv); -} - -static void -val_list_insert(GValue *valv, int i, GValue *val) -{ - valv[i] = *val; -} - -/* - * GValue - */ - -static GValue * -_g_value_alloc() -{ - return (g_new0(GValue, 1)); -} - -static GValue * -_g_value_init(GType g_type) -{ - GValue *value; - - value = g_new0(GValue, 1); - return (g_value_init(value, g_type)); -} - -static gboolean -_g_is_value(GValue *val) -{ - return (G_IS_VALUE(val)); -} - -static GType -_g_value_type(GValue *val) -{ - return (G_VALUE_TYPE(val)); -} - -static GType -_g_value_fundamental(GType type) -{ - return (G_TYPE_FUNDAMENTAL(type)); -} - -static GObjectClass * -_g_object_get_class (GObject *object) -{ - return (G_OBJECT_GET_CLASS(object)); -} - -/* - * Closure support - */ - -extern void goMarshal(GClosure *, GValue *, guint, GValue *, gpointer, GValue *); - -static GClosure * -_g_closure_new() -{ - GClosure *closure; - - closure = g_closure_new_simple(sizeof(GClosure), NULL); - g_closure_set_marshal(closure, (GClosureMarshal)(goMarshal)); - return (closure); -} - -extern void removeClosure(gpointer, GClosure *); - -static void -_g_closure_add_finalize_notifier(GClosure *closure) -{ - g_closure_add_finalize_notifier(closure, NULL, removeClosure); -} + +/* GObject Type Casting */ +static GObject * +toGObject(void *p) +{ + return (G_OBJECT(p)); +} + +static GMenuModel * +toGMenuModel(void *p) +{ + return (G_MENU_MODEL(p)); +} + +static GMenu * +toGMenu(void *p) +{ + return (G_MENU(p)); +} + +static GMenuItem * +toGMenuItem(void *p) +{ + return (G_MENU_ITEM(p)); +} + +static GNotification * +toGNotification(void *p) +{ + return (G_NOTIFICATION(p)); +} + +static GApplication * +toGApplication(void *p) +{ + return (G_APPLICATION(p)); +} + +static GSettings * +toGSettings(void *p) +{ + return (G_SETTINGS(p)); +} + +static GSettingsBackend * +toGSettingsBackend(void *p) +{ + return (G_SETTINGS_BACKEND(p)); +} + + +static GType +_g_type_from_instance(gpointer instance) +{ + return (G_TYPE_FROM_INSTANCE(instance)); +} + +/* Wrapper to avoid variable arg list */ +static void +_g_object_set_one(gpointer object, const gchar *property_name, void *val) +{ + g_object_set(object, property_name, *(gpointer **)val, NULL); +} + +static GValue * +alloc_gvalue_list(int n) +{ + GValue *valv; + + valv = g_new0(GValue, n); + return (valv); +} + +static void +val_list_insert(GValue *valv, int i, GValue *val) +{ + valv[i] = *val; +} + +/* + * GValue + */ + +static GValue * +_g_value_alloc() +{ + return (g_new0(GValue, 1)); +} + +static GValue * +_g_value_init(GType g_type) +{ + GValue *value; + + value = g_new0(GValue, 1); + return (g_value_init(value, g_type)); +} + +static gboolean +_g_is_value(GValue *val) +{ + return (G_IS_VALUE(val)); +} + +static GType +_g_value_type(GValue *val) +{ + return (G_VALUE_TYPE(val)); +} + +static GType +_g_value_fundamental(GType type) +{ + return (G_TYPE_FUNDAMENTAL(type)); +} + +static GObjectClass * +_g_object_get_class (GObject *object) +{ + return (G_OBJECT_GET_CLASS(object)); +} + +/* + * Closure support + */ + +extern void goMarshal(GClosure *, GValue *, guint, GValue *, gpointer, GValue *); + +static GClosure * +_g_closure_new() +{ + GClosure *closure; + + closure = g_closure_new_simple(sizeof(GClosure), NULL); + g_closure_set_marshal(closure, (GClosureMarshal)(goMarshal)); + return (closure); +} + +extern void removeClosure(gpointer, GClosure *); + +static void +_g_closure_add_finalize_notifier(GClosure *closure) +{ + g_closure_add_finalize_notifier(closure, NULL, removeClosure); +} static inline guint _g_signal_new(const gchar *name) { return g_signal_new(name, @@ -180,6 +194,10 @@ static void init_i18n(const char *domain, const char *dir) { textdomain(domain); } +static const char* localize(const char *string) { + return _(string); +} + static inline char** make_strings(int count) { return (char**)malloc(sizeof(char*) * count); } @@ -196,4 +214,6 @@ static inline void set_string(char** strings, int n, char* str) { strings[n] = str; } +static inline gchar** next_gcharptr(gchar** s) { return (s+1); } + #endif diff --git a/vendor/github.com/gotk3/gotk3/glib/gmain_context.go b/vendor/github.com/gotk3/gotk3/glib/gmain_context.go new file mode 100644 index 0000000..da0a097 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gmain_context.go @@ -0,0 +1,32 @@ +package glib + +// #cgo pkg-config: glib-2.0 gobject-2.0 gio-2.0 +// #include +// #include +// #include +// #include "glib.go.h" +import "C" + +type MainContext C.GMainContext + +// native returns a pointer to the underlying GMainContext. +func (v *MainContext) native() *C.GMainContext { + if v == nil { + return nil + } + return (*C.GMainContext)(v) +} + +// MainContextDefault is a wrapper around g_main_context_default(). +func MainContextDefault() *MainContext { + c := C.g_main_context_default() + if c == nil { + return nil + } + return (*MainContext)(c) +} + +// MainDepth is a wrapper around g_main_depth(). +func MainDepth() int { + return int(C.g_main_depth()) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gsource.go b/vendor/github.com/gotk3/gotk3/glib/gsource.go new file mode 100644 index 0000000..427c946 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gsource.go @@ -0,0 +1,27 @@ +package glib + +// #cgo pkg-config: glib-2.0 gobject-2.0 gio-2.0 +// #include +// #include +// #include +// #include "glib.go.h" +import "C" + +type Source C.GSource + +// native returns a pointer to the underlying GSource. +func (v *Source) native() *C.GSource { + if v == nil { + return nil + } + return (*C.GSource)(v) +} + +// MainCurrentSource is a wrapper around g_main_current_source(). +func MainCurrentSource() *Source { + c := C.g_main_current_source() + if c == nil { + return nil + } + return (*Source)(c) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/settings.go b/vendor/github.com/gotk3/gotk3/glib/settings.go new file mode 100644 index 0000000..8cc68ee --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings.go @@ -0,0 +1,277 @@ +package glib + +// #cgo pkg-config: glib-2.0 gobject-2.0 +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// Settings is a representation of GSettings. +type Settings struct { + *Object +} + +// native() returns a pointer to the underlying GSettings. +func (v *Settings) native() *C.GSettings { + if v == nil || v.GObject == nil { + return nil + } + return C.toGSettings(unsafe.Pointer(v.GObject)) +} + +func (v *Settings) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalSettings(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapSettings(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapSettings(obj *Object) *Settings { + return &Settings{obj} +} + +func wrapFullSettings(obj *C.GSettings) *Settings { + if obj == nil { + return nil + } + return wrapSettings(wrapObject(unsafe.Pointer(obj))) +} + +// SettingsNew is a wrapper around g_settings_new(). +func SettingsNew(schemaID string) *Settings { + cstr := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr)) + + return wrapFullSettings(C.g_settings_new(cstr)) +} + +// SettingsNewWithPath is a wrapper around g_settings_new_with_path(). +func SettingsNewWithPath(schemaID, path string) *Settings { + cstr1 := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr2)) + + return wrapFullSettings(C.g_settings_new_with_path(cstr1, cstr2)) +} + +// SettingsNewWithBackend is a wrapper around g_settings_new_with_backend(). +func SettingsNewWithBackend(schemaID string, backend *SettingsBackend) *Settings { + cstr1 := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr1)) + + return wrapFullSettings(C.g_settings_new_with_backend(cstr1, backend.native())) +} + +// SettingsNewWithBackendAndPath is a wrapper around g_settings_new_with_backend_and_path(). +func SettingsNewWithBackendAndPath(schemaID string, backend *SettingsBackend, path string) *Settings { + cstr1 := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr2)) + + return wrapFullSettings(C.g_settings_new_with_backend_and_path(cstr1, backend.native(), cstr2)) +} + +// SettingsNewFull is a wrapper around g_settings_new_full(). +func SettingsNewFull(schema *SettingsSchema, backend *SettingsBackend, path string) *Settings { + cstr1 := (*C.gchar)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr1)) + + return wrapFullSettings(C.g_settings_new_full(schema.native(), backend.native(), cstr1)) +} + +// SettingsSync is a wrapper around g_settings_sync(). +func SettingsSync() { + C.g_settings_sync() +} + +// IsWritable is a wrapper around g_settings_is_writable(). +func (v *Settings) IsWritable(name string) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_is_writable(v.native(), cstr1)) +} + +// Delay is a wrapper around g_settings_delay(). +func (v *Settings) Delay() { + C.g_settings_delay(v.native()) +} + +// Apply is a wrapper around g_settings_apply(). +func (v *Settings) Apply() { + C.g_settings_apply(v.native()) +} + +// Revert is a wrapper around g_settings_revert(). +func (v *Settings) Revert() { + C.g_settings_revert(v.native()) +} + +// GetHasUnapplied is a wrapper around g_settings_get_has_unapplied(). +func (v *Settings) GetHasUnapplied() bool { + return gobool(C.g_settings_get_has_unapplied(v.native())) +} + +// GetChild is a wrapper around g_settings_get_child(). +func (v *Settings) GetChild(name string) *Settings { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return wrapFullSettings(C.g_settings_get_child(v.native(), cstr1)) +} + +// Reset is a wrapper around g_settings_reset(). +func (v *Settings) Reset(name string) { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_settings_reset(v.native(), cstr1) +} + +// ListChildren is a wrapper around g_settings_list_children(). +func (v *Settings) ListChildren() []string { + return toGoStringArray(C.g_settings_list_children(v.native())) +} + +// GetBoolean is a wrapper around g_settings_get_boolean(). +func (v *Settings) GetBoolean(name string) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_get_boolean(v.native(), cstr1)) +} + +// SetBoolean is a wrapper around g_settings_set_boolean(). +func (v *Settings) SetBoolean(name string, value bool) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_boolean(v.native(), cstr1, gbool(value))) +} + +// GetInt is a wrapper around g_settings_get_int(). +func (v *Settings) GetInt(name string) int { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return int(C.g_settings_get_int(v.native(), cstr1)) +} + +// SetInt is a wrapper around g_settings_set_int(). +func (v *Settings) SetInt(name string, value int) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_int(v.native(), cstr1, C.gint(value))) +} + +// GetUInt is a wrapper around g_settings_get_uint(). +func (v *Settings) GetUInt(name string) uint { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return uint(C.g_settings_get_uint(v.native(), cstr1)) +} + +// SetUInt is a wrapper around g_settings_set_uint(). +func (v *Settings) SetUInt(name string, value uint) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_uint(v.native(), cstr1, C.guint(value))) +} + +// GetDouble is a wrapper around g_settings_get_double(). +func (v *Settings) GetDouble(name string) float64 { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return float64(C.g_settings_get_double(v.native(), cstr1)) +} + +// SetDouble is a wrapper around g_settings_set_double(). +func (v *Settings) SetDouble(name string, value float64) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_double(v.native(), cstr1, C.gdouble(value))) +} + +// GetString is a wrapper around g_settings_get_string(). +func (v *Settings) GetString(name string) string { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return C.GoString((*C.char)(C.g_settings_get_string(v.native(), cstr1))) +} + +// SetString is a wrapper around g_settings_set_string(). +func (v *Settings) SetString(name string, value string) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(value)) + defer C.free(unsafe.Pointer(cstr2)) + + return gobool(C.g_settings_set_string(v.native(), cstr1, cstr2)) +} + +// GetEnum is a wrapper around g_settings_get_enum(). +func (v *Settings) GetEnum(name string) int { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return int(C.g_settings_get_enum(v.native(), cstr1)) +} + +// SetEnum is a wrapper around g_settings_set_enum(). +func (v *Settings) SetEnum(name string, value int) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_enum(v.native(), cstr1, C.gint(value))) +} + +// GetFlags is a wrapper around g_settings_get_flags(). +func (v *Settings) GetFlags(name string) uint { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return uint(C.g_settings_get_flags(v.native(), cstr1)) +} + +// SetFlags is a wrapper around g_settings_set_flags(). +func (v *Settings) SetFlags(name string, value uint) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_flags(v.native(), cstr1, C.guint(value))) +} + +// GVariant * g_settings_get_value () +// gboolean g_settings_set_value () +// GVariant * g_settings_get_user_value () +// GVariant * g_settings_get_default_value () +// const gchar * const * g_settings_list_schemas () +// const gchar * const * g_settings_list_relocatable_schemas () +// gchar ** g_settings_list_keys () +// GVariant * g_settings_get_range () +// gboolean g_settings_range_check () +// void g_settings_get () +// gboolean g_settings_set () +// gpointer g_settings_get_mapped () +// void g_settings_bind () +// void g_settings_bind_with_mapping () +// void g_settings_bind_writable () +// void g_settings_unbind () +// gaction * g_settings_create_action () +// gchar ** g_settings_get_strv () +// gboolean g_settings_set_strv () diff --git a/vendor/github.com/gotk3/gotk3/glib/settings_backend.go b/vendor/github.com/gotk3/gotk3/glib/settings_backend.go new file mode 100644 index 0000000..d988f3e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings_backend.go @@ -0,0 +1,71 @@ +package glib + +// #cgo pkg-config: glib-2.0 gobject-2.0 +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// SettingsBackend is a representation of GSettingsBackend. +type SettingsBackend struct { + *Object +} + +// native() returns a pointer to the underlying GSettingsBackend. +func (v *SettingsBackend) native() *C.GSettingsBackend { + if v == nil || v.GObject == nil { + return nil + } + return C.toGSettingsBackend(unsafe.Pointer(v.GObject)) +} + +func (v *SettingsBackend) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalSettingsBackend(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapSettingsBackend(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapSettingsBackend(obj *Object) *SettingsBackend { + return &SettingsBackend{obj} +} + +// SettingsBackendGetDefault is a wrapper around g_settings_backend_get_default(). +func SettingsBackendGetDefault() *SettingsBackend { + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_settings_backend_get_default()))) +} + +// KeyfileSettingsBackendNew is a wrapper around g_keyfile_settings_backend_new(). +func KeyfileSettingsBackendNew(filename, rootPath, rootGroup string) *SettingsBackend { + cstr1 := (*C.gchar)(C.CString(filename)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(rootPath)) + defer C.free(unsafe.Pointer(cstr2)) + + cstr3 := (*C.gchar)(C.CString(rootGroup)) + defer C.free(unsafe.Pointer(cstr3)) + + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_keyfile_settings_backend_new(cstr1, cstr2, cstr3)))) +} + +// MemorySettingsBackendNew is a wrapper around g_memory_settings_backend_new(). +func MemorySettingsBackendNew() *SettingsBackend { + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_memory_settings_backend_new()))) +} + +// NullSettingsBackendNew is a wrapper around g_null_settings_backend_new(). +func NullSettingsBackendNew() *SettingsBackend { + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_null_settings_backend_new()))) +} + +// void g_settings_backend_changed () +// void g_settings_backend_path_changed () +// void g_settings_backend_keys_changed () +// void g_settings_backend_path_writable_changed () +// void g_settings_backend_writable_changed () +// void g_settings_backend_changed_tree () +// void g_settings_backend_flatten_tree () diff --git a/vendor/github.com/gotk3/gotk3/glib/settings_schema.go b/vendor/github.com/gotk3/gotk3/glib/settings_schema.go new file mode 100644 index 0000000..dfb17b0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings_schema.go @@ -0,0 +1,96 @@ +package glib + +// #cgo pkg-config: glib-2.0 gobject-2.0 +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// SettingsSchema is a representation of GSettingsSchema. +type SettingsSchema struct { + schema *C.GSettingsSchema +} + +func wrapSettingsSchema(obj *C.GSettingsSchema) *SettingsSchema { + if obj == nil { + return nil + } + return &SettingsSchema{obj} +} + +func (v *SettingsSchema) Native() uintptr { + return uintptr(unsafe.Pointer(v.schema)) +} + +func (v *SettingsSchema) native() *C.GSettingsSchema { + if v == nil || v.schema == nil { + return nil + } + return v.schema +} + +// Ref() is a wrapper around g_settings_schema_ref(). +func (v *SettingsSchema) Ref() *SettingsSchema { + return wrapSettingsSchema(C.g_settings_schema_ref(v.native())) +} + +// Unref() is a wrapper around g_settings_schema_unref(). +func (v *SettingsSchema) Unref() { + C.g_settings_schema_unref(v.native()) +} + +// GetID() is a wrapper around g_settings_schema_get_id(). +func (v *SettingsSchema) GetID() string { + return C.GoString((*C.char)(C.g_settings_schema_get_id(v.native()))) +} + +// GetPath() is a wrapper around g_settings_schema_get_path(). +func (v *SettingsSchema) GetPath() string { + return C.GoString((*C.char)(C.g_settings_schema_get_path(v.native()))) +} + +// HasKey() is a wrapper around g_settings_schema_has_key(). +func (v *SettingsSchema) HasKey(v1 string) bool { + cstr := (*C.gchar)(C.CString(v1)) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.g_settings_schema_has_key(v.native(), cstr)) +} + +func toGoStringArray(c **C.gchar) []string { + var strs []string + originalc := c + defer C.g_strfreev(originalc) + + for *c != nil { + strs = append(strs, C.GoString((*C.char)(*c))) + c = C.next_gcharptr(c) + } + + return strs + +} + +// // ListChildren() is a wrapper around g_settings_schema_list_children(). +// func (v *SettingsSchema) ListChildren() []string { +// return toGoStringArray(C.g_settings_schema_list_children(v.native())) +// } + +// // ListKeys() is a wrapper around g_settings_schema_list_keys(). +// func (v *SettingsSchema) ListKeys() []string { +// return toGoStringArray(C.g_settings_schema_list_keys(v.native())) +// } + +// const GVariantType * g_settings_schema_key_get_value_type () +// GVariant * g_settings_schema_key_get_default_value () +// GVariant * g_settings_schema_key_get_range () +// gboolean g_settings_schema_key_range_check () +// const gchar * g_settings_schema_key_get_name () +// const gchar * g_settings_schema_key_get_summary () +// const gchar * g_settings_schema_key_get_description () + +// GSettingsSchemaKey * g_settings_schema_get_key () +// GSettingsSchemaKey * g_settings_schema_key_ref () +// void g_settings_schema_key_unref () diff --git a/vendor/github.com/gotk3/gotk3/glib/settings_schema_source.go b/vendor/github.com/gotk3/gotk3/glib/settings_schema_source.go new file mode 100644 index 0000000..43286a1 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings_schema_source.go @@ -0,0 +1,70 @@ +package glib + +// #cgo pkg-config: glib-2.0 gobject-2.0 +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// SettingsSchemaSource is a representation of GSettingsSchemaSource. +type SettingsSchemaSource struct { + source *C.GSettingsSchemaSource +} + +func wrapSettingsSchemaSource(obj *C.GSettingsSchemaSource) *SettingsSchemaSource { + if obj == nil { + return nil + } + return &SettingsSchemaSource{obj} +} + +func (v *SettingsSchemaSource) Native() uintptr { + return uintptr(unsafe.Pointer(v.source)) +} + +func (v *SettingsSchemaSource) native() *C.GSettingsSchemaSource { + if v == nil || v.source == nil { + return nil + } + return v.source +} + +// SettingsSchemaSourceGetDefault is a wrapper around g_settings_schema_source_get_default(). +func SettingsSchemaSourceGetDefault() *SettingsSchemaSource { + return wrapSettingsSchemaSource(C.g_settings_schema_source_get_default()) +} + +// Ref() is a wrapper around g_settings_schema_source_ref(). +func (v *SettingsSchemaSource) Ref() *SettingsSchemaSource { + return wrapSettingsSchemaSource(C.g_settings_schema_source_ref(v.native())) +} + +// Unref() is a wrapper around g_settings_schema_source_unref(). +func (v *SettingsSchemaSource) Unref() { + C.g_settings_schema_source_unref(v.native()) +} + +// SettingsSchemaSourceNewFromDirectory() is a wrapper around g_settings_schema_source_new_from_directory(). +func SettingsSchemaSourceNewFromDirectory(dir string, parent *SettingsSchemaSource, trusted bool) *SettingsSchemaSource { + cstr := (*C.gchar)(C.CString(dir)) + defer C.free(unsafe.Pointer(cstr)) + + return wrapSettingsSchemaSource(C.g_settings_schema_source_new_from_directory(cstr, parent.native(), gbool(trusted), nil)) +} + +// Lookup() is a wrapper around g_settings_schema_source_lookup(). +func (v *SettingsSchemaSource) Lookup(schema string, recursive bool) *SettingsSchema { + cstr := (*C.gchar)(C.CString(schema)) + defer C.free(unsafe.Pointer(cstr)) + + return wrapSettingsSchema(C.g_settings_schema_source_lookup(v.native(), cstr, gbool(recursive))) +} + +// ListSchemas is a wrapper around g_settings_schema_source_list_schemas(). +func (v *SettingsSchemaSource) ListSchemas(recursive bool) (nonReolcatable, relocatable []string) { + var nonRel, rel **C.gchar + C.g_settings_schema_source_list_schemas(v.native(), gbool(recursive), &nonRel, &rel) + return toGoStringArray(nonRel), toGoStringArray(rel) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk.go b/vendor/github.com/gotk3/gotk3/gtk/gtk.go index e36e00b..25fad10 100644 --- a/vendor/github.com/gotk3/gotk3/gtk/gtk.go +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk.go @@ -193,6 +193,7 @@ func init() { // Boxed {glib.Type(C.gtk_target_entry_get_type()), marshalTargetEntry}, {glib.Type(C.gtk_text_iter_get_type()), marshalTextIter}, + {glib.Type(C.gtk_text_mark_get_type()), marshalTextMark}, {glib.Type(C.gtk_tree_iter_get_type()), marshalTreeIter}, {glib.Type(C.gtk_tree_path_get_type()), marshalTreePath}, } @@ -5218,6 +5219,12 @@ func (v *MenuItem) SetLabel(label string) { C.gtk_menu_item_set_label(v.native(), (*C.gchar)(cstr)) } +// Gets text on the menu_item label +func (v *MenuItem) GetLabel() string { + l := C.gtk_menu_item_get_label(v.native()) + return C.GoString((*C.char)(l)) +} + /* * GtkMessageDialog */ @@ -7185,218 +7192,6 @@ func (v *TargetEntry) free() { C.gtk_target_entry_free(v.native()) } -/* - * GtkTextView - */ - -// TextView is a representation of GTK's GtkTextView -type TextView struct { - Container -} - -// native returns a pointer to the underlying GtkTextView. -func (v *TextView) native() *C.GtkTextView { - if v == nil || v.GObject == nil { - return nil - } - p := unsafe.Pointer(v.GObject) - return C.toGtkTextView(p) -} - -func marshalTextView(p uintptr) (interface{}, error) { - c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) - obj := wrapObject(unsafe.Pointer(c)) - return wrapTextView(obj), nil -} - -func wrapTextView(obj *glib.Object) *TextView { - return &TextView{Container{Widget{glib.InitiallyUnowned{obj}}}} -} - -// TextViewNew is a wrapper around gtk_text_view_new(). -func TextViewNew() (*TextView, error) { - c := C.gtk_text_view_new() - if c == nil { - return nil, nilPtrErr - } - return wrapTextView(wrapObject(unsafe.Pointer(c))), nil -} - -// TextViewNewWithBuffer is a wrapper around gtk_text_view_new_with_buffer(). -func TextViewNewWithBuffer(buf *TextBuffer) (*TextView, error) { - cbuf := buf.native() - c := C.gtk_text_view_new_with_buffer(cbuf) - return wrapTextView(wrapObject(unsafe.Pointer(c))), nil -} - -// GetBuffer is a wrapper around gtk_text_view_get_buffer(). -func (v *TextView) GetBuffer() (*TextBuffer, error) { - c := C.gtk_text_view_get_buffer(v.native()) - if c == nil { - return nil, nilPtrErr - } - return wrapTextBuffer(wrapObject(unsafe.Pointer(c))), nil -} - -// SetBuffer is a wrapper around gtk_text_view_set_buffer(). -func (v *TextView) SetBuffer(buffer *TextBuffer) { - C.gtk_text_view_set_buffer(v.native(), buffer.native()) -} - -// SetEditable is a wrapper around gtk_text_view_set_editable(). -func (v *TextView) SetEditable(editable bool) { - C.gtk_text_view_set_editable(v.native(), gbool(editable)) -} - -// GetEditable is a wrapper around gtk_text_view_get_editable(). -func (v *TextView) GetEditable() bool { - c := C.gtk_text_view_get_editable(v.native()) - return gobool(c) -} - -// SetWrapMode is a wrapper around gtk_text_view_set_wrap_mode(). -func (v *TextView) SetWrapMode(wrapMode WrapMode) { - C.gtk_text_view_set_wrap_mode(v.native(), C.GtkWrapMode(wrapMode)) -} - -// GetWrapMode is a wrapper around gtk_text_view_get_wrap_mode(). -func (v *TextView) GetWrapMode() WrapMode { - return WrapMode(C.gtk_text_view_get_wrap_mode(v.native())) -} - -// SetCursorVisible is a wrapper around gtk_text_view_set_cursor_visible(). -func (v *TextView) SetCursorVisible(visible bool) { - C.gtk_text_view_set_cursor_visible(v.native(), gbool(visible)) -} - -// GetCursorVisible is a wrapper around gtk_text_view_get_cursor_visible(). -func (v *TextView) GetCursorVisible() bool { - c := C.gtk_text_view_get_cursor_visible(v.native()) - return gobool(c) -} - -// SetOverwrite is a wrapper around gtk_text_view_set_overwrite(). -func (v *TextView) SetOverwrite(overwrite bool) { - C.gtk_text_view_set_overwrite(v.native(), gbool(overwrite)) -} - -// GetOverwrite is a wrapper around gtk_text_view_get_overwrite(). -func (v *TextView) GetOverwrite() bool { - c := C.gtk_text_view_get_overwrite(v.native()) - return gobool(c) -} - -// SetJustification is a wrapper around gtk_text_view_set_justification(). -func (v *TextView) SetJustification(justify Justification) { - C.gtk_text_view_set_justification(v.native(), C.GtkJustification(justify)) -} - -// GetJustification is a wrapper around gtk_text_view_get_justification(). -func (v *TextView) GetJustification() Justification { - c := C.gtk_text_view_get_justification(v.native()) - return Justification(c) -} - -// SetAcceptsTab is a wrapper around gtk_text_view_set_accepts_tab(). -func (v *TextView) SetAcceptsTab(acceptsTab bool) { - C.gtk_text_view_set_accepts_tab(v.native(), gbool(acceptsTab)) -} - -// GetAcceptsTab is a wrapper around gtk_text_view_get_accepts_tab(). -func (v *TextView) GetAcceptsTab() bool { - c := C.gtk_text_view_get_accepts_tab(v.native()) - return gobool(c) -} - -// SetPixelsAboveLines is a wrapper around gtk_text_view_set_pixels_above_lines(). -func (v *TextView) SetPixelsAboveLines(px int) { - C.gtk_text_view_set_pixels_above_lines(v.native(), C.gint(px)) -} - -// GetPixelsAboveLines is a wrapper around gtk_text_view_get_pixels_above_lines(). -func (v *TextView) GetPixelsAboveLines() int { - c := C.gtk_text_view_get_pixels_above_lines(v.native()) - return int(c) -} - -// SetPixelsBelowLines is a wrapper around gtk_text_view_set_pixels_below_lines(). -func (v *TextView) SetPixelsBelowLines(px int) { - C.gtk_text_view_set_pixels_below_lines(v.native(), C.gint(px)) -} - -// GetPixelsBelowLines is a wrapper around gtk_text_view_get_pixels_below_lines(). -func (v *TextView) GetPixelsBelowLines() int { - c := C.gtk_text_view_get_pixels_below_lines(v.native()) - return int(c) -} - -// SetPixelsInsideWrap is a wrapper around gtk_text_view_set_pixels_inside_wrap(). -func (v *TextView) SetPixelsInsideWrap(px int) { - C.gtk_text_view_set_pixels_inside_wrap(v.native(), C.gint(px)) -} - -// GetPixelsInsideWrap is a wrapper around gtk_text_view_get_pixels_inside_wrap(). -func (v *TextView) GetPixelsInsideWrap() int { - c := C.gtk_text_view_get_pixels_inside_wrap(v.native()) - return int(c) -} - -// SetLeftMargin is a wrapper around gtk_text_view_set_left_margin(). -func (v *TextView) SetLeftMargin(margin int) { - C.gtk_text_view_set_left_margin(v.native(), C.gint(margin)) -} - -// GetLeftMargin is a wrapper around gtk_text_view_get_left_margin(). -func (v *TextView) GetLeftMargin() int { - c := C.gtk_text_view_get_left_margin(v.native()) - return int(c) -} - -// SetRightMargin is a wrapper around gtk_text_view_set_right_margin(). -func (v *TextView) SetRightMargin(margin int) { - C.gtk_text_view_set_right_margin(v.native(), C.gint(margin)) -} - -// GetRightMargin is a wrapper around gtk_text_view_get_right_margin(). -func (v *TextView) GetRightMargin() int { - c := C.gtk_text_view_get_right_margin(v.native()) - return int(c) -} - -// SetIndent is a wrapper around gtk_text_view_set_indent(). -func (v *TextView) SetIndent(indent int) { - C.gtk_text_view_set_indent(v.native(), C.gint(indent)) -} - -// GetIndent is a wrapper around gtk_text_view_get_indent(). -func (v *TextView) GetIndent() int { - c := C.gtk_text_view_get_indent(v.native()) - return int(c) -} - -// SetInputHints is a wrapper around gtk_text_view_set_input_hints(). -func (v *TextView) SetInputHints(hints InputHints) { - C.gtk_text_view_set_input_hints(v.native(), C.GtkInputHints(hints)) -} - -// GetInputHints is a wrapper around gtk_text_view_get_input_hints(). -func (v *TextView) GetInputHints() InputHints { - c := C.gtk_text_view_get_input_hints(v.native()) - return InputHints(c) -} - -// SetInputPurpose is a wrapper around gtk_text_view_set_input_purpose(). -func (v *TextView) SetInputPurpose(purpose InputPurpose) { - C.gtk_text_view_set_input_purpose(v.native(), - C.GtkInputPurpose(purpose)) -} - -// GetInputPurpose is a wrapper around gtk_text_view_get_input_purpose(). -func (v *TextView) GetInputPurpose() InputPurpose { - c := C.gtk_text_view_get_input_purpose(v.native()) - return InputPurpose(c) -} - /* * GtkTextTag */ @@ -7663,16 +7458,19 @@ func (v *TextBuffer) SetText(text string) { C.gint(len(text))) } -/* - * GtkTextIter - */ - -// TextIter is a representation of GTK's GtkTextIter -type TextIter C.GtkTextIter +// GetIterAtMark() is a wrapper around gtk_text_buffer_get_iter_at_mark(). +func (v *TextBuffer) GetIterAtMark(mark *TextMark) *TextIter { + var iter C.GtkTextIter + C.gtk_text_buffer_get_iter_at_mark(v.native(), &iter, (*C.GtkTextMark)(mark)) + return (*TextIter)(&iter) +} -func marshalTextIter(p uintptr) (interface{}, error) { - c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) - return (*TextIter)(unsafe.Pointer(c)), nil +// CreateMark() is a wrapper around gtk_text_buffer_create_mark(). +func (v *TextBuffer) CreateMark(mark_name string, where *TextIter, left_gravity bool) *TextMark { + cstr := C.CString(mark_name) + defer C.free(unsafe.Pointer(cstr)) + ret := C.gtk_text_buffer_create_mark(v.native(), (*C.gchar)(cstr), (*C.GtkTextIter)(where), gbool(left_gravity)) + return (*TextMark)(ret) } /* @@ -8350,6 +8148,12 @@ func (v *TreeModel) IterPrevious(iter *TreeIter) bool { return gobool(c) } +// IterNthChild is a wrapper around gtk_tree_model_iter_nth_child(). +func (v *TreeModel) IterNthChild(iter *TreeIter, parent *TreeIter, n int) bool { + c := C.gtk_tree_model_iter_nth_child(v.native(), iter.native(), parent.native(), C.gint(n)) + return gobool(c) +} + // IterChildren is a wrapper around gtk_tree_model_iter_children(). func (v *TreeModel) IterChildren(iter, child *TreeIter) bool { var cIter, cChild *C.GtkTreeIter @@ -8498,7 +8302,7 @@ func (v *TreeSelection) GetSelectedRows(model ITreeModel) *glib.List { }) runtime.SetFinalizer(glist, func(glist *glib.List) { glist.FreeFull(func(item interface{}) { - path := item.(TreePath) + path := item.(*TreePath) C.gtk_tree_path_free(path.GtkTreePath) }) }) @@ -8766,6 +8570,7 @@ var WrapMap = map[string]WrapFn{ "GtkCheckButton": wrapCheckButton, "GtkCheckMenuItem": wrapCheckMenuItem, "GtkClipboard": wrapClipboard, + "GtkColorButton": wrapColorButton, "GtkContainer": wrapContainer, "GtkDialog": wrapDialog, "GtkDrawingArea": wrapDrawingArea, diff --git a/vendor/github.com/gotk3/gotk3/gtk/label.go b/vendor/github.com/gotk3/gotk3/gtk/label.go index 39ffb29..c89a7a7 100644 --- a/vendor/github.com/gotk3/gotk3/gtk/label.go +++ b/vendor/github.com/gotk3/gotk3/gtk/label.go @@ -255,3 +255,12 @@ func (v *Label) SetLabel(str string) { defer C.free(unsafe.Pointer(cstr)) C.gtk_label_set_label(v.native(), (*C.gchar)(cstr)) } + +// GetLabel is a wrapper around gtk_label_get_label(). +func (v *Label) GetLabel() string { + c := C.gtk_label_get_label(v.native()) + if c == nil { + return "" + } + return C.GoString((*C.char)(c)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_iter.go b/vendor/github.com/gotk3/gotk3/gtk/text_iter.go new file mode 100644 index 0000000..3ebabf3 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_iter.go @@ -0,0 +1,404 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" + +import "unsafe" + +/* + * GtkTextIter + */ + +// TextIter is a representation of GTK's GtkTextIter +type TextIter C.GtkTextIter + +// native returns a pointer to the underlying GtkTextIter. +func (v *TextIter) native() *C.GtkTextIter { + if v == nil { + return nil + } + return (*C.GtkTextIter)(v) +} + +func marshalTextIter(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return (*TextIter)(unsafe.Pointer(c)), nil +} + +// GetBuffer is a wrapper around gtk_text_iter_get_buffer(). +func (v *TextIter) GetBuffer() *TextBuffer { + c := C.gtk_text_iter_get_buffer(v.native()) + if c == nil { + return nil + } + return wrapTextBuffer(wrapObject(unsafe.Pointer(c))) +} + +// GetOffset is a wrapper around gtk_text_iter_get_offset(). +func (v *TextIter) GetOffset() int { + return int(C.gtk_text_iter_get_offset(v.native())) +} + +// GetLine is a wrapper around gtk_text_iter_get_line(). +func (v *TextIter) GetLine() int { + return int(C.gtk_text_iter_get_line(v.native())) +} + +// GetLineOffset is a wrapper around gtk_text_iter_get_line_offset(). +func (v *TextIter) GetLineOffset() int { + return int(C.gtk_text_iter_get_line_offset(v.native())) +} + +// GetLineIndex is a wrapper around gtk_text_iter_get_line_index(). +func (v *TextIter) GetLineIndex() int { + return int(C.gtk_text_iter_get_line_index(v.native())) +} + +// GetVisibleLineOffset is a wrapper around gtk_text_iter_get_visible_line_offset(). +func (v *TextIter) GetVisibleLineOffset() int { + return int(C.gtk_text_iter_get_visible_line_offset(v.native())) +} + +// GetVisibleLineIndex is a wrapper around gtk_text_iter_get_visible_line_index(). +func (v *TextIter) GetVisibleLineIndex() int { + return int(C.gtk_text_iter_get_visible_line_index(v.native())) +} + +// GetChar is a wrapper around gtk_text_iter_get_char(). +func (v *TextIter) GetChar() rune { + return rune(C.gtk_text_iter_get_char(v.native())) +} + +// GetSlice is a wrapper around gtk_text_iter_get_slice(). +func (v *TextIter) GetSlice(end *TextIter) string { + c := C.gtk_text_iter_get_slice(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// GetText is a wrapper around gtk_text_iter_get_text(). +func (v *TextIter) GetText(end *TextIter) string { + c := C.gtk_text_iter_get_text(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// GetVisibleSlice is a wrapper around gtk_text_iter_get_visible_slice(). +func (v *TextIter) GetVisibleSlice(end *TextIter) string { + c := C.gtk_text_iter_get_visible_slice(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// GetVisibleText is a wrapper around gtk_text_iter_get_visible_text(). +func (v *TextIter) GetVisibleText(end *TextIter) string { + c := C.gtk_text_iter_get_visible_text(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// BeginsTag is a wrapper around gtk_text_iter_begins_tag(). +func (v *TextIter) BeginsTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_begins_tag(v.native(), v1.native())) +} + +// EndsTag is a wrapper around gtk_text_iter_ends_tag(). +func (v *TextIter) EndsTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_ends_tag(v.native(), v1.native())) +} + +// TogglesTag is a wrapper around gtk_text_iter_toggles_tag(). +func (v *TextIter) TogglesTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_toggles_tag(v.native(), v1.native())) +} + +// HasTag is a wrapper around gtk_text_iter_has_tag(). +func (v *TextIter) HasTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_has_tag(v.native(), v1.native())) +} + +// Editable is a wrapper around gtk_text_iter_editable(). +func (v *TextIter) Editable(v1 bool) bool { + return gobool(C.gtk_text_iter_editable(v.native(), gbool(v1))) +} + +// CanInsert is a wrapper around gtk_text_iter_can_insert(). +func (v *TextIter) CanInsert(v1 bool) bool { + return gobool(C.gtk_text_iter_can_insert(v.native(), gbool(v1))) +} + +// StartsWord is a wrapper around gtk_text_iter_starts_word(). +func (v *TextIter) StartsWord() bool { + return gobool(C.gtk_text_iter_starts_word(v.native())) +} + +// EndsWord is a wrapper around gtk_text_iter_ends_word(). +func (v *TextIter) EndsWord() bool { + return gobool(C.gtk_text_iter_ends_word(v.native())) +} + +// InsideWord is a wrapper around gtk_text_iter_inside_word(). +func (v *TextIter) InsideWord() bool { + return gobool(C.gtk_text_iter_inside_word(v.native())) +} + +// StartsLine is a wrapper around gtk_text_iter_starts_line(). +func (v *TextIter) StartsLine() bool { + return gobool(C.gtk_text_iter_starts_line(v.native())) +} + +// EndsLine is a wrapper around gtk_text_iter_ends_line(). +func (v *TextIter) EndsLine() bool { + return gobool(C.gtk_text_iter_ends_line(v.native())) +} + +// StartsSentence is a wrapper around gtk_text_iter_starts_sentence(). +func (v *TextIter) StartsSentence() bool { + return gobool(C.gtk_text_iter_starts_sentence(v.native())) +} + +// EndsSentence is a wrapper around gtk_text_iter_ends_sentence(). +func (v *TextIter) EndsSentence() bool { + return gobool(C.gtk_text_iter_ends_sentence(v.native())) +} + +// InsideSentence is a wrapper around gtk_text_iter_inside_sentence(). +func (v *TextIter) InsideSentence() bool { + return gobool(C.gtk_text_iter_inside_sentence(v.native())) +} + +// IsCursorPosition is a wrapper around gtk_text_iter_is_cursor_position(). +func (v *TextIter) IsCursorPosition() bool { + return gobool(C.gtk_text_iter_is_cursor_position(v.native())) +} + +// GetCharsInLine is a wrapper around gtk_text_iter_get_chars_in_line(). +func (v *TextIter) GetCharsInLine() int { + return int(C.gtk_text_iter_get_chars_in_line(v.native())) +} + +// GetBytesInLine is a wrapper around gtk_text_iter_get_bytes_in_line(). +func (v *TextIter) GetBytesInLine() int { + return int(C.gtk_text_iter_get_bytes_in_line(v.native())) +} + +// IsEnd is a wrapper around gtk_text_iter_is_end(). +func (v *TextIter) IsEnd() bool { + return gobool(C.gtk_text_iter_is_end(v.native())) +} + +// IsStart is a wrapper around gtk_text_iter_is_start(). +func (v *TextIter) IsStart() bool { + return gobool(C.gtk_text_iter_is_start(v.native())) +} + +// ForwardChar is a wrapper around gtk_text_iter_forward_char(). +func (v *TextIter) ForwardChar() bool { + return gobool(C.gtk_text_iter_forward_char(v.native())) +} + +// BackwardChar is a wrapper around gtk_text_iter_backward_char(). +func (v *TextIter) BackwardChar() bool { + return gobool(C.gtk_text_iter_backward_char(v.native())) +} + +// ForwardChars is a wrapper around gtk_text_iter_forward_chars(). +func (v *TextIter) ForwardChars(v1 int) bool { + return gobool(C.gtk_text_iter_forward_chars(v.native(), C.gint(v1))) +} + +// BackwardChars is a wrapper around gtk_text_iter_backward_chars(). +func (v *TextIter) BackwardChars(v1 int) bool { + return gobool(C.gtk_text_iter_backward_chars(v.native(), C.gint(v1))) +} + +// ForwardLine is a wrapper around gtk_text_iter_forward_line(). +func (v *TextIter) ForwardLine() bool { + return gobool(C.gtk_text_iter_forward_line(v.native())) +} + +// BackwardLine is a wrapper around gtk_text_iter_backward_line(). +func (v *TextIter) BackwardLine() bool { + return gobool(C.gtk_text_iter_backward_line(v.native())) +} + +// ForwardLines is a wrapper around gtk_text_iter_forward_lines(). +func (v *TextIter) ForwardLines(v1 int) bool { + return gobool(C.gtk_text_iter_forward_lines(v.native(), C.gint(v1))) +} + +// BackwardLines is a wrapper around gtk_text_iter_backward_lines(). +func (v *TextIter) BackwardLines(v1 int) bool { + return gobool(C.gtk_text_iter_backward_lines(v.native(), C.gint(v1))) +} + +// ForwardWordEnds is a wrapper around gtk_text_iter_forward_word_ends(). +func (v *TextIter) ForwardWordEnds(v1 int) bool { + return gobool(C.gtk_text_iter_forward_word_ends(v.native(), C.gint(v1))) +} + +// ForwardWordEnd is a wrapper around gtk_text_iter_forward_word_end(). +func (v *TextIter) ForwardWordEnd() bool { + return gobool(C.gtk_text_iter_forward_word_end(v.native())) +} + +// ForwardCursorPosition is a wrapper around gtk_text_iter_forward_cursor_position(). +func (v *TextIter) ForwardCursorPosition() bool { + return gobool(C.gtk_text_iter_forward_cursor_position(v.native())) +} + +// BackwardCursorPosition is a wrapper around gtk_text_iter_backward_cursor_position(). +func (v *TextIter) BackwardCursorPosition() bool { + return gobool(C.gtk_text_iter_backward_cursor_position(v.native())) +} + +// ForwardCursorPositions is a wrapper around gtk_text_iter_forward_cursor_positions(). +func (v *TextIter) ForwardCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_forward_cursor_positions(v.native(), C.gint(v1))) +} + +// BackwardCursorPositions is a wrapper around gtk_text_iter_backward_cursor_positions(). +func (v *TextIter) BackwardCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_backward_cursor_positions(v.native(), C.gint(v1))) +} + +// ForwardSentenceEnds is a wrapper around gtk_text_iter_forward_sentence_ends(). +func (v *TextIter) ForwardSentenceEnds(v1 int) bool { + return gobool(C.gtk_text_iter_forward_sentence_ends(v.native(), C.gint(v1))) +} + +// ForwardSentenceEnd is a wrapper around gtk_text_iter_forward_sentence_end(). +func (v *TextIter) ForwardSentenceEnd() bool { + return gobool(C.gtk_text_iter_forward_sentence_end(v.native())) +} + +// ForwardVisibleWordEnds is a wrapper around gtk_text_iter_forward_word_ends(). +func (v *TextIter) ForwardVisibleWordEnds(v1 int) bool { + return gobool(C.gtk_text_iter_forward_word_ends(v.native(), C.gint(v1))) +} + +// ForwardVisibleWordEnd is a wrapper around gtk_text_iter_forward_visible_word_end(). +func (v *TextIter) ForwardVisibleWordEnd() bool { + return gobool(C.gtk_text_iter_forward_visible_word_end(v.native())) +} + +// ForwardVisibleCursorPosition is a wrapper around gtk_text_iter_forward_visible_cursor_position(). +func (v *TextIter) ForwardVisibleCursorPosition() bool { + return gobool(C.gtk_text_iter_forward_visible_cursor_position(v.native())) +} + +// BackwardVisibleCursorPosition is a wrapper around gtk_text_iter_backward_visible_cursor_position(). +func (v *TextIter) BackwardVisibleCursorPosition() bool { + return gobool(C.gtk_text_iter_backward_visible_cursor_position(v.native())) +} + +// ForwardVisibleCursorPositions is a wrapper around gtk_text_iter_forward_visible_cursor_positions(). +func (v *TextIter) ForwardVisibleCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_forward_visible_cursor_positions(v.native(), C.gint(v1))) +} + +// BackwardVisibleCursorPositions is a wrapper around gtk_text_iter_backward_visible_cursor_positions(). +func (v *TextIter) BackwardVisibleCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_backward_visible_cursor_positions(v.native(), C.gint(v1))) +} + +// ForwardVisibleLine is a wrapper around gtk_text_iter_forward_visible_line(). +func (v *TextIter) ForwardVisibleLine() bool { + return gobool(C.gtk_text_iter_forward_visible_line(v.native())) +} + +// BackwardVisibleLine is a wrapper around gtk_text_iter_backward_visible_line(). +func (v *TextIter) BackwardVisibleLine() bool { + return gobool(C.gtk_text_iter_backward_visible_line(v.native())) +} + +// ForwardVisibleLines is a wrapper around gtk_text_iter_forward_visible_lines(). +func (v *TextIter) ForwardVisibleLines(v1 int) bool { + return gobool(C.gtk_text_iter_forward_visible_lines(v.native(), C.gint(v1))) +} + +// BackwardVisibleLines is a wrapper around gtk_text_iter_backward_visible_lines(). +func (v *TextIter) BackwardVisibleLines(v1 int) bool { + return gobool(C.gtk_text_iter_backward_visible_lines(v.native(), C.gint(v1))) +} + +// SetOffset is a wrapper around gtk_text_iter_set_offset(). +func (v *TextIter) SetOffset(v1 int) { + C.gtk_text_iter_set_offset(v.native(), C.gint(v1)) +} + +// SetLine is a wrapper around gtk_text_iter_set_line(). +func (v *TextIter) SetLine(v1 int) { + C.gtk_text_iter_set_line(v.native(), C.gint(v1)) +} + +// SetLineOffset is a wrapper around gtk_text_iter_set_line_offset(). +func (v *TextIter) SetLineOffset(v1 int) { + C.gtk_text_iter_set_line_offset(v.native(), C.gint(v1)) +} + +// SetLineIndex is a wrapper around gtk_text_iter_set_line_index(). +func (v *TextIter) SetLineIndex(v1 int) { + C.gtk_text_iter_set_line_index(v.native(), C.gint(v1)) +} + +// SetVisibleLineOffset is a wrapper around gtk_text_iter_set_visible_line_offset(). +func (v *TextIter) SetVisibleLineOffset(v1 int) { + C.gtk_text_iter_set_visible_line_offset(v.native(), C.gint(v1)) +} + +// SetVisibleLineIndex is a wrapper around gtk_text_iter_set_visible_line_index(). +func (v *TextIter) SetVisibleLineIndex(v1 int) { + C.gtk_text_iter_set_visible_line_index(v.native(), C.gint(v1)) +} + +// ForwardToEnd is a wrapper around gtk_text_iter_forward_to_end(). +func (v *TextIter) ForwardToEnd() { + C.gtk_text_iter_forward_to_end(v.native()) +} + +// ForwardToLineEnd is a wrapper around gtk_text_iter_forward_to_line_end(). +func (v *TextIter) ForwardToLineEnd() bool { + return gobool(C.gtk_text_iter_forward_to_line_end(v.native())) +} + +// ForwardToTagToggle is a wrapper around gtk_text_iter_forward_to_tag_toggle(). +func (v *TextIter) ForwardToTagToggle(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_forward_to_tag_toggle(v.native(), v1.native())) +} + +// BackwardToTagToggle is a wrapper around gtk_text_iter_backward_to_tag_toggle(). +func (v *TextIter) BackwardToTagToggle(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_backward_to_tag_toggle(v.native(), v1.native())) +} + +// Equal is a wrapper around gtk_text_iter_equal(). +func (v *TextIter) Equal(v1 *TextIter) bool { + return gobool(C.gtk_text_iter_equal(v.native(), v1.native())) +} + +// Compare is a wrapper around gtk_text_iter_compare(). +func (v *TextIter) Compare(v1 *TextIter) int { + return int(C.gtk_text_iter_compare(v.native(), v1.native())) +} + +// InRange is a wrapper around gtk_text_iter_in_range(). +func (v *TextIter) InRange(v1 *TextIter, v2 *TextIter) bool { + return gobool(C.gtk_text_iter_in_range(v.native(), v1.native(), v2.native())) +} + +// void gtk_text_iter_order () +// gboolean (*GtkTextCharPredicate) () +// gboolean gtk_text_iter_forward_find_char () +// gboolean gtk_text_iter_backward_find_char () +// gboolean gtk_text_iter_forward_search () +// gboolean gtk_text_iter_backward_search () +// gboolean gtk_text_iter_get_attributes () +// GtkTextIter * gtk_text_iter_copy () +// void gtk_text_iter_assign () +// void gtk_text_iter_free () +// GdkPixbuf * gtk_text_iter_get_pixbuf () +// GSList * gtk_text_iter_get_marks () +// GSList * gtk_text_iter_get_toggled_tags () +// GtkTextChildAnchor * gtk_text_iter_get_child_anchor () +// GSList * gtk_text_iter_get_tags () +// PangoLanguage * gtk_text_iter_get_language () diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_mark.go b/vendor/github.com/gotk3/gotk3/gtk/text_mark.go new file mode 100644 index 0000000..1a41934 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_mark.go @@ -0,0 +1,29 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" + +import "unsafe" + +/* + * GtkTextMark + */ + +// TextMark is a representation of GTK's GtkTextMark +type TextMark C.GtkTextMark + +// native returns a pointer to the underlying GtkTextMark. +func (v *TextMark) native() *C.GtkTextMark { + if v == nil { + return nil + } + return (*C.GtkTextMark)(v) +} + +func marshalTextMark(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return (*TextMark)(unsafe.Pointer(c)), nil +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_view.go b/vendor/github.com/gotk3/gotk3/gtk/text_view.go new file mode 100644 index 0000000..75d2b9a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_view.go @@ -0,0 +1,420 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +// TextWindowType is a representation of GTK's GtkTextWindowType. +type TextWindowType int + +const ( + TEXT_WINDOW_WIDGET TextWindowType = C.GTK_TEXT_WINDOW_WIDGET + TEXT_WINDOW_TEXT TextWindowType = C.GTK_TEXT_WINDOW_TEXT + TEXT_WINDOW_LEFT TextWindowType = C.GTK_TEXT_WINDOW_LEFT + TEXT_WINDOW_RIGHT TextWindowType = C.GTK_TEXT_WINDOW_RIGHT + TEXT_WINDOW_TOP TextWindowType = C.GTK_TEXT_WINDOW_TOP + TEXT_WINDOW_BOTTOM TextWindowType = C.GTK_TEXT_WINDOW_BOTTOM +) + +/* + * GtkTextView + */ + +// TextView is a representation of GTK's GtkTextView +type TextView struct { + Container +} + +// native returns a pointer to the underlying GtkTextView. +func (v *TextView) native() *C.GtkTextView { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTextView(p) +} + +func marshalTextView(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := wrapObject(unsafe.Pointer(c)) + return wrapTextView(obj), nil +} + +func wrapTextView(obj *glib.Object) *TextView { + return &TextView{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// TextViewNew is a wrapper around gtk_text_view_new(). +func TextViewNew() (*TextView, error) { + c := C.gtk_text_view_new() + if c == nil { + return nil, nilPtrErr + } + return wrapTextView(wrapObject(unsafe.Pointer(c))), nil +} + +// TextViewNewWithBuffer is a wrapper around gtk_text_view_new_with_buffer(). +func TextViewNewWithBuffer(buf *TextBuffer) (*TextView, error) { + cbuf := buf.native() + c := C.gtk_text_view_new_with_buffer(cbuf) + return wrapTextView(wrapObject(unsafe.Pointer(c))), nil +} + +// GetBuffer is a wrapper around gtk_text_view_get_buffer(). +func (v *TextView) GetBuffer() (*TextBuffer, error) { + c := C.gtk_text_view_get_buffer(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapTextBuffer(wrapObject(unsafe.Pointer(c))), nil +} + +// SetBuffer is a wrapper around gtk_text_view_set_buffer(). +func (v *TextView) SetBuffer(buffer *TextBuffer) { + C.gtk_text_view_set_buffer(v.native(), buffer.native()) +} + +// SetEditable is a wrapper around gtk_text_view_set_editable(). +func (v *TextView) SetEditable(editable bool) { + C.gtk_text_view_set_editable(v.native(), gbool(editable)) +} + +// GetEditable is a wrapper around gtk_text_view_get_editable(). +func (v *TextView) GetEditable() bool { + c := C.gtk_text_view_get_editable(v.native()) + return gobool(c) +} + +// SetWrapMode is a wrapper around gtk_text_view_set_wrap_mode(). +func (v *TextView) SetWrapMode(wrapMode WrapMode) { + C.gtk_text_view_set_wrap_mode(v.native(), C.GtkWrapMode(wrapMode)) +} + +// GetWrapMode is a wrapper around gtk_text_view_get_wrap_mode(). +func (v *TextView) GetWrapMode() WrapMode { + return WrapMode(C.gtk_text_view_get_wrap_mode(v.native())) +} + +// SetCursorVisible is a wrapper around gtk_text_view_set_cursor_visible(). +func (v *TextView) SetCursorVisible(visible bool) { + C.gtk_text_view_set_cursor_visible(v.native(), gbool(visible)) +} + +// GetCursorVisible is a wrapper around gtk_text_view_get_cursor_visible(). +func (v *TextView) GetCursorVisible() bool { + c := C.gtk_text_view_get_cursor_visible(v.native()) + return gobool(c) +} + +// SetOverwrite is a wrapper around gtk_text_view_set_overwrite(). +func (v *TextView) SetOverwrite(overwrite bool) { + C.gtk_text_view_set_overwrite(v.native(), gbool(overwrite)) +} + +// GetOverwrite is a wrapper around gtk_text_view_get_overwrite(). +func (v *TextView) GetOverwrite() bool { + c := C.gtk_text_view_get_overwrite(v.native()) + return gobool(c) +} + +// SetJustification is a wrapper around gtk_text_view_set_justification(). +func (v *TextView) SetJustification(justify Justification) { + C.gtk_text_view_set_justification(v.native(), C.GtkJustification(justify)) +} + +// GetJustification is a wrapper around gtk_text_view_get_justification(). +func (v *TextView) GetJustification() Justification { + c := C.gtk_text_view_get_justification(v.native()) + return Justification(c) +} + +// SetAcceptsTab is a wrapper around gtk_text_view_set_accepts_tab(). +func (v *TextView) SetAcceptsTab(acceptsTab bool) { + C.gtk_text_view_set_accepts_tab(v.native(), gbool(acceptsTab)) +} + +// GetAcceptsTab is a wrapper around gtk_text_view_get_accepts_tab(). +func (v *TextView) GetAcceptsTab() bool { + c := C.gtk_text_view_get_accepts_tab(v.native()) + return gobool(c) +} + +// SetPixelsAboveLines is a wrapper around gtk_text_view_set_pixels_above_lines(). +func (v *TextView) SetPixelsAboveLines(px int) { + C.gtk_text_view_set_pixels_above_lines(v.native(), C.gint(px)) +} + +// GetPixelsAboveLines is a wrapper around gtk_text_view_get_pixels_above_lines(). +func (v *TextView) GetPixelsAboveLines() int { + c := C.gtk_text_view_get_pixels_above_lines(v.native()) + return int(c) +} + +// SetPixelsBelowLines is a wrapper around gtk_text_view_set_pixels_below_lines(). +func (v *TextView) SetPixelsBelowLines(px int) { + C.gtk_text_view_set_pixels_below_lines(v.native(), C.gint(px)) +} + +// GetPixelsBelowLines is a wrapper around gtk_text_view_get_pixels_below_lines(). +func (v *TextView) GetPixelsBelowLines() int { + c := C.gtk_text_view_get_pixels_below_lines(v.native()) + return int(c) +} + +// SetPixelsInsideWrap is a wrapper around gtk_text_view_set_pixels_inside_wrap(). +func (v *TextView) SetPixelsInsideWrap(px int) { + C.gtk_text_view_set_pixels_inside_wrap(v.native(), C.gint(px)) +} + +// GetPixelsInsideWrap is a wrapper around gtk_text_view_get_pixels_inside_wrap(). +func (v *TextView) GetPixelsInsideWrap() int { + c := C.gtk_text_view_get_pixels_inside_wrap(v.native()) + return int(c) +} + +// SetLeftMargin is a wrapper around gtk_text_view_set_left_margin(). +func (v *TextView) SetLeftMargin(margin int) { + C.gtk_text_view_set_left_margin(v.native(), C.gint(margin)) +} + +// GetLeftMargin is a wrapper around gtk_text_view_get_left_margin(). +func (v *TextView) GetLeftMargin() int { + c := C.gtk_text_view_get_left_margin(v.native()) + return int(c) +} + +// SetRightMargin is a wrapper around gtk_text_view_set_right_margin(). +func (v *TextView) SetRightMargin(margin int) { + C.gtk_text_view_set_right_margin(v.native(), C.gint(margin)) +} + +// GetRightMargin is a wrapper around gtk_text_view_get_right_margin(). +func (v *TextView) GetRightMargin() int { + c := C.gtk_text_view_get_right_margin(v.native()) + return int(c) +} + +// SetIndent is a wrapper around gtk_text_view_set_indent(). +func (v *TextView) SetIndent(indent int) { + C.gtk_text_view_set_indent(v.native(), C.gint(indent)) +} + +// GetIndent is a wrapper around gtk_text_view_get_indent(). +func (v *TextView) GetIndent() int { + c := C.gtk_text_view_get_indent(v.native()) + return int(c) +} + +// SetInputHints is a wrapper around gtk_text_view_set_input_hints(). +func (v *TextView) SetInputHints(hints InputHints) { + C.gtk_text_view_set_input_hints(v.native(), C.GtkInputHints(hints)) +} + +// GetInputHints is a wrapper around gtk_text_view_get_input_hints(). +func (v *TextView) GetInputHints() InputHints { + c := C.gtk_text_view_get_input_hints(v.native()) + return InputHints(c) +} + +// SetInputPurpose is a wrapper around gtk_text_view_set_input_purpose(). +func (v *TextView) SetInputPurpose(purpose InputPurpose) { + C.gtk_text_view_set_input_purpose(v.native(), + C.GtkInputPurpose(purpose)) +} + +// GetInputPurpose is a wrapper around gtk_text_view_get_input_purpose(). +func (v *TextView) GetInputPurpose() InputPurpose { + c := C.gtk_text_view_get_input_purpose(v.native()) + return InputPurpose(c) +} + +// ScrollToMark is a wrapper around gtk_text_view_scroll_to_mark(). +func (v *TextView) ScrollToMark(mark *TextMark, within_margin float64, use_align bool, xalign, yalign float64) { + C.gtk_text_view_scroll_to_mark(v.native(), mark.native(), C.gdouble(within_margin), gbool(use_align), C.gdouble(xalign), C.gdouble(yalign)) +} + +// ScrollToIter is a wrapper around gtk_text_view_scroll_to_iter(). +func (v *TextView) ScrollToIter(iter *TextIter, within_margin float64, use_align bool, xalign, yalign float64) bool { + return gobool(C.gtk_text_view_scroll_to_iter(v.native(), iter.native(), C.gdouble(within_margin), gbool(use_align), C.gdouble(xalign), C.gdouble(yalign))) +} + +// ScrollMarkOnscreen is a wrapper around gtk_text_view_scroll_mark_onscreen(). +func (v *TextView) ScrollMarkOnscreen(mark *TextMark) { + C.gtk_text_view_scroll_mark_onscreen(v.native(), mark.native()) +} + +// MoveMarkOnscreen is a wrapper around gtk_text_view_move_mark_onscreen(). +func (v *TextView) MoveMarkOnscreen(mark *TextMark) bool { + return gobool(C.gtk_text_view_move_mark_onscreen(v.native(), mark.native())) +} + +// PlaceCursorOnscreen is a wrapper around gtk_text_view_place_cursor_onscreen(). +func (v *TextView) PlaceCursorOnscreen() bool { + return gobool(C.gtk_text_view_place_cursor_onscreen(v.native())) +} + +// GetVisibleRect is a wrapper around gtk_text_view_get_visible_rect(). +func (v *TextView) GetVisibleRect() *gdk.Rectangle { + var rect C.GdkRectangle + C.gtk_text_view_get_visible_rect(v.native(), &rect) + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&rect))) +} + +// GetIterLocation is a wrapper around gtk_text_view_get_iter_location(). +func (v *TextView) GetIterLocation(iter *TextIter) *gdk.Rectangle { + var rect C.GdkRectangle + C.gtk_text_view_get_iter_location(v.native(), iter.native(), &rect) + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&rect))) +} + +// GetCursorLocations is a wrapper around gtk_text_view_get_cursor_locations(). +func (v *TextView) GetCursorLocations(iter *TextIter) (strong, weak *gdk.Rectangle) { + var strongRect, weakRect C.GdkRectangle + C.gtk_text_view_get_cursor_locations(v.native(), iter.native(), &strongRect, &weakRect) + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&strongRect))), gdk.WrapRectangle(uintptr(unsafe.Pointer(&weakRect))) +} + +// GetLineAtY is a wrapper around gtk_text_view_get_line_at_y(). +func (v *TextView) GetLineAtY(y int) (*TextIter, int) { + var iter TextIter + var line_top C.gint + iiter := (C.GtkTextIter)(iter) + C.gtk_text_view_get_line_at_y(v.native(), &iiter, C.gint(y), &line_top) + return &iter, int(line_top) +} + +// GetLineYrange is a wrapper around gtk_text_view_get_line_yrange(). +func (v *TextView) GetLineYrange(iter *TextIter) (y, height int) { + var yx, heightx C.gint + C.gtk_text_view_get_line_yrange(v.native(), iter.native(), &yx, &heightx) + return int(yx), int(heightx) +} + +// GetIterAtLocation is a wrapper around gtk_text_view_get_iter_at_location(). +func (v *TextView) GetIterAtLocation(x, y int) *TextIter { + var iter TextIter + iiter := (C.GtkTextIter)(iter) + C.gtk_text_view_get_iter_at_location(v.native(), &iiter, C.gint(x), C.gint(y)) + return &iter +} + +// GetIterAtPosition is a wrapper around gtk_text_view_get_iter_at_position(). +func (v *TextView) GetIterAtPosition(x, y int) (*TextIter, int) { + var iter TextIter + var trailing C.gint + iiter := (C.GtkTextIter)(iter) + C.gtk_text_view_get_iter_at_position(v.native(), &iiter, &trailing, C.gint(x), C.gint(y)) + return &iter, int(trailing) +} + +// BufferToWindowCoords is a wrapper around gtk_text_view_buffer_to_window_coords(). +func (v *TextView) BufferToWindowCoords(win TextWindowType, buffer_x, buffer_y int) (window_x, window_y int) { + var wx, wy C.gint + C.gtk_text_view_buffer_to_window_coords(v.native(), C.GtkTextWindowType(win), C.gint(buffer_x), C.gint(buffer_y), &wx, &wy) + return int(wx), int(wy) +} + +// WindowToBufferCoords is a wrapper around gtk_text_view_window_to_buffer_coords(). +func (v *TextView) WindowToBufferCoords(win TextWindowType, window_x, window_y int) (buffer_x, buffer_y int) { + var bx, by C.gint + C.gtk_text_view_window_to_buffer_coords(v.native(), C.GtkTextWindowType(win), C.gint(window_x), C.gint(window_y), &bx, &by) + return int(bx), int(by) +} + +// GetWindow is a wrapper around gtk_text_view_get_window(). +func (v *TextView) GetWindow(win TextWindowType) *gdk.Window { + c := C.gtk_text_view_get_window(v.native(), C.GtkTextWindowType(win)) + if c == nil { + return nil + } + return &gdk.Window{wrapObject(unsafe.Pointer(c))} +} + +// GetWindowType is a wrapper around gtk_text_view_get_window_type(). +func (v *TextView) GetWindowType(w *gdk.Window) TextWindowType { + return TextWindowType(C.gtk_text_view_get_window_type(v.native(), (*C.GdkWindow)(unsafe.Pointer(w.Native())))) +} + +// SetBorderWindowSize is a wrapper around gtk_text_view_set_border_window_size(). +func (v *TextView) SetBorderWindowSize(tp TextWindowType, size int) { + C.gtk_text_view_set_border_window_size(v.native(), C.GtkTextWindowType(tp), C.gint(size)) +} + +// GetBorderWindowSize is a wrapper around gtk_text_view_get_border_window_size(). +func (v *TextView) GetBorderWindowSize(tp TextWindowType) int { + return int(C.gtk_text_view_get_border_window_size(v.native(), C.GtkTextWindowType(tp))) +} + +// ForwardDisplayLine is a wrapper around gtk_text_view_forward_display_line(). +func (v *TextView) ForwardDisplayLine(iter *TextIter) bool { + return gobool(C.gtk_text_view_forward_display_line(v.native(), iter.native())) +} + +// BackwardDisplayLine is a wrapper around gtk_text_view_backward_display_line(). +func (v *TextView) BackwardDisplayLine(iter *TextIter) bool { + return gobool(C.gtk_text_view_backward_display_line(v.native(), iter.native())) +} + +// ForwardDisplayLineEnd is a wrapper around gtk_text_view_forward_display_line_end(). +func (v *TextView) ForwardDisplayLineEnd(iter *TextIter) bool { + return gobool(C.gtk_text_view_forward_display_line_end(v.native(), iter.native())) +} + +// BackwardDisplayLineStart is a wrapper around gtk_text_view_backward_display_line_start(). +func (v *TextView) BackwardDisplayLineStart(iter *TextIter) bool { + return gobool(C.gtk_text_view_backward_display_line_start(v.native(), iter.native())) +} + +// StartsDisplayLine is a wrapper around gtk_text_view_starts_display_line(). +func (v *TextView) StartsDisplayLine(iter *TextIter) bool { + return gobool(C.gtk_text_view_starts_display_line(v.native(), iter.native())) +} + +// MoveVisually is a wrapper around gtk_text_view_move_visually(). +func (v *TextView) MoveVisually(iter *TextIter, count int) bool { + return gobool(C.gtk_text_view_move_visually(v.native(), iter.native(), C.gint(count))) +} + +// AddChildInWindow is a wrapper around gtk_text_view_add_child_in_window(). +func (v *TextView) AddChildInWindow(child IWidget, tp TextWindowType, xpos, ypos int) { + C.gtk_text_view_add_child_in_window(v.native(), child.toWidget(), C.GtkTextWindowType(tp), C.gint(xpos), C.gint(ypos)) +} + +// MoveChild is a wrapper around gtk_text_view_move_child(). +func (v *TextView) MoveChild(child IWidget, xpos, ypos int) { + C.gtk_text_view_move_child(v.native(), child.toWidget(), C.gint(xpos), C.gint(ypos)) +} + +// ImContextFilterKeypress is a wrapper around gtk_text_view_im_context_filter_keypress(). +func (v *TextView) ImContextFilterKeypress(event *gdk.EventKey) bool { + return gobool(C.gtk_text_view_im_context_filter_keypress(v.native(), (*C.GdkEventKey)(unsafe.Pointer(event.Native())))) +} + +// ResetImContext is a wrapper around gtk_text_view_reset_im_context(). +func (v *TextView) ResetImContext() { + C.gtk_text_view_reset_im_context(v.native()) +} + +// GtkAdjustment * gtk_text_view_get_hadjustment () -- DEPRECATED +// GtkAdjustment * gtk_text_view_get_vadjustment () -- DEPRECATED +// void gtk_text_view_add_child_at_anchor () +// GtkTextChildAnchor * gtk_text_child_anchor_new () +// GList * gtk_text_child_anchor_get_widgets () +// gboolean gtk_text_child_anchor_get_deleted () +// void gtk_text_view_set_top_margin () -- SINCE 3.18 +// gint gtk_text_view_get_top_margin () -- SINCE 3.18 +// void gtk_text_view_set_bottom_margin () -- SINCE 3.18 +// gint gtk_text_view_get_bottom_margin () -- SINCE 3.18 +// void gtk_text_view_set_tabs () -- PangoTabArray +// PangoTabArray * gtk_text_view_get_tabs () -- PangoTabArray +// GtkTextAttributes * gtk_text_view_get_default_attributes () -- GtkTextAttributes +// void gtk_text_view_set_monospace () -- SINCE 3.16 +// gboolean gtk_text_view_get_monospace () -- SINCE 3.16 diff --git a/vendor/github.com/gotk3/gotk3/gtk/window.go b/vendor/github.com/gotk3/gotk3/gtk/window.go index 497796d..7b9a5f2 100644 --- a/vendor/github.com/gotk3/gotk3/gtk/window.go +++ b/vendor/github.com/gotk3/gotk3/gtk/window.go @@ -140,11 +140,10 @@ func (v *Window) SetGeometryHints() { } */ -// TODO(jrick) GdkGravity. -/* -func (v *Window) SetGravity() { +// SetGravity is a wrapper around gtk_window_set_gravity(). +func (v *Window) SetGravity(gravity gdk.GdkGravity) { + C.gtk_window_set_gravity(v.native(), C.GdkGravity(gravity)) } -*/ // TODO(jrick) GdkGravity. /* diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go b/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go index 5d33de5..d41e6da 100644 --- a/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go +++ b/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + package pango // #cgo pkg-config: pango diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-layout.go b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go index 66f993e..e25f2bd 100644 --- a/vendor/github.com/gotk3/gotk3/pango/pango-layout.go +++ b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + package pango // #cgo pkg-config: pango From 9259438ae58e86473c167362897935599b5069d6 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 18:35:29 +0000 Subject: [PATCH 25/28] update dependency go-logging --- Godeps/Godeps.json | 3 +- vendor/github.com/op/go-logging/CHANGELOG.md | 19 +++++ vendor/github.com/op/go-logging/README.md | 8 +- vendor/github.com/op/go-logging/format.go | 61 +++++++++++++-- vendor/github.com/op/go-logging/log_nix.go | 67 ++++++++++------ vendor/github.com/op/go-logging/logger.go | 80 +++++++++++--------- 6 files changed, 171 insertions(+), 67 deletions(-) create mode 100644 vendor/github.com/op/go-logging/CHANGELOG.md diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 8f3ebcf..463c6b9 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -43,7 +43,8 @@ }, { "ImportPath": "github.com/op/go-logging", - "Rev": "dfaf3dff9b631bc4236201d90d41ee0de9202889" + "Comment": "v1-7-g970db52", + "Rev": "970db520ece77730c7e4724c61121037378659d9" }, { "ImportPath": "github.com/subgraph/go-procsnitch", diff --git a/vendor/github.com/op/go-logging/CHANGELOG.md b/vendor/github.com/op/go-logging/CHANGELOG.md new file mode 100644 index 0000000..4b7d233 --- /dev/null +++ b/vendor/github.com/op/go-logging/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog + +## 2.0.0-rc1 (2016-02-11) + +Time flies and it has been three years since this package was first released. +There have been a couple of API changes I have wanted to do for some time but +I've tried to maintain backwards compatibility. Some inconsistencies in the +API have started to show, proper vendor support in Go out of the box and +the fact that `go vet` will give warnings -- I have decided to bump the major +version. + +* Make eg. `Info` and `Infof` do different things. You want to change all calls + to `Info` with a string format go to `Infof` etc. In many cases, `go vet` will + guide you. +* `Id` in `Record` is now called `ID` + +## 1.0.0 (2013-02-21) + +Initial release diff --git a/vendor/github.com/op/go-logging/README.md b/vendor/github.com/op/go-logging/README.md index 65177d1..0a7326b 100644 --- a/vendor/github.com/op/go-logging/README.md +++ b/vendor/github.com/op/go-logging/README.md @@ -7,6 +7,10 @@ is customizable and supports different logging backends like syslog, file and memory. Multiple backends can be utilized with different log levels per backend and logger. +**_NOTE:_** backwards compatibility promise have been dropped for master. Please +vendor this package or use `gopkg.in/op/go-logging.v1` for previous version. See +[changelog](CHANGELOG.md) for details. + ## Example Let's have a look at an [example](examples/example.go) which demonstrates most @@ -74,7 +78,7 @@ func main() { After this command *go-logging* is ready to use. Its source will be in: - $GOROOT/src/pkg/github.com/op/go-logging + $GOPATH/src/pkg/github.com/op/go-logging You can use `go get -u` to update the package. @@ -86,4 +90,4 @@ For docs, see http://godoc.org/github.com/op/go-logging or run: ## Additional resources -* [wslog](https://godoc.org/github.com/cryptix/go/logging/wslog) -- exposes log messages through a WebSocket. +* [wslog](https://godoc.org/github.com/cryptix/exp/wslog) -- exposes log messages through a WebSocket. diff --git a/vendor/github.com/op/go-logging/format.go b/vendor/github.com/op/go-logging/format.go index 0fb5a4f..7160674 100644 --- a/vendor/github.com/op/go-logging/format.go +++ b/vendor/github.com/op/go-logging/format.go @@ -14,6 +14,7 @@ import ( "path/filepath" "regexp" "runtime" + "strconv" "strings" "sync" "time" @@ -39,6 +40,7 @@ const ( fmtVerbShortpkg fmtVerbLongfunc fmtVerbShortfunc + fmtVerbCallpath fmtVerbLevelColor // Keep last, there are no match for these below. @@ -60,6 +62,7 @@ var fmtVerbs = []string{ "shortpkg", "longfunc", "shortfunc", + "callpath", "color", } @@ -79,6 +82,7 @@ var defaultVerbsLayout = []string{ "s", "s", "s", + "0", "", } @@ -159,6 +163,7 @@ type stringFormatter struct { // %{message} Message (string) // %{longfile} Full file name and line number: /a/b/c/d.go:23 // %{shortfile} Final file name element and line number: d.go:23 +// %{callpath} Callpath like main.a.b.c...c "..." meaning recursive call ~. meaning truncated path // %{color} ANSI color based on log level // // For normal types, the output can be customized by using the 'verbs' defined @@ -175,6 +180,9 @@ type stringFormatter struct { // "%{color:bold}%{time:15:04:05} %{level:-8s}%{color:reset} %{message}" will // just colorize the time and level, leaving the message uncolored. // +// For the 'callpath' verb, the output can be adjusted to limit the printing +// the stack depth. i.e. '%{callpath:3}' will print '~.a.b.c' +// // Colors on Windows is unfortunately not supported right now and is currently // a no-op. // @@ -187,6 +195,7 @@ type stringFormatter struct { // %{shortpkg} Base package path, eg. go-logging // %{longfunc} Full function name, eg. littleEndian.PutUint32 // %{shortfunc} Base function name, eg. PutUint32 +// %{callpath} Call function path, eg. main.a.b.c func NewStringFormatter(format string) (Formatter, error) { var fmter = &stringFormatter{} @@ -211,12 +220,12 @@ func NewStringFormatter(format string) (Formatter, error) { } // Handle layout customizations or use the default. If this is not for the - // time or color formatting, we need to prefix with %. + // time, color formatting or callpath, we need to prefix with %. layout := defaultVerbsLayout[verb] if m[4] != -1 { layout = format[m[4]:m[5]] } - if verb != fmtVerbTime && verb != fmtVerbLevelColor { + if verb != fmtVerbTime && verb != fmtVerbLevelColor && verb != fmtVerbCallpath { layout = "%" + layout } @@ -233,12 +242,13 @@ func NewStringFormatter(format string) (Formatter, error) { if err != nil { panic(err) } + testFmt := "hello %s" r := &Record{ - Id: 12345, + ID: 12345, Time: t, Module: "logger", - fmt: "hello %s", - args: []interface{}{"go"}, + Args: []interface{}{"go"}, + fmt: &testFmt, } if err := fmter.Format(0, r, &bytes.Buffer{}); err != nil { return nil, err @@ -269,6 +279,12 @@ func (f *stringFormatter) Format(calldepth int, r *Record, output io.Writer) err output.Write([]byte(r.Time.Format(part.layout))) } else if part.verb == fmtVerbLevelColor { doFmtVerbLevelColor(part.layout, r.Level, output) + } else if part.verb == fmtVerbCallpath { + depth, err := strconv.Atoi(part.layout) + if err != nil { + depth = 0 + } + output.Write([]byte(formatCallpath(calldepth+1, depth))) } else { var v interface{} switch part.verb { @@ -276,7 +292,7 @@ func (f *stringFormatter) Format(calldepth int, r *Record, output io.Writer) err v = r.Level break case fmtVerbID: - v = r.Id + v = r.ID break case fmtVerbPid: v = pid @@ -343,6 +359,39 @@ func formatFuncName(v fmtVerb, f string) string { panic("unexpected func formatter") } +func formatCallpath(calldepth int, depth int) string { + v := "" + callers := make([]uintptr, 64) + n := runtime.Callers(calldepth+2, callers) + oldPc := callers[n-1] + + start := n - 3 + if depth > 0 && start >= depth { + start = depth - 1 + v += "~." + } + recursiveCall := false + for i := start; i >= 0; i-- { + pc := callers[i] + if oldPc == pc { + recursiveCall = true + continue + } + oldPc = pc + if recursiveCall { + recursiveCall = false + v += ".." + } + if i < start { + v += "." + } + if f := runtime.FuncForPC(pc); f != nil { + v += formatFuncName(fmtVerbShortfunc, f.Name()) + } + } + return v +} + // backendFormatter combines a backend with a specific formatter making it // possible to have different log formats for different backends. type backendFormatter struct { diff --git a/vendor/github.com/op/go-logging/log_nix.go b/vendor/github.com/op/go-logging/log_nix.go index f06a871..4ff2ab1 100644 --- a/vendor/github.com/op/go-logging/log_nix.go +++ b/vendor/github.com/op/go-logging/log_nix.go @@ -16,37 +16,38 @@ import ( type color int const ( - colorBlack = iota + 30 - colorRed - colorGreen - colorYellow - colorBlue - colorMagenta - colorCyan - colorWhite + ColorBlack = iota + 30 + ColorRed + ColorGreen + ColorYellow + ColorBlue + ColorMagenta + ColorCyan + ColorWhite ) var ( colors = []string{ - CRITICAL: colorSeq(colorMagenta), - ERROR: colorSeq(colorRed), - WARNING: colorSeq(colorYellow), - NOTICE: colorSeq(colorGreen), - DEBUG: colorSeq(colorCyan), + CRITICAL: ColorSeq(ColorMagenta), + ERROR: ColorSeq(ColorRed), + WARNING: ColorSeq(ColorYellow), + NOTICE: ColorSeq(ColorGreen), + DEBUG: ColorSeq(ColorCyan), } boldcolors = []string{ - CRITICAL: colorSeqBold(colorMagenta), - ERROR: colorSeqBold(colorRed), - WARNING: colorSeqBold(colorYellow), - NOTICE: colorSeqBold(colorGreen), - DEBUG: colorSeqBold(colorCyan), + CRITICAL: ColorSeqBold(ColorMagenta), + ERROR: ColorSeqBold(ColorRed), + WARNING: ColorSeqBold(ColorYellow), + NOTICE: ColorSeqBold(ColorGreen), + DEBUG: ColorSeqBold(ColorCyan), } ) // LogBackend utilizes the standard log module. type LogBackend struct { - Logger *log.Logger - Color bool + Logger *log.Logger + Color bool + ColorConfig []string } // NewLogBackend creates a new LogBackend. @@ -57,8 +58,13 @@ func NewLogBackend(out io.Writer, prefix string, flag int) *LogBackend { // Log implements the Backend interface. func (b *LogBackend) Log(level Level, calldepth int, rec *Record) error { if b.Color { + col := colors[level] + if len(b.ColorConfig) > int(level) && b.ColorConfig[level] != "" { + col = b.ColorConfig[level] + } + buf := &bytes.Buffer{} - buf.Write([]byte(colors[level])) + buf.Write([]byte(col)) buf.Write([]byte(rec.Formatted(calldepth + 1))) buf.Write([]byte("\033[0m")) // For some reason, the Go logger arbitrarily decided "2" was the correct @@ -69,11 +75,26 @@ func (b *LogBackend) Log(level Level, calldepth int, rec *Record) error { return b.Logger.Output(calldepth+2, rec.Formatted(calldepth+1)) } -func colorSeq(color color) string { +// ConvertColors takes a list of ints representing colors for log levels and +// converts them into strings for ANSI color formatting +func ConvertColors(colors []int, bold bool) []string { + converted := []string{} + for _, i := range colors { + if bold { + converted = append(converted, ColorSeqBold(color(i))) + } else { + converted = append(converted, ColorSeq(color(i))) + } + } + + return converted +} + +func ColorSeq(color color) string { return fmt.Sprintf("\033[%dm", int(color)) } -func colorSeqBold(color color) string { +func ColorSeqBold(color color) string { return fmt.Sprintf("\033[%d;1m", int(color)) } diff --git a/vendor/github.com/op/go-logging/logger.go b/vendor/github.com/op/go-logging/logger.go index b430124..535ed9b 100644 --- a/vendor/github.com/op/go-logging/logger.go +++ b/vendor/github.com/op/go-logging/logger.go @@ -41,16 +41,16 @@ var ( // was created, an increasing id, filename and line and finally the actual // formatted log line. type Record struct { - Id uint64 + ID uint64 Time time.Time Module string Level Level + Args []interface{} // message is kept as a pointer to have shallow copies update this once // needed. message *string - args []interface{} - fmt string + fmt *string formatter Formatter formatted string } @@ -69,12 +69,20 @@ func (r *Record) Formatted(calldepth int) string { func (r *Record) Message() string { if r.message == nil { // Redact the arguments that implements the Redactor interface - for i, arg := range r.args { + for i, arg := range r.Args { if redactor, ok := arg.(Redactor); ok == true { - r.args[i] = redactor.Redacted() + r.Args[i] = redactor.Redacted() } } - msg := fmt.Sprintf(r.fmt, r.args...) + var buf bytes.Buffer + if r.fmt != nil { + fmt.Fprintf(&buf, *r.fmt, r.Args...) + } else { + // use Fprintln to make sure we always get space between arguments + fmt.Fprintln(&buf, r.Args...) + buf.Truncate(buf.Len() - 1) // strip newline + } + msg := buf.String() r.message = &msg } return *r.message @@ -132,19 +140,19 @@ func (l *Logger) IsEnabledFor(level Level) bool { return defaultBackend.IsEnabledFor(level, l.Module) } -func (l *Logger) log(lvl Level, format string, args ...interface{}) { +func (l *Logger) log(lvl Level, format *string, args ...interface{}) { if !l.IsEnabledFor(lvl) { return } // Create the logging record and pass it in to the backend record := &Record{ - Id: atomic.AddUint64(&sequenceNo, 1), + ID: atomic.AddUint64(&sequenceNo, 1), Time: timeNow(), Module: l.Module, Level: lvl, fmt: format, - args: args, + Args: args, } // TODO use channels to fan out the records to all backends? @@ -164,84 +172,86 @@ func (l *Logger) log(lvl Level, format string, args ...interface{}) { // Fatal is equivalent to l.Critical(fmt.Sprint()) followed by a call to os.Exit(1). func (l *Logger) Fatal(args ...interface{}) { - s := fmt.Sprint(args...) - l.log(CRITICAL, "%s", s) + l.log(CRITICAL, nil, args...) os.Exit(1) } // Fatalf is equivalent to l.Critical followed by a call to os.Exit(1). func (l *Logger) Fatalf(format string, args ...interface{}) { - l.log(CRITICAL, format, args...) + l.log(CRITICAL, &format, args...) os.Exit(1) } // Panic is equivalent to l.Critical(fmt.Sprint()) followed by a call to panic(). func (l *Logger) Panic(args ...interface{}) { - s := fmt.Sprint(args...) - l.log(CRITICAL, "%s", s) - panic(s) + l.log(CRITICAL, nil, args...) + panic(fmt.Sprint(args...)) } // Panicf is equivalent to l.Critical followed by a call to panic(). func (l *Logger) Panicf(format string, args ...interface{}) { - s := fmt.Sprintf(format, args...) - l.log(CRITICAL, "%s", s) - panic(s) + l.log(CRITICAL, &format, args...) + panic(fmt.Sprintf(format, args...)) } // Critical logs a message using CRITICAL as log level. -func (l *Logger) Critical(format string, args ...interface{}) { - l.log(CRITICAL, format, args...) +func (l *Logger) Critical(args ...interface{}) { + l.log(CRITICAL, nil, args...) +} + +// Criticalf logs a message using CRITICAL as log level. +func (l *Logger) Criticalf(format string, args ...interface{}) { + l.log(CRITICAL, &format, args...) } // Error logs a message using ERROR as log level. -func (l *Logger) Error(format string, args ...interface{}) { - l.log(ERROR, format, args...) +func (l *Logger) Error(args ...interface{}) { + l.log(ERROR, nil, args...) } // Errorf logs a message using ERROR as log level. func (l *Logger) Errorf(format string, args ...interface{}) { - l.log(ERROR, format, args...) + l.log(ERROR, &format, args...) } // Warning logs a message using WARNING as log level. -func (l *Logger) Warning(format string, args ...interface{}) { - l.log(WARNING, format, args...) +func (l *Logger) Warning(args ...interface{}) { + l.log(WARNING, nil, args...) } // Warningf logs a message using WARNING as log level. func (l *Logger) Warningf(format string, args ...interface{}) { - l.log(WARNING, format, args...) + l.log(WARNING, &format, args...) } // Notice logs a message using NOTICE as log level. -func (l *Logger) Notice(format string, args ...interface{}) { - l.log(NOTICE, format, args...) +func (l *Logger) Notice(args ...interface{}) { + l.log(NOTICE, nil, args...) } // Noticef logs a message using NOTICE as log level. func (l *Logger) Noticef(format string, args ...interface{}) { - l.log(NOTICE, format, args...) + l.log(NOTICE, &format, args...) } // Info logs a message using INFO as log level. -func (l *Logger) Info(format string, args ...interface{}) { - l.log(INFO, format, args...) +func (l *Logger) Info(args ...interface{}) { + l.log(INFO, nil, args...) } // Infof logs a message using INFO as log level. func (l *Logger) Infof(format string, args ...interface{}) { - l.log(INFO, format, args...) + l.log(INFO, &format, args...) } // Debug logs a message using DEBUG as log level. -func (l *Logger) Debug(format string, args ...interface{}) { - l.log(DEBUG, format, args...) +func (l *Logger) Debug(args ...interface{}) { + l.log(DEBUG, nil, args...) } // Debugf logs a message using DEBUG as log level. func (l *Logger) Debugf(format string, args ...interface{}) { - l.log(DEBUG, format, args...) + l.log(DEBUG, &format, args...) } func init() { From 9eeeb599571532b6bf07705684a513ef1e69a8e5 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 18:48:34 +0000 Subject: [PATCH 26/28] Update to new logging library API, Warning() -> Warningf() etc... --- dbus.go | 6 +++--- dns.go | 8 ++++---- icons.go | 6 +++--- iptables.go | 6 +++--- policy.go | 12 ++++++------ prompt.go | 4 ++-- rules.go | 16 ++++++++-------- socks_server_chain_test.go | 12 ++++++------ 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/dbus.go b/dbus.go index 074edf9..99fc432 100644 --- a/dbus.go +++ b/dbus.go @@ -90,7 +90,7 @@ func newDbusServer() (*dbusServer, error) { } func (ds *dbusServer) SetEnabled(flag bool) *dbus.Error { - log.Debug("SetEnabled(%v) called", flag) + log.Debugf("SetEnabled(%v) called", flag) ds.fw.setEnabled(flag) return nil } @@ -136,7 +136,7 @@ func (ds *dbusServer) DeleteRule(id uint32) *dbus.Error { } func (ds *dbusServer) UpdateRule(rule DbusRule) *dbus.Error { - log.Debug("UpdateRule %v", rule) + log.Debugf("UpdateRule %v", rule) ds.fw.lock.Lock() r := ds.fw.rulesById[uint(rule.Id)] ds.fw.lock.Unlock() @@ -144,7 +144,7 @@ func (ds *dbusServer) UpdateRule(rule DbusRule) *dbus.Error { tmp := new(Rule) tmp.addr = noAddress if !tmp.parseTarget(rule.Target) { - log.Warning("Unable to parse target: %s", rule.Target) + log.Warningf("Unable to parse target: %s", rule.Target) return nil } r.policy.lock.Lock() diff --git a/dns.go b/dns.go index fb6664f..57675d1 100644 --- a/dns.go +++ b/dns.go @@ -31,7 +31,7 @@ func (dc *dnsCache) processDNS(pkt *nfqueue.Packet) { return } if len(dns.question) != 1 { - log.Warning("Length of DNS Question section is not 1 as expected: %d", len(dns.question)) + log.Warningf("Length of DNS Question section is not 1 as expected: %d", len(dns.question)) return } q := dns.question[0] @@ -39,7 +39,7 @@ func (dc *dnsCache) processDNS(pkt *nfqueue.Packet) { dc.processRecordA(q.Name, dns.answer) return } - log.Info("Unhandled DNS message: %v", dns) + log.Infof("Unhandled DNS message: %v", dns) } @@ -55,10 +55,10 @@ func (dc *dnsCache) processRecordA(name string, answers []dnsRR) { } dc.ipMap[ip] = name if !logRedact { - log.Info("Adding %s: %s", name, ip) + log.Infof("Adding %s: %s", name, ip) } default: - log.Warning("Unexpected RR type in answer section of A response: %v", rec) + log.Warningf("Unexpected RR type in answer section of A response: %v", rec) } } } diff --git a/icons.go b/icons.go index 7e3db50..55a0fdc 100644 --- a/icons.go +++ b/icons.go @@ -34,12 +34,12 @@ func initIcons() { path := "/usr/share/applications" dir, err := os.Open(path) if err != nil { - log.Warning("Failed to open %s for reading: %v", path, err) + log.Warningf("Failed to open %s for reading: %v", path, err) return } names, err := dir.Readdirnames(0) if err != nil { - log.Warning("Could not read directory %s: %v", path, err) + log.Warningf("Could not read directory %s: %v", path, err) return } for _, n := range names { @@ -53,7 +53,7 @@ func initIcons() { func loadDesktopFile(path string) { bs, err := ioutil.ReadFile(path) if err != nil { - log.Warning("Error reading %s: %v", path, err) + log.Warningf("Error reading %s: %v", path, err) return } exec := "" diff --git a/iptables.go b/iptables.go index 2a4e2d0..438ad76 100644 --- a/iptables.go +++ b/iptables.go @@ -18,9 +18,9 @@ func setupIPTables() { func addIPTRules(rules ...string) { for _, r := range rules { if iptables('C', r) { - log.Info("IPTables rule already present: %s", r) + log.Infof("IPTables rule already present: %s", r) } else { - log.Info("Installing IPTables rule: %s", r) + log.Infof("Installing IPTables rule: %s", r) iptables('I', r) } } @@ -38,7 +38,7 @@ func iptables(verb rune, rule string) bool { _, err = cmd.CombinedOutput() _, exitErr := err.(*exec.ExitError) if err != nil && !exitErr { - log.Warning("Error running iptables: %v", err) + log.Warningf("Error running iptables: %v", err) } return !exitErr } diff --git a/policy.go b/policy.go index 6ad7898..1ea7b95 100644 --- a/policy.go +++ b/policy.go @@ -99,7 +99,7 @@ func (p *Policy) processPacket(pkt *nfqueue.Packet, pinfo *procsnitch.Info) { defer p.lock.Unlock() name := p.fw.dns.Lookup(pkt.Dst) if !logRedact { - log.Info("Lookup(%s): %s", pkt.Dst.String(), name) + log.Infof("Lookup(%s): %s", pkt.Dst.String(), name) } result := p.rules.filterPacket(pkt, pinfo, name) switch result { @@ -111,7 +111,7 @@ func (p *Policy) processPacket(pkt *nfqueue.Packet, pinfo *procsnitch.Info) { case FILTER_PROMPT: p.processPromptResult(&pendingPkt{pol: p, name: name, pkt: pkt, pinfo: pinfo}) default: - log.Warning("Unexpected filter result: %d", result) + log.Warningf("Unexpected filter result: %d", result) } } @@ -195,7 +195,7 @@ func (p *Policy) filterPending(rule *Rule) { remaining := []pendingConnection{} for _, pc := range p.pendingQueue { if rule.match(pc.dst(), pc.dstPort(), pc.hostname()) { - log.Info("Also applying %s to %s", rule.getString(logRedact), pc.print()) + log.Infof("Also applying %s to %s", rule.getString(logRedact), pc.print()) if rule.rtype == RULE_ALLOW { pc.accept() } else { @@ -249,11 +249,11 @@ func (fw *Firewall) filterPacket(pkt *nfqueue.Packet) { } pinfo := findProcessForPacket(pkt) if pinfo == nil { - log.Warning("No proc found for %s", printPacket(pkt, fw.dns.Lookup(pkt.Dst))) + log.Warningf("No proc found for %s", printPacket(pkt, fw.dns.Lookup(pkt.Dst))) pkt.Accept() return } - log.Debug("filterPacket [%s] %s", pinfo.ExePath, printPacket(pkt, fw.dns.Lookup(pkt.Dst))) + log.Debugf("filterPacket [%s] %s", pinfo.ExePath, printPacket(pkt, fw.dns.Lookup(pkt.Dst))) if basicAllowPacket(pkt) { pkt.Accept() return @@ -269,7 +269,7 @@ func findProcessForPacket(pkt *nfqueue.Packet) *procsnitch.Info { case nfqueue.UDP: return procsnitch.LookupUDPSocketProcess(pkt.SrcPort) default: - log.Warning("Packet has unknown protocol: %d", pkt.Protocol) + log.Warningf("Packet has unknown protocol: %d", pkt.Protocol) return nil } } diff --git a/prompt.go b/prompt.go index d0bafdd..4f556a1 100644 --- a/prompt.go +++ b/prompt.go @@ -97,7 +97,7 @@ func (p *prompter) processConnection(pc pendingConnection) { int32(pc.procInfo().Pid)) err := call.Store(&scope, &rule) if err != nil { - log.Warning("Error sending dbus RequestPrompt message: %v", err) + log.Warningf("Error sending dbus RequestPrompt message: %v", err) policy.removePending(pc) pc.drop() return @@ -105,7 +105,7 @@ func (p *prompter) processConnection(pc pendingConnection) { r, err := policy.parseRule(rule, false) if err != nil { - log.Warning("Error parsing rule string returned from dbus RequestPrompt: %v", err) + log.Warningf("Error parsing rule string returned from dbus RequestPrompt: %v", err) policy.removePending(pc) pc.drop() return diff --git a/rules.go b/rules.go index c1cc9d7..b76f470 100644 --- a/rules.go +++ b/rules.go @@ -106,7 +106,7 @@ func (rl *RuleList) filter(dst net.IP, dstPort uint16, hostname string, pinfo *p if logRedact { dstStr = "[redacted]" } - log.Info("%s (%s -> %s:%d)", r.getString(logRedact), pinfo.ExePath, dstStr, dstPort) + log.Infof("%s (%s -> %s:%d)", r.getString(logRedact), pinfo.ExePath, dstStr, dstPort) if r.rtype == RULE_DENY { return FILTER_DENY } else if r.rtype == RULE_ALLOW { @@ -205,12 +205,12 @@ func (fw *Firewall) saveRules() { p, err := rulesPath() if err != nil { - log.Warning("Failed to open %s for writing: %v", p, err) + log.Warningf("Failed to open %s for writing: %v", p, err) return } f, err := os.Create(p) if err != nil { - log.Warning("Failed to open %s for writing: %v", p, err) + log.Warningf("Failed to open %s for writing: %v", p, err) return } defer f.Close() @@ -242,7 +242,7 @@ func savePolicy(f *os.File, p *Policy) { func writeLine(f *os.File, line string) bool { _, err := f.WriteString(line + "\n") if err != nil { - log.Warning("Error writing to rule file: %v", err) + log.Warningf("Error writing to rule file: %v", err) return false } return true @@ -256,13 +256,13 @@ func (fw *Firewall) loadRules() { p, err := rulesPath() if err != nil { - log.Warning("Failed to open %s for reading: %v", p, err) + log.Warningf("Failed to open %s for reading: %v", p, err) return } bs, err := ioutil.ReadFile(p) if err != nil { if !os.IsNotExist(err) { - log.Warning("Failed to open %s for reading: %v", p, err) + log.Warningf("Failed to open %s for reading: %v", p, err) } return } @@ -287,12 +287,12 @@ func (fw *Firewall) processPathLine(line string) *Policy { func processRuleLine(policy *Policy, line string) { if policy == nil { - log.Warning("Cannot process rule line without first seeing path line: %s", line) + log.Warningf("Cannot process rule line without first seeing path line: %s", line) return } _, err := policy.parseRule(line, true) if err != nil { - log.Warning("Error parsing rule (%s): %v", line, err) + log.Warningf("Error parsing rule (%s): %v", line, err) return } } diff --git a/socks_server_chain_test.go b/socks_server_chain_test.go index 4fc71be..05ae9b1 100644 --- a/socks_server_chain_test.go +++ b/socks_server_chain_test.go @@ -43,7 +43,7 @@ func NewMortalService(network, address string, connectionCallback func(net.Conn) // Stop will kill our listener and all it's connections func (l *MortalService) Stop() { - log.Info("stopping listener service %s:%s", l.network, l.address) + log.Infof("stopping listener service %s:%s", l.network, l.address) close(l.quit) if l.listener != nil { l.listener.Close() @@ -54,10 +54,10 @@ func (l *MortalService) Stop() { func (l *MortalService) acceptLoop() { defer l.waitGroup.Done() defer func() { - log.Info("stoping listener service %s:%s", l.network, l.address) + log.Infof("stoping listener service %s:%s", l.network, l.address) for i, conn := range l.conns { if conn != nil { - log.Info("Closing connection #%d", i) + log.Infof("Closing connection #%d", i) conn.Close() } } @@ -70,7 +70,7 @@ func (l *MortalService) acceptLoop() { if opErr, ok := err.(*net.OpError); ok && opErr.Timeout() { continue } else { - log.Info("MortalService connection accept failure: %s\n", err) + log.Infof("MortalService connection accept failure: %s\n", err) select { case <-l.quit: return @@ -130,12 +130,12 @@ func (l *MortalService) Start() error { func (l *MortalService) handleConnection(conn net.Conn, id int) error { defer func() { - log.Info("Closing connection #%d", id) + log.Infof("Closing connection #%d", id) conn.Close() l.conns[id] = nil }() - log.Info("Starting connection #%d", id) + log.Infof("Starting connection #%d", id) for { if err := l.connectionCallback(conn); err != nil { From 79741be8a19c81df2b0c3cd3a533449eb36aacb3 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 29 Jun 2016 18:55:26 +0000 Subject: [PATCH 27/28] Update procsnitch dependency --- Godeps/Godeps.json | 4 ++-- .../github.com/subgraph/go-procsnitch/proc.go | 2 +- .../subgraph/go-procsnitch/proc_pid.go | 18 +++++++++--------- .../subgraph/go-procsnitch/socket.go | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 463c6b9..886dfd3 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -48,11 +48,11 @@ }, { "ImportPath": "github.com/subgraph/go-procsnitch", - "Rev": "84754d9af0ff985a28b3e6be743c7d453fda7322" + "Rev": "9ed73dde9f6f84be72aa010394902057ac26b625" }, { "ImportPath": "golang.org/x/net/proxy", - "Rev": "2e9cee70ee697e0a2ef894b560dda50dec7dff58" + "Rev": "ef2e00e88c5e0a3569f0bb9df697e9cbc6215fea" } ] } diff --git a/vendor/github.com/subgraph/go-procsnitch/proc.go b/vendor/github.com/subgraph/go-procsnitch/proc.go index a2c7445..00da23c 100644 --- a/vendor/github.com/subgraph/go-procsnitch/proc.go +++ b/vendor/github.com/subgraph/go-procsnitch/proc.go @@ -163,7 +163,7 @@ func resolveProcinfo(conns []*connectionInfo) { } ss := new(socketStatus) if err := ss.parseLine(line); err != nil { - log.Warning("Unable to parse line [%s]: %v", line, err) + log.Warningf("Unable to parse line [%s]: %v", line, err) } /* else { /* pid := findPidForInode(ss.inode) diff --git a/vendor/github.com/subgraph/go-procsnitch/proc_pid.go b/vendor/github.com/subgraph/go-procsnitch/proc_pid.go index 845d82b..97c18ae 100644 --- a/vendor/github.com/subgraph/go-procsnitch/proc_pid.go +++ b/vendor/github.com/subgraph/go-procsnitch/proc_pid.go @@ -77,7 +77,7 @@ func inodesFromPid(pid int) []uint64 { for _, n := range readdir(fdpath) { if link, err := os.Readlink(path.Join(fdpath, n)); err != nil { if !os.IsNotExist(err) { - log.Warning("Error reading link %s: %v", n, err) + log.Warningf("Error reading link %s: %v", n, err) } } else { if inode := extractSocket(link); inode > 0 { @@ -95,7 +95,7 @@ func extractSocket(name string) uint64 { val := name[8 : len(name)-1] inode, err := strconv.ParseUint(val, 10, 64) if err != nil { - log.Warning("Error parsing inode value from %s: %v", name, err) + log.Warningf("Error parsing inode value from %s: %v", name, err) return 0 } return inode @@ -104,13 +104,13 @@ func extractSocket(name string) uint64 { func readdir(dir string) []string { d, err := os.Open(dir) if err != nil { - log.Warning("Error opening directory %s: %v", dir, err) + log.Warningf("Error opening directory %s: %v", dir, err) return nil } defer d.Close() names, err := d.Readdirnames(0) if err != nil { - log.Warning("Error reading directory names from %s: %v", dir, err) + log.Warningf("Error reading directory names from %s: %v", dir, err) return nil } return names @@ -123,12 +123,12 @@ func (pi *Info) loadProcessInfo() bool { exePath, err := os.Readlink(fmt.Sprintf("/proc/%d/exe", pi.Pid)) if err != nil { - log.Warning("Error reading exe link for pid %d: %v", pi.Pid, err) + log.Warningf("Error reading exe link for pid %d: %v", pi.Pid, err) return false } bs, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cmdline", pi.Pid)) if err != nil { - log.Warning("Error reading cmdline for pid %d: %v", pi.Pid, err) + log.Warningf("Error reading cmdline for pid %d: %v", pi.Pid, err) return false } for i, b := range bs { @@ -139,18 +139,18 @@ func (pi *Info) loadProcessInfo() bool { bs, err = ioutil.ReadFile(fmt.Sprintf("/proc/%d/stat", pi.Pid)) if err != nil { - log.Warning("Error reading cmdline for pid %d: %v", pi.Pid, err) + log.Warningf("Error reading cmdline for pid %d: %v", pi.Pid, err) return false } fs := strings.Fields(string(bs)) if len(fs) < 50 { - log.Warning("Unable to parse stat for pid %d: ", pi.Pid) + log.Warningf("Unable to parse stat for pid %d: ", pi.Pid) return false } finfo, err := os.Stat(fmt.Sprintf("/proc/%d", pi.Pid)) if err != nil { - log.Warning("Could not stat /proc/%d: %v", pi.Pid, err) + log.Warningf("Could not stat /proc/%d: %v", pi.Pid, err) return false } sys := finfo.Sys().(*syscall.Stat_t) diff --git a/vendor/github.com/subgraph/go-procsnitch/socket.go b/vendor/github.com/subgraph/go-procsnitch/socket.go index aef64aa..27020da 100644 --- a/vendor/github.com/subgraph/go-procsnitch/socket.go +++ b/vendor/github.com/subgraph/go-procsnitch/socket.go @@ -106,7 +106,7 @@ func findUNIXSocket(socketFile string) *socketStatus { } ss := socketStatus{} if err := ss.parseUnixProcLine(line); err != nil { - log.Warning("Unable to parse line from /proc/net/%s [%s]: %v", proto, line, err) + log.Warningf("Unable to parse line from /proc/net/%s [%s]: %v", proto, line, err) continue } if ss.remoteInode != 0 { @@ -134,7 +134,7 @@ func findSocket(proto string, matcher func(socketStatus) bool) *socketStatus { continue } if err := ss.parseLine(line); err != nil { - log.Warning("Unable to parse line from /proc/net/%s [%s]: %v", proto, line, err) + log.Warningf("Unable to parse line from /proc/net/%s [%s]: %v", proto, line, err) continue } if matcher(ss) { @@ -203,7 +203,7 @@ func getSocketLines(proto string) []string { path := fmt.Sprintf("/proc/net/%s", proto) data, err := ioutil.ReadFile(path) if err != nil { - log.Warning("Error reading %s: %v", path, err) + log.Warningf("Error reading %s: %v", path, err) return nil } lines := strings.Split(string(data), "\n") From a860eeffa0df70131fcc7e477f55f2d965f718a7 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 14 Sep 2016 18:24:29 +0000 Subject: [PATCH 28/28] updated gnome shell versions --- gnome-shell/firewall@subgraph.com/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnome-shell/firewall@subgraph.com/metadata.json b/gnome-shell/firewall@subgraph.com/metadata.json index c6c92fe..6c0b473 100644 --- a/gnome-shell/firewall@subgraph.com/metadata.json +++ b/gnome-shell/firewall@subgraph.com/metadata.json @@ -1,6 +1,6 @@ { "description": "Firewall Extension", - "shell-version": ["3.18", "3.20"], + "shell-version": ["3.18", "3.20", "3.21", "3.21.91", "3.22"], "uuid": "firewall@subgraph.com", "name": "Firewall Extension", "settings-schema": "com.subgraph.firewall"