cztomczak / cef2go Goto Github PK
View Code? Open in Web Editor NEWGo lang bindings for the Chromium Embedded Framework (CEF)
Home Page: https://groups.google.com/d/forum/cef2go
License: Other
Go lang bindings for the Chromium Embedded Framework (CEF)
Home Page: https://groups.google.com/d/forum/cef2go
License: Other
Do you know if any of the forks implement a way to call Go Code from html/javascript without having to use more convoluted solutions like an HTTP server/xml requests? i.e. something like a Javascript.Callback() which then sends some parameters into a go function which can be inspected there, and dealt with..
paperlesspost/cef2go fork seems mostly focused on Linux only?
If there is no code out there that offers this (prefer it to work on Windows/MacOsx, other OS's like bsd/linux are a bonus) then would you or anyone be interested in me setting up a bounty to get callbacks/ipc working? By bounty I mean money/payment for to get something working...
Other options to consider are usinggoogle protocol buffers for ipc, or a background http request that somehow communicates with go.
Would prefer to do something like this in my Go Code:
func CefCallback(params..) {
// inspect parameters here, which are sent from a javascript function
// so that javascript can send messages back to GoLang code
}
Javascript:
CEF.CallBack(1,2,"string", "etc")
Obviously C++ and chromium embedded for delphi have something like this which Go lacks, as your go code right now requires and http server, which could work, but I would prefer just a simpler callback mechanism.
And I guess there also needs to be a way to send data to javascript, in addition to sending data back to go, so that it goes both ways
So do any of the forks have this functionality that you know of (hope they work on macosx and windows, not just Linux for example)... And if not, a bounty/payment for the work could be provided by myself? Any interest/knowledge on this? thanks
With Go 1.3 the project compiles - but the example most likely crashes under Windows.
Hi
I have pulled your repository on my mac.
I have downloaded the CEF binary (64 bit) from here: https://cefbuilds.com/ the 32bit one is depricated.
In that zip, is the release folder containing this, amongst others:
/Users/alex/Downloads/cef_binary_3.2641.1392.ge1aa8cc_macosx64 2/Release
└── Chromium Embedded Framework.framework
└── Resources
├── am.lproj
├── ar.lproj
├── bg.lproj
├── bn.lproj
├── ca.lproj
├── crash_report_sender.app
│ └── Contents
│ ├── MacOS
│ └── Resources
│ └── English.lproj
├── cs.lproj
├── da.lproj
I copied the Chromium Embedded Framework.framework to cef2go/Release/Chromium Embedded Framework.framework
I ran make.
I get:
clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -o $WORK/cef/_obj/_cgo_.o $WORK/cef/_obj/_cgo_main.o $WORK/cef/_obj/_cgo_export.o $WORK/cef/_obj/cef.cgo2.o $WORK/cef/_obj/cef_darwin.cgo2.o -F/Users/alex/go/src/github.com/amlwwalker/cztomczak/cef2go/Release/tmp -framework Cocoa -framework cef -framework Cocoa
# cef
ld: framework not found cef
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Darwin] Error 2
make: *** [detect_os] Error 2
This is one line in the makefile I think that is relevant:
export CGO_LDFLAGS=-F$(PWD)/Release/tmp -framework Cocoa -framework cef
I can see in the makefile this, for Darwin:
cp -rf Release/cef2go.app/Contents/Frameworks/Chromium\ Embedded\ Framework.framework Release/tmp/cef.framework ;\
mv Release/tmp/cef.framework/Chromium\ Embedded\ Framework Release/tmp/cef.framework/cef ;\
Is it incorrect??
Thanks
Alex
GOROOT=E:/win10soft/go
GOPATH=E:/test/GoProjects/test
E:/win10soft/go\bin\go.exe build -o "C:\Users\jay\AppData\Local\Temp\Build main_win.go and run1go" -gcflags "-N -l" E:/test/cef2go-0.10/src/main_win.go
e:/win10soft/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ./../../Release/libcef.lib when searching for -llibcef
e:/win10soft/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ./../../Release/libcef.dll when searching for -llibcef
e:/win10soft/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ./../../Release/libcef.lib when searching for -llibcef
e:/win10soft/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ./../../Release/libcef.dll when searching for -llibcef
e:/win10soft/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ./../../Release\libcef.lib when searching for -llibcef
e:/win10soft/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibcef
collect2.exe: error: ld returned 1 exit status
The error appearing in console:
2015-02-12 21:19:41.699 cef2go[3407:507] -[NSApplication
isHandlingSendEvent]: unrecognized selector sent to instance 0x9222330
This is similar to Issue 156
in CEF Python, see:
https://code.google.com/p/cefpython/issues/detail?id=156
To fix it in CEF2go we would need to include the code in util_mac.mm. This code could be added in cef2go/src/cocoa/cocoa.go
file similarly to how other Objective C++ code is added there, inside the multiline comment. See util_mac.mm:
https://code.google.com/p/cefpython/source/browse/cefpython/cef3/client_handler/util_mac.mm?r=8ca9a32e9103
And then call MacInitialize() from within cocoa.InitializeApp().
Hey!
I'm really confused about the way of using CEF 64-bit for OS X (this is my first project on OS X), I already made it work with the 32-bit binaries that are provided with releases/tag/v0.12 , but for 64-bit, what are the procedures to get something similar to copy to the Release folder? I download the CEF build, then I build it with CMake as it says in CMakeLists.txt ? Or should I just copy CEF 64-bit binaries into the Release folder?
I would really appreciate your help with this.
Hey, I would really like to use cef2go but am having trouble building it. I can't find any information on the build errors. It may be environmental but any help would be greatly appreciated.
Here's the build output:
make Darwin
clear
go install -x cef
WORK=/var/folders/54/8cx95hq12p712jw1n3z1q9t40000gn/T/go-build060576339
mkdir -p $WORK/cef/_obj/
mkdir -p $WORK/
cd ~/.go/src/github.com/cztomczak/cef2go/src/cef
CGO_LDFLAGS="-F~/.go/src/github.com/cztomczak/cef2go/Release/tmp" "-framework" "Cocoa" "-framework" "cef" "-framework" "Cocoa" /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/cgo -objdir $WORK/cef/_obj/ -- -I $WORK/cef/_obj/ -I./../../ -I./../../ -x objective-c cef.go cef_darwin.go
# cef
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:7:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSRange.h:5:
/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:12:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const char *objCType NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:15:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:8:
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:248:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) __strong const char *UTF8String NS_RETURNS_INNER_POINTER; // Convenience to return null-terminated UTF8 representation
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:17:
/System/Library/Frameworks/Foundation.framework/Headers/NSData.h:76:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const void *bytes NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSData.h:161:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) void *mutableBytes NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:25:
/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h:101:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const char *objCType NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:31:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:8:
/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:34:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) __strong const char *fileSystemRepresentation NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:41:
/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueObserving.h:183:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property void *observationInfo NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:46:
/System/Library/Frameworks/Foundation.framework/Headers/NSMethodSignature.h:22:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const char *methodReturnType NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:74:
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:86:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) __strong const char *fileSystemRepresentation NS_RETURNS_INNER_POINTER NS_AVAILABLE(10_9, 7_0);
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:151:
/System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:50:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const AEDesc *aeDesc NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:13:
/System/Library/Frameworks/AppKit.framework/Headers/NSGraphicsContext.h:80:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) CGContextRef CGContext NS_RETURNS_INNER_POINTER NS_AVAILABLE_MAC(10_10);
^ ~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/AppKit.framework/Headers/NSGraphicsContext.h:113:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) void *graphicsPort NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSActionCell.h:8:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSCell.h:10:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSText.h:8:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:8:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:9:
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:323:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) void *userData NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:339:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const void * /* EventRef */eventRef NS_RETURNS_INNER_POINTER NS_AVAILABLE_MAC(10_5);
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:28:
/System/Library/Frameworks/AppKit.framework/Headers/NSFont.h:107:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const CGFloat *matrix NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:32:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSFontPanel.h:8:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSPanel.h:8:
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:651:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) void * /* WindowRef */windowRef NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:277:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) CGColorRef CGColor NS_RETURNS_INNER_POINTER NS_AVAILABLE_MAC(10_8); // Returns an autoreleased CGColor. This will never be NULL, although the return value may be an approximation in some cases, so there isn't guaranteed round-trip fidelity.
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:39:
/System/Library/Frameworks/AppKit.framework/Headers/NSColorSpace.h:50:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) void * /* ColorSyncProfileRef */colorSyncProfile NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:40:
/System/Library/Frameworks/AppKit.framework/Headers/NSBitmapImageRep.h:105:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) unsigned char *bitmapData NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:97:
/System/Library/Frameworks/AppKit.framework/Headers/NSScreen.h:39:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) const NSWindowDepth *supportedWindowDepths NS_RETURNS_INNER_POINTER; /* 0 terminated */
^ ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/cef/cef_darwin.go:13:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:164:
/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:126:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) struct _CGLPixelFormatObject *CGLPixelFormatObj NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:241:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) struct _CGLContextObject *CGLContextObj NS_RETURNS_INNER_POINTER;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
22 errors generated.
Hi everyone,
I tried to update the CEF binaries, because "CEF 3 branch 1750 revision 1590" is quite outdated. So I copied the same files from a newer version of CEF. When I tried to build the app, CEF complains that it could not load its .pak files - though they are in the "cwd" directory.
So what's the proper way to update CEF in CEF2go?
Thanks in advance!
Two suggestions:
atom/electron seems to be a robust and well maintained project and could become a solid foundation for cef2go.
Also, Go lacks a standard GUI toolkit and cef2go could be a good choice, if that happens, then the name "cef2go" is not good enough.
To make the project index better in terms of Go, I'd suggest you to create a submodule for both include and handlers folder. You can then delete the tag folder as well. Then the project's main language will then be Go rather than C++.
I tested the changes on my forked project and it seems to work well. Although, as I know little C++ I'd rather have you host the submodules for your own project, so therefore I've not linked a pull request on this issue.
Currently SWIG doesn't work with Go on Windows. When building misc/swig/stdio, it results in error. Issue reported in the Go project:
https://code.google.com/p/go/issues/detail?id=7281
In comment #3
in that issue I've added some useful links to solutions/hacks that can fix the problem. But this is not official, so I think that cef2go should wait until it is patched in official SWIG and/or Go releases.
See the issue in the SWIG tracker:
"Go: SWIG doesn't work on Windows"
swig/swig#100
Go will support SWIG static linking in version 1.3 (targetted for June 2014), see the Go issue:
"cmd/go: build static swig wrapper"
https://code.google.com/p/go/issues/detail?id=7156
It happened only once. Couldn't reproduce anymore.
Was it CEF fault? or GTK fault?
From the logs, compared to other successful launches, I see that there was one message missing, about the sandbox missing "Running renderer without sandbox". So it seems that the call to cef_create_browser_sync() failed. Did it return a null pointer? Need to add a check for that.
It would be a good idea to do some stress testing. Do 1000 launches of application and see if we can reproduce the problem.
There is no keyboard focus, it is required to click with mouse in browser content. Also when application is minimized and then restored the keyboard focus is lost.
Set CefSettings.remote_debugging_port to a random value between 49152 and 65535 to enable developer tools.
The C++ code for showing devtools is:
bool ShowDevTools(CefRefPtr<CefBrowser> browser) {
CefWindowInfo windowInfo;
CefBrowserSettings settings;
#if defined(OS_WIN)
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
#endif
browser->GetHost()->ShowDevTools(windowInfo, browser->GetHost()->GetClient(), settings);
return true;
}
The C++ code for adding a menu item is:
CefContextMenuHandler::OnBeforeContextMenu() {
model->AddItem(_MENU_ID_DEVTOOLS, "Show Developer Tools");
}
CefContextMenuHandler::OnContextMenuCommand() {
if (command_id == _MENU_ID_DEVTOOLS) {
ShowDevTools(browser);
return true;
}
}
I have followed all steps mentioned in the Readme, downloaded 64bit CEF binaries and placed them correctly in the Release folder, this is the "make" command output :
Copying CEF framework directory to Release/tmp
go install -x cef
WORK=/var/folders/c6/snmkcstx5t927hn229tjvg480000gn/T/go-build794425398
rm -f Release/cef2go.app/Contents/MacOS/cef2go
go build -x -ldflags "-r ." -o Release/cef2go.app/Contents/MacOS/cef2go src/main_darwin.go
WORK=/var/folders/c6/snmkcstx5t927hn229tjvg480000gn/T/go-build373331596
mkdir -p $WORK/cocoa/_obj/
mkdir -p $WORK/
cd /Users/tony/go/src/github.com/CzarekTomczak/cef2go/src/cocoa
CGO_LDFLAGS="-F/Users/tony/go/src/github.com/CzarekTomczak/cef2go/Release/tmp" "-framework" "Cocoa" "-framework" "cef" "-framework" "Cocoa" "-framework" "Cocoa" /usr/local/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/cocoa/_obj/ -- -I $WORK/cocoa/_obj/ -I./../../ -x objective-c -I./../../ -x objective-c cocoa.go export.go
/usr/local/go/pkg/tool/darwin_amd64/6c -F -V -w -trimpath $WORK -I $WORK/cocoa/_obj/ -I /usr/local/go/pkg/darwin_amd64 -o $WORK/cocoa/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/cocoa/_obj/_cgo_defun.c
clang -I . -I. -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -print-libgcc-file-name
clang -I . -I. -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -I $WORK/cocoa/_obj/ -g -O2 -I./../../ -x objective-c -I./../../ -x objective-c -o $WORK/cocoa/_obj/_cgo_main.o -c $WORK/cocoa/_obj/_cgo_main.c
clang -I . -I. -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -I $WORK/cocoa/_obj/ -g -O2 -I./../../ -x objective-c -I./../../ -x objective-c -o $WORK/cocoa/_obj/_cgo_export.o -c $WORK/cocoa/_obj/_cgo_export.c
clang -I . -I. -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -I $WORK/cocoa/_obj/ -g -O2 -I./../../ -x objective-c -I./../../ -x objective-c -o $WORK/cocoa/_obj/cocoa.cgo2.o -c $WORK/cocoa/_obj/cocoa.cgo2.c
src/cocoa/cocoa.go:30:5: warning: implicit declaration of function '_GoDestroySignal' is invalid in C99 [-Wimplicit-function-declaration]
clang -I . -I. -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -I $WORK/cocoa/_obj/ -g -O2 -I./../../ -x objective-c -I./../../ -x objective-c -o $WORK/cocoa/_obj/export.cgo2.o -c $WORK/cocoa/_obj/export.cgo2.c
clang -I . -I. -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -o $WORK/cocoa/_obj/cgo.o $WORK/cocoa/_obj/_cgo_main.o $WORK/cocoa/_obj/_cgo_export.o $WORK/cocoa/_obj/cocoa.cgo2.o $WORK/cocoa/_obj/export.cgo2.o -F/Users/tony/go/src/github.com/CzarekTomczak/cef2go/Release/tmp -framework Cocoa -framework cef -framework Cocoa -framework Cocoa
/usr/local/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/cocoa/_obj/ -dynimport $WORK/cocoa/_obj/cgo.o -dynout $WORK/cocoa/_obj/_cgo_import.c
/usr/local/go/pkg/tool/darwin_amd64/6c -F -V -w -trimpath $WORK -I $WORK/cocoa/_obj/ -I /usr/local/go/pkg/darwin_amd64 -o $WORK/cocoa/_obj/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/cocoa/_obj/_cgo_import.c
clang -I . -I. -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -o $WORK/cocoa/_obj/_all.o $WORK/cocoa/_obj/_cgo_export.o $WORK/cocoa/_obj/cocoa.cgo2.o $WORK/cocoa/_obj/export.cgo2.o -F/Users/tony/go/src/github.com/CzarekTomczak/cef2go/Release/tmp -Wl,-r -nostdlib
/usr/local/go/pkg/tool/darwin_amd64/6g -o $WORK/cocoa.a -trimpath $WORK -p cocoa -D _/Users/tony/go/src/github.com/CzarekTomczak/cef2go/src/cocoa -I $WORK -pack $WORK/cocoa/_obj/_cgo_gotypes.go $WORK/cocoa/_obj/cocoa.cgo1.go $WORK/cocoa/_obj/export.cgo1.go
pack r $WORK/cocoa.a $WORK/cocoa/_obj/_cgo_import.6 $WORK/cocoa/_obj/_cgo_defun.6 $WORK/cocoa/_obj/_all.o # internal
mkdir -p $WORK/command-line-arguments/_obj/
mkdir -p Release/cef2go.app/Contents/MacOS/
cd /Users/tony/go/src/github.com/CzarekTomczak/cef2go/src
/usr/local/go/pkg/tool/darwin_amd64/6g -o $WORK/command-line-arguments.a -trimpath $WORK -p command-line-arguments -complete -D _/Users/tony/go/src/github.com/CzarekTomczak/cef2go/src -I $WORK -I /Users/tony/go/src/github.com/CzarekTomczak/cef2go/pkg/darwin_amd64 -pack ./main_darwin.go
cd .
/usr/local/go/pkg/tool/darwin_amd64/6l -o Release/cef2go.app/Contents/MacOS/cef2go -L $WORK -L /Users/tony/go/src/github.com/CzarekTomczak/cef2go/pkg/darwin_amd64 -r . -extld=clang -extldflags=-I. $WORK/command-line-arguments.a
install_name_tool -change @executable_path/Chromium\ Embedded\ Framework @executable_path/../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework Release/cef2go.app/Contents/MacOS/cef2go
cp -f Release/example.html Release/cef2go.app/Contents/MacOS/example.html
cd Release/cef2go.app/Contents/MacOS && ./cef2go && cd ../../../../
dyld: Library not loaded: @executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework
Referenced from: /Users/tony/go/src/github.com/CzarekTomczak/cef2go/Release/cef2go.app/Contents/MacOS/./cef2go
Reason: image not found
/bin/sh: line 1: 58752 Trace/BPT trap: 5 ./cef2go
make[1]: *** [Darwin] Error 133
make: *** [detect_os] Error 2
Any idea about how to solve the problem ?
Hello,
I tried to build by following the README.md but i had this output:
go install gtk
# gtk
src/gtk/gtk.go: In function ‘TerminationSignal’:
src/gtk/gtk.go:14:39: warning: implicit declaration of function ‘cef_quit_message_loop’ [-Wimplicit-function-declaration]
void TerminationSignal(int signatl) { cef_quit_message_loop(); }
^~~~~~~~~~~~~~~~~~~~~
src/gtk/gtk.go: In function ‘DestroySignal’:
src/gtk/gtk.go:20:5: warning: implicit declaration of function ‘_GoDestroySignal’ [-Wimplicit-function-declaration]
_GoDestroySignal(widget, data);
^~~~~~~~~~~~~~~~
go install cef
# cef
In file included from /home/frederic/go/src/github.com/cztomczak/cef2go/include/internal/cef_types.h:46:0,
from /home/frederic/go/src/github.com/cztomczak/cef2go/include/capi/cef_base_capi.h:43,
from /home/frederic/go/src/github.com/cztomczak/cef2go/include/capi/cef_app_capi.h:45,
from src/cef/cef.go:27:
/home/frederic/go/src/github.com/cztomczak/cef2go/include/internal/cef_types_linux.h:38:21: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^
compilation terminated.
Makefile:33 : la recette pour la cible « Linux » a échouée
make[1]: *** [Linux] Erreur 2
make[1] : on quitte le répertoire « /home/frederic/go/src/github.com/cztomczak/cef2go »
Makefile:30 : la recette pour la cible « detect_os » a échouée
make: *** [detect_os] Erreur 2
Development libraries are installed, i checked the needings with:
pkg-config --libs --cflags gtk+-2.0
The output is:
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype
I used latest CEF binaries (cef_binary_3.3163.1670.g934eaba_linux64.tar.bz2)
Add Mac support.
What OS X versions should we support?
An example of using Cocoa API in Go:
https://gist.github.com/kavu/6740536
hi,
in win 7x64 compile cef2go can' success,notice me bellow:
F:\code\chrome\cef2go>go build -o Release/cef2go.exe src/main_win.go
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible ./../../Release/libcef.lib when searching fo
r -llibcef
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible ./../../Release/libcef.dll when searching fo
r -llibcef
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible ./../../Release/libcef.lib when searching fo
r -llibcef
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible ./../../Release/libcef.dll when searching fo
r -llibcef
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible ./../../Release\libcef.lib when searching fo
r -llibcef
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw3
2/bin/ld.exe: cannot find -llibcef
collect2.exe: error: ld returned 1 exit status
After reading around the forums I'm realizing that upgrading libcef itself on linux is not just a matter of dropping in the new headers and .so file, but that the build hosted here is different than the one provided by cefbuilds. Is it possible to upload a build of the new stable release? Or document the build process somewhere?
What do you think are the most important things to do? Please discuss it on the Forum. I have already posted some info of what are the plans. See this topic: https://groups.google.com/d/topic/cef2go/wjyYg9nxVQg/discussion
The "size" member is not set. The same problem in cef_browser_settings_t and probably others. Check the code carefully and fix it.
See the cefcapi project that shows how to use C API in CEF correctly:
https://github.com/CzarekTomczak/cefcapi
What toolkit should we use for window creation in the example?
Probably go-gtk? https://github.com/mattn/go-gtk
Binary example doesn't work anymore on WinXP after installing Windows Updates.
Issue reported to the Go project:
"Windows XP: "panic before malloc heap initialized" after installing Windows Updates"
https://code.google.com/p/go/issues/detail?id=7284
I look up example in src, not found how to set width and height of windows. I noticed that CreateWindowEx has parameters about width and height, but how to use it ?
I have a project that requires a web page with flash in the app, but I have not found a way to support flash.
Make necessary changes so that the cef2go package can be imported with statement like this: import github.com/CzarekTomczak/cef2go
.
Not yet sure how to do that, golang documentation is not clear in that regard.
I think that after restructuring, the main_windows.go example should update this code:
import cef
import wingui
To this:
import github.com/CzarekTomczak/cef2go/cef
import github.com/CzarekTomczak/cef2go/wingui
Some questions:
import cef
for local development and the other for download with import github.com/...
? Do we need to make two copies of the same file or is there a better way to do this? Is there something like try: import cef except: import github.com/...
?import github.com/...
is not enough? What would be the simplest Hello World example? This needs further investigation.I don't think there can be created a simple one click HelloWorld example. It is still required to download binaries and copy them to the Release/ directory, as explained in README.
Hello, I can't make "Hello world" example successfully.
First of all, it's difficult to understand where to place builded/installed CzarekTomczak/cef2go
repository or how to structure the code.
After some attempts, I make the following:
#I add the root of cef2go repository into ~/.profile file:
#export GOPATH=$HOME/cloud/go:$HOME/cloud/go/src/github.com/CzarekTomczak/cef2go
~/cloud/go/src/github.com/CzarekTomczak/cef2go
#Create dead simple project:
~/cloud/go/src/myapp/app.go
After that, I try to go run app.go
in the project directory, but I get the following:
/tmp/go-build526896982/command-line-arguments/_obj/exe/app: error while loading shared libraries: libcef.so: cannot open shared object file: No such file or directory
exit status 127
What need I do?
Can it package an android app that uses android web view as the client and a go server ?
Many people are asking for this, so it should become a high priority.
What should the example do? What libraries to use in the example? Some framework/game engine or just plain win32 WM_PAINT?
Hello, this project is very interesting to me, because I need make stack of golang, html, css, js and sqlite. However I don't know much about programming in general, so it is difficult to get started. It seems like the project is intended for experienced users. I'm web developer and golang is my first programming language I've started to learn it recently.
So it is very difficult to build even "hello world" app. There is nothing about file structure, many unknow files, folders etc. I think each root file and folder in the project should be explained, because it looks very disgusting.
I'm having problems similar to #8 in an application I'm working on. I'm creating this as a seperate issue, because in my fork I've actually switched to using create_browser_sync
, and browser creation is failing way more than once in a while. I know (based on your notes) that this is not the ideal way to do things, however, this puts me in a bind because I need access to the cef_browser
instance so that I can get access to the cef_frame
and call functions on it (i.e. execute_javascript
and load_url
). It seems like you had some ideas on reconciling but I'm lost as to how to hook into those cef lifespan events.
Any help is hugely appreciated. Thanks for the great work on this wrapper - its enabling us to build some pretty awesome things!
Closing window using keyboard doesn't work.
cannot find -llibcef
collect2.exe: error: ld returned 1 exit status
See the main_linux.go and main_windows.go files.
Daniel Theophanes suggested to use something like this:
https://bitbucket.org/kardianos/osext/src
On Windows the executable's path can be obtained by a call to GetModuleFileNameW().
Though I don't see an example for Linux in the link above.
Now that godoc.org indexes our project fine, one could work on the documentation comments in go sources.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.