提交 8dcdd2c7 编写于 作者: yanghye's avatar yanghye

Ready to fix some problems on linux

上级 7efeb6aa
......@@ -11,11 +11,15 @@ type ICefImage struct {
instance unsafe.Pointer
}
func NewImage() *ICefImage {
r1, _, _ := Proc(internale_CEFImage_New).Call()
return &ICefImage{
instance: unsafe.Pointer(r1),
}
//func NewImage() *ICefImage {
// r1, _, _ := Proc(internale_CEFImage_New).Call()
// return &ICefImage{
// instance: unsafe.Pointer(r1),
// }
//}
func (m *ICefImage) Instance() uintptr {
return uintptr(m.instance)
}
func (m *ICefImage) AddPngFS(scaleFactor float32, filename string) bool {
......
......@@ -377,10 +377,8 @@ func init() {
dllimports.NewEnergyImport("CEFWindowComponent_Title", 0),
dllimports.NewEnergyImport("CEFWindowComponent_WindowIcon", 0),
dllimports.NewEnergyImport("CEFWindowComponent_SetWindowIcon", 0),
dllimports.NewEnergyImport("CEFWindowComponent_SetWindowIconImage", 0),
dllimports.NewEnergyImport("CEFWindowComponent_WindowAppIcon", 0),
dllimports.NewEnergyImport("CEFWindowComponent_SetWindowAppIcon", 0),
dllimports.NewEnergyImport("CEFWindowComponent_SetWindowAppIconImage", 0),
dllimports.NewEnergyImport("CEFWindowComponent_Display", 0),
dllimports.NewEnergyImport("CEFWindowComponent_ClientAreaBoundsInScreen", 0),
dllimports.NewEnergyImport("CEFWindowComponent_WindowHandle", 0),
......@@ -794,10 +792,8 @@ const (
internale_CEFWindowComponent_Title
internale_CEFWindowComponent_WindowIcon
internale_CEFWindowComponent_SetWindowIcon
internale_CEFWindowComponent_SetWindowIconImage
internale_CEFWindowComponent_WindowAppIcon
internale_CEFWindowComponent_SetWindowAppIcon
internale_CEFWindowComponent_SetWindowAppIconImage
internale_CEFWindowComponent_Display
internale_CEFWindowComponent_ClientAreaBoundsInScreen
internale_CEFWindowComponent_WindowHandle
......
......@@ -123,11 +123,6 @@ func (m *TCEFWindowComponent) WindowIcon() *ICefImage {
}
}
func (m *TCEFWindowComponent) SetWindowIconImage(icon *ICefImage) error {
Proc(internale_CEFWindowComponent_SetWindowIconImage).Call(uintptr(m.instance), uintptr(icon.instance))
return nil
}
func (m *TCEFWindowComponent) SetWindowIcon(scaleFactor float32, filename string) error {
bytes, err := emfs.GetResources(filename)
if err != nil {
......@@ -154,11 +149,6 @@ func (m *TCEFWindowComponent) SetWindowAppIcon(scaleFactor float32, filename str
return nil
}
func (m *TCEFWindowComponent) SetWindowAppIconImage(icon *ICefImage) error {
Proc(internale_CEFWindowComponent_SetWindowAppIconImage).Call(uintptr(m.instance), uintptr(icon.instance))
return nil
}
func (m *TCEFWindowComponent) Display() *ICefDisplay {
var ret uintptr
Proc(internale_CEFWindowComponent_Display).Call(uintptr(m.instance), uintptr(unsafe.Pointer(&ret)))
......
......@@ -55,16 +55,10 @@ func main() {
fmt.Println("\t", display.Bounds(), display.WorkArea())
windowComponent.CenterWindow(cef.NewCefSize(1024, 768))
browserViewComponent.RequestFocus()
image := cef.NewImage()
fs := image.AddPngFS(1, "resources/icon.png")
fmt.Println("image", image, fs)
windowComponent.SetWindowIcon(1, "resources/icon.png")
windowComponent.SetWindowAppIcon(1, "resources/icon.png")
windowComponent.SetWindowAppIconImage(image)
windowComponent.Show()
icon := windowComponent.WindowIcon()
windowComponent.SetWindowAppIcon(1, "resources/gitcode.png")
appIcon := windowComponent.WindowAppIcon()
fmt.Println("WindowIcon", icon, appIcon)
fmt.Println("WindowIcon", appIcon.GetHeight())
})
windowComponent.SetOnCanClose(func(sender lcl.IObject, window *cef.ICefWindow, aResult *bool) {
fmt.Println("OnCanClose")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册