This repository has been archived by the owner on Sep 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
client.go
96 lines (74 loc) · 2.5 KB
/
client.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
91
92
93
94
95
96
// Copyright ©2018-2020 by Richard A. Wilkes. All rights reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, version 2.0. If a copy of the MPL was not distributed with
// this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This Source Code Form is "Incompatible With Secondary Licenses", as
// defined by the Mozilla Public License, version 2.0.
package webapp
import (
"unsafe"
"github.com/richardwilkes/cef/cef"
)
type client struct {
keyboardHandler *cef.KeyboardHandler
}
func newClient() *cef.Client {
c := &client{}
c.keyboardHandler = cef.NewKeyboardHandler(c)
c.keyboardHandler.Base().AddRef()
return cef.NewClient(c)
}
func (c *client) GetAudioHandler(self *cef.Client) *cef.AudioHandler {
return nil
}
func (c *client) GetContextMenuHandler(self *cef.Client) *cef.ContextMenuHandler {
return nil
}
func (c *client) GetDialogHandler(self *cef.Client) *cef.DialogHandler {
return nil
}
func (c *client) GetDisplayHandler(self *cef.Client) *cef.DisplayHandler {
return nil
}
func (c *client) GetDownloadHandler(self *cef.Client) *cef.DownloadHandler {
return nil
}
func (c *client) GetDragHandler(self *cef.Client) *cef.DragHandler {
return nil
}
func (c *client) GetFindHandler(self *cef.Client) *cef.FindHandler {
return nil
}
func (c *client) GetFocusHandler(self *cef.Client) *cef.FocusHandler {
return nil
}
func (c *client) GetJsdialogHandler(self *cef.Client) *cef.JsdialogHandler {
return nil
}
func (c *client) GetKeyboardHandler(self *cef.Client) *cef.KeyboardHandler {
c.keyboardHandler.Base().AddRef()
return c.keyboardHandler
}
func (c *client) GetLifeSpanHandler(self *cef.Client) *cef.LifeSpanHandler {
return nil
}
func (c *client) GetLoadHandler(self *cef.Client) *cef.LoadHandler {
return nil
}
func (c *client) GetRenderHandler(self *cef.Client) *cef.RenderHandler {
return nil
}
func (c *client) GetRequestHandler(self *cef.Client) *cef.RequestHandler {
return nil
}
func (c *client) OnProcessMessageReceived(self *cef.Client, browser *cef.Browser, frame *cef.Frame, sourceProcess cef.ProcessID, message *cef.ProcessMessage) int32 {
return 0
}
func (c *client) OnPreKeyEvent(self *cef.KeyboardHandler, browser *cef.Browser, event *cef.KeyEvent, osEvent unsafe.Pointer, isKeyboardShortcut *int32) int32 {
return driver.OnPreKeyEvent(event, isKeyboardShortcut)
}
func (c *client) OnKeyEvent(self *cef.KeyboardHandler, browser *cef.Browser, event *cef.KeyEvent, osEvent unsafe.Pointer) int32 {
return driver.OnKeyEvent(event)
}