-
Notifications
You must be signed in to change notification settings - Fork 28
/
types_dom_document.go
173 lines (154 loc) · 4.02 KB
/
types_dom_document.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Apache License Version 2.0, January 2004
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//----------------------------------------
package cef
import (
"github.com/energye/energy/v2/cef/internal/def"
"github.com/energye/energy/v2/common/imports"
"github.com/energye/energy/v2/consts"
"github.com/energye/golcl/lcl/api"
"unsafe"
)
// Instance 实例
func (m *ICefDomDocument) Instance() uintptr {
if m == nil {
return 0
}
return uintptr(m.instance)
}
func (m *ICefDomDocument) Free() {
if m.instance != nil {
m.base.Free(m.Instance())
m.instance = nil
}
}
func (m *ICefDomDocument) IsValid() bool {
if m == nil || m.instance == nil {
return false
}
return m.instance != nil
}
func (m *ICefDomDocument) GetDocType() consts.TCefDomDocumentType {
if !m.IsValid() {
return 0
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetDocType).Call(m.Instance())
return consts.TCefDomDocumentType(r1)
}
func (m *ICefDomDocument) GetDocument() *ICefDomNode {
if !m.IsValid() {
return nil
}
var result uintptr
imports.Proc(def.CefDomDocument_GetDocument).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &ICefDomNode{instance: unsafe.Pointer(result)}
}
return nil
}
func (m *ICefDomDocument) GetBody() *ICefDomNode {
if !m.IsValid() {
return nil
}
var result uintptr
imports.Proc(def.CefDomDocument_GetBody).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &ICefDomNode{instance: unsafe.Pointer(result)}
}
return nil
}
func (m *ICefDomDocument) GetHead() *ICefDomNode {
if !m.IsValid() {
return nil
}
var result uintptr
imports.Proc(def.CefDomDocument_GetHead).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &ICefDomNode{instance: unsafe.Pointer(result)}
}
return nil
}
func (m *ICefDomDocument) GetTitle() string {
if !m.IsValid() {
return ""
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetTitle).Call(m.Instance())
return api.GoStr(r1)
}
func (m *ICefDomDocument) GetElementById(id string) *ICefDomNode {
if !m.IsValid() {
return nil
}
var result uintptr
imports.Proc(def.CefDomDocument_GetElementById).Call(m.Instance(), api.PascalStr(id), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &ICefDomNode{instance: unsafe.Pointer(result)}
}
return nil
}
func (m *ICefDomDocument) GetFocusedNode() *ICefDomNode {
if !m.IsValid() {
return nil
}
var result uintptr
imports.Proc(def.CefDomDocument_GetFocusedNode).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
if result != 0 {
return &ICefDomNode{instance: unsafe.Pointer(result)}
}
return nil
}
func (m *ICefDomDocument) HasSelection() bool {
if !m.IsValid() {
return false
}
r1, _, _ := imports.Proc(def.CefDomDocument_HasSelection).Call(m.Instance())
return api.GoBool(r1)
}
func (m *ICefDomDocument) GetSelectionStartOffset() int32 {
if !m.IsValid() {
return 0
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetSelectionStartOffset).Call(m.Instance())
return int32(r1)
}
func (m *ICefDomDocument) GetSelectionEndOffset() int32 {
if !m.IsValid() {
return 0
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetSelectionEndOffset).Call(m.Instance())
return int32(r1)
}
func (m *ICefDomDocument) GetSelectionAsMarkup() string {
if !m.IsValid() {
return ""
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetSelectionAsMarkup).Call(m.Instance())
return api.GoStr(r1)
}
func (m *ICefDomDocument) GetSelectionAsText() string {
if !m.IsValid() {
return ""
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetSelectionAsText).Call(m.Instance())
return api.GoStr(r1)
}
func (m *ICefDomDocument) GetBaseUrl() string {
if !m.IsValid() {
return ""
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetBaseUrl).Call(m.Instance())
return api.GoStr(r1)
}
func (m *ICefDomDocument) GetCompleteUrl() string {
if !m.IsValid() {
return ""
}
r1, _, _ := imports.Proc(def.CefDomDocument_GetCompleteUrl).Call(m.Instance())
return api.GoStr(r1)
}