-
Notifications
You must be signed in to change notification settings - Fork 22
/
types_post_data.go
123 lines (107 loc) · 2.93 KB
/
types_post_data.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
//----------------------------------------
//
// 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/golcl/lcl/api"
"unsafe"
)
// PostDataRef -> ICefPostData
var PostDataRef postData
// postData
type postData uintptr
func (m *postData) New() *ICefPostData {
var result uintptr
imports.Proc(def.CefPostDataRef_Create).Call(uintptr(unsafe.Pointer(&result)))
return &ICefPostData{instance: unsafe.Pointer(result)}
}
func (m *postData) UnWrap(data *ICefPostData) *ICefPostData {
var result uintptr
imports.Proc(def.CefPostDataRef_UnWrap).Call(data.Instance(), uintptr(unsafe.Pointer(&result)))
if result == 0 {
return nil
}
data.base.Free(data.Instance())
data.instance = getInstance(result)
return data
}
// Instance 实例
func (m *ICefPostData) Instance() uintptr {
if m == nil {
return 0
}
return uintptr(m.instance)
}
func (m *ICefPostData) IsValid() bool {
if m == nil || m.instance == nil {
return false
}
return true
}
func (m *ICefPostData) Free() {
if m.instance != nil {
m.base.Free(m.Instance())
m.instance = nil
}
}
func (m *ICefPostData) IsReadOnly() bool {
if !m.IsValid() {
return false
}
r1, _, _ := imports.Proc(def.CefPostData_IsReadOnly).Call(m.Instance())
return api.GoBool(r1)
}
func (m *ICefPostData) HasExcludedElements() bool {
if !m.IsValid() {
return false
}
r1, _, _ := imports.Proc(def.CefPostData_HasExcludedElements).Call(m.Instance())
return api.GoBool(r1)
}
func (m *ICefPostData) GetElementCount() uint32 {
if !m.IsValid() {
return 0
}
r1, _, _ := imports.Proc(def.CefPostData_GetElementCount).Call(m.Instance())
return uint32(r1)
}
func (m *ICefPostData) GetElements() *TCefPostDataElementArray {
if !m.IsValid() {
return nil
}
var elementsCount = m.GetElementCount()
if elementsCount <= 0 {
return nil
}
var result uintptr
imports.Proc(def.CefPostData_GetElements).Call(m.Instance(), uintptr(elementsCount), uintptr(unsafe.Pointer(&result)))
return &TCefPostDataElementArray{instance: unsafe.Pointer(result), postDataElement: result, postDataElementLength: elementsCount}
}
func (m *ICefPostData) RemoveElement(postDataElement *ICefPostDataElement) bool {
if !m.IsValid() {
return false
}
r1, _, _ := imports.Proc(def.CefPostData_RemoveElement).Call(m.Instance(), postDataElement.Instance())
return api.GoBool(r1)
}
func (m *ICefPostData) AddElement(postDataElement *ICefPostDataElement) bool {
if !m.IsValid() {
return false
}
r1, _, _ := imports.Proc(def.CefPostData_AddElement).Call(m.Instance(), postDataElement.Instance())
return api.GoBool(r1)
}
func (m *ICefPostData) RemoveElements() {
if !m.IsValid() {
return
}
imports.Proc(def.CefPostData_RemoveElements).Call(m.Instance())
}