diff --git a/cef/cef-image.go b/cef/cef-image.go index 886a11e10ff695d16b03232d69ea3e0d42c2b705..8174fe0a530b293017ee7f44ea0d9d6008321228 100644 --- a/cef/cef-image.go +++ b/cef/cef-image.go @@ -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 { diff --git a/cef/cef-proc-def.go b/cef/cef-proc-def.go index 8bb56a61b047fed2848f09d07f9d44d847f36f5e..87156aa853b5c5089a227a956310fc8746b8d7b9 100644 --- a/cef/cef-proc-def.go +++ b/cef/cef-proc-def.go @@ -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 diff --git a/cef/cef-window-component.go b/cef/cef-window-component.go index 357d18a2cb90c24e5bc8280ee48d329f06c94740..122d6cfffba732cb5146d0f7f1ea960170a5d5b3 100644 --- a/cef/cef-window-component.go +++ b/cef/cef-window-component.go @@ -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))) diff --git a/example/browser-tiny/tiny.go b/example/browser-tiny/tiny.go index 92f1faaed62fa9a19d287c55ea92cd567b17e3d7..3423934ff6e44fc53a73e2e602bc8352c4f3f17d 100644 --- a/example/browser-tiny/tiny.go +++ b/example/browser-tiny/tiny.go @@ -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")