Git Product home page Git Product logo

cef2go's Introduction

CEF2go

Table of contents:

Introduction

CEF2go is an open source project founded by Czarek Tomczak in 2014 to provide Go bindings for the Chromium Embedded Framework (CEF). CEF2go can act as a GUI toolkit, allowing you to create an HTML 5 based GUI in your application. Or you can provide browser capabilities to your application.

Currently the CEF2go example creates just a simple window with the Chromium browser embedded. You can set a few options for your application like the cache directory. More advanced bindings are in plans, and that includes javascript bindings and callbacks, so that you can have bidirectional communication between Go and Javascript in a native way. Though, it is already possible to communicate with Go from Javascript, see the "Communication between Go and Javascript" section further down this page.

CEF2go is licensed under the BSD 3-clause license, see the LICENSE file.

Compatibility

Supported platforms: Windows, Linux, Mac OSX.

CEF2go was tested and works fine with Go 1.2 / Go 1.3.3.

Binary examples

The binary examples provided here use CEF 3 branch 1750 (Chrome 33 beta channel as of build time).

Windows example: releases/tag/v0.10

Linux example: releases/tag/v0.11

Mac OSX example: releases/tag/v0.12

Help

Having problems or questions? Go to the CEF2go Forum. Please do not use Issue Tracker for asking questions.

See the auto generated docs for the following packages:

Support development

Both code contributions and Paypal donations are welcome. Donate through Paypal

Thanks to those who have made a Paypal donation:

  • David Witten

Forks worth a look

  • fromkeith/cef2go
    • Adds support for client handlers (eg. Display, LifeSpan, Request, Resource, Scheme, Download).
    • Exposes new objects (eg. Browser, Frame, Request, Response).
    • Tested only on Windows.
  • paperlesspost/cef2go
    • Adds suport for a few client handlers including Render handler (off-screen rendering to a raw pixel buffer).
    • Implements V8 callbacks for native communication from Javascript to Go.
    • Tested only on Linux.

Communication between Go and Javascript

For now to make communication between Go and javascript possible you have to run an internal http server and communicate using XMLHttpRequests in javascript. See the http_server_windows.go example that embeds both a http server and a Chromium browser in a standalone application. To run it type "build.bat http_server". The http server is listening at 127.0.0.1:54007, thus it is not accessible from the outside, it can be accessed only from the machine it is running on.

Getting started on Windows

  1. Install Go 32-bit. CEF 64-bit binaries are still experimental and were not tested.

  2. Install mingw 32-bit and add C:\MinGW\bin to PATH. You can install mingw using mingw-get-setup.exe. Select packages to install: "mingw-developer-toolkit", "mingw32-base", "msys-base". CEF2go was tested and works fine with GCC 4.8.2. You can check gcc version with "gcc --version".

  3. Download CEF 3 branch 1750 revision 1590 binaries: cef_binary_3.1750.1590_windows32.7z
    Copy Release/* to cef2go/Release
    Copy Resources/* to cef2go/Release

  4. Run build.bat (or "build.bat noconsole" to get rid of the console window when running the final executable)

Getting started on Linux

  1. These instructions work fine with Ubuntu 12.04 64-bit. On Ubuntu 13/14 libudev.so.0 is missing and it is required to create a symbolic link to libudev.so.1. For example on Ubuntu 14.04 64-bit run this command: cd /lib/x86_64-linux-gnu/ && sudo ln -sf libudev.so.1 libudev.so.0.

  2. Install CEF dependencies:
    sudo apt-get install build-essential libgtk2.0-dev libgtkglext1-dev

  3. Download CEF 3 branch 1750 revision 1604 binaries: cef_binary_notcmalloc_3.1750.1604_linux64.zip
    Copy Release/* to cef2go/Release

  4. Run "make" command.

Getting started on Mac OS X

  1. These instructions work fine with OS X 10.8 Mountain Lion. May also work with other versions, but were not tested.

  2. Install Go 32-bit. Tested with Go 1.2-386 for OSX 10.8. CEF binaries for OSX 64-bit are still experimental, that's why we're using 32-bit. Though you can try building with CEF 64-bit, download binaries from cefbuilds.com.

  3. Install command line tools (make is required) from:
    https://developer.apple.com/downloads/
    (In my case command line tools for Mountain Lion from September 2013)

  4. Install XCode (gcc that comes with XCode is required). Use the link above. In my case it was XCode 4.6.3 from June 2013.

  5. Download CEF 3 branch 1750 revision 1625 binaries for 32-bit: releases/tag/v0.12
    Copy the cef2go.app directory to cef2go/Release.

  6. Run "make" command.

Built a cool app?

Built a cool app using CEF2go and would like to share info with the community? Talk about it on the CEF2go Forum.

Familiar with Python or PHP?

The author of CEF2go is also working on CEF bindings for other languages. For Python see the CEF Python project. For PHP see the PHP Desktop project.

cef2go's People

Contributors

cztomczak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cef2go's Issues

Building with CEF 64-bit for OS X question

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.

error while loading shared libraries: libcef.so (sandboxing)

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?

Cannot build with go1.9 for GTK ??

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)

Linux/OSX: browser creation fails once in a while

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.

Off-screen rendering (OSR) support

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?

Where are examples how to build your own app for newbie?

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.

How to set windows width and height?

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 ?

android web view

Can it package an android app that uses android web view as the client and a go server ?

Use CEF C++ API on Windows with SWIG and gc Go compiler

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

How to support flash player

I have a project that requires a web page with flash in the app, but I have not found a way to support flash.

create_browser problems

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!

Building on OSX El Capitan

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

Restructure files to allow for easy import of cef2go package

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:

  1. Should package be installed with "go get" or "go install"?
  2. Will it also work by writing "import cef2go/cef" after cef2go package is installed?
  3. Are there any additional changes required to run.bat and Makefile?
  4. The main_windows.go example - should this example be provided in two copies, one with 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/...?
  5. cef2go is not a pure go package. After compiling to run it it is required for .so/.dll files to be in app directory. Adding it to PATH may not be the best idea, as it may cause loading of wrong .dll libraries (one such issue was already reported on forum). So how do we go about that, writing 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.

CEF Callbacks to execute Go Code (communication mechanism)

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

Build failures on OSX

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.

Move C++ files into submodules to make the repo show up as Go project

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.

compile error

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/test/cef2go-0.10/src/cef

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

New cef linux release or build instructions

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?

Mouse context menu and <select> control crash app on Mac

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().

Add Developer Tools to mouse context menu

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;
    }
}

compile error

cannot find -llibcef
collect2.exe: error: ld returned 1 exit status

Update CEF binaries

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!

Unable to compile on OSX 64bit

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

cocoa

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 ?

Go 1.3 support

With Go 1.3 the project compiles - but the example most likely crashes under Windows.

Auto keyboard focus

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.

cef2go in win7x64 error

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

/F/code/chrome/cef2go/src/cef

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.