-
Notifications
You must be signed in to change notification settings - Fork 0
/
webview_ioleclientsite.go
89 lines (72 loc) · 2.72 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
// 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/go-winapi"
var webViewIOleClientSiteVtbl *IOleClientSiteVtbl
func init() {
webViewIOleClientSiteVtbl = &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 {
IOleClientSite
inPlaceSite webViewIOleInPlaceSite
docHostUIHandler webViewIDocHostUIHandler
webBrowserEvents2 webViewDWebBrowserEvents2
}
func webView_IOleClientSite_QueryInterface(clientSite *webViewIOleClientSite, riid REFIID, ppvObject *unsafe.Pointer) uintptr {
if EqualREFIID(riid, &IID_IUnknown) {
*ppvObject = unsafe.Pointer(clientSite)
} else if EqualREFIID(riid, &IID_IOleClientSite) {
*ppvObject = unsafe.Pointer(clientSite)
} else if EqualREFIID(riid, &IID_IOleInPlaceSite) {
*ppvObject = unsafe.Pointer(&clientSite.inPlaceSite)
} else if EqualREFIID(riid, &IID_IDocHostUIHandler) {
*ppvObject = unsafe.Pointer(&clientSite.docHostUIHandler)
// FIXME: Reactivate after fixing crash
// } else if EqualREFIID(riid, &IID_IDispatch) {
// *ppvObject = unsafe.Pointer(&clientSite.webBrowserEvents2)
} else {
*ppvObject = nil
return E_NOINTERFACE
}
return 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 E_NOTIMPL
}
func webView_IOleClientSite_GetMoniker(clientSite *webViewIOleClientSite, dwAssign, dwWhichMoniker uint, ppmk *unsafe.Pointer) uintptr {
return E_NOTIMPL
}
func webView_IOleClientSite_GetContainer(clientSite *webViewIOleClientSite, ppContainer *unsafe.Pointer) uintptr {
*ppContainer = nil
return E_NOINTERFACE
}
func webView_IOleClientSite_ShowObject(clientSite *webViewIOleClientSite) uintptr {
return S_OK
}
func webView_IOleClientSite_OnShowWindow(clientSite *webViewIOleClientSite, fShow BOOL) uintptr {
return E_NOTIMPL
}
func webView_IOleClientSite_RequestNewObjectLayout(clientSite *webViewIOleClientSite) uintptr {
return E_NOTIMPL
}