forked from BambooEngine/goibus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_common.cgo
More file actions
55 lines (45 loc) · 1.52 KB
/
Copy path_common.cgo
File metadata and controls
55 lines (45 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package goibus
/*
#cgo pkg-config: ibus-1.0
#include <ibus.h>
#include <stdlib.h>
*/
import "C"
import "unsafe"
const (
BUS_DAEMON_NAME = "org.freedesktop.DBus"
BUS_DAEMON_PATH = "/org/freedesktop/DBus"
BUS_PROPERTIES_NAME = "org.freedesktop.DBus.Properties"
IBUS_IFACE_IBUS = "org.freedesktop.IBus"
IBUS_PATH_IBUS = "/org/freedesktop/IBus"
IBUS_SERVICE_IBUS = "org.freedesktop.IBus"
IBUS_IFACE_PANEL = "org.freedesktop.IBus.Panel"
IBUS_IFACE_CONFIG = "org.freedesktop.IBus.Config"
IBUS_IFACE_ENGINE = "org.freedesktop.IBus.Engine"
IBUS_IFACE_ENGINE_FACTORY = "org.freedesktop.IBus.Factory"
IBUS_IFACE_INPUT_CONTEXT = "org.freedesktop.IBus.InputContext"
IBUS_IFACE_NOTIFICATIONS = "org.freedesktop.IBus.Notifications"
IBUS_ENGINE_PREEDIT_CLEAR uint32 = 0
IBUS_ENGINE_PREEDIT_COMMIT uint32 = 1
ORIENTATION_HORIZONTAL int32 = 0
ORIENTATION_VERTICAL int32 = 1
ORIENTATION_SYSTEM int32 = 2
PROP_TYPE_NORMAL uint32 = 0
PROP_TYPE_TOGGLE uint32 = 1
PROP_TYPE_RADIO uint32 = 2
PROP_TYPE_MENU uint32 = 3
PROP_TYPE_SEPARATOR uint32 = 4
PROP_STATE_UNCHECKED uint32 = 0
PROP_STATE_CHECKED uint32 = 1
PROP_STATE_INCONSISTENT uint32 = 2
)
func GetAddress() string {
cString := (*C.char)(unsafe.Pointer(C.ibus_get_address()))
// defer C.free(unsafe.Pointer(cString))
return C.GoString(cString)
}
func GetSocketPath() string {
cString := (*C.char)(unsafe.Pointer(C.ibus_get_socket_path()))
// defer C.free(unsafe.Pointer(cString))
return C.GoString(cString)
}