├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── AUTHORS ├── LICENSE ├── Makefile ├── README.md ├── Release ├── .gitignore └── example.html ├── build.bat ├── donate.gif ├── handlers ├── cef_app.h ├── cef_base.h └── cef_client.h ├── include ├── capi │ ├── cef_app_capi.h │ ├── cef_auth_callback_capi.h │ ├── cef_base_capi.h │ ├── cef_browser_capi.h │ ├── cef_browser_process_handler_capi.h │ ├── cef_callback_capi.h │ ├── cef_client_capi.h │ ├── cef_command_line_capi.h │ ├── cef_context_menu_handler_capi.h │ ├── cef_cookie_capi.h │ ├── cef_dialog_handler_capi.h │ ├── cef_display_handler_capi.h │ ├── cef_dom_capi.h │ ├── cef_download_handler_capi.h │ ├── cef_download_item_capi.h │ ├── cef_drag_data_capi.h │ ├── cef_drag_handler_capi.h │ ├── cef_focus_handler_capi.h │ ├── cef_frame_capi.h │ ├── cef_geolocation_capi.h │ ├── cef_geolocation_handler_capi.h │ ├── cef_jsdialog_handler_capi.h │ ├── cef_keyboard_handler_capi.h │ ├── cef_life_span_handler_capi.h │ ├── cef_load_handler_capi.h │ ├── cef_menu_model_capi.h │ ├── cef_origin_whitelist_capi.h │ ├── cef_path_util_capi.h │ ├── cef_process_message_capi.h │ ├── cef_process_util_capi.h │ ├── cef_render_handler_capi.h │ ├── cef_render_process_handler_capi.h │ ├── cef_request_capi.h │ ├── cef_request_context_capi.h │ ├── cef_request_context_handler_capi.h │ ├── cef_request_handler_capi.h │ ├── cef_resource_bundle_handler_capi.h │ ├── cef_resource_handler_capi.h │ ├── cef_response_capi.h │ ├── cef_scheme_capi.h │ ├── cef_stream_capi.h │ ├── cef_string_visitor_capi.h │ ├── cef_task_capi.h │ ├── cef_trace_capi.h │ ├── cef_url_capi.h │ ├── cef_urlrequest_capi.h │ ├── cef_v8_capi.h │ ├── cef_values_capi.h │ ├── cef_web_plugin_capi.h │ ├── cef_xml_reader_capi.h │ └── cef_zip_reader_capi.h └── internal │ ├── cef_build.h │ ├── cef_export.h │ ├── cef_linux.h │ ├── cef_mac.h │ ├── cef_ptr.h │ ├── cef_string.h │ ├── cef_string_list.h │ ├── cef_string_map.h │ ├── cef_string_multimap.h │ ├── cef_string_types.h │ ├── cef_string_wrappers.h │ ├── cef_time.h │ ├── cef_tuple.h │ ├── cef_types.h │ ├── cef_types_linux.h │ ├── cef_types_mac.h │ ├── cef_types_win.h │ ├── cef_types_wrappers.h │ └── cef_win.h ├── src ├── cef │ ├── cef.go │ ├── cef_darwin.go │ ├── cef_linux.go │ └── cef_windows.go ├── cocoa │ ├── cocoa.go │ └── export.go ├── gtk │ ├── export.go │ └── gtk.go ├── http_server_windows.go ├── main_darwin.go ├── main_linux.go ├── main_windows.go ├── tests │ └── cef_test.go └── wingui │ ├── gui.go │ ├── winapi.go │ └── zwinapi.go └── tag ├── !README.txt ├── !tag100.py ├── tag01.go ├── tag02.go ├── tag03.go ├── tag04.go ├── tag05.go ├── tag06.go ├── tag07.go ├── tag08.go ├── tag09.go ├── tag10.go ├── tag11.go ├── tag12.go ├── tag13.go ├── tag14.go ├── tag15.go ├── tag16.go ├── tag17.go ├── tag18.go ├── tag19.go ├── tag20.go ├── tag21.go ├── tag22.go ├── tag23.go ├── tag24.go ├── tag25.go ├── tag26.go ├── tag27.go ├── tag28.go ├── tag29.go ├── tag30.go ├── tag31.go ├── tag32.go ├── tag33.go ├── tag34.go ├── tag35.go ├── tag36.go ├── tag37.go ├── tag38.go ├── tag39.go ├── tag40.go ├── tag41.go ├── tag42.go ├── tag43.go ├── tag44.go ├── tag45.go ├── tag46.go ├── tag47.go ├── tag48.go ├── tag49.go ├── tag50.go ├── tag51.go ├── tag52.go ├── tag53.go ├── tag54.go ├── tag55.go ├── tag56.go ├── tag57.go ├── tag58.go ├── tag59.go ├── tag60.go ├── tag61.go ├── tag62.go ├── tag63.go ├── tag64.go ├── tag65.go ├── tag66.go ├── tag67.go ├── tag68.go ├── tag69.go ├── tag70.go ├── tag71.go ├── tag72.go ├── tag73.go ├── tag74.go ├── tag75.go ├── tag76.go ├── tag77.go ├── tag78.go ├── tag79.go ├── tag80.go ├── tag81.go ├── tag82.go ├── tag83.go ├── tag84.go ├── tag85.go ├── tag86.go ├── tag87.go ├── tag88.go ├── tag89.go ├── tag90.go ├── tag91.go ├── tag92.go ├── tag93.go ├── tag94.go ├── tag95.go ├── tag96.go ├── tag97.go ├── tag98.go └── tag99.go /.gitattributes: -------------------------------------------------------------------------------- 1 | LICENSE text eol=crlf 2 | *.md text eol=crlf 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9CAMRSA48UVT8'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | pkg/ -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Czarek Tomczak 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 The CEF2go authors, see the AUTHORS file. 2 | All rights reserved. 3 | 4 | Project website: 5 | https://github.com/CzarekTomczak/cef2go 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, this 14 | list of conditions and the following disclaimer in the documentation and/or 15 | other materials provided with the distribution. 16 | 17 | * Neither the name of the {organization} nor the names of its 18 | contributors may be used to endorse or promote products derived from 19 | this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | This product includes the following third party libraries: 33 | * Chromium Embedded Framework licensed under the BSD 3-clause license. 34 | See: https://code.google.com/p/chromiumembedded/ 35 | 36 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: detect_os Linux Darwin clean 2 | 3 | export GOPATH=$(PWD) 4 | UNAME_S = $(shell uname -s) 5 | 6 | ifeq ($(UNAME_S), Linux) 7 | INC=-I. \ 8 | -I/usr/include/gtk-2.0 \ 9 | -I/usr/include/glib-2.0 \ 10 | -I/usr/include/cairo \ 11 | -I/usr/include/pango-1.0 \ 12 | -I/usr/include/gdk-pixbuf-2.0 \ 13 | -I/usr/include/atk-1.0 \ 14 | -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \ 15 | -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include \ 16 | -I/usr/lib/i386-linux-gnu/gtk-2.0/include \ 17 | -I/usr/lib/i386-linux-gnu/glib-2.0/include \ 18 | -I/usr/lib64/glib-2.0/include \ 19 | -I/usr/lib64/gtk-2.0/include 20 | export CC=gcc $(INC) 21 | export CGO_LDFLAGS=-L $(PWD)/Release -lcef 22 | else ifeq ($(UNAME_S), Darwin) 23 | INC=-I. 24 | export CGO_ENABLED=1 25 | export CC=clang $(INC) 26 | export CGO_LDFLAGS=-F$(PWD)/Release/tmp -framework Cocoa -framework cef 27 | endif 28 | 29 | detect_os: 30 | make $(UNAME_S) 31 | 32 | Linux: 33 | clear 34 | go install gtk 35 | go install cef 36 | go test -ldflags "-r $(PWD)/Release" src/tests/cef_test.go 37 | go build -ldflags "-r ." -o Release/cef2go src/main_linux.go 38 | cd Release && ./cef2go && cd ../ 39 | 40 | Darwin: 41 | clear 42 | 43 | @# Required for linking. Go doesn't allow framework name 44 | @# to contain spaces, so we're making a copy of the framework 45 | @# without spaces. 46 | @if [ ! -d Release/tmp ]; then \ 47 | echo Copying CEF framework directory to Release/tmp ;\ 48 | mkdir -p Release/tmp ;\ 49 | cp -rf Release/cef2go.app/Contents/Frameworks/Chromium\ Embedded\ Framework.framework Release/tmp/cef.framework ;\ 50 | mv Release/tmp/cef.framework/Chromium\ Embedded\ Framework Release/tmp/cef.framework/cef ;\ 51 | fi 52 | go install -x cef 53 | @# CEF requires specific app bundle / directory structure 54 | @# on OSX, but Go doesn't allow for such thing when 55 | @# running test. So turning off test. 56 | @# go test -ldflags "-r $(PWD)/Release" src/tests/cef_test.go 57 | rm -f Release/cef2go.app/Contents/MacOS/cef2go 58 | go build -x -ldflags "-r ." -o Release/cef2go.app/Contents/MacOS/cef2go src/main_darwin.go 59 | 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 60 | cp -f Release/example.html Release/cef2go.app/Contents/MacOS/example.html 61 | cd Release/cef2go.app/Contents/MacOS && ./cef2go && cd ../../../../ 62 | 63 | clean: 64 | clear 65 | go clean -i cef 66 | -------------------------------------------------------------------------------- /Release/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !example.html -------------------------------------------------------------------------------- /Release/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 |

cef2go example

10 | 11 | This is a basic example of embedding Chromium browser in Go application. 12 | More to come. 13 | 14 |

Google

