/
platform_linux.go
53 lines (40 loc) · 1.01 KB
/
platform_linux.go
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
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
// +build linux
package vcl
import (
"unsafe"
. "github.com/ying32/govcl/vcl/api"
"github.com/ying32/govcl/vcl/types"
)
type GdkWindow uintptr
type GtkWidget uintptr
type GtkFixed uintptr
type XID uintptr
// PGtkWidget
func HandleToPlatformHandle(h types.HWND) GtkWidget {
return GtkWidget(h)
}
func (f *TForm) PlatformWindow() GdkWindow {
r, _, _ := GdkWindow_FromForm.Call(f.instance)
return GdkWindow(r)
}
func (g GdkWindow) XID() (xid XID) {
GdkWindow_GetXId.Call(uintptr(g), uintptr(unsafe.Pointer(&xid)))
return
}
// lz中首先是一个widget,然后上面用了一个fixedWidget来处理的。
func (g GtkWidget) FixedWidget() GtkFixed {
r, _, _ := GtkWidget_GetGtkFixed.Call(uintptr(g))
return GtkFixed(r)
}
func (g GtkWidget) Window() GdkWindow {
return 0
r, _, _ := GtkWidget_Window.Call(uintptr(g))
return GdkWindow(r)
}