Update sequence

This commit is contained in:
vCaesar 2017-01-02 23:10:31 +08:00
parent bb213e0dfe
commit cc0d7f76b7
2 changed files with 23 additions and 23 deletions

View File

@ -84,14 +84,6 @@ func GetScreenSize() (int, int) {
return int(size.width), int(size.height)
}
//GetXDisplayName Get XDisplay Name
func GetXDisplayName() string {
name := C.aGetXDisplayName()
gname := C.GoString(name)
defer C.free(unsafe.Pointer(name))
return gname
}
//SetXDisplayName Set XDisplay Name
func SetXDisplayName(name string) string {
cname := C.CString(name)
@ -100,6 +92,14 @@ func SetXDisplayName(name string) string {
return gstr
}
//GetXDisplayName Get XDisplay Name
func GetXDisplayName() string {
name := C.aGetXDisplayName()
gname := C.GoString(name)
defer C.free(unsafe.Pointer(name))
return gname
}
//CaptureScreen Capture the Screen
func CaptureScreen(args ...int) C.MMBitmapRef {
var x C.size_t
@ -740,6 +740,12 @@ func CloseWindow() {
C.aCloseWindow()
}
//SetHandle Set the Window Handle
func SetHandle(hwnd int) {
chwnd := C.uintptr(hwnd)
C.aSetHandle(chwnd)
}
//GetHandle Get the Window Handle
func GetHandle() int {
hwnd := C.aGetHandle()
@ -748,12 +754,6 @@ func GetHandle() int {
return ghwnd
}
//SetHandle Set the Window Handle
func SetHandle(hwnd int) {
chwnd := C.uintptr(hwnd)
C.aSetHandle(chwnd)
}
//GetTitle Get the Window Title
func GetTitle() string {
title := C.aGetTitle()

View File

@ -56,6 +56,15 @@ MMSize aGetScreenSize(){
return displaySize;
}
char* aSetXDisplayName(char* name){
#if defined(USE_X11)
setXDisplay(name);
return "success";
#else
return "setXDisplayName is only supported on Linux";
#endif
}
char* aGetXDisplayName(){
#if defined(USE_X11)
const char* display = getXDisplay();
@ -68,15 +77,6 @@ char* aGetXDisplayName(){
#endif
}
char* aSetXDisplayName(char* name){
#if defined(USE_X11)
setXDisplay(name);
return "success";
#else
return "setXDisplayName is only supported on Linux";
#endif
}
MMBitmapRef aCaptureScreen(size_t x,size_t y,size_t w,size_t h){
// if (){
// x = 0;