15 | https://www.google.com/ 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | set GOPATH=%~dp0 2 | 3 | go install cef 4 | @if %ERRORLEVEL% neq 0 goto end 5 | 6 | go install wingui 7 | @if %ERRORLEVEL% neq 0 goto end 8 | 9 | IF "%1"=="http_server" ( 10 | @if exist "%~dp0Release\cef2go_http_server.exe" ( 11 | @del "%~dp0Release\cef2go_http_server.exe" 12 | ) 13 | go build -o Release/cef2go_http_server.exe src/http_server_windows.go 14 | @if %ERRORLEVEL% neq 0 goto end 15 | cd Release/ 16 | call "cef2go_http_server.exe" 17 | cd ../ 18 | goto end 19 | ) 20 | 21 | @SET ORIGPATH=%PATH% 22 | @SET PATH=%PATH%;%~dp0/Release 23 | go test src/tests/cef_test.go 24 | @if %ERRORLEVEL% neq 0 goto end 25 | @SET PATH=%ORIGPATH% 26 | @if exist "%~dp0src\tests\debug.log" ( 27 | @del "%~dp0src\tests\debug.log" 28 | ) 29 | 30 | @if exist "%~dp0Release\cef2go.exe" ( 31 | @del "%~dp0Release\cef2go.exe" 32 | ) 33 | 34 | IF "%1"=="noconsole" ( 35 | go build -ldflags="-H windowsgui" -o Release/cef2go.exe src/main_windows.go 36 | @if %ERRORLEVEL% neq 0 goto end 37 | ) else ( 38 | go build -o Release/cef2go.exe src/main_windows.go 39 | @if %ERRORLEVEL% neq 0 goto end 40 | ) 41 | 42 | cd Release/ 43 | call "cef2go.exe" 44 | cd ../ 45 | 46 | :end 47 | @echo exit code = %ERRORLEVEL% 48 | -------------------------------------------------------------------------------- /donate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cztomczak/cef2go/a8da6e1377d1b9ec0087cc7bfe8fa8a11d2c3db7/donate.gif -------------------------------------------------------------------------------- /handlers/cef_app.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cefcapi authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cefcapi 4 | 5 | #pragma once 6 | 7 | #include "handlers/cef_base.h" 8 | #include "include/capi/cef_app_capi.h" 9 | 10 | // ---------------------------------------------------------------------------- 11 | // cef_app_t 12 | // ---------------------------------------------------------------------------- 13 | 14 | /// 15 | // Implement this structure to provide handler implementations. Methods will be 16 | // called by the process and/or thread indicated. 17 | /// 18 | 19 | /// 20 | // Provides an opportunity to view and/or modify command-line arguments before 21 | // processing by CEF and Chromium. The |process_type| value will be NULL for 22 | // the browser process. Do not keep a reference to the cef_command_line_t 23 | // object passed to this function. The CefSettings.command_line_args_disabled 24 | // value can be used to start with an NULL command-line object. Any values 25 | // specified in CefSettings that equate to command-line arguments will be set 26 | // before this function is called. Be cautious when using this function to 27 | // modify command-line arguments for non-browser processes as this may result 28 | // in undefined behavior including crashes. 29 | /// 30 | void CEF_CALLBACK on_before_command_line_processing( 31 | struct _cef_app_t* self, const cef_string_t* process_type, 32 | struct _cef_command_line_t* command_line) { 33 | DEBUG_CALLBACK("on_before_command_line_processing\n"); 34 | } 35 | 36 | /// 37 | // Provides an opportunity to register custom schemes. Do not keep a reference 38 | // to the |registrar| object. This function is called on the main thread for 39 | // each process and the registered schemes should be the same across all 40 | // processes. 41 | /// 42 | void CEF_CALLBACK on_register_custom_schemes( 43 | struct _cef_app_t* self, 44 | struct _cef_scheme_registrar_t* registrar) { 45 | DEBUG_CALLBACK("on_register_custom_schemes\n"); 46 | } 47 | 48 | /// 49 | // Return the handler for resource bundle events. If 50 | // CefSettings.pack_loading_disabled is true (1) a handler must be returned. 51 | // If no handler is returned resources will be loaded from pack files. This 52 | // function is called by the browser and render processes on multiple threads. 53 | /// 54 | struct _cef_resource_bundle_handler_t* 55 | CEF_CALLBACK get_resource_bundle_handler(struct _cef_app_t* self) { 56 | DEBUG_CALLBACK("get_resource_bundle_handler\n"); 57 | return NULL; 58 | } 59 | 60 | /// 61 | // Return the handler for functionality specific to the browser process. This 62 | // function is called on multiple threads in the browser process. 63 | /// 64 | struct _cef_browser_process_handler_t* 65 | CEF_CALLBACK get_browser_process_handler(struct _cef_app_t* self) { 66 | DEBUG_CALLBACK("get_browser_process_handler\n"); 67 | return NULL; 68 | } 69 | 70 | /// 71 | // Return the handler for functionality specific to the render process. This 72 | // function is called on the render process main thread. 73 | /// 74 | struct _cef_render_process_handler_t* 75 | CEF_CALLBACK get_render_process_handler(struct _cef_app_t* self) { 76 | DEBUG_CALLBACK("get_render_process_handler\n"); 77 | return NULL; 78 | } 79 | 80 | void initialize_app_handler(cef_app_t* app) { 81 | printf("initialize_app_handler\n"); 82 | app->base.size = sizeof(cef_app_t); 83 | initialize_cef_base((cef_base_t*)app); 84 | // callbacks 85 | app->on_before_command_line_processing = on_before_command_line_processing; 86 | app->on_register_custom_schemes = on_register_custom_schemes; 87 | app->get_resource_bundle_handler = get_resource_bundle_handler; 88 | app->get_browser_process_handler = get_browser_process_handler; 89 | app->get_render_process_handler = get_render_process_handler; 90 | } 91 | -------------------------------------------------------------------------------- /handlers/cef_base.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cefcapi authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cefcapi 4 | 5 | #pragma once 6 | 7 | #include "include/capi/cef_base_capi.h" 8 | #include 9 | 10 | // Set to 1 to check if add_ref() and release() 11 | // are called and to track the total number of calls. 12 | // add_ref will be printed as "+", release as "-". 13 | #define DEBUG_REFERENCE_COUNTING 0 14 | 15 | // Print only the first execution of the callback, 16 | // ignore the subsequent. 17 | #define DEBUG_CALLBACK(x) { static int first_call = 1; if (first_call == 1) { first_call = 0; printf(x); } } 18 | 19 | // ---------------------------------------------------------------------------- 20 | // cef_base_t 21 | // ---------------------------------------------------------------------------- 22 | 23 | /// 24 | // Structure defining the reference count implementation functions. All 25 | // framework structures must include the cef_base_t structure first. 26 | /// 27 | 28 | /// 29 | // Increment the reference count. 30 | /// 31 | int CEF_CALLBACK add_ref(cef_base_t* self) { 32 | DEBUG_CALLBACK("cef_base_t.add_ref\n"); 33 | if (DEBUG_REFERENCE_COUNTING) 34 | printf("+"); 35 | return 1; 36 | } 37 | 38 | /// 39 | // Decrement the reference count. Delete this object when no references 40 | // remain. 41 | /// 42 | int CEF_CALLBACK release(cef_base_t* self) { 43 | DEBUG_CALLBACK("cef_base_t.release\n"); 44 | if (DEBUG_REFERENCE_COUNTING) 45 | printf("-"); 46 | return 1; 47 | } 48 | 49 | /// 50 | // Returns the current number of references. 51 | /// 52 | int CEF_CALLBACK get_refct(cef_base_t* self) { 53 | DEBUG_CALLBACK("cef_base_t.get_refct\n"); 54 | if (DEBUG_REFERENCE_COUNTING) 55 | printf("="); 56 | return 1; 57 | } 58 | 59 | void initialize_cef_base(cef_base_t* base) { 60 | printf("initialize_cef_base\n"); 61 | // Check if "size" member was set. 62 | size_t size = base->size; 63 | // Let's print the size in case sizeof was used 64 | // on a pointer instead of a structure. In such 65 | // case the number will be very high. 66 | printf("cef_base_t.size = %lu\n", (unsigned long)size); 67 | if (size <= 0) { 68 | printf("FATAL: initialize_cef_base failed, size member not set\n"); 69 | _exit(1); 70 | } 71 | base->add_ref = add_ref; 72 | base->release = release; 73 | base->get_refct = get_refct; 74 | } 75 | -------------------------------------------------------------------------------- /include/capi/cef_auth_callback_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Callback structure used for asynchronous continuation of authentication 50 | // requests. 51 | /// 52 | typedef struct _cef_auth_callback_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Continue the authentication request. 60 | /// 61 | void (CEF_CALLBACK *cont)(struct _cef_auth_callback_t* self, 62 | const cef_string_t* username, const cef_string_t* password); 63 | 64 | /// 65 | // Cancel the authentication request. 66 | /// 67 | void (CEF_CALLBACK *cancel)(struct _cef_auth_callback_t* self); 68 | } cef_auth_callback_t; 69 | 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif // CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ 76 | -------------------------------------------------------------------------------- /include/capi/cef_base_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ 32 | #define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #include "include/internal/cef_export.h" 39 | #include "include/internal/cef_string.h" 40 | #include "include/internal/cef_string_list.h" 41 | #include "include/internal/cef_string_map.h" 42 | #include "include/internal/cef_string_multimap.h" 43 | #include "include/internal/cef_types.h" 44 | 45 | /// 46 | // Structure defining the reference count implementation functions. All 47 | // framework structures must include the cef_base_t structure first. 48 | /// 49 | typedef struct _cef_base_t { 50 | /// 51 | // Size of the data structure. 52 | /// 53 | size_t size; 54 | 55 | /// 56 | // Increment the reference count. 57 | /// 58 | int (CEF_CALLBACK *add_ref)(struct _cef_base_t* self); 59 | 60 | /// 61 | // Decrement the reference count. Delete this object when no references 62 | // remain. 63 | /// 64 | int (CEF_CALLBACK *release)(struct _cef_base_t* self); 65 | 66 | /// 67 | // Returns the current number of references. 68 | /// 69 | int (CEF_CALLBACK *get_refct)(struct _cef_base_t* self); 70 | } cef_base_t; 71 | 72 | 73 | // Check that the structure |s|, which is defined with a cef_base_t member named 74 | // |base|, is large enough to contain the specified member |f|. 75 | #define CEF_MEMBER_EXISTS(s, f) \ 76 | ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= (s)->base.size) 77 | 78 | #define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f)) 79 | 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ 86 | -------------------------------------------------------------------------------- /include/capi/cef_browser_process_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_command_line_capi.h" 47 | #include "include/capi/cef_values_capi.h" 48 | 49 | 50 | /// 51 | // Structure used to implement browser process callbacks. The functions of this 52 | // structure will be called on the browser process main thread unless otherwise 53 | // indicated. 54 | /// 55 | typedef struct _cef_browser_process_handler_t { 56 | /// 57 | // Base structure. 58 | /// 59 | cef_base_t base; 60 | 61 | /// 62 | // Called on the browser process UI thread immediately after the CEF context 63 | // has been initialized. 64 | /// 65 | void (CEF_CALLBACK *on_context_initialized)( 66 | struct _cef_browser_process_handler_t* self); 67 | 68 | /// 69 | // Called before a child process is launched. Will be called on the browser 70 | // process UI thread when launching a render process and on the browser 71 | // process IO thread when launching a GPU or plugin process. Provides an 72 | // opportunity to modify the child process command line. Do not keep a 73 | // reference to |command_line| outside of this function. 74 | /// 75 | void (CEF_CALLBACK *on_before_child_process_launch)( 76 | struct _cef_browser_process_handler_t* self, 77 | struct _cef_command_line_t* command_line); 78 | 79 | /// 80 | // Called on the browser process IO thread after the main thread has been 81 | // created for a new render process. Provides an opportunity to specify extra 82 | // information that will be passed to 83 | // cef_render_process_handler_t::on_render_thread_created() in the render 84 | // process. Do not keep a reference to |extra_info| outside of this function. 85 | /// 86 | void (CEF_CALLBACK *on_render_process_thread_created)( 87 | struct _cef_browser_process_handler_t* self, 88 | struct _cef_list_value_t* extra_info); 89 | } cef_browser_process_handler_t; 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif // CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ 97 | -------------------------------------------------------------------------------- /include/capi/cef_callback_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Generic callback structure used for asynchronous continuation. 50 | /// 51 | typedef struct _cef_callback_t { 52 | /// 53 | // Base structure. 54 | /// 55 | cef_base_t base; 56 | 57 | /// 58 | // Continue processing. 59 | /// 60 | void (CEF_CALLBACK *cont)(struct _cef_callback_t* self); 61 | 62 | /// 63 | // Cancel processing. 64 | /// 65 | void (CEF_CALLBACK *cancel)(struct _cef_callback_t* self); 66 | } cef_callback_t; 67 | 68 | 69 | /// 70 | // Generic callback structure used for asynchronous completion. 71 | /// 72 | typedef struct _cef_completion_handler_t { 73 | /// 74 | // Base structure. 75 | /// 76 | cef_base_t base; 77 | 78 | /// 79 | // Method that will be called once the task is complete. 80 | /// 81 | void (CEF_CALLBACK *on_complete)(struct _cef_completion_handler_t* self); 82 | } cef_completion_handler_t; 83 | 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ 90 | -------------------------------------------------------------------------------- /include/capi/cef_dialog_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | 48 | 49 | /// 50 | // Callback structure for asynchronous continuation of file dialog requests. 51 | /// 52 | typedef struct _cef_file_dialog_callback_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Continue the file selection with the specified |file_paths|. This may be a 60 | // single value or a list of values depending on the dialog mode. An NULL 61 | // value is treated the same as calling cancel(). 62 | /// 63 | void (CEF_CALLBACK *cont)(struct _cef_file_dialog_callback_t* self, 64 | cef_string_list_t file_paths); 65 | 66 | /// 67 | // Cancel the file selection. 68 | /// 69 | void (CEF_CALLBACK *cancel)(struct _cef_file_dialog_callback_t* self); 70 | } cef_file_dialog_callback_t; 71 | 72 | 73 | /// 74 | // Implement this structure to handle dialog events. The functions of this 75 | // structure will be called on the browser process UI thread. 76 | /// 77 | typedef struct _cef_dialog_handler_t { 78 | /// 79 | // Base structure. 80 | /// 81 | cef_base_t base; 82 | 83 | /// 84 | // Called to run a file chooser dialog. |mode| represents the type of dialog 85 | // to display. |title| to the title to be used for the dialog and may be NULL 86 | // to show the default title ("Open" or "Save" depending on the mode). 87 | // |default_file_name| is the default file name to select in the dialog. 88 | // |accept_types| is a list of valid lower-cased MIME types or file extensions 89 | // specified in an input element and is used to restrict selectable files to 90 | // such types. To display a custom dialog return true (1) and execute 91 | // |callback| either inline or at a later time. To display the default dialog 92 | // return false (0). 93 | /// 94 | int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self, 95 | struct _cef_browser_t* browser, cef_file_dialog_mode_t mode, 96 | const cef_string_t* title, const cef_string_t* default_file_name, 97 | cef_string_list_t accept_types, 98 | struct _cef_file_dialog_callback_t* callback); 99 | } cef_dialog_handler_t; 100 | 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif // CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ 107 | -------------------------------------------------------------------------------- /include/capi/cef_display_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | #include "include/capi/cef_frame_capi.h" 48 | 49 | 50 | /// 51 | // Implement this structure to handle events related to browser display state. 52 | // The functions of this structure will be called on the UI thread. 53 | /// 54 | typedef struct _cef_display_handler_t { 55 | /// 56 | // Base structure. 57 | /// 58 | cef_base_t base; 59 | 60 | /// 61 | // Called when a frame's address has changed. 62 | /// 63 | void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self, 64 | struct _cef_browser_t* browser, struct _cef_frame_t* frame, 65 | const cef_string_t* url); 66 | 67 | /// 68 | // Called when the page title changes. 69 | /// 70 | void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self, 71 | struct _cef_browser_t* browser, const cef_string_t* title); 72 | 73 | /// 74 | // Called when the browser is about to display a tooltip. |text| contains the 75 | // text that will be displayed in the tooltip. To handle the display of the 76 | // tooltip yourself return true (1). Otherwise, you can optionally modify 77 | // |text| and then return false (0) to allow the browser to display the 78 | // tooltip. When window rendering is disabled the application is responsible 79 | // for drawing tooltips and the return value is ignored. 80 | /// 81 | int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self, 82 | struct _cef_browser_t* browser, cef_string_t* text); 83 | 84 | /// 85 | // Called when the browser receives a status message. |text| contains the text 86 | // that will be displayed in the status message and |type| indicates the 87 | // status message type. 88 | /// 89 | void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self, 90 | struct _cef_browser_t* browser, const cef_string_t* value); 91 | 92 | /// 93 | // Called to display a console message. Return true (1) to stop the message 94 | // from being output to the console. 95 | /// 96 | int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self, 97 | struct _cef_browser_t* browser, const cef_string_t* message, 98 | const cef_string_t* source, int line); 99 | } cef_display_handler_t; 100 | 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ 107 | -------------------------------------------------------------------------------- /include/capi/cef_download_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | #include "include/capi/cef_download_item_capi.h" 48 | 49 | 50 | /// 51 | // Callback structure used to asynchronously continue a download. 52 | /// 53 | typedef struct _cef_before_download_callback_t { 54 | /// 55 | // Base structure. 56 | /// 57 | cef_base_t base; 58 | 59 | /// 60 | // Call to continue the download. Set |download_path| to the full file path 61 | // for the download including the file name or leave blank to use the 62 | // suggested name and the default temp directory. Set |show_dialog| to true 63 | // (1) if you do wish to show the default "Save As" dialog. 64 | /// 65 | void (CEF_CALLBACK *cont)(struct _cef_before_download_callback_t* self, 66 | const cef_string_t* download_path, int show_dialog); 67 | } cef_before_download_callback_t; 68 | 69 | 70 | /// 71 | // Callback structure used to asynchronously cancel a download. 72 | /// 73 | typedef struct _cef_download_item_callback_t { 74 | /// 75 | // Base structure. 76 | /// 77 | cef_base_t base; 78 | 79 | /// 80 | // Call to cancel the download. 81 | /// 82 | void (CEF_CALLBACK *cancel)(struct _cef_download_item_callback_t* self); 83 | } cef_download_item_callback_t; 84 | 85 | 86 | /// 87 | // Structure used to handle file downloads. The functions of this structure will 88 | // called on the browser process UI thread. 89 | /// 90 | typedef struct _cef_download_handler_t { 91 | /// 92 | // Base structure. 93 | /// 94 | cef_base_t base; 95 | 96 | /// 97 | // Called before a download begins. |suggested_name| is the suggested name for 98 | // the download file. By default the download will be canceled. Execute 99 | // |callback| either asynchronously or in this function to continue the 100 | // download if desired. Do not keep a reference to |download_item| outside of 101 | // this function. 102 | /// 103 | void (CEF_CALLBACK *on_before_download)(struct _cef_download_handler_t* self, 104 | struct _cef_browser_t* browser, 105 | struct _cef_download_item_t* download_item, 106 | const cef_string_t* suggested_name, 107 | struct _cef_before_download_callback_t* callback); 108 | 109 | /// 110 | // Called when a download's status or progress information has been updated. 111 | // This may be called multiple times before and after on_before_download(). 112 | // Execute |callback| either asynchronously or in this function to cancel the 113 | // download if desired. Do not keep a reference to |download_item| outside of 114 | // this function. 115 | /// 116 | void (CEF_CALLBACK *on_download_updated)(struct _cef_download_handler_t* self, 117 | struct _cef_browser_t* browser, 118 | struct _cef_download_item_t* download_item, 119 | struct _cef_download_item_callback_t* callback); 120 | } cef_download_handler_t; 121 | 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ 128 | -------------------------------------------------------------------------------- /include/capi/cef_drag_data_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Structure used to represent drag data. The functions of this structure may be 50 | // called on any thread. 51 | /// 52 | typedef struct _cef_drag_data_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Returns true (1) if the drag data is a link. 60 | /// 61 | int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self); 62 | 63 | /// 64 | // Returns true (1) if the drag data is a text or html fragment. 65 | /// 66 | int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self); 67 | 68 | /// 69 | // Returns true (1) if the drag data is a file. 70 | /// 71 | int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self); 72 | 73 | /// 74 | // Return the link URL that is being dragged. 75 | /// 76 | // The resulting string must be freed by calling cef_string_userfree_free(). 77 | cef_string_userfree_t (CEF_CALLBACK *get_link_url)( 78 | struct _cef_drag_data_t* self); 79 | 80 | /// 81 | // Return the title associated with the link being dragged. 82 | /// 83 | // The resulting string must be freed by calling cef_string_userfree_free(). 84 | cef_string_userfree_t (CEF_CALLBACK *get_link_title)( 85 | struct _cef_drag_data_t* self); 86 | 87 | /// 88 | // Return the metadata, if any, associated with the link being dragged. 89 | /// 90 | // The resulting string must be freed by calling cef_string_userfree_free(). 91 | cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)( 92 | struct _cef_drag_data_t* self); 93 | 94 | /// 95 | // Return the plain text fragment that is being dragged. 96 | /// 97 | // The resulting string must be freed by calling cef_string_userfree_free(). 98 | cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)( 99 | struct _cef_drag_data_t* self); 100 | 101 | /// 102 | // Return the text/html fragment that is being dragged. 103 | /// 104 | // The resulting string must be freed by calling cef_string_userfree_free(). 105 | cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)( 106 | struct _cef_drag_data_t* self); 107 | 108 | /// 109 | // Return the base URL that the fragment came from. This value is used for 110 | // resolving relative URLs and may be NULL. 111 | /// 112 | // The resulting string must be freed by calling cef_string_userfree_free(). 113 | cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)( 114 | struct _cef_drag_data_t* self); 115 | 116 | /// 117 | // Return the name of the file being dragged out of the browser window. 118 | /// 119 | // The resulting string must be freed by calling cef_string_userfree_free(). 120 | cef_string_userfree_t (CEF_CALLBACK *get_file_name)( 121 | struct _cef_drag_data_t* self); 122 | 123 | /// 124 | // Retrieve the list of file names that are being dragged into the browser 125 | // window. 126 | /// 127 | int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self, 128 | cef_string_list_t names); 129 | } cef_drag_data_t; 130 | 131 | 132 | #ifdef __cplusplus 133 | } 134 | #endif 135 | 136 | #endif // CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ 137 | -------------------------------------------------------------------------------- /include/capi/cef_drag_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | #include "include/capi/cef_drag_data_capi.h" 48 | 49 | 50 | /// 51 | // Implement this structure to handle events related to dragging. The functions 52 | // of this structure will be called on the UI thread. 53 | /// 54 | typedef struct _cef_drag_handler_t { 55 | /// 56 | // Base structure. 57 | /// 58 | cef_base_t base; 59 | 60 | /// 61 | // Called when an external drag event enters the browser window. |dragData| 62 | // contains the drag event data and |mask| represents the type of drag 63 | // operation. Return false (0) for default drag handling behavior or true (1) 64 | // to cancel the drag event. 65 | /// 66 | int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self, 67 | struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, 68 | cef_drag_operations_mask_t mask); 69 | } cef_drag_handler_t; 70 | 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ 77 | -------------------------------------------------------------------------------- /include/capi/cef_focus_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | #include "include/capi/cef_dom_capi.h" 48 | #include "include/capi/cef_frame_capi.h" 49 | 50 | 51 | /// 52 | // Implement this structure to handle events related to focus. The functions of 53 | // this structure will be called on the UI thread. 54 | /// 55 | typedef struct _cef_focus_handler_t { 56 | /// 57 | // Base structure. 58 | /// 59 | cef_base_t base; 60 | 61 | /// 62 | // Called when the browser component is about to loose focus. For instance, if 63 | // focus was on the last HTML element and the user pressed the TAB key. |next| 64 | // will be true (1) if the browser is giving focus to the next component and 65 | // false (0) if the browser is giving focus to the previous component. 66 | /// 67 | void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self, 68 | struct _cef_browser_t* browser, int next); 69 | 70 | /// 71 | // Called when the browser component is requesting focus. |source| indicates 72 | // where the focus request is originating from. Return false (0) to allow the 73 | // focus to be set or true (1) to cancel setting the focus. 74 | /// 75 | int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self, 76 | struct _cef_browser_t* browser, cef_focus_source_t source); 77 | 78 | /// 79 | // Called when the browser component has received focus. 80 | /// 81 | void (CEF_CALLBACK *on_got_focus)(struct _cef_focus_handler_t* self, 82 | struct _cef_browser_t* browser); 83 | } cef_focus_handler_t; 84 | 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif // CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ 91 | -------------------------------------------------------------------------------- /include/capi/cef_geolocation_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Implement this structure to receive geolocation updates. The functions of 50 | // this structure will be called on the browser process UI thread. 51 | /// 52 | typedef struct _cef_get_geolocation_callback_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Called with the 'best available' location information or, if the location 60 | // update failed, with error information. 61 | /// 62 | void (CEF_CALLBACK *on_location_update)( 63 | struct _cef_get_geolocation_callback_t* self, 64 | const struct _cef_geoposition_t* position); 65 | } cef_get_geolocation_callback_t; 66 | 67 | 68 | /// 69 | // Request a one-time geolocation update. This function bypasses any user 70 | // permission checks so should only be used by code that is allowed to access 71 | // location information. 72 | /// 73 | CEF_EXPORT int cef_get_geolocation(cef_get_geolocation_callback_t* callback); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ 80 | -------------------------------------------------------------------------------- /include/capi/cef_geolocation_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | 48 | 49 | /// 50 | // Callback structure used for asynchronous continuation of geolocation 51 | // permission requests. 52 | /// 53 | typedef struct _cef_geolocation_callback_t { 54 | /// 55 | // Base structure. 56 | /// 57 | cef_base_t base; 58 | 59 | /// 60 | // Call to allow or deny geolocation access. 61 | /// 62 | void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self, 63 | int allow); 64 | } cef_geolocation_callback_t; 65 | 66 | 67 | /// 68 | // Implement this structure to handle events related to geolocation permission 69 | // requests. The functions of this structure will be called on the browser 70 | // process IO thread. 71 | /// 72 | typedef struct _cef_geolocation_handler_t { 73 | /// 74 | // Base structure. 75 | /// 76 | cef_base_t base; 77 | 78 | /// 79 | // Called when a page requests permission to access geolocation information. 80 | // |requesting_url| is the URL requesting permission and |request_id| is the 81 | // unique ID for the permission request. Call 82 | // cef_geolocation_callback_t::Continue to allow or deny the permission 83 | // request. 84 | /// 85 | void (CEF_CALLBACK *on_request_geolocation_permission)( 86 | struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, 87 | const cef_string_t* requesting_url, int request_id, 88 | struct _cef_geolocation_callback_t* callback); 89 | 90 | /// 91 | // Called when a geolocation access request is canceled. |requesting_url| is 92 | // the URL that originally requested permission and |request_id| is the unique 93 | // ID for the permission request. 94 | /// 95 | void (CEF_CALLBACK *on_cancel_geolocation_permission)( 96 | struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, 97 | const cef_string_t* requesting_url, int request_id); 98 | } cef_geolocation_handler_t; 99 | 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ 106 | -------------------------------------------------------------------------------- /include/capi/cef_keyboard_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | 48 | 49 | /// 50 | // Implement this structure to handle events related to keyboard input. The 51 | // functions of this structure will be called on the UI thread. 52 | /// 53 | typedef struct _cef_keyboard_handler_t { 54 | /// 55 | // Base structure. 56 | /// 57 | cef_base_t base; 58 | 59 | // Called before a keyboard event is sent to the renderer. |event| contains 60 | // information about the keyboard event. |os_event| is the operating system 61 | // event message, if any. Return true (1) if the event was handled or false 62 | // (0) otherwise. If the event will be handled in on_key_event() as a keyboard 63 | // shortcut set |is_keyboard_shortcut| to true (1) and return false (0). 64 | int (CEF_CALLBACK *on_pre_key_event)(struct _cef_keyboard_handler_t* self, 65 | struct _cef_browser_t* browser, const struct _cef_key_event_t* event, 66 | cef_event_handle_t os_event, int* is_keyboard_shortcut); 67 | 68 | /// 69 | // Called after the renderer and JavaScript in the page has had a chance to 70 | // handle the event. |event| contains information about the keyboard event. 71 | // |os_event| is the operating system event message, if any. Return true (1) 72 | // if the keyboard event was handled or false (0) otherwise. 73 | /// 74 | int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self, 75 | struct _cef_browser_t* browser, const struct _cef_key_event_t* event, 76 | cef_event_handle_t os_event); 77 | } cef_keyboard_handler_t; 78 | 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif // CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ 85 | -------------------------------------------------------------------------------- /include/capi/cef_load_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | #include "include/capi/cef_frame_capi.h" 48 | 49 | 50 | /// 51 | // Implement this structure to handle events related to browser load status. The 52 | // functions of this structure will be called on the browser process UI thread 53 | // or render process main thread (TID_RENDERER). 54 | /// 55 | typedef struct _cef_load_handler_t { 56 | /// 57 | // Base structure. 58 | /// 59 | cef_base_t base; 60 | 61 | /// 62 | // Called when the loading state has changed. This callback will be executed 63 | // twice -- once when loading is initiated either programmatically or by user 64 | // action, and once when loading is terminated due to completion, cancellation 65 | // of failure. 66 | /// 67 | void (CEF_CALLBACK *on_loading_state_change)(struct _cef_load_handler_t* self, 68 | struct _cef_browser_t* browser, int isLoading, int canGoBack, 69 | int canGoForward); 70 | 71 | /// 72 | // Called when the browser begins loading a frame. The |frame| value will 73 | // never be NULL -- call the is_main() function to check if this frame is the 74 | // main frame. Multiple frames may be loading at the same time. Sub-frames may 75 | // start or continue loading after the main frame load has ended. This 76 | // function may not be called for a particular frame if the load request for 77 | // that frame fails. For notification of overall browser load status use 78 | // OnLoadingStateChange instead. 79 | /// 80 | void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self, 81 | struct _cef_browser_t* browser, struct _cef_frame_t* frame); 82 | 83 | /// 84 | // Called when the browser is done loading a frame. The |frame| value will 85 | // never be NULL -- call the is_main() function to check if this frame is the 86 | // main frame. Multiple frames may be loading at the same time. Sub-frames may 87 | // start or continue loading after the main frame load has ended. This 88 | // function will always be called for all frames irrespective of whether the 89 | // request completes successfully. 90 | /// 91 | void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self, 92 | struct _cef_browser_t* browser, struct _cef_frame_t* frame, 93 | int httpStatusCode); 94 | 95 | /// 96 | // Called when the resource load for a navigation fails or is canceled. 97 | // |errorCode| is the error code number, |errorText| is the error text and 98 | // |failedUrl| is the URL that failed to load. See net\base\net_error_list.h 99 | // for complete descriptions of the error codes. 100 | /// 101 | void (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self, 102 | struct _cef_browser_t* browser, struct _cef_frame_t* frame, 103 | cef_errorcode_t errorCode, const cef_string_t* errorText, 104 | const cef_string_t* failedUrl); 105 | } cef_load_handler_t; 106 | 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ 113 | -------------------------------------------------------------------------------- /include/capi/cef_origin_whitelist_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Add an entry to the cross-origin access whitelist. 50 | // 51 | // The same-origin policy restricts how scripts hosted from different origins 52 | // (scheme + domain + port) can communicate. By default, scripts can only access 53 | // resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes 54 | // (but no other schemes) can use the "Access-Control-Allow-Origin" header to 55 | // allow cross-origin requests. For example, https://source.example.com can make 56 | // XMLHttpRequest requests on http://target.example.com if the 57 | // http://target.example.com request returns an "Access-Control-Allow-Origin: 58 | // https://source.example.com" response header. 59 | // 60 | // Scripts in separate frames or iframes and hosted from the same protocol and 61 | // domain suffix can execute cross-origin JavaScript if both pages set the 62 | // document.domain value to the same domain suffix. For example, 63 | // scheme://foo.example.com and scheme://bar.example.com can communicate using 64 | // JavaScript if both domains set document.domain="example.com". 65 | // 66 | // This function is used to allow access to origins that would otherwise violate 67 | // the same-origin policy. Scripts hosted underneath the fully qualified 68 | // |source_origin| URL (like http://www.example.com) will be allowed access to 69 | // all resources hosted on the specified |target_protocol| and |target_domain|. 70 | // If |target_domain| is non-NULL and |allow_target_subdomains| if false (0) 71 | // only exact domain matches will be allowed. If |target_domain| contains a top- 72 | // level domain component (like "example.com") and |allow_target_subdomains| is 73 | // true (1) sub-domain matches will be allowed. If |target_domain| is NULL and 74 | // |allow_target_subdomains| if true (1) all domains and IP addresses will be 75 | // allowed. 76 | // 77 | // This function cannot be used to bypass the restrictions on local or display 78 | // isolated schemes. See the comments on CefRegisterCustomScheme for more 79 | // information. 80 | // 81 | // This function may be called on any thread. Returns false (0) if 82 | // |source_origin| is invalid or the whitelist cannot be accessed. 83 | /// 84 | CEF_EXPORT int cef_add_cross_origin_whitelist_entry( 85 | const cef_string_t* source_origin, const cef_string_t* target_protocol, 86 | const cef_string_t* target_domain, int allow_target_subdomains); 87 | 88 | /// 89 | // Remove an entry from the cross-origin access whitelist. Returns false (0) if 90 | // |source_origin| is invalid or the whitelist cannot be accessed. 91 | /// 92 | CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( 93 | const cef_string_t* source_origin, const cef_string_t* target_protocol, 94 | const cef_string_t* target_domain, int allow_target_subdomains); 95 | 96 | /// 97 | // Remove all entries from the cross-origin access whitelist. Returns false (0) 98 | // if the whitelist cannot be accessed. 99 | /// 100 | CEF_EXPORT int cef_clear_cross_origin_whitelist(); 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ 107 | -------------------------------------------------------------------------------- /include/capi/cef_path_util_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Retrieve the path associated with the specified |key|. Returns true (1) on 50 | // success. Can be called on any thread in the browser process. 51 | /// 52 | CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif // CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ 59 | -------------------------------------------------------------------------------- /include/capi/cef_process_message_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_values_capi.h" 47 | 48 | 49 | /// 50 | // Structure representing a message. Can be used on any process and thread. 51 | /// 52 | typedef struct _cef_process_message_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Returns true (1) if this object is valid. Do not call any other functions 60 | // if this function returns false (0). 61 | /// 62 | int (CEF_CALLBACK *is_valid)(struct _cef_process_message_t* self); 63 | 64 | /// 65 | // Returns true (1) if the values of this object are read-only. Some APIs may 66 | // expose read-only objects. 67 | /// 68 | int (CEF_CALLBACK *is_read_only)(struct _cef_process_message_t* self); 69 | 70 | /// 71 | // Returns a writable copy of this object. 72 | /// 73 | struct _cef_process_message_t* (CEF_CALLBACK *copy)( 74 | struct _cef_process_message_t* self); 75 | 76 | /// 77 | // Returns the message name. 78 | /// 79 | // The resulting string must be freed by calling cef_string_userfree_free(). 80 | cef_string_userfree_t (CEF_CALLBACK *get_name)( 81 | struct _cef_process_message_t* self); 82 | 83 | /// 84 | // Returns the list of arguments. 85 | /// 86 | struct _cef_list_value_t* (CEF_CALLBACK *get_argument_list)( 87 | struct _cef_process_message_t* self); 88 | } cef_process_message_t; 89 | 90 | 91 | /// 92 | // Create a new cef_process_message_t object with the specified name. 93 | /// 94 | CEF_EXPORT cef_process_message_t* cef_process_message_create( 95 | const cef_string_t* name); 96 | 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | 102 | #endif // CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ 103 | -------------------------------------------------------------------------------- /include/capi/cef_process_util_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Launches the process specified via |command_line|. Returns true (1) upon 50 | // success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. 51 | // 52 | // Unix-specific notes: - All file descriptors open in the parent process will 53 | // be closed in the 54 | // child process except for stdin, stdout, and stderr. 55 | // - If the first argument on the command line does not contain a slash, 56 | // PATH will be searched. (See man execvp.) 57 | /// 58 | CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif // CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ 65 | -------------------------------------------------------------------------------- /include/capi/cef_request_context_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_request_context_handler_capi.h" 46 | 47 | 48 | /// 49 | // A request context provides request handling for a set of related browser 50 | // objects. A request context is specified when creating a new browser object 51 | // via the cef_browser_host_t static factory functions. Browser objects with 52 | // different request contexts will never be hosted in the same render process. 53 | // Browser objects with the same request context may or may not be hosted in the 54 | // same render process depending on the process model. Browser objects created 55 | // indirectly via the JavaScript window.open function or targeted links will 56 | // share the same render process and the same request context as the source 57 | // browser. When running in single-process mode there is only a single render 58 | // process (the main process) and so all browsers created in single-process mode 59 | // will share the same request context. This will be the first request context 60 | // passed into a cef_browser_host_t static factory function and all other 61 | // request context objects will be ignored. 62 | /// 63 | typedef struct _cef_request_context_t { 64 | /// 65 | // Base structure. 66 | /// 67 | cef_base_t base; 68 | 69 | /// 70 | // Returns true (1) if this object is pointing to the same context as |that| 71 | // object. 72 | /// 73 | int (CEF_CALLBACK *is_same)(struct _cef_request_context_t* self, 74 | struct _cef_request_context_t* other); 75 | 76 | /// 77 | // Returns true (1) if this object is the global context. 78 | /// 79 | int (CEF_CALLBACK *is_global)(struct _cef_request_context_t* self); 80 | 81 | /// 82 | // Returns the handler for this context if any. 83 | /// 84 | struct _cef_request_context_handler_t* (CEF_CALLBACK *get_handler)( 85 | struct _cef_request_context_t* self); 86 | } cef_request_context_t; 87 | 88 | 89 | /// 90 | // Returns the global context object. 91 | /// 92 | CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context(); 93 | 94 | /// 95 | // Creates a new context object with the specified handler. 96 | /// 97 | CEF_EXPORT cef_request_context_t* cef_request_context_create_context( 98 | struct _cef_request_context_handler_t* handler); 99 | 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ 106 | -------------------------------------------------------------------------------- /include/capi/cef_request_context_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_cookie_capi.h" 47 | 48 | 49 | /// 50 | // Implement this structure to provide handler implementations. 51 | /// 52 | typedef struct _cef_request_context_handler_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Called on the IO thread to retrieve the cookie manager. The global cookie 60 | // manager will be used if this function returns NULL. 61 | /// 62 | struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)( 63 | struct _cef_request_context_handler_t* self); 64 | } cef_request_context_handler_t; 65 | 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ 72 | -------------------------------------------------------------------------------- /include/capi/cef_resource_bundle_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Structure used to implement a custom resource bundle structure. The functions 50 | // of this structure may be called on multiple threads. 51 | /// 52 | typedef struct _cef_resource_bundle_handler_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Called to retrieve a localized translation for the string specified by 60 | // |message_id|. To provide the translation set |string| to the translation 61 | // string and return true (1). To use the default translation return false 62 | // (0). Supported message IDs are listed in cef_pack_strings.h. 63 | /// 64 | int (CEF_CALLBACK *get_localized_string)( 65 | struct _cef_resource_bundle_handler_t* self, int message_id, 66 | cef_string_t* string); 67 | 68 | /// 69 | // Called to retrieve data for the resource specified by |resource_id|. To 70 | // provide the resource data set |data| and |data_size| to the data pointer 71 | // and size respectively and return true (1). To use the default resource data 72 | // return false (0). The resource data will not be copied and must remain 73 | // resident in memory. Supported resource IDs are listed in 74 | // cef_pack_resources.h. 75 | /// 76 | int (CEF_CALLBACK *get_data_resource)( 77 | struct _cef_resource_bundle_handler_t* self, int resource_id, void** data, 78 | size_t* data_size); 79 | } cef_resource_bundle_handler_t; 80 | 81 | 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | 86 | #endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ 87 | -------------------------------------------------------------------------------- /include/capi/cef_resource_handler_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_browser_capi.h" 47 | #include "include/capi/cef_callback_capi.h" 48 | #include "include/capi/cef_cookie_capi.h" 49 | #include "include/capi/cef_request_capi.h" 50 | #include "include/capi/cef_response_capi.h" 51 | 52 | 53 | /// 54 | // Structure used to implement a custom request handler structure. The functions 55 | // of this structure will always be called on the IO thread. 56 | /// 57 | typedef struct _cef_resource_handler_t { 58 | /// 59 | // Base structure. 60 | /// 61 | cef_base_t base; 62 | 63 | /// 64 | // Begin processing the request. To handle the request return true (1) and 65 | // call cef_callback_t::cont() once the response header information is 66 | // available (cef_callback_t::cont() can also be called from inside this 67 | // function if header information is available immediately). To cancel the 68 | // request return false (0). 69 | /// 70 | int (CEF_CALLBACK *process_request)(struct _cef_resource_handler_t* self, 71 | struct _cef_request_t* request, struct _cef_callback_t* callback); 72 | 73 | /// 74 | // Retrieve response header information. If the response length is not known 75 | // set |response_length| to -1 and read_response() will be called until it 76 | // returns false (0). If the response length is known set |response_length| to 77 | // a positive value and read_response() will be called until it returns false 78 | // (0) or the specified number of bytes have been read. Use the |response| 79 | // object to set the mime type, http status code and other optional header 80 | // values. To redirect the request to a new URL set |redirectUrl| to the new 81 | // URL. 82 | /// 83 | void (CEF_CALLBACK *get_response_headers)( 84 | struct _cef_resource_handler_t* self, struct _cef_response_t* response, 85 | int64* response_length, cef_string_t* redirectUrl); 86 | 87 | /// 88 | // Read response data. If data is available immediately copy up to 89 | // |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of 90 | // bytes copied, and return true (1). To read the data at a later time set 91 | // |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the 92 | // data is available. To indicate response completion return false (0). 93 | /// 94 | int (CEF_CALLBACK *read_response)(struct _cef_resource_handler_t* self, 95 | void* data_out, int bytes_to_read, int* bytes_read, 96 | struct _cef_callback_t* callback); 97 | 98 | /// 99 | // Return true (1) if the specified cookie can be sent with the request or 100 | // false (0) otherwise. If false (0) is returned for any cookie then no 101 | // cookies will be sent with the request. 102 | /// 103 | int (CEF_CALLBACK *can_get_cookie)(struct _cef_resource_handler_t* self, 104 | const struct _cef_cookie_t* cookie); 105 | 106 | /// 107 | // Return true (1) if the specified cookie returned with the response can be 108 | // set or false (0) otherwise. 109 | /// 110 | int (CEF_CALLBACK *can_set_cookie)(struct _cef_resource_handler_t* self, 111 | const struct _cef_cookie_t* cookie); 112 | 113 | /// 114 | // Request processing has been canceled. 115 | /// 116 | void (CEF_CALLBACK *cancel)(struct _cef_resource_handler_t* self); 117 | } cef_resource_handler_t; 118 | 119 | 120 | #ifdef __cplusplus 121 | } 122 | #endif 123 | 124 | #endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ 125 | -------------------------------------------------------------------------------- /include/capi/cef_response_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Structure used to represent a web response. The functions of this structure 50 | // may be called on any thread. 51 | /// 52 | typedef struct _cef_response_t { 53 | /// 54 | // Base structure. 55 | /// 56 | cef_base_t base; 57 | 58 | /// 59 | // Returns true (1) if this object is read-only. 60 | /// 61 | int (CEF_CALLBACK *is_read_only)(struct _cef_response_t* self); 62 | 63 | /// 64 | // Get the response status code. 65 | /// 66 | int (CEF_CALLBACK *get_status)(struct _cef_response_t* self); 67 | 68 | /// 69 | // Set the response status code. 70 | /// 71 | void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status); 72 | 73 | /// 74 | // Get the response status text. 75 | /// 76 | // The resulting string must be freed by calling cef_string_userfree_free(). 77 | cef_string_userfree_t (CEF_CALLBACK *get_status_text)( 78 | struct _cef_response_t* self); 79 | 80 | /// 81 | // Set the response status text. 82 | /// 83 | void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self, 84 | const cef_string_t* statusText); 85 | 86 | /// 87 | // Get the response mime type. 88 | /// 89 | // The resulting string must be freed by calling cef_string_userfree_free(). 90 | cef_string_userfree_t (CEF_CALLBACK *get_mime_type)( 91 | struct _cef_response_t* self); 92 | 93 | /// 94 | // Set the response mime type. 95 | /// 96 | void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self, 97 | const cef_string_t* mimeType); 98 | 99 | /// 100 | // Get the value for the specified response header field. 101 | /// 102 | // The resulting string must be freed by calling cef_string_userfree_free(). 103 | cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self, 104 | const cef_string_t* name); 105 | 106 | /// 107 | // Get all response header fields. 108 | /// 109 | void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self, 110 | cef_string_multimap_t headerMap); 111 | 112 | /// 113 | // Set all response header fields. 114 | /// 115 | void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self, 116 | cef_string_multimap_t headerMap); 117 | } cef_response_t; 118 | 119 | 120 | /// 121 | // Create a new cef_response_t object. 122 | /// 123 | CEF_EXPORT cef_response_t* cef_response_create(); 124 | 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif // CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ 131 | -------------------------------------------------------------------------------- /include/capi/cef_string_visitor_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Implement this structure to receive string values asynchronously. 50 | /// 51 | typedef struct _cef_string_visitor_t { 52 | /// 53 | // Base structure. 54 | /// 55 | cef_base_t base; 56 | 57 | /// 58 | // Method that will be executed. 59 | /// 60 | void (CEF_CALLBACK *visit)(struct _cef_string_visitor_t* self, 61 | const cef_string_t* string); 62 | } cef_string_visitor_t; 63 | 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif // CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ 70 | -------------------------------------------------------------------------------- /include/capi/cef_trace_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Implement this structure to receive notification when tracing has completed. 50 | // The functions of this structure will be called on the browser process UI 51 | // thread. 52 | /// 53 | typedef struct _cef_end_tracing_callback_t { 54 | /// 55 | // Base structure. 56 | /// 57 | cef_base_t base; 58 | 59 | /// 60 | // Called after all processes have sent their trace data. |tracing_file| is 61 | // the path at which tracing data was written. The client is responsible for 62 | // deleting |tracing_file|. 63 | /// 64 | void (CEF_CALLBACK *on_end_tracing_complete)( 65 | struct _cef_end_tracing_callback_t* self, 66 | const cef_string_t* tracing_file); 67 | } cef_end_tracing_callback_t; 68 | 69 | 70 | /// 71 | // Start tracing events on all processes. Tracing begins immediately locally, 72 | // and asynchronously on child processes as soon as they receive the 73 | // BeginTracing request. 74 | // 75 | // If CefBeginTracing was called previously, or if a CefEndTracingAsync call is 76 | // pending, CefBeginTracing will fail and return false (0). 77 | // 78 | // |categories| is a comma-delimited list of category wildcards. A category can 79 | // have an optional '-' prefix to make it an excluded category. Having both 80 | // included and excluded categories in the same list is not supported. 81 | // 82 | // Example: "test_MyTest*" Example: "test_MyTest*,test_OtherStuff" Example: 83 | // "-excluded_category1,-excluded_category2" 84 | // 85 | // This function must be called on the browser process UI thread. 86 | /// 87 | CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories); 88 | 89 | /// 90 | // Stop tracing events on all processes. 91 | // 92 | // This function will fail and return false (0) if a previous call to 93 | // CefEndTracingAsync is already pending or if CefBeginTracing was not called. 94 | // 95 | // |tracing_file| is the path at which tracing data will be written and 96 | // |callback| is the callback that will be executed once all processes have sent 97 | // their trace data. If |tracing_file| is NULL a new temporary file path will be 98 | // used. If |callback| is NULL no trace data will be written. 99 | // 100 | // This function must be called on the browser process UI thread. 101 | /// 102 | CEF_EXPORT int cef_end_tracing_async(const cef_string_t* tracing_file, 103 | cef_end_tracing_callback_t* callback); 104 | 105 | /// 106 | // Returns the current system trace time or, if none is defined, the current 107 | // high-res time. Can be used by clients to synchronize with the time 108 | // information in trace events. 109 | /// 110 | CEF_EXPORT int64 cef_now_from_system_trace_time(); 111 | 112 | #ifdef __cplusplus 113 | } 114 | #endif 115 | 116 | #endif // CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ 117 | -------------------------------------------------------------------------------- /include/capi/cef_url_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | 47 | 48 | /// 49 | // Parse the specified |url| into its component parts. Returns false (0) if the 50 | // URL is NULL or invalid. 51 | /// 52 | CEF_EXPORT int cef_parse_url(const cef_string_t* url, 53 | struct _cef_urlparts_t* parts); 54 | 55 | /// 56 | // Creates a URL from the specified |parts|, which must contain a non-NULL spec 57 | // or a non-NULL host and path (at a minimum), but not both. Returns false (0) 58 | // if |parts| isn't initialized as described. 59 | /// 60 | CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, 61 | cef_string_t* url); 62 | 63 | /// 64 | // Returns the mime type for the specified file extension or an NULL string if 65 | // unknown. 66 | /// 67 | // The resulting string must be freed by calling cef_string_userfree_free(). 68 | CEF_EXPORT cef_string_userfree_t cef_get_mime_type( 69 | const cef_string_t* extension); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif // CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ 76 | -------------------------------------------------------------------------------- /include/capi/cef_zip_reader_capi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --------------------------------------------------------------------------- 31 | // 32 | // This file was generated by the CEF translator tool and should not edited 33 | // by hand. See the translator.README.txt file in the tools directory for 34 | // more information. 35 | // 36 | 37 | #ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ 38 | #define CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ 39 | #pragma once 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #include "include/capi/cef_base_capi.h" 46 | #include "include/capi/cef_stream_capi.h" 47 | 48 | 49 | /// 50 | // Structure that supports the reading of zip archives via the zlib unzip API. 51 | // The functions of this structure should only be called on the thread that 52 | // creates the object. 53 | /// 54 | typedef struct _cef_zip_reader_t { 55 | /// 56 | // Base structure. 57 | /// 58 | cef_base_t base; 59 | 60 | /// 61 | // Moves the cursor to the first file in the archive. Returns true (1) if the 62 | // cursor position was set successfully. 63 | /// 64 | int (CEF_CALLBACK *move_to_first_file)(struct _cef_zip_reader_t* self); 65 | 66 | /// 67 | // Moves the cursor to the next file in the archive. Returns true (1) if the 68 | // cursor position was set successfully. 69 | /// 70 | int (CEF_CALLBACK *move_to_next_file)(struct _cef_zip_reader_t* self); 71 | 72 | /// 73 | // Moves the cursor to the specified file in the archive. If |caseSensitive| 74 | // is true (1) then the search will be case sensitive. Returns true (1) if the 75 | // cursor position was set successfully. 76 | /// 77 | int (CEF_CALLBACK *move_to_file)(struct _cef_zip_reader_t* self, 78 | const cef_string_t* fileName, int caseSensitive); 79 | 80 | /// 81 | // Closes the archive. This should be called directly to ensure that cleanup 82 | // occurs on the correct thread. 83 | /// 84 | int (CEF_CALLBACK *close)(struct _cef_zip_reader_t* self); 85 | 86 | 87 | // The below functions act on the file at the current cursor position. 88 | 89 | /// 90 | // Returns the name of the file. 91 | /// 92 | // The resulting string must be freed by calling cef_string_userfree_free(). 93 | cef_string_userfree_t (CEF_CALLBACK *get_file_name)( 94 | struct _cef_zip_reader_t* self); 95 | 96 | /// 97 | // Returns the uncompressed size of the file. 98 | /// 99 | int64 (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self); 100 | 101 | /// 102 | // Returns the last modified timestamp for the file. 103 | /// 104 | time_t (CEF_CALLBACK *get_file_last_modified)(struct _cef_zip_reader_t* self); 105 | 106 | /// 107 | // Opens the file for reading of uncompressed data. A read password may 108 | // optionally be specified. 109 | /// 110 | int (CEF_CALLBACK *open_file)(struct _cef_zip_reader_t* self, 111 | const cef_string_t* password); 112 | 113 | /// 114 | // Closes the file. 115 | /// 116 | int (CEF_CALLBACK *close_file)(struct _cef_zip_reader_t* self); 117 | 118 | /// 119 | // Read uncompressed file contents into the specified buffer. Returns < 0 if 120 | // an error occurred, 0 if at the end of file, or the number of bytes read. 121 | /// 122 | int (CEF_CALLBACK *read_file)(struct _cef_zip_reader_t* self, void* buffer, 123 | size_t bufferSize); 124 | 125 | /// 126 | // Returns the current offset in the uncompressed file contents. 127 | /// 128 | int64 (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self); 129 | 130 | /// 131 | // Returns true (1) if at end of the file contents. 132 | /// 133 | int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self); 134 | } cef_zip_reader_t; 135 | 136 | 137 | /// 138 | // Create a new cef_zip_reader_t object. The returned object's functions can 139 | // only be called from the thread that created the object. 140 | /// 141 | CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( 142 | struct _cef_stream_reader_t* stream); 143 | 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif // CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ 150 | -------------------------------------------------------------------------------- /include/internal/cef_build.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #ifndef CEF_INCLUDE_INTERNAL_CEF_BUILD_H_ 32 | #define CEF_INCLUDE_INTERNAL_CEF_BUILD_H_ 33 | #pragma once 34 | 35 | #if defined(BUILDING_CEF_SHARED) 36 | 37 | #include "base/compiler_specific.h" 38 | 39 | #else // !BUILDING_CEF_SHARED 40 | 41 | #if defined(_WIN32) 42 | #ifndef OS_WIN 43 | #define OS_WIN 1 44 | #endif 45 | #elif defined(__APPLE__) 46 | #ifndef OS_MACOSX 47 | #define OS_MACOSX 1 48 | #endif 49 | #elif defined(__linux__) 50 | #ifndef OS_LINUX 51 | #define OS_LINUX 1 52 | #endif 53 | #else 54 | #error Please add support for your platform in cef_build.h 55 | #endif 56 | 57 | // For access to standard POSIXish features, use OS_POSIX instead of a 58 | // more specific macro. 59 | #if defined(OS_MACOSX) || defined(OS_LINUX) 60 | #ifndef OS_POSIX 61 | #define OS_POSIX 1 62 | #endif 63 | #endif 64 | 65 | // Compiler detection. 66 | #if defined(__GNUC__) 67 | #ifndef COMPILER_GCC 68 | #define COMPILER_GCC 1 69 | #endif 70 | #elif defined(_MSC_VER) 71 | #ifndef COMPILER_MSVC 72 | #define COMPILER_MSVC 1 73 | #endif 74 | #else 75 | #error Please add support for your compiler in cef_build.h 76 | #endif 77 | 78 | // Annotate a virtual method indicating it must be overriding a virtual 79 | // method in the parent class. 80 | // Use like: 81 | // virtual void foo() OVERRIDE; 82 | #ifndef OVERRIDE 83 | #if defined(COMPILER_MSVC) 84 | #define OVERRIDE override 85 | #elif defined(__clang__) 86 | #define OVERRIDE override 87 | #else 88 | #define OVERRIDE 89 | #endif 90 | #endif 91 | 92 | #ifndef ALLOW_THIS_IN_INITIALIZER_LIST 93 | #if defined(COMPILER_MSVC) 94 | 95 | // MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled. 96 | // The warning remains disabled until popped by MSVC_POP_WARNING. 97 | #define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \ 98 | __pragma(warning(disable:n)) 99 | 100 | // MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level 101 | // remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all 102 | // warnings. 103 | #define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n)) 104 | 105 | // Pop effects of innermost MSVC_PUSH_* macro. 106 | #define MSVC_POP_WARNING() __pragma(warning(pop)) 107 | 108 | // Allows |this| to be passed as an argument in constructor initializer lists. 109 | // This uses push/pop instead of the seemingly simpler suppress feature to avoid 110 | // having the warning be disabled for more than just |code|. 111 | // 112 | // Example usage: 113 | // Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {} 114 | // 115 | // Compiler warning C4355: 'this': used in base member initializer list: 116 | // http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx 117 | #define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \ 118 | code \ 119 | MSVC_POP_WARNING() 120 | #else // !COMPILER_MSVC 121 | 122 | #define ALLOW_THIS_IN_INITIALIZER_LIST(code) code 123 | 124 | #endif // !COMPILER_MSVC 125 | #endif 126 | 127 | #endif // !BUILDING_CEF_SHARED 128 | 129 | #endif // CEF_INCLUDE_INTERNAL_CEF_BUILD_H_ 130 | -------------------------------------------------------------------------------- /include/internal/cef_export.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights 2 | // reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the name Chromium Embedded 15 | // Framework nor the names of its contributors may be used to endorse 16 | // or promote products derived from this software without specific prior 17 | // written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #ifndef CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ 32 | #define CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ 33 | #pragma once 34 | 35 | #include "include/internal/cef_build.h" 36 | 37 | #if defined(COMPILER_MSVC) 38 | 39 | #ifdef BUILDING_CEF_SHARED 40 | #define CEF_EXPORT __declspec(dllexport) 41 | #elif USING_CEF_SHARED 42 | #define CEF_EXPORT __declspec(dllimport) 43 | #else 44 | #define CEF_EXPORT 45 | #endif 46 | #define CEF_CALLBACK __stdcall 47 | 48 | #elif defined(COMPILER_GCC) 49 | 50 | #define CEF_EXPORT __attribute__ ((visibility("default"))) 51 | 52 | #ifdef OS_WIN 53 | #define CEF_CALLBACK __stdcall 54 | #else 55 | #define CEF_CALLBACK 56 | #endif 57 | 58 | #endif // COMPILER_GCC 59 | 60 | #endif // CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ 61 | -------------------------------------------------------------------------------- /include/internal/cef_linux.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #ifndef CEF_INCLUDE_INTERNAL_CEF_LINUX_H_ 32 | #define CEF_INCLUDE_INTERNAL_CEF_LINUX_H_ 33 | #pragma once 34 | 35 | #if defined(OS_LINUX) 36 | #include 37 | #include "include/internal/cef_types_linux.h" 38 | #include "include/internal/cef_types_wrappers.h" 39 | 40 | // Atomic increment and decrement. 41 | inline long CefAtomicIncrement(long volatile *pDest) { // NOLINT(runtime/int) 42 | return __sync_add_and_fetch(pDest, 1); 43 | } 44 | inline long CefAtomicDecrement(long volatile *pDest) { // NOLINT(runtime/int) 45 | return __sync_sub_and_fetch(pDest, 1); 46 | } 47 | 48 | // Critical section wrapper. 49 | class CefCriticalSection { 50 | public: 51 | CefCriticalSection() { 52 | pthread_mutexattr_init(&attr_); 53 | pthread_mutexattr_settype(&attr_, PTHREAD_MUTEX_RECURSIVE); 54 | pthread_mutex_init(&lock_, &attr_); 55 | } 56 | virtual ~CefCriticalSection() { 57 | pthread_mutex_destroy(&lock_); 58 | pthread_mutexattr_destroy(&attr_); 59 | } 60 | void Lock() { 61 | pthread_mutex_lock(&lock_); 62 | } 63 | void Unlock() { 64 | pthread_mutex_unlock(&lock_); 65 | } 66 | 67 | pthread_mutex_t lock_; 68 | pthread_mutexattr_t attr_; 69 | }; 70 | 71 | // Handle types. 72 | #define CefCursorHandle cef_cursor_handle_t 73 | #define CefEventHandle cef_event_handle_t 74 | #define CefWindowHandle cef_window_handle_t 75 | #define CefTextInputContext cef_text_input_context_t 76 | 77 | struct CefMainArgsTraits { 78 | typedef cef_main_args_t struct_type; 79 | 80 | static inline void init(struct_type* s) {} 81 | static inline void clear(struct_type* s) {} 82 | 83 | static inline void set(const struct_type* src, struct_type* target, 84 | bool copy) { 85 | target->argc = src->argc; 86 | target->argv = src->argv; 87 | } 88 | }; 89 | 90 | // Class representing CefExecuteProcess arguments. 91 | class CefMainArgs : public CefStructBase { 92 | public: 93 | typedef CefStructBase parent; 94 | 95 | CefMainArgs() : parent() {} 96 | explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {} 97 | explicit CefMainArgs(const CefMainArgs& r) : parent(r) {} 98 | CefMainArgs(int argc_arg, char** argv_arg) : parent() { 99 | argc = argc_arg; 100 | argv = argv_arg; 101 | } 102 | }; 103 | 104 | struct CefWindowInfoTraits { 105 | typedef cef_window_info_t struct_type; 106 | 107 | static inline void init(struct_type* s) {} 108 | static inline void clear(struct_type* s) {} 109 | 110 | static inline void set(const struct_type* src, struct_type* target, 111 | bool copy) { 112 | target->parent_widget = src->parent_widget; 113 | target->window_rendering_disabled = src->window_rendering_disabled; 114 | target->transparent_painting = src->transparent_painting; 115 | target->widget = src->widget; 116 | } 117 | }; 118 | 119 | // Class representing window information. 120 | class CefWindowInfo : public CefStructBase { 121 | public: 122 | typedef CefStructBase parent; 123 | 124 | CefWindowInfo() : parent() {} 125 | explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {} 126 | explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {} 127 | 128 | void SetAsChild(CefWindowHandle ParentWidget) { 129 | parent_widget = ParentWidget; 130 | } 131 | 132 | void SetTransparentPainting(bool transparentPainting) { 133 | transparent_painting = transparentPainting; 134 | } 135 | 136 | void SetAsOffScreen(CefWindowHandle ParentWidget) { 137 | window_rendering_disabled = true; 138 | parent_widget = ParentWidget; 139 | } 140 | }; 141 | 142 | #endif // OS_LINUX 143 | 144 | #endif // CEF_INCLUDE_INTERNAL_CEF_LINUX_H_ 145 | -------------------------------------------------------------------------------- /include/internal/cef_string.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_H_ 31 | #define CEF_INCLUDE_INTERNAL_CEF_STRING_H_ 32 | #pragma once 33 | 34 | // The CEF interface is built with one string type as the default. Comment out 35 | // all but one of the CEF_STRING_TYPE_* defines below to specify the default. 36 | // If you change the default you MUST recompile all of CEF. 37 | 38 | // Build with the UTF8 string type as default. 39 | // #define CEF_STRING_TYPE_UTF8 1 40 | 41 | // Build with the UTF16 string type as default. 42 | #define CEF_STRING_TYPE_UTF16 1 43 | 44 | // Build with the wide string type as default. 45 | // #define CEF_STRING_TYPE_WIDE 1 46 | 47 | 48 | #include "include/internal/cef_string_types.h" 49 | 50 | #ifdef __cplusplus 51 | #include "include/internal/cef_string_wrappers.h" 52 | #if defined(CEF_STRING_TYPE_UTF16) 53 | typedef CefStringUTF16 CefString; 54 | #elif defined(CEF_STRING_TYPE_UTF8) 55 | typedef CefStringUTF8 CefString; 56 | #elif defined(CEF_STRING_TYPE_WIDE) 57 | typedef CefStringWide CefString; 58 | #endif 59 | #endif // __cplusplus 60 | 61 | #if defined(CEF_STRING_TYPE_UTF8) 62 | typedef char cef_char_t; 63 | typedef cef_string_utf8_t cef_string_t; 64 | typedef cef_string_userfree_utf8_t cef_string_userfree_t; 65 | #define cef_string_set cef_string_utf8_set 66 | #define cef_string_copy cef_string_utf8_copy 67 | #define cef_string_clear cef_string_utf8_clear 68 | #define cef_string_userfree_alloc cef_string_userfree_utf8_alloc 69 | #define cef_string_userfree_free cef_string_userfree_utf8_free 70 | #define cef_string_from_ascii cef_string_utf8_copy 71 | #define cef_string_to_utf8 cef_string_utf8_copy 72 | #define cef_string_from_utf8 cef_string_utf8_copy 73 | #define cef_string_to_utf16 cef_string_utf8_to_utf16 74 | #define cef_string_from_utf16 cef_string_utf16_to_utf8 75 | #define cef_string_to_wide cef_string_utf8_to_wide 76 | #define cef_string_from_wide cef_string_wide_to_utf8 77 | #elif defined(CEF_STRING_TYPE_UTF16) 78 | typedef char16 cef_char_t; 79 | typedef cef_string_userfree_utf16_t cef_string_userfree_t; 80 | // typedef cef_string_utf16_t cef_string_t; 81 | #define cef_string_t cef_string_utf16_t 82 | #define cef_string_set cef_string_utf16_set 83 | #define cef_string_copy cef_string_utf16_copy 84 | #define cef_string_clear cef_string_utf16_clear 85 | #define cef_string_userfree_alloc cef_string_userfree_utf16_alloc 86 | #define cef_string_userfree_free cef_string_userfree_utf16_free 87 | #define cef_string_from_ascii cef_string_ascii_to_utf16 88 | #define cef_string_to_utf8 cef_string_utf16_to_utf8 89 | #define cef_string_from_utf8 cef_string_utf8_to_utf16 90 | #define cef_string_to_utf16 cef_string_utf16_copy 91 | #define cef_string_from_utf16 cef_string_utf16_copy 92 | #define cef_string_to_wide cef_string_utf16_to_wide 93 | #define cef_string_from_wide cef_string_wide_to_utf16 94 | #elif defined(CEF_STRING_TYPE_WIDE) 95 | typedef wchar_t cef_char_t; 96 | typedef cef_string_wide_t cef_string_t; 97 | typedef cef_string_userfree_wide_t cef_string_userfree_t; 98 | #define cef_string_set cef_string_wide_set 99 | #define cef_string_copy cef_string_wide_copy 100 | #define cef_string_clear cef_string_wide_clear 101 | #define cef_string_userfree_alloc cef_string_userfree_wide_alloc 102 | #define cef_string_userfree_free cef_string_userfree_wide_free 103 | #define cef_string_from_ascii cef_string_ascii_to_wide 104 | #define cef_string_to_utf8 cef_string_wide_to_utf8 105 | #define cef_string_from_utf8 cef_string_utf8_to_wide 106 | #define cef_string_to_utf16 cef_string_wide_to_utf16 107 | #define cef_string_from_utf16 cef_string_utf16_to_wide 108 | #define cef_string_to_wide cef_string_wide_copy 109 | #define cef_string_from_wide cef_string_wide_copy 110 | #else 111 | #error Please choose a string type. 112 | #endif 113 | 114 | #endif // CEF_INCLUDE_INTERNAL_CEF_STRING_H_ 115 | -------------------------------------------------------------------------------- /include/internal/cef_string_list.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ 31 | #define CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ 32 | #pragma once 33 | 34 | #include "include/internal/cef_export.h" 35 | #include "include/internal/cef_string.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /// 42 | // CEF string maps are a set of key/value string pairs. 43 | /// 44 | typedef void* cef_string_list_t; 45 | 46 | /// 47 | // Allocate a new string map. 48 | /// 49 | CEF_EXPORT cef_string_list_t cef_string_list_alloc(); 50 | 51 | /// 52 | // Return the number of elements in the string list. 53 | /// 54 | CEF_EXPORT int cef_string_list_size(cef_string_list_t list); 55 | 56 | /// 57 | // Retrieve the value at the specified zero-based string list index. Returns 58 | // true (1) if the value was successfully retrieved. 59 | /// 60 | CEF_EXPORT int cef_string_list_value(cef_string_list_t list, 61 | int index, cef_string_t* value); 62 | 63 | /// 64 | // Append a new value at the end of the string list. 65 | /// 66 | CEF_EXPORT void cef_string_list_append(cef_string_list_t list, 67 | const cef_string_t* value); 68 | 69 | /// 70 | // Clear the string list. 71 | /// 72 | CEF_EXPORT void cef_string_list_clear(cef_string_list_t list); 73 | 74 | /// 75 | // Free the string list. 76 | /// 77 | CEF_EXPORT void cef_string_list_free(cef_string_list_t list); 78 | 79 | /// 80 | // Creates a copy of an existing string list. 81 | /// 82 | CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif // CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ 89 | -------------------------------------------------------------------------------- /include/internal/cef_string_map.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ 31 | #define CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ 32 | #pragma once 33 | 34 | #include "include/internal/cef_export.h" 35 | #include "include/internal/cef_string.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /// 42 | // CEF string maps are a set of key/value string pairs. 43 | /// 44 | typedef void* cef_string_map_t; 45 | 46 | /// 47 | // Allocate a new string map. 48 | /// 49 | CEF_EXPORT cef_string_map_t cef_string_map_alloc(); 50 | 51 | /// 52 | // Return the number of elements in the string map. 53 | /// 54 | CEF_EXPORT int cef_string_map_size(cef_string_map_t map); 55 | 56 | /// 57 | // Return the value assigned to the specified key. 58 | /// 59 | CEF_EXPORT int cef_string_map_find(cef_string_map_t map, 60 | const cef_string_t* key, 61 | cef_string_t* value); 62 | 63 | /// 64 | // Return the key at the specified zero-based string map index. 65 | /// 66 | CEF_EXPORT int cef_string_map_key(cef_string_map_t map, int index, 67 | cef_string_t* key); 68 | 69 | /// 70 | // Return the value at the specified zero-based string map index. 71 | /// 72 | CEF_EXPORT int cef_string_map_value(cef_string_map_t map, int index, 73 | cef_string_t* value); 74 | 75 | /// 76 | // Append a new key/value pair at the end of the string map. 77 | /// 78 | CEF_EXPORT int cef_string_map_append(cef_string_map_t map, 79 | const cef_string_t* key, 80 | const cef_string_t* value); 81 | 82 | /// 83 | // Clear the string map. 84 | /// 85 | CEF_EXPORT void cef_string_map_clear(cef_string_map_t map); 86 | 87 | /// 88 | // Free the string map. 89 | /// 90 | CEF_EXPORT void cef_string_map_free(cef_string_map_t map); 91 | 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ 98 | -------------------------------------------------------------------------------- /include/internal/cef_string_multimap.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ 31 | #define CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ 32 | #pragma once 33 | 34 | #include "include/internal/cef_export.h" 35 | #include "include/internal/cef_string.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /// 42 | // CEF string multimaps are a set of key/value string pairs. 43 | // More than one value can be assigned to a single key. 44 | /// 45 | typedef void* cef_string_multimap_t; 46 | 47 | /// 48 | // Allocate a new string multimap. 49 | /// 50 | CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc(); 51 | 52 | /// 53 | // Return the number of elements in the string multimap. 54 | /// 55 | CEF_EXPORT int cef_string_multimap_size(cef_string_multimap_t map); 56 | 57 | /// 58 | // Return the number of values with the specified key. 59 | /// 60 | CEF_EXPORT int cef_string_multimap_find_count(cef_string_multimap_t map, 61 | const cef_string_t* key); 62 | 63 | /// 64 | // Return the value_index-th value with the specified key. 65 | /// 66 | CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map, 67 | const cef_string_t* key, 68 | int value_index, 69 | cef_string_t* value); 70 | 71 | /// 72 | // Return the key at the specified zero-based string multimap index. 73 | /// 74 | CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, int index, 75 | cef_string_t* key); 76 | 77 | /// 78 | // Return the value at the specified zero-based string multimap index. 79 | /// 80 | CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, int index, 81 | cef_string_t* value); 82 | 83 | /// 84 | // Append a new key/value pair at the end of the string multimap. 85 | /// 86 | CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map, 87 | const cef_string_t* key, 88 | const cef_string_t* value); 89 | 90 | /// 91 | // Clear the string multimap. 92 | /// 93 | CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map); 94 | 95 | /// 96 | // Free the string multimap. 97 | /// 98 | CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map); 99 | 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ 106 | -------------------------------------------------------------------------------- /include/internal/cef_time.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef CEF_INCLUDE_INTERNAL_CEF_TIME_H_ 31 | #define CEF_INCLUDE_INTERNAL_CEF_TIME_H_ 32 | #pragma once 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #include "include/internal/cef_export.h" 39 | #include 40 | 41 | /// 42 | // Time information. Values should always be in UTC. 43 | /// 44 | typedef struct _cef_time_t { 45 | int year; // Four digit year "2007" 46 | int month; // 1-based month (values 1 = January, etc.) 47 | int day_of_week; // 0-based day of week (0 = Sunday, etc.) 48 | int day_of_month; // 1-based day of month (1-31) 49 | int hour; // Hour within the current day (0-23) 50 | int minute; // Minute within the current hour (0-59) 51 | int second; // Second within the current minute (0-59 plus leap 52 | // seconds which may take it up to 60). 53 | int millisecond; // Milliseconds within the current second (0-999) 54 | } cef_time_t; 55 | 56 | /// 57 | // Converts cef_time_t to/from time_t. Returns true (1) on success and false (0) 58 | // on failure. 59 | /// 60 | CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time); 61 | CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time); 62 | 63 | /// 64 | // Converts cef_time_t to/from a double which is the number of seconds since 65 | // epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0 66 | // means "not initialized". Returns true (1) on success and false (0) on 67 | // failure. 68 | /// 69 | CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time); 70 | CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time); 71 | 72 | /// 73 | // Retrieve the current system time. 74 | // 75 | CEF_EXPORT int cef_time_now(cef_time_t* cef_time); 76 | 77 | /// 78 | // Retrieve the delta in milliseconds between two time values. 79 | // 80 | CEF_EXPORT int cef_time_delta(const cef_time_t* cef_time1, 81 | const cef_time_t* cef_time2, 82 | long long* delta); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif // CEF_INCLUDE_INTERNAL_CEF_TIME_H_ 89 | -------------------------------------------------------------------------------- /include/internal/cef_types_linux.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_ 32 | #define CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_ 33 | #pragma once 34 | 35 | #include "include/internal/cef_build.h" 36 | 37 | #if defined(OS_LINUX) 38 | #include 39 | #include "include/internal/cef_string.h" 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | // Handle types. 46 | #define cef_cursor_handle_t GdkCursor* 47 | #define cef_event_handle_t GdkEvent* 48 | #define cef_window_handle_t GtkWidget* 49 | #define cef_text_input_context_t void* 50 | 51 | /// 52 | // Structure representing CefExecuteProcess arguments. 53 | /// 54 | typedef struct _cef_main_args_t { 55 | int argc; 56 | char** argv; 57 | } cef_main_args_t; 58 | 59 | /// 60 | // Class representing window information. 61 | /// 62 | typedef struct _cef_window_info_t { 63 | // Pointer for the parent GtkBox widget. 64 | cef_window_handle_t parent_widget; 65 | 66 | // If window rendering is disabled no browser window will be created. Set 67 | // |parent_widget| to the window that will act as the parent for popup menus, 68 | // dialog boxes, etc. 69 | int window_rendering_disabled; 70 | 71 | // Set to true to enable transparent painting. 72 | int transparent_painting; 73 | 74 | // Pointer for the new browser widget. 75 | cef_window_handle_t widget; 76 | } cef_window_info_t; 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif // OS_LINUX 83 | 84 | #endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_ 85 | -------------------------------------------------------------------------------- /include/internal/cef_types_mac.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_ 32 | #define CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_ 33 | #pragma once 34 | 35 | #include "include/internal/cef_build.h" 36 | 37 | #if defined(OS_MACOSX) 38 | #include "include/internal/cef_string.h" 39 | 40 | // Handle types. 41 | #ifdef __cplusplus 42 | #ifdef __OBJC__ 43 | @class NSCursor; 44 | @class NSEvent; 45 | @class NSView; 46 | @class NSTextInputContext; 47 | #else 48 | class NSCursor; 49 | class NSEvent; 50 | struct NSView; 51 | class NSTextInputContext; 52 | #endif 53 | #define cef_cursor_handle_t NSCursor* 54 | #define cef_event_handle_t NSEvent* 55 | #define cef_window_handle_t NSView* 56 | #define cef_text_input_context_t NSTextInputContext* 57 | #else 58 | #define cef_cursor_handle_t void* 59 | #define cef_event_handle_t void* 60 | #define cef_window_handle_t void* 61 | #define cef_text_input_context_t void* 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | /// 69 | // Structure representing CefExecuteProcess arguments. 70 | /// 71 | typedef struct _cef_main_args_t { 72 | int argc; 73 | char** argv; 74 | } cef_main_args_t; 75 | 76 | /// 77 | // Class representing window information. 78 | /// 79 | typedef struct _cef_window_info_t { 80 | cef_string_t window_name; 81 | int x; 82 | int y; 83 | int width; 84 | int height; 85 | int hidden; 86 | 87 | // NSView pointer for the parent view. 88 | cef_window_handle_t parent_view; 89 | 90 | // If window rendering is disabled no browser window will be created. Set 91 | // |parent_view| to the window that will act as the parent for popup menus, 92 | // dialog boxes, etc. 93 | int window_rendering_disabled; 94 | 95 | // Set to true to enable transparent painting. 96 | int transparent_painting; 97 | 98 | // NSView pointer for the new browser view. 99 | cef_window_handle_t view; 100 | } cef_window_info_t; 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif // OS_MACOSX 107 | 108 | #endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_ 109 | -------------------------------------------------------------------------------- /include/internal/cef_types_win.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ 32 | #define CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ 33 | #pragma once 34 | 35 | #include "include/internal/cef_build.h" 36 | 37 | #if defined(OS_WIN) 38 | #include 39 | #include "include/internal/cef_string.h" 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | // Handle types. 46 | #define cef_cursor_handle_t HCURSOR 47 | #define cef_event_handle_t MSG* 48 | #define cef_window_handle_t HWND 49 | #define cef_text_input_context_t void* 50 | 51 | /// 52 | // Structure representing CefExecuteProcess arguments. 53 | /// 54 | typedef struct _cef_main_args_t { 55 | HINSTANCE instance; 56 | } cef_main_args_t; 57 | 58 | /// 59 | // Structure representing window information. 60 | /// 61 | typedef struct _cef_window_info_t { 62 | // Standard parameters required by CreateWindowEx() 63 | DWORD ex_style; 64 | cef_string_t window_name; 65 | DWORD style; 66 | int x; 67 | int y; 68 | int width; 69 | int height; 70 | cef_window_handle_t parent_window; 71 | HMENU menu; 72 | 73 | // If window rendering is disabled no browser window will be created. Set 74 | // |parent_window| to be used for identifying monitor info 75 | // (MonitorFromWindow). If |parent_window| is not provided the main screen 76 | // monitor will be used. 77 | BOOL window_rendering_disabled; 78 | 79 | // Set to true to enable transparent painting. 80 | // If window rendering is disabled and |transparent_painting| is set to true 81 | // WebKit rendering will draw on a transparent background (RGBA=0x00000000). 82 | // When this value is false the background will be white and opaque. 83 | BOOL transparent_painting; 84 | 85 | // Handle for the new browser window. 86 | cef_window_handle_t window; 87 | } cef_window_info_t; 88 | 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | 93 | #endif // OS_WIN 94 | 95 | #endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ 96 | -------------------------------------------------------------------------------- /src/cef/cef_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package cef 6 | 7 | /* 8 | #cgo CFLAGS: -I./../../ -x objective-c 9 | #cgo LDFLAGS: -framework Cocoa 10 | #include 11 | #include 12 | #include "include/capi/cef_app_capi.h" 13 | #include 14 | NSRect GetWindowBounds(void* view) { 15 | [NSAutoreleasePool new]; 16 | NSView* nsView = (__bridge NSView*)view; 17 | return [nsView bounds]; 18 | } 19 | */ 20 | import "C" 21 | import "unsafe" 22 | 23 | import ( 24 | "os" 25 | ) 26 | 27 | var _Argv []*C.char = make([]*C.char, len(os.Args)) 28 | 29 | func FillMainArgs(mainArgs *C.struct__cef_main_args_t, 30 | appHandle unsafe.Pointer) { 31 | // On Mac appHandle is nil. 32 | Logger.Println("FillMainArgs, argc=", len(os.Args)) 33 | for i, arg := range os.Args { 34 | _Argv[C.int(i)] = C.CString(arg) 35 | } 36 | mainArgs.argc = C.int(len(os.Args)) 37 | mainArgs.argv = &_Argv[0] 38 | } 39 | 40 | func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer) { 41 | Logger.Println("FillWindowInfo") 42 | 43 | // Setting title isn't required for the CEF inner window. 44 | // -- 45 | // var windowName *C.char = C.CString("TODO Darwin example") 46 | // defer C.free(unsafe.Pointer(windowName)) 47 | // C.cef_string_from_utf8(windowName, C.strlen(windowName), 48 | // &windowInfo.window_name) 49 | 50 | var bounds C.NSRect = C.GetWindowBounds(hwnd) 51 | 52 | windowInfo.x = C.int(bounds.origin.x) 53 | windowInfo.y = C.int(bounds.origin.y) 54 | windowInfo.width = C.int(bounds.size.width) 55 | windowInfo.height = C.int(bounds.size.height) 56 | 57 | // parent 58 | windowInfo.parent_view = hwnd 59 | } 60 | -------------------------------------------------------------------------------- /src/cef/cef_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package cef 6 | 7 | /* 8 | #cgo CFLAGS: -I./../../ 9 | #include 10 | #include "string.h" 11 | #include "include/capi/cef_app_capi.h" 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | import ( 17 | "os" 18 | ) 19 | 20 | var _Argv []*C.char = make([]*C.char, len(os.Args)) 21 | 22 | func FillMainArgs(mainArgs *C.struct__cef_main_args_t, 23 | appHandle unsafe.Pointer) { 24 | // On Linux appHandle is nil. 25 | Logger.Println("FillMainArgs, argc=", len(os.Args)) 26 | for i, arg := range os.Args { 27 | _Argv[C.int(i)] = C.CString(arg) 28 | } 29 | mainArgs.argc = C.int(len(os.Args)) 30 | mainArgs.argv = &_Argv[0] 31 | } 32 | 33 | func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer) { 34 | Logger.Println("FillWindowInfo") 35 | windowInfo.parent_widget = (*C.GtkWidget)(hwnd) 36 | } 37 | -------------------------------------------------------------------------------- /src/cef/cef_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package cef 6 | 7 | /* 8 | #cgo CFLAGS: -I./../../ 9 | #cgo LDFLAGS: -L./../../Release -llibcef 10 | #include 11 | #include "string.h" 12 | #include "include/capi/cef_app_capi.h" 13 | */ 14 | import "C" 15 | import "unsafe" 16 | 17 | func FillMainArgs(mainArgs *C.struct__cef_main_args_t, 18 | appHandle unsafe.Pointer) { 19 | Logger.Println("FillMainArgs") 20 | mainArgs.instance = (C.HINSTANCE)(appHandle) 21 | } 22 | 23 | func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer) { 24 | Logger.Println("FillWindowInfo") 25 | var rect C.RECT 26 | C.GetWindowRect((C.HWND)(hwnd), 27 | (*C.struct_tagRECT)(unsafe.Pointer(&rect))) 28 | windowInfo.style = C.WS_CHILD | C.WS_CLIPCHILDREN | C.WS_CLIPSIBLINGS | 29 | C.WS_TABSTOP | C.WS_VISIBLE 30 | windowInfo.parent_window = (C.HWND)(hwnd) 31 | windowInfo.x = C.int(rect.left) 32 | windowInfo.y = C.int(rect.top) 33 | windowInfo.width = C.int(rect.right - rect.left) 34 | windowInfo.height = C.int(rect.bottom - rect.top) 35 | } 36 | 37 | func WindowResized(hwnd unsafe.Pointer) { 38 | var rect C.RECT; 39 | C.GetClientRect((C.HWND)(hwnd), 40 | (*C.struct_tagRECT)(unsafe.Pointer(&rect))) 41 | var hdwp C.HDWP = C.BeginDeferWindowPos(1) 42 | var cefHwnd C.HWND = C.GetWindow((C.HWND)(hwnd), C.GW_CHILD) 43 | hdwp = C.DeferWindowPos(hdwp, cefHwnd, nil, 44 | C.int(rect.left), C.int(rect.top), 45 | C.int(rect.right - rect.left), 46 | C.int(rect.bottom - rect.top), 47 | C.SWP_NOZORDER) 48 | C.EndDeferWindowPos(hdwp) 49 | } 50 | -------------------------------------------------------------------------------- /src/cocoa/cocoa.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package cocoa 6 | 7 | /* 8 | #cgo CFLAGS: -I./../../ -x objective-c 9 | #cgo LDFLAGS: -framework Cocoa 10 | #include 11 | #include 12 | #include 13 | #include 14 | void InitializeApp() { 15 | [NSAutoreleasePool new]; 16 | [NSApplication sharedApplication]; 17 | [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; 18 | } 19 | @interface WindowDelegate : NSObject { 20 | @private 21 | NSView* view_; 22 | } 23 | @property (nonatomic, assign) NSView* view; 24 | @end 25 | @implementation WindowDelegate 26 | @synthesize view = view_; 27 | - (void)windowWillClose:(NSNotification *)notification { 28 | [NSAutoreleasePool new]; 29 | printf("NSWindowDelegate::windowWillClose\n"); 30 | _GoDestroySignal((__bridge void*)view_); 31 | } 32 | @end 33 | void* CreateWindow(char* title, int width, int height) { 34 | [NSAutoreleasePool new]; 35 | WindowDelegate* delegate = [[WindowDelegate alloc] init]; 36 | id window = [[NSWindow alloc] 37 | initWithContentRect:NSMakeRect(0, 0, width, height) 38 | styleMask:(NSTitledWindowMask | 39 | NSClosableWindowMask | 40 | NSMiniaturizableWindowMask | 41 | NSResizableWindowMask | 42 | NSUnifiedTitleAndToolbarWindowMask ) 43 | backing:NSBackingStoreBuffered 44 | defer:NO]; 45 | delegate.view = [window contentView]; 46 | [window setDelegate:delegate]; 47 | [window cascadeTopLeftFromPoint:NSMakePoint(20,20)]; 48 | [window setTitle:[NSString stringWithUTF8String:title]]; 49 | [window makeKeyAndOrderFront:nil]; 50 | return (__bridge void*) [window contentView]; 51 | } 52 | void ActivateApp() { 53 | [NSAutoreleasePool new]; 54 | [NSApp activateIgnoringOtherApps:YES]; 55 | } 56 | */ 57 | import "C" 58 | import "unsafe" 59 | import ( 60 | "os" 61 | "log" 62 | "path/filepath" 63 | ) 64 | 65 | var Logger *log.Logger = log.New(os.Stdout, "[cocoa] ", log.Lshortfile) 66 | 67 | func InitializeApp() { 68 | C.InitializeApp() 69 | } 70 | 71 | func CreateWindow(title string, width int, height int) unsafe.Pointer { 72 | Logger.Println("CreateWindow") 73 | csTitle := C.CString(title) 74 | defer C.free(unsafe.Pointer(csTitle)) 75 | window := C.CreateWindow(csTitle, C.int(width), C.int(height)) 76 | return window 77 | } 78 | 79 | func ActivateApp() { 80 | C.ActivateApp() 81 | } 82 | 83 | type DestroyCallback func() 84 | var destroySignalCallbacks map[uintptr]DestroyCallback = 85 | make(map[uintptr]DestroyCallback) 86 | 87 | func ConnectDestroySignal(window unsafe.Pointer, callback DestroyCallback) { 88 | Logger.Println("ConnectDestroySignal") 89 | ptr := uintptr(window) 90 | destroySignalCallbacks[ptr] = callback 91 | } 92 | 93 | func GetExecutableDir() string { 94 | var path []C.char = make([]C.char, 1024) 95 | var size C.uint32_t = 1024 96 | if (C._NSGetExecutablePath(&path[0], &size) == 0) { 97 | return filepath.Dir(C.GoString(&path[0])) 98 | } 99 | return "." 100 | } 101 | -------------------------------------------------------------------------------- /src/cocoa/export.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package cocoa 6 | 7 | /* 8 | #cgo CFLAGS: -I./../../ -x objective-c 9 | #cgo LDFLAGS: -framework Cocoa 10 | #include 11 | */ 12 | import "C" 13 | import "unsafe" 14 | 15 | //export _GoDestroySignal 16 | func _GoDestroySignal(window unsafe.Pointer) { 17 | Logger.Println("_GoDestroySignal") 18 | ptr := uintptr(window) 19 | if callback,ok := destroySignalCallbacks[ptr]; ok { 20 | delete(destroySignalCallbacks, ptr) 21 | callback() 22 | } else { 23 | Logger.Println("WARNING: _GoDestroySignal failed, callback not found") 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/gtk/export.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package gtk 6 | 7 | //#include "gtk/gtk.h" 8 | import "C" 9 | import "unsafe" 10 | 11 | //export _GoDestroySignal 12 | func _GoDestroySignal(widget *C.GtkWidget, data C.gpointer) { 13 | Logger.Println("_GoDestroySignal") 14 | ptr := uintptr(unsafe.Pointer(widget)) 15 | if callback,ok := destroySignalCallbacks[ptr]; ok { 16 | delete(destroySignalCallbacks, ptr) 17 | callback() 18 | } else { 19 | Logger.Println("WARNING: _GoDestroySignal failed, callback not found") 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/gtk/gtk.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package gtk 6 | 7 | /* 8 | #cgo pkg-config: --libs --cflags gtk+-2.0 9 | #include 10 | #include 11 | #include 12 | static inline GtkWindow* ToGtkWindow(GtkWidget* w) { return GTK_WINDOW(w); } 13 | static inline GtkContainer* ToGtkContainer(GtkWidget* w) { return GTK_CONTAINER(w); } 14 | void TerminationSignal(int signatl) { cef_quit_message_loop(); } 15 | void ConnectTerminationSignal() { 16 | signal(SIGINT, TerminationSignal); 17 | signal(SIGTERM, TerminationSignal); 18 | } 19 | void DestroySignal(GtkWidget* widget, gpointer data) { 20 | _GoDestroySignal(widget, data); 21 | } 22 | void ConnectDestroySignal(GtkWidget* window) { 23 | g_signal_connect(G_OBJECT(window), "destroy", 24 | G_CALLBACK(DestroySignal), NULL); 25 | } 26 | */ 27 | import "C" 28 | import "unsafe" 29 | import ( 30 | "os" 31 | "log" 32 | ) 33 | 34 | var Logger *log.Logger = log.New(os.Stdout, "[gtk] ", log.Lshortfile) 35 | 36 | func Initialize() { 37 | C.gtk_init(nil, nil) 38 | C.ConnectTerminationSignal() 39 | } 40 | 41 | func CreateWindow(title string, width int, height int) unsafe.Pointer { 42 | Logger.Println("CreateWindow") 43 | 44 | // Create window. 45 | window := C.gtk_window_new(C.GTK_WINDOW_TOPLEVEL) 46 | 47 | // Default size. 48 | C.gtk_window_set_default_size(C.ToGtkWindow(window), 49 | C.gint(width), C.gint(height)) 50 | 51 | // Center. 52 | C.gtk_window_set_position(C.ToGtkWindow(window), C.GTK_WIN_POS_CENTER) 53 | 54 | // Title. 55 | csTitle := C.CString(title) 56 | defer C.free(unsafe.Pointer(csTitle)) 57 | C.gtk_window_set_title(C.ToGtkWindow(window), (*C.gchar)(csTitle)) 58 | 59 | // TODO: focus 60 | // g_signal_connect(window, "focus", G_CALLBACK(&HandleFocus), NULL); 61 | 62 | // CEF requires a container. Embedding browser in a top 63 | // level window fails. 64 | vbox := C.gtk_vbox_new(0, 0) 65 | C.gtk_container_add(C.ToGtkContainer(window), vbox) 66 | 67 | // Show. 68 | C.gtk_widget_show_all(window) 69 | 70 | return unsafe.Pointer(vbox) 71 | } 72 | 73 | type DestroyCallback func() 74 | var destroySignalCallbacks map[uintptr]DestroyCallback = 75 | make(map[uintptr]DestroyCallback) 76 | 77 | func ConnectDestroySignal(window unsafe.Pointer, callback DestroyCallback) { 78 | Logger.Println("ConnectDestroySignal") 79 | ptr := uintptr(window) 80 | destroySignalCallbacks[ptr] = callback 81 | C.ConnectDestroySignal((*C.GtkWidget)(window)) 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/http_server_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | // DESCRIPTION: 6 | // ---------------------------------------------------------------------------- 7 | // This example shows how to run an internal web server while 8 | // embedding Chromium browser. You can communicate with Go from 9 | // javascript using XMLHttpRequests. 10 | // ---------------------------------------------------------------------------- 11 | 12 | package main 13 | 14 | import ( 15 | "fmt" 16 | "net/http" 17 | "runtime" 18 | ) 19 | 20 | // Imports from "main_windows.go" 21 | import ( 22 | "cef" 23 | "wingui" 24 | "os" 25 | "syscall" 26 | "unsafe" 27 | "log" 28 | "time" 29 | ) 30 | 31 | func handler(w http.ResponseWriter, req *http.Request) { 32 | w.Header().Set("Content-Type", "text/html; charset=utf-8") 33 | fmt.Fprintf(w, "This is Go server talking.
") 34 | fmt.Fprintf(w, "Time on the server: %v
", 35 | time.Now().Format("Jan 2, 2006 at 3:04pm (MST)")) 36 | fmt.Fprintf(w, "Go version: %v
", runtime.Version()) 37 | fmt.Fprintf(w, "
") 38 | if req.URL.Path == "/" { 39 | fmt.Fprintf(w, "Try /test.go
") 40 | } else if req.URL.Path == "/test.go" { 41 | fmt.Fprintf(w, "You accessed /test.go
") 42 | } 43 | } 44 | 45 | func run_http_server() { 46 | http.HandleFunc("/", handler) 47 | listen_at := "127.0.0.1:54007" 48 | fmt.Printf("Running http server at %s\n", listen_at) 49 | http.ListenAndServe(listen_at, nil) 50 | } 51 | 52 | // ---------------------------------------------------------------------------- 53 | // The code below copied from "main_windows.go" with the following changes: 54 | // 1. Added a call to run_http_server() at the beginning of main. 55 | // 2. Changed url at browser creation to "http://127.0.0.1:54007/" 56 | // 3. Imports were moved to the top of the file 57 | // ---------------------------------------------------------------------------- 58 | 59 | var Logger *log.Logger = log.New(os.Stdout, "[main] ", log.Lshortfile) 60 | 61 | func main() { 62 | go run_http_server() 63 | 64 | hInstance, e := wingui.GetModuleHandle(nil) 65 | if e != nil { wingui.AbortErrNo("GetModuleHandle", e) } 66 | 67 | cef.ExecuteProcess(unsafe.Pointer(hInstance)) 68 | 69 | settings := cef.Settings{} 70 | settings.CachePath = "webcache" // Set to empty to disable 71 | settings.LogSeverity = cef.LOGSEVERITY_DEFAULT // LOGSEVERITY_VERBOSE 72 | cef.Initialize(settings) 73 | 74 | wndproc := syscall.NewCallback(WndProc) 75 | Logger.Println("CreateWindow") 76 | hwnd := wingui.CreateWindow("cef2go example", wndproc) 77 | 78 | browserSettings := cef.BrowserSettings{} 79 | // TODO: It should be executable's directory used 80 | // rather than working directory. 81 | url, _ := os.Getwd() 82 | url = "file://" + url + "/example.html" 83 | url = "http://127.0.0.1:54007/" 84 | cef.CreateBrowser(unsafe.Pointer(hwnd), browserSettings, url) 85 | 86 | // It should be enough to call WindowResized after 10ms, 87 | // though to be sure let's extend it to 100ms. 88 | time.AfterFunc(time.Millisecond * 100, func(){ 89 | cef.WindowResized(unsafe.Pointer(hwnd)) 90 | }) 91 | 92 | cef.RunMessageLoop() 93 | cef.Shutdown() 94 | os.Exit(0) 95 | } 96 | 97 | func WndProc(hwnd syscall.Handle, msg uint32, wparam, lparam uintptr) (rc uintptr) { 98 | switch msg { 99 | case wingui.WM_CREATE: 100 | rc = wingui.DefWindowProc(hwnd, msg, wparam, lparam) 101 | case wingui.WM_SIZE: 102 | cef.WindowResized(unsafe.Pointer(hwnd)) 103 | case wingui.WM_CLOSE: 104 | wingui.DestroyWindow(hwnd) 105 | case wingui.WM_DESTROY: 106 | cef.QuitMessageLoop() 107 | default: 108 | rc = wingui.DefWindowProc(hwnd, msg, wparam, lparam) 109 | } 110 | return 111 | } 112 | -------------------------------------------------------------------------------- /src/main_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package main 6 | 7 | import ( 8 | "cef" 9 | "cocoa" 10 | "os" 11 | "log" 12 | ) 13 | 14 | var Logger *log.Logger = log.New(os.Stdout, "[main] ", log.Lshortfile) 15 | 16 | func main() { 17 | // Executable's directory 18 | exeDir := cocoa.GetExecutableDir() 19 | 20 | // CEF subprocesses. 21 | cef.ExecuteProcess(nil) 22 | 23 | // Initialize CEF. 24 | settings := cef.Settings{} 25 | settings.CachePath = exeDir + "/webcache" // Set to empty to disable 26 | settings.LogSeverity = cef.LOGSEVERITY_DEFAULT // LOGSEVERITY_VERBOSE 27 | settings.LogFile = exeDir + "/debug.log" 28 | //settings.LocalesDirPath = cwd + "/cef.framework/Resources" 29 | //settings.ResourcesDirPath = cwd + "/cef.framework/Resources" 30 | cef.Initialize(settings) 31 | 32 | // Create Window using Cocoa API. 33 | cocoa.InitializeApp() 34 | window := cocoa.CreateWindow("cef2go example", 1024, 768) 35 | cocoa.ConnectDestroySignal(window, OnDestroyWindow) 36 | cocoa.ActivateApp() 37 | 38 | // Create browser. 39 | browserSettings := cef.BrowserSettings{} 40 | url := "file://" + exeDir + "/example.html" 41 | cef.CreateBrowser(window, browserSettings, url) 42 | 43 | // CEF loop and shutdown. 44 | cef.RunMessageLoop() 45 | cef.Shutdown() 46 | os.Exit(0) 47 | } 48 | 49 | func OnDestroyWindow() { 50 | cef.QuitMessageLoop() 51 | } 52 | -------------------------------------------------------------------------------- /src/main_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package main 6 | 7 | import ( 8 | "cef" 9 | "gtk" 10 | "os" 11 | "log" 12 | ) 13 | 14 | var Logger *log.Logger = log.New(os.Stdout, "[main] ", log.Lshortfile) 15 | 16 | func main() { 17 | // TODO: It should be executable's directory used 18 | // rather than working directory. 19 | cwd, _ := os.Getwd() 20 | 21 | // CEF subprocesses. 22 | cef.ExecuteProcess(nil) 23 | 24 | // CEF initialize. 25 | settings := cef.Settings{} 26 | settings.CachePath = cwd + "/webcache" // Set to empty to disable 27 | settings.LogSeverity = cef.LOGSEVERITY_DEFAULT // LOGSEVERITY_VERBOSE 28 | settings.LogFile = cwd + "/debug.log" 29 | cef.Initialize(settings) 30 | 31 | // Create GTK window. 32 | gtk.Initialize() 33 | window := gtk.CreateWindow("cef2go example", 1024, 768) 34 | gtk.ConnectDestroySignal(window, OnDestroyWindow) 35 | 36 | // Create browser. 37 | browserSettings := cef.BrowserSettings{} 38 | url := "file://" + cwd + "/example.html" 39 | cef.CreateBrowser(window, browserSettings, url) 40 | 41 | // CEF loop and shutdown. 42 | cef.RunMessageLoop() 43 | cef.Shutdown() 44 | os.Exit(0) 45 | } 46 | 47 | func OnDestroyWindow() { 48 | cef.QuitMessageLoop() 49 | } 50 | -------------------------------------------------------------------------------- /src/main_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | package main 6 | 7 | import ( 8 | "cef" 9 | "wingui" 10 | "os" 11 | "syscall" 12 | "unsafe" 13 | "log" 14 | "time" 15 | ) 16 | 17 | var Logger *log.Logger = log.New(os.Stdout, "[main] ", log.Lshortfile) 18 | 19 | func main() { 20 | hInstance, e := wingui.GetModuleHandle(nil) 21 | if e != nil { wingui.AbortErrNo("GetModuleHandle", e) } 22 | 23 | cef.ExecuteProcess(unsafe.Pointer(hInstance)) 24 | 25 | settings := cef.Settings{} 26 | settings.CachePath = "webcache" // Set to empty to disable 27 | settings.LogSeverity = cef.LOGSEVERITY_DEFAULT // LOGSEVERITY_VERBOSE 28 | cef.Initialize(settings) 29 | 30 | wndproc := syscall.NewCallback(WndProc) 31 | Logger.Println("CreateWindow") 32 | hwnd := wingui.CreateWindow("cef2go example", wndproc) 33 | 34 | browserSettings := cef.BrowserSettings{} 35 | // TODO: It should be executable's directory used 36 | // rather than working directory. 37 | url, _ := os.Getwd() 38 | url = "file://" + url + "/example.html" 39 | cef.CreateBrowser(unsafe.Pointer(hwnd), browserSettings, url) 40 | 41 | // It should be enough to call WindowResized after 10ms, 42 | // though to be sure let's extend it to 100ms. 43 | time.AfterFunc(time.Millisecond * 100, func(){ 44 | cef.WindowResized(unsafe.Pointer(hwnd)) 45 | }) 46 | 47 | cef.RunMessageLoop() 48 | cef.Shutdown() 49 | os.Exit(0) 50 | } 51 | 52 | func WndProc(hwnd syscall.Handle, msg uint32, wparam, lparam uintptr) (rc uintptr) { 53 | switch msg { 54 | case wingui.WM_CREATE: 55 | rc = wingui.DefWindowProc(hwnd, msg, wparam, lparam) 56 | case wingui.WM_SIZE: 57 | cef.WindowResized(unsafe.Pointer(hwnd)) 58 | case wingui.WM_CLOSE: 59 | wingui.DestroyWindow(hwnd) 60 | case wingui.WM_DESTROY: 61 | cef.QuitMessageLoop() 62 | default: 63 | rc = wingui.DefWindowProc(hwnd, msg, wparam, lparam) 64 | } 65 | return 66 | } 67 | -------------------------------------------------------------------------------- /src/tests/cef_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The cef2go authors. All rights reserved. 2 | // License: BSD 3-clause. 3 | // Website: https://github.com/CzarekTomczak/cef2go 4 | 5 | // cef_test package tests the cef package. The tests 6 | // had to be put to a separate package to speed up 7 | // the running of tests. When the test was inside the 8 | // cef package, then the cef package was recompiled 9 | // each time, even though it was installed in GOPATH 10 | // before running the test. And this took time and 11 | // and slowed down the build process significantly. 12 | package cef_test 13 | 14 | import ( 15 | "testing" 16 | "cef" 17 | "log" 18 | "os" 19 | ) 20 | 21 | var Logger *log.Logger = log.New(os.Stdout, "[cef_test] ", log.Lshortfile) 22 | 23 | func Test_WorkingDirectory(t *testing.T) { 24 | // Change working directory while running tests, otherwise 25 | // CEF may have troubles finding the resource pak files. 26 | os.Chdir("./../../Release") 27 | } 28 | 29 | func Test_ExecuteProcess(t *testing.T) { 30 | Logger.Println("Test_ExecuteProcess") 31 | // If called for the browser process it will return 32 | // immediately with a value of -1 33 | code := cef.ExecuteProcess(nil) 34 | Logger.Println("ExecuteProcess returned:", code) 35 | } 36 | 37 | func Test_Initialize(t *testing.T) { 38 | Logger.Println("Test_Initialize") 39 | settings := cef.Settings{} 40 | init := cef.Initialize(settings) 41 | Logger.Println("Initialize() returned:", init) 42 | if init != 1 { 43 | t.Errorf("Initialize() returned: %d", init) 44 | } 45 | } 46 | 47 | func Test_Shutdown(t *testing.T) { 48 | Logger.Println("Test_Shutdown") 49 | cef.Shutdown() 50 | } 51 | -------------------------------------------------------------------------------- /src/wingui/gui.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package wingui 8 | 9 | import ( 10 | "fmt" 11 | "os" 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // some help functions 17 | 18 | func abortf(format string, a ...interface{}) { 19 | fmt.Fprintf(os.Stdout, format, a...) 20 | os.Exit(1) 21 | } 22 | 23 | func AbortErrNo(funcname string, err error) { 24 | errno, _ := err.(syscall.Errno) 25 | abortf("%s failed: %d %s\n", funcname, uint32(errno), err) 26 | } 27 | 28 | // global vars 29 | 30 | var ( 31 | mh syscall.Handle 32 | bh syscall.Handle 33 | ) 34 | 35 | func CreateWindow(title string, wndproc uintptr) (hwnd syscall.Handle) { 36 | var e error 37 | 38 | // GetModuleHandle 39 | mh, e = GetModuleHandle(nil) 40 | if e != nil { 41 | AbortErrNo("GetModuleHandle", e) 42 | } 43 | 44 | // Get icon we're going to use. 45 | myicon, e := LoadIcon(0, IDI_APPLICATION) 46 | if e != nil { 47 | AbortErrNo("LoadIcon", e) 48 | } 49 | 50 | // Get cursor we're going to use. 51 | mycursor, e := LoadCursor(0, IDC_ARROW) 52 | if e != nil { 53 | AbortErrNo("LoadCursor", e) 54 | } 55 | 56 | // RegisterClassEx 57 | wcname := syscall.StringToUTF16Ptr("myWindowClass") 58 | var wc Wndclassex 59 | wc.Size = uint32(unsafe.Sizeof(wc)) 60 | wc.WndProc = wndproc 61 | wc.Instance = mh 62 | wc.Icon = myicon 63 | wc.Cursor = mycursor 64 | wc.Background = COLOR_BTNFACE + 1 65 | wc.MenuName = nil 66 | wc.ClassName = wcname 67 | wc.IconSm = myicon 68 | if _, e := RegisterClassEx(&wc); e != nil { 69 | AbortErrNo("RegisterClassEx", e) 70 | } 71 | 72 | // CreateWindowEx 73 | wh, e := CreateWindowEx( 74 | 0, 75 | wcname, 76 | syscall.StringToUTF16Ptr(title), 77 | WS_OVERLAPPEDWINDOW, 78 | CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 79 | 0, 0, mh, 0) 80 | if e != nil { 81 | AbortErrNo("CreateWindowEx", e) 82 | } 83 | //fmt.Printf("main window handle is %x\n", wh) 84 | 85 | // ShowWindow 86 | ShowWindow(wh, SW_SHOWDEFAULT) 87 | 88 | // UpdateWindow 89 | if e := UpdateWindow(wh); e != nil { 90 | AbortErrNo("UpdateWindow", e) 91 | } 92 | 93 | hwnd = wh 94 | 95 | return 96 | 97 | /* 98 | // Process all windows messages until WM_QUIT. 99 | var m Msg 100 | for { 101 | r, e := GetMessage(&m, 0, 0, 0) 102 | if e != nil { 103 | AbortErrNo("GetMessage", e) 104 | } 105 | if r == 0 { 106 | // WM_QUIT received -> get out 107 | break 108 | } 109 | TranslateMessage(&m) 110 | DispatchMessage(&m) 111 | } 112 | return int(m.Wparam) 113 | */ 114 | } 115 | 116 | 117 | /* 118 | func main() { 119 | rc := rungui() 120 | os.Exit(rc) 121 | } 122 | */ 123 | -------------------------------------------------------------------------------- /src/wingui/winapi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package wingui 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | type Wndclassex struct { 15 | Size uint32 16 | Style uint32 17 | WndProc uintptr 18 | ClsExtra int32 19 | WndExtra int32 20 | Instance syscall.Handle 21 | Icon syscall.Handle 22 | Cursor syscall.Handle 23 | Background syscall.Handle 24 | MenuName *uint16 25 | ClassName *uint16 26 | IconSm syscall.Handle 27 | } 28 | 29 | type Point struct { 30 | X uintptr 31 | Y uintptr 32 | } 33 | 34 | type Msg struct { 35 | Hwnd syscall.Handle 36 | Message uint32 37 | Wparam uintptr 38 | Lparam uintptr 39 | Time uint32 40 | Pt Point 41 | } 42 | 43 | const ( 44 | // Window styles 45 | WS_OVERLAPPED = 0 46 | WS_POPUP = 0x80000000 47 | WS_CHILD = 0x40000000 48 | WS_MINIMIZE = 0x20000000 49 | WS_VISIBLE = 0x10000000 50 | WS_DISABLED = 0x8000000 51 | WS_CLIPSIBLINGS = 0x4000000 52 | WS_CLIPCHILDREN = 0x2000000 53 | WS_MAXIMIZE = 0x1000000 54 | WS_CAPTION = WS_BORDER | WS_DLGFRAME 55 | WS_BORDER = 0x800000 56 | WS_DLGFRAME = 0x400000 57 | WS_VSCROLL = 0x200000 58 | WS_HSCROLL = 0x100000 59 | WS_SYSMENU = 0x80000 60 | WS_THICKFRAME = 0x40000 61 | WS_GROUP = 0x20000 62 | WS_TABSTOP = 0x10000 63 | WS_MINIMIZEBOX = 0x20000 64 | WS_MAXIMIZEBOX = 0x10000 65 | WS_TILED = WS_OVERLAPPED 66 | WS_ICONIC = WS_MINIMIZE 67 | WS_SIZEBOX = WS_THICKFRAME 68 | // Common Window Styles 69 | WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX 70 | WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW 71 | WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU 72 | WS_CHILDWINDOW = WS_CHILD 73 | 74 | WS_EX_CLIENTEDGE = 0x200 75 | 76 | // Some windows messages 77 | WM_CREATE = 1 78 | WM_DESTROY = 2 79 | WM_SIZE = 5 80 | WM_CLOSE = 16 81 | WM_COMMAND = 273 82 | 83 | // Some button control styles 84 | BS_DEFPUSHBUTTON = 1 85 | 86 | // Some color constants 87 | COLOR_WINDOW = 5 88 | COLOR_BTNFACE = 15 89 | 90 | // Default window position 91 | CW_USEDEFAULT = 0x80000000 - 0x100000000 92 | 93 | // Show window default style 94 | SW_SHOWDEFAULT = 10 95 | ) 96 | 97 | var ( 98 | // Some globally known cursors 99 | IDC_ARROW = MakeIntResource(32512) 100 | IDC_IBEAM = MakeIntResource(32513) 101 | IDC_WAIT = MakeIntResource(32514) 102 | IDC_CROSS = MakeIntResource(32515) 103 | 104 | // Some globally known icons 105 | IDI_APPLICATION = MakeIntResource(32512) 106 | IDI_HAND = MakeIntResource(32513) 107 | IDI_QUESTION = MakeIntResource(32514) 108 | IDI_EXCLAMATION = MakeIntResource(32515) 109 | IDI_ASTERISK = MakeIntResource(32516) 110 | IDI_WINLOGO = MakeIntResource(32517) 111 | IDI_WARNING = IDI_EXCLAMATION 112 | IDI_ERROR = IDI_HAND 113 | IDI_INFORMATION = IDI_ASTERISK 114 | ) 115 | 116 | //sys GetModuleHandle(modname *uint16) (handle syscall.Handle, err error) = GetModuleHandleW 117 | //sys RegisterClassEx(wndclass *Wndclassex) (atom uint16, err error) = user32.RegisterClassExW 118 | //sys CreateWindowEx(exstyle uint32, classname *uint16, windowname *uint16, style uint32, x int32, y int32, width int32, height int32, wndparent syscall.Handle, menu syscall.Handle, instance syscall.Handle, param uintptr) (hwnd syscall.Handle, err error) = user32.CreateWindowExW 119 | //sys DefWindowProc(hwnd syscall.Handle, msg uint32, wparam uintptr, lparam uintptr) (lresult uintptr) = user32.DefWindowProcW 120 | //sys DestroyWindow(hwnd syscall.Handle) (err error) = user32.DestroyWindow 121 | //sys PostQuitMessage(exitcode int32) = user32.PostQuitMessage 122 | //sys ShowWindow(hwnd syscall.Handle, cmdshow int32) (wasvisible bool) = user32.ShowWindow 123 | //sys UpdateWindow(hwnd syscall.Handle) (err error) = user32.UpdateWindow 124 | //sys GetMessage(msg *Msg, hwnd syscall.Handle, MsgFilterMin uint32, MsgFilterMax uint32) (ret int32, err error) [failretval==-1] = user32.GetMessageW 125 | //sys TranslateMessage(msg *Msg) (done bool) = user32.TranslateMessage 126 | //sys DispatchMessage(msg *Msg) (ret int32) = user32.DispatchMessageW 127 | //sys LoadIcon(instance syscall.Handle, iconname *uint16) (icon syscall.Handle, err error) = user32.LoadIconW 128 | //sys LoadCursor(instance syscall.Handle, cursorname *uint16) (cursor syscall.Handle, err error) = user32.LoadCursorW 129 | //sys SetCursor(cursor syscall.Handle) (precursor syscall.Handle, err error) = user32.SetCursor 130 | //sys SendMessage(hwnd syscall.Handle, msg uint32, wparam uintptr, lparam uintptr) (lresult uintptr) = user32.SendMessageW 131 | //sys PostMessage(hwnd syscall.Handle, msg uint32, wparam uintptr, lparam uintptr) (err error) = user32.PostMessageW 132 | 133 | func MakeIntResource(id uint16) *uint16 { 134 | return (*uint16)(unsafe.Pointer(uintptr(id))) 135 | } 136 | -------------------------------------------------------------------------------- /tag/!README.txt: -------------------------------------------------------------------------------- 1 | Github thinks the project's main language is C++ because 2 | there are lots of .h files in the include/ directory. 3 | Thus godoc.org cannot index this project, as it looks 4 | only for projects tagged as Go. The solution is to create 5 | 99 .go files so that github knows this project's main 6 | language is Go. 7 | -------------------------------------------------------------------------------- /tag/!tag100.py: -------------------------------------------------------------------------------- 1 | for i in range(1, 100): 2 | i2 = i 3 | if i2 < 10: 4 | i2 = str("0")+str(i) 5 | i2 = str(i2) 6 | name = "tag"+i2+".go" 7 | with open(name, "w") as f: 8 | f.write("// Package tag.\npackage tag\n\nprintln(\"tag%s\")\n" % i2) 9 | -------------------------------------------------------------------------------- /tag/tag01.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag01") 5 | -------------------------------------------------------------------------------- /tag/tag02.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag02") 5 | -------------------------------------------------------------------------------- /tag/tag03.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag03") 5 | -------------------------------------------------------------------------------- /tag/tag04.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag04") 5 | -------------------------------------------------------------------------------- /tag/tag05.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag05") 5 | -------------------------------------------------------------------------------- /tag/tag06.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag06") 5 | -------------------------------------------------------------------------------- /tag/tag07.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag07") 5 | -------------------------------------------------------------------------------- /tag/tag08.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag08") 5 | -------------------------------------------------------------------------------- /tag/tag09.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag09") 5 | -------------------------------------------------------------------------------- /tag/tag10.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag10") 5 | -------------------------------------------------------------------------------- /tag/tag11.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag11") 5 | -------------------------------------------------------------------------------- /tag/tag12.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag12") 5 | -------------------------------------------------------------------------------- /tag/tag13.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag13") 5 | -------------------------------------------------------------------------------- /tag/tag14.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag14") 5 | -------------------------------------------------------------------------------- /tag/tag15.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag15") 5 | -------------------------------------------------------------------------------- /tag/tag16.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag16") 5 | -------------------------------------------------------------------------------- /tag/tag17.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag17") 5 | -------------------------------------------------------------------------------- /tag/tag18.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag18") 5 | -------------------------------------------------------------------------------- /tag/tag19.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag19") 5 | -------------------------------------------------------------------------------- /tag/tag20.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag20") 5 | -------------------------------------------------------------------------------- /tag/tag21.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag21") 5 | -------------------------------------------------------------------------------- /tag/tag22.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag22") 5 | -------------------------------------------------------------------------------- /tag/tag23.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag23") 5 | -------------------------------------------------------------------------------- /tag/tag24.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag24") 5 | -------------------------------------------------------------------------------- /tag/tag25.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag25") 5 | -------------------------------------------------------------------------------- /tag/tag26.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag26") 5 | -------------------------------------------------------------------------------- /tag/tag27.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag27") 5 | -------------------------------------------------------------------------------- /tag/tag28.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag28") 5 | -------------------------------------------------------------------------------- /tag/tag29.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag29") 5 | -------------------------------------------------------------------------------- /tag/tag30.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag30") 5 | -------------------------------------------------------------------------------- /tag/tag31.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag31") 5 | -------------------------------------------------------------------------------- /tag/tag32.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag32") 5 | -------------------------------------------------------------------------------- /tag/tag33.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag33") 5 | -------------------------------------------------------------------------------- /tag/tag34.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag34") 5 | -------------------------------------------------------------------------------- /tag/tag35.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag35") 5 | -------------------------------------------------------------------------------- /tag/tag36.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag36") 5 | -------------------------------------------------------------------------------- /tag/tag37.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag37") 5 | -------------------------------------------------------------------------------- /tag/tag38.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag38") 5 | -------------------------------------------------------------------------------- /tag/tag39.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag39") 5 | -------------------------------------------------------------------------------- /tag/tag40.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag40") 5 | -------------------------------------------------------------------------------- /tag/tag41.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag41") 5 | -------------------------------------------------------------------------------- /tag/tag42.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag42") 5 | -------------------------------------------------------------------------------- /tag/tag43.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag43") 5 | -------------------------------------------------------------------------------- /tag/tag44.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag44") 5 | -------------------------------------------------------------------------------- /tag/tag45.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag45") 5 | -------------------------------------------------------------------------------- /tag/tag46.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag46") 5 | -------------------------------------------------------------------------------- /tag/tag47.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag47") 5 | -------------------------------------------------------------------------------- /tag/tag48.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag48") 5 | -------------------------------------------------------------------------------- /tag/tag49.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag49") 5 | -------------------------------------------------------------------------------- /tag/tag50.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag50") 5 | -------------------------------------------------------------------------------- /tag/tag51.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag51") 5 | -------------------------------------------------------------------------------- /tag/tag52.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag52") 5 | -------------------------------------------------------------------------------- /tag/tag53.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag53") 5 | -------------------------------------------------------------------------------- /tag/tag54.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag54") 5 | -------------------------------------------------------------------------------- /tag/tag55.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag55") 5 | -------------------------------------------------------------------------------- /tag/tag56.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag56") 5 | -------------------------------------------------------------------------------- /tag/tag57.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag57") 5 | -------------------------------------------------------------------------------- /tag/tag58.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag58") 5 | -------------------------------------------------------------------------------- /tag/tag59.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag59") 5 | -------------------------------------------------------------------------------- /tag/tag60.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag60") 5 | -------------------------------------------------------------------------------- /tag/tag61.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag61") 5 | -------------------------------------------------------------------------------- /tag/tag62.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag62") 5 | -------------------------------------------------------------------------------- /tag/tag63.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag63") 5 | -------------------------------------------------------------------------------- /tag/tag64.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag64") 5 | -------------------------------------------------------------------------------- /tag/tag65.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag65") 5 | -------------------------------------------------------------------------------- /tag/tag66.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag66") 5 | -------------------------------------------------------------------------------- /tag/tag67.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag67") 5 | -------------------------------------------------------------------------------- /tag/tag68.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag68") 5 | -------------------------------------------------------------------------------- /tag/tag69.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag69") 5 | -------------------------------------------------------------------------------- /tag/tag70.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag70") 5 | -------------------------------------------------------------------------------- /tag/tag71.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag71") 5 | -------------------------------------------------------------------------------- /tag/tag72.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag72") 5 | -------------------------------------------------------------------------------- /tag/tag73.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag73") 5 | -------------------------------------------------------------------------------- /tag/tag74.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag74") 5 | -------------------------------------------------------------------------------- /tag/tag75.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag75") 5 | -------------------------------------------------------------------------------- /tag/tag76.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag76") 5 | -------------------------------------------------------------------------------- /tag/tag77.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag77") 5 | -------------------------------------------------------------------------------- /tag/tag78.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag78") 5 | -------------------------------------------------------------------------------- /tag/tag79.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag79") 5 | -------------------------------------------------------------------------------- /tag/tag80.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag80") 5 | -------------------------------------------------------------------------------- /tag/tag81.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag81") 5 | -------------------------------------------------------------------------------- /tag/tag82.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag82") 5 | -------------------------------------------------------------------------------- /tag/tag83.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag83") 5 | -------------------------------------------------------------------------------- /tag/tag84.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag84") 5 | -------------------------------------------------------------------------------- /tag/tag85.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag85") 5 | -------------------------------------------------------------------------------- /tag/tag86.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag86") 5 | -------------------------------------------------------------------------------- /tag/tag87.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag87") 5 | -------------------------------------------------------------------------------- /tag/tag88.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag88") 5 | -------------------------------------------------------------------------------- /tag/tag89.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag89") 5 | -------------------------------------------------------------------------------- /tag/tag90.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag90") 5 | -------------------------------------------------------------------------------- /tag/tag91.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag91") 5 | -------------------------------------------------------------------------------- /tag/tag92.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag92") 5 | -------------------------------------------------------------------------------- /tag/tag93.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag93") 5 | -------------------------------------------------------------------------------- /tag/tag94.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag94") 5 | -------------------------------------------------------------------------------- /tag/tag95.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag95") 5 | -------------------------------------------------------------------------------- /tag/tag96.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag96") 5 | -------------------------------------------------------------------------------- /tag/tag97.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag97") 5 | -------------------------------------------------------------------------------- /tag/tag98.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag98") 5 | -------------------------------------------------------------------------------- /tag/tag99.go: -------------------------------------------------------------------------------- 1 | // Package tag. 2 | package tag 3 | 4 | println("tag99") 5 | --------------------------------------------------------------------------------