github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/cef2go.README.md (about)

     1  CEF2go
     2  ======
     3  
     4  Table of contents:
     5   * [Introduction](#introduction)
     6   * [Compatibility](#compatibility)
     7   * [Binary examples](#binary-examples)
     8   * [Help](#help)
     9   * [Support Development](#support-development)
    10   * [Forks worth a look](#forks-worth-a-look)
    11   * [Communication between Go and Javascript]
    12      (#communication-between-go-and-javascript)
    13   * [Getting started on Windows](#getting-started-on-windows)
    14   * [Getting started on Linux](#getting-started-on-linux)
    15   * [Getting started on Mac OS X](#getting-started-on-mac-os-x)
    16   * [Built a cool app?](#built-a-cool-app)
    17   * [Familiar with Python or PHP?](#familiar-with-python-or-php)
    18  
    19  
    20  Introduction
    21  ------------
    22  
    23  CEF2go is an open source project founded by [Czarek Tomczak]
    24  (http://www.linkedin.com/in/czarektomczak) in 2014
    25  to provide Go bindings for the [Chromium Embedded Framework]
    26  (https://code.google.com/p/chromiumembedded/) (CEF).
    27  CEF2go can act as a GUI toolkit, allowing you to create an HTML 5
    28  based GUI in your application. Or you can provide browser
    29  capabilities to your application.
    30  
    31  Currently the CEF2go example creates just a simple window with
    32  the Chromium browser embedded. You can set a few options for
    33  your application like the cache directory. More advanced bindings
    34  are in plans, and that includes javascript bindings and callbacks, so
    35  that you can have bidirectional communication between Go and
    36  Javascript in a native way. Though, it is already possible to
    37  communicate with Go from Javascript, see the "Communication 
    38  between Go and Javascript" section further down this page.
    39  
    40  CEF2go is licensed under the BSD 3-clause license, see the cef2go.LICENSE
    41  file.
    42  
    43  
    44  Compatibility
    45  -------------
    46  Supported platforms: Windows, Linux, Mac OSX.
    47  
    48  CEF2go was tested and works fine with Go 1.2 / Go 1.3.3.
    49  
    50  
    51  Binary examples
    52  ---------------
    53  The binary examples provided here use CEF 3 branch 1750 (Chrome 33
    54  beta channel as of build time).
    55  
    56  Windows example: [releases/tag/v0.10]
    57  (https://github.com/CzarekTomczak/cef2go/releases/tag/v0.10)  
    58  
    59  Linux example: [releases/tag/v0.11]
    60  (https://github.com/CzarekTomczak/cef2go/releases/tag/v0.11)  
    61  
    62  Mac OSX example: [releases/tag/v0.12]
    63  (https://github.com/CzarekTomczak/cef2go/releases/tag/v0.12)
    64  
    65  
    66  Help
    67  ----
    68  Having problems or questions? Go to the [CEF2go Forum]
    69  (http://groups.google.com/group/cef2go). Please do not use Issue 
    70  Tracker for asking questions.
    71  
    72  See the auto generated docs for the following packages:
    73   * [cef](https://godoc.org/github.com/CzarekTomczak/cef2go/src/cef)
    74   * [cocoa](https://godoc.org/github.com/CzarekTomczak/cef2go/src/cocoa)
    75   * [gtk](https://godoc.org/github.com/CzarekTomczak/cef2go/src/gtk)
    76   * [wingui](https://godoc.org/github.com/CzarekTomczak/cef2go/src/wingui)
    77  
    78  
    79  Support development
    80  -------------------
    81  
    82  Both code contributions and Paypal donations are welcome.
    83  [![Donate through Paypal]
    84  (https://raw.githubusercontent.com/CzarekTomczak/cef2go/master/donate.gif)]
    85  (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9CAMRSA48UVT8)
    86  
    87  
    88  Forks worth a look
    89  ------------------
    90   * [fromkeith/cef2go](https://github.com/fromkeith/cef2go)
    91      * Adds support for client handlers (eg. Display, LifeSpan, Request,
    92      Resource, Scheme, Download).
    93      * Exposes new objects (eg. Browser, Frame, Request, Response). 
    94      * Tested only on Windows.
    95   * [paperlesspost/cef2go](https://github.com/paperlesspost/cef2go)
    96      * Adds suport for a few client handlers including Render handler
    97      (off-screen rendering to a raw pixel buffer). 
    98      * Implements V8 callbacks for native communication from Javascript
    99      to Go.
   100      * Tested only on Linux.
   101  
   102  
   103  Communication between Go and Javascript
   104  ---------------------------------------
   105  For now to make communication between Go and javascript possible
   106  you have to run an internal http server and communicate using 
   107  XMLHttpRequests in javascript. See the [http_server_windows.go]
   108  (https://github.com/CzarekTomczak/cef2go/blob/master/src/http_server_windows.go)
   109  example that embeds both a http server and a Chromium browser
   110  in a standalone application. To run it type "build.bat http_server". 
   111  The http server is listening at 127.0.0.1:54007, thus it is not 
   112  accessible from the outside, it can be accessed only from the 
   113  machine it is running on.
   114  
   115  
   116  Getting started on Windows
   117  --------------------------
   118  1. Install Go 32-bit. CEF 64-bit binaries are still experimental and
   119     were not tested.
   120  
   121  2. Install mingw 32-bit and add C:\MinGW\bin to PATH. You can install mingw
   122     using [mingw-get-setup.exe]
   123     (http://sourceforge.net/projects/mingw/files/Installer/).
   124     Select packages to install: "mingw-developer-toolkit",
   125     "mingw32-base", "msys-base". CEF2go was tested and works fine
   126     with GCC 4.8.2. You can check gcc version with "gcc --version".
   127  
   128  3. Download CEF 3 branch 1750 revision 1590 binaries:
   129     [cef_binary_3.1750.1590_windows32.7z]
   130     (https://github.com/CzarekTomczak/cef2go/releases/download/cef3-b1750-r1590/cef_binary_3.1750.1590_windows32.7z)  
   131     Copy Release/* to cef2go/Release  
   132     Copy Resources/* to cef2go/Release  
   133  
   134  4. Run build.bat (or "build.bat noconsole" to get rid of the console
   135      window when running the final executable)
   136  
   137  
   138  Getting started on Linux
   139  ------------------------
   140  1. These instructions work fine with Ubuntu 12.04 64-bit. 
   141     On Ubuntu 13/14 libudev.so.0 is missing and it is required to 
   142     create a symbolic link to libudev.so.1. For example on 
   143     Ubuntu 14.04 64-bit run this command: 
   144    `cd /lib/x86_64-linux-gnu/ && sudo ln -sf libudev.so.1 libudev.so.0`.
   145  
   146  2. Install CEF dependencies:  
   147     `sudo apt-get install build-essential libgtk2.0-dev libgtkglext1-dev`
   148  
   149  3. Download CEF 3 branch 1750 revision 1604 binaries:
   150     [cef_binary_notcmalloc_3.1750.1604_linux64.zip]
   151     (https://github.com/CzarekTomczak/cef2go/releases/download/cef3-b1750-r1604/cef_binary_notcmalloc_3.1750.1604_linux64.zip)  
   152     Copy Release/* to cef2go/Release
   153  
   154  4. Run "make" command.
   155  
   156  
   157  Getting started on Mac OS X
   158  ---------------------------
   159  1. These instructions work fine with OS X 10.8 Mountain Lion.
   160     May also work with other versions, but were not tested.
   161  
   162  2. Install Go 32-bit. Tested with Go 1.2-386 for OSX 10.8.
   163     CEF binaries for OSX 64-bit are still experimental, that's
   164     why we're using 32-bit. Though you can try building with
   165     CEF 64-bit, download binaries from [cefbuilds.com]
   166     (http://cefbuilds.com).
   167  
   168  3. Install command line tools (make is required) from:  
   169     https://developer.apple.com/downloads/  
   170     (In my case command line tools for Mountain Lion from September 2013)
   171  
   172  4. Install XCode (gcc that comes with XCode is required). 
   173     Use the link above. In my case it was XCode 4.6.3 from June 2013.
   174  
   175  5. Download CEF 3 branch 1750 revision 1625 binaries for 32-bit:
   176     [releases/tag/v0.12]
   177     (https://github.com/CzarekTomczak/cef2go/releases/tag/v0.12)  
   178     Copy the cef2go.app directory to cef2go/Release.
   179  
   180  6. Run "make" command.
   181  
   182  
   183  Built a cool app?
   184  -----------------
   185  Built a cool app using CEF2go and would like to share info with
   186  the community? Talk about it on the [CEF2go Forum]
   187  (http://groups.google.com/group/cef2go).
   188  
   189  
   190  Familiar with Python or PHP?
   191  ----------------------------
   192  The author of CEF2go is also working on CEF bindings
   193  for other languages. For Python see the [CEF Python]
   194  (https://code.google.com/p/cefpython/) project. For PHP see the 
   195  [PHP Desktop](https://code.google.com/p/phpdesktop/) project.
   196