-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebview_ioleclientsite.go
90 lines (73 loc) · 2.77 KB
/
webview_ioleclientsite.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright 2010 The Walk 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 walk
import (
"syscall"
"unsafe"
)
import (
"github.com/lxn/win"
)
var webViewIOleClientSiteVtbl *win.IOleClientSiteVtbl
func init() {
webViewIOleClientSiteVtbl = &win.IOleClientSiteVtbl{
syscall.NewCallback(webView_IOleClientSite_QueryInterface),
syscall.NewCallback(webView_IOleClientSite_AddRef),
syscall.NewCallback(webView_IOleClientSite_Release),
syscall.NewCallback(webView_IOleClientSite_SaveObject),
syscall.NewCallback(webView_IOleClientSite_GetMoniker),
syscall.NewCallback(webView_IOleClientSite_GetContainer),
syscall.NewCallback(webView_IOleClientSite_ShowObject),
syscall.NewCallback(webView_IOleClientSite_OnShowWindow),
syscall.NewCallback(webView_IOleClientSite_RequestNewObjectLayout),
}
}
type webViewIOleClientSite struct {
win.IOleClientSite
inPlaceSite webViewIOleInPlaceSite
docHostUIHandler webViewIDocHostUIHandler
webBrowserEvents2 webViewDWebBrowserEvents2
}
func webView_IOleClientSite_QueryInterface(clientSite *webViewIOleClientSite, riid win.REFIID, ppvObject *unsafe.Pointer) uintptr {
if win.EqualREFIID(riid, &win.IID_IUnknown) {
*ppvObject = unsafe.Pointer(clientSite)
} else if win.EqualREFIID(riid, &win.IID_IOleClientSite) {
*ppvObject = unsafe.Pointer(clientSite)
} else if win.EqualREFIID(riid, &win.IID_IOleInPlaceSite) {
*ppvObject = unsafe.Pointer(&clientSite.inPlaceSite)
} else if win.EqualREFIID(riid, &win.IID_IDocHostUIHandler) {
*ppvObject = unsafe.Pointer(&clientSite.docHostUIHandler)
} else if win.EqualREFIID(riid, &win.DIID_DWebBrowserEvents2) {
*ppvObject = unsafe.Pointer(&clientSite.webBrowserEvents2)
} else {
*ppvObject = nil
return win.E_NOINTERFACE
}
return win.S_OK
}
func webView_IOleClientSite_AddRef(clientSite *webViewIOleClientSite) uintptr {
return 1
}
func webView_IOleClientSite_Release(clientSite *webViewIOleClientSite) uintptr {
return 1
}
func webView_IOleClientSite_SaveObject(clientSite *webViewIOleClientSite) uintptr {
return win.E_NOTIMPL
}
func webView_IOleClientSite_GetMoniker(clientSite *webViewIOleClientSite, dwAssign, dwWhichMoniker uint32, ppmk *unsafe.Pointer) uintptr {
return win.E_NOTIMPL
}
func webView_IOleClientSite_GetContainer(clientSite *webViewIOleClientSite, ppContainer *unsafe.Pointer) uintptr {
*ppContainer = nil
return win.E_NOINTERFACE
}
func webView_IOleClientSite_ShowObject(clientSite *webViewIOleClientSite) uintptr {
return win.S_OK
}
func webView_IOleClientSite_OnShowWindow(clientSite *webViewIOleClientSite, fShow win.BOOL) uintptr {
return win.E_NOTIMPL
}
func webView_IOleClientSite_RequestNewObjectLayout(clientSite *webViewIOleClientSite) uintptr {
return win.E_NOTIMPL
}