mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-03-09 00:17:48 +01:00
Branch CEF3 files from /branches/cef3 to /trunk/cef3 (issue #564).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@571 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
b568f160d9
commit
34adee805c
22
AUTHORS.txt
Normal file
22
AUTHORS.txt
Normal file
@ -0,0 +1,22 @@
|
||||
# This file is an addendum to the Chromium AUTHORS file.
|
||||
# Names should be added to this file like so:
|
||||
# Name or Organization <email address>
|
||||
|
||||
Marshall Greenblatt <magreenblatt@gmail.com>
|
||||
Jamie Kirkpatrick <jkp@spotify.com>
|
||||
Johan Lindström <johanl@spotify.com>
|
||||
Igor Pavlov <igor.arabesc.pavlov@gmail.com>
|
||||
Yanko Yankov <yyankov@gmail.com>
|
||||
Emerick Rogul <emerick@gmail.com>
|
||||
Valve Corporation <mac@valvesoftware.com>
|
||||
Anthony Taranto <anthony.taranto@gmail.com>
|
||||
Joe Andrieu <joe@joeandrieu.com>
|
||||
Keith Poole <platima@gmail.com>
|
||||
Aviv Rind <avivrind@gmail.com>
|
||||
Michael Kaminski <mikeyk730@gmail.com>
|
||||
ADInstruments Ltd. <dev.team@adinstruments.com>
|
||||
Gus Verdun <gusverdun@gmail.com>
|
||||
Joinerysoft Ltd. <cpinfold@joinerysoft.com>
|
||||
Johan Björk <phb@spotify.com>
|
||||
Dmitry Azaraev <dmitry.azaraev@gmail.com>
|
||||
David Xue <ddxue27@gmail.com>
|
21
CHROMIUM_BUILD_COMPATIBILITY.txt
Normal file
21
CHROMIUM_BUILD_COMPATIBILITY.txt
Normal file
@ -0,0 +1,21 @@
|
||||
# The Chromium Embedded Framework (CEF) project is built on top of the Chromium
|
||||
# project source tree. Chromium should be updated to the URL and revision listed
|
||||
# below before building CEF. Chromium compatibility information for older CEF
|
||||
# revisions is available by viewing this file's change history.
|
||||
#
|
||||
# To configure a specific Chromium URL:
|
||||
# gclient config chromium_url
|
||||
#
|
||||
# To update to a specific Chromium revision:
|
||||
# gclient sync --revision src@chromium_revision --jobs 8 --force
|
||||
#
|
||||
# This file is integrated with the CEF Automation Tool. See the
|
||||
# tools/automate/automate.README.txt file for more information.
|
||||
#
|
||||
# For general gclient usage information visit:
|
||||
# http://dev.chromium.org/developers/how-tos/get-the-code
|
||||
|
||||
{
|
||||
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
||||
'chromium_revision': '128896',
|
||||
}
|
7
DEPS
Normal file
7
DEPS
Normal file
@ -0,0 +1,7 @@
|
||||
hooks = [
|
||||
{
|
||||
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
|
||||
"pattern": ".",
|
||||
"action": ["python", "src/cef/tools/gclient_hook.py"],
|
||||
},
|
||||
]
|
29
LICENSE.txt
Normal file
29
LICENSE.txt
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2008-2012 Marshall A. Greenblatt. Portions Copyright (c)
|
||||
// 2006-2009 Google Inc. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
22
cef.gypi
Normal file
22
cef.gypi
Normal file
@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
|
||||
# reserved. Use of this source code is governed by a BSD-style license that
|
||||
# can be found in the LICENSE file.
|
||||
|
||||
{
|
||||
'variables': {
|
||||
'conditions': [
|
||||
# Directory for CEF source files.
|
||||
[ 'OS=="win"', {
|
||||
'cef_directory' : '<!(echo %CEF_DIRECTORY%)',
|
||||
# Use SKIA text rendering for transparency support.
|
||||
'enable_skia_text': 1,
|
||||
}, { # OS!="win"
|
||||
'cef_directory' : '<!(echo $CEF_DIRECTORY)',
|
||||
}],
|
||||
[ 'OS=="mac"', {
|
||||
# Don't use the chrome style plugin with CEF.
|
||||
'clang_use_chrome_plugins': 0,
|
||||
}],
|
||||
]
|
||||
},
|
||||
}
|
2
cef_create_projects.bat
Normal file
2
cef_create_projects.bat
Normal file
@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
..\third_party\python_26\python.exe tools\gclient_hook.py
|
2
cef_create_projects.sh
Executable file
2
cef_create_projects.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
python tools/gclient_hook.py
|
249
cef_paths.gypi
Normal file
249
cef_paths.gypi
Normal file
@ -0,0 +1,249 @@
|
||||
# Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
||||
# reserved. Use of this source code is governed by a BSD-style license that
|
||||
# can be found in the LICENSE file.
|
||||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# This file was generated by the CEF translator tool and should not edited
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
|
||||
{
|
||||
'variables': {
|
||||
'autogen_cpp_includes': [
|
||||
'include/cef_app.h',
|
||||
'include/cef_browser.h',
|
||||
'include/cef_callback.h',
|
||||
'include/cef_client.h',
|
||||
'include/cef_command_line.h',
|
||||
'include/cef_cookie.h',
|
||||
'include/cef_display_handler.h',
|
||||
'include/cef_frame.h',
|
||||
'include/cef_geolocation_handler.h',
|
||||
'include/cef_life_span_handler.h',
|
||||
'include/cef_load_handler.h',
|
||||
'include/cef_origin_whitelist.h',
|
||||
'include/cef_process_message.h',
|
||||
'include/cef_proxy_handler.h',
|
||||
'include/cef_render_process_handler.h',
|
||||
'include/cef_request.h',
|
||||
'include/cef_request_handler.h',
|
||||
'include/cef_resource_bundle_handler.h',
|
||||
'include/cef_resource_handler.h',
|
||||
'include/cef_response.h',
|
||||
'include/cef_scheme.h',
|
||||
'include/cef_stream.h',
|
||||
'include/cef_string_visitor.h',
|
||||
'include/cef_task.h',
|
||||
'include/cef_url.h',
|
||||
'include/cef_v8.h',
|
||||
'include/cef_values.h',
|
||||
'include/cef_xml_reader.h',
|
||||
'include/cef_zip_reader.h',
|
||||
],
|
||||
'autogen_capi_includes': [
|
||||
'include/capi/cef_app_capi.h',
|
||||
'include/capi/cef_browser_capi.h',
|
||||
'include/capi/cef_callback_capi.h',
|
||||
'include/capi/cef_client_capi.h',
|
||||
'include/capi/cef_command_line_capi.h',
|
||||
'include/capi/cef_cookie_capi.h',
|
||||
'include/capi/cef_display_handler_capi.h',
|
||||
'include/capi/cef_frame_capi.h',
|
||||
'include/capi/cef_geolocation_handler_capi.h',
|
||||
'include/capi/cef_life_span_handler_capi.h',
|
||||
'include/capi/cef_load_handler_capi.h',
|
||||
'include/capi/cef_origin_whitelist_capi.h',
|
||||
'include/capi/cef_process_message_capi.h',
|
||||
'include/capi/cef_proxy_handler_capi.h',
|
||||
'include/capi/cef_render_process_handler_capi.h',
|
||||
'include/capi/cef_request_capi.h',
|
||||
'include/capi/cef_request_handler_capi.h',
|
||||
'include/capi/cef_resource_bundle_handler_capi.h',
|
||||
'include/capi/cef_resource_handler_capi.h',
|
||||
'include/capi/cef_response_capi.h',
|
||||
'include/capi/cef_scheme_capi.h',
|
||||
'include/capi/cef_stream_capi.h',
|
||||
'include/capi/cef_string_visitor_capi.h',
|
||||
'include/capi/cef_task_capi.h',
|
||||
'include/capi/cef_url_capi.h',
|
||||
'include/capi/cef_v8_capi.h',
|
||||
'include/capi/cef_values_capi.h',
|
||||
'include/capi/cef_xml_reader_capi.h',
|
||||
'include/capi/cef_zip_reader_capi.h',
|
||||
],
|
||||
'autogen_library_side': [
|
||||
'libcef_dll/ctocpp/app_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/app_ctocpp.h',
|
||||
'libcef_dll/cpptoc/auth_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/auth_callback_cpptoc.h',
|
||||
'libcef_dll/cpptoc/binary_value_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/binary_value_cpptoc.h',
|
||||
'libcef_dll/cpptoc/browser_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/browser_cpptoc.h',
|
||||
'libcef_dll/cpptoc/browser_host_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/browser_host_cpptoc.h',
|
||||
'libcef_dll/cpptoc/callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/client_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/client_ctocpp.h',
|
||||
'libcef_dll/cpptoc/command_line_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/command_line_cpptoc.h',
|
||||
'libcef_dll/cpptoc/cookie_manager_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/cookie_manager_cpptoc.h',
|
||||
'libcef_dll/ctocpp/cookie_visitor_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/cookie_visitor_ctocpp.h',
|
||||
'libcef_dll/cpptoc/dictionary_value_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/dictionary_value_cpptoc.h',
|
||||
'libcef_dll/ctocpp/display_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/display_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/frame_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/frame_cpptoc.h',
|
||||
'libcef_dll/cpptoc/geolocation_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/geolocation_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/geolocation_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/geolocation_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/life_span_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/life_span_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/list_value_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/list_value_cpptoc.h',
|
||||
'libcef_dll/ctocpp/load_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/load_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/post_data_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/post_data_cpptoc.h',
|
||||
'libcef_dll/cpptoc/post_data_element_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/post_data_element_cpptoc.h',
|
||||
'libcef_dll/cpptoc/process_message_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/process_message_cpptoc.h',
|
||||
'libcef_dll/ctocpp/proxy_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/proxy_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/read_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/read_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/render_process_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/render_process_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/request_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/request_cpptoc.h',
|
||||
'libcef_dll/ctocpp/request_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/request_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/resource_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/resource_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/response_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/response_cpptoc.h',
|
||||
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h',
|
||||
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/stream_reader_cpptoc.h',
|
||||
'libcef_dll/cpptoc/stream_writer_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/stream_writer_cpptoc.h',
|
||||
'libcef_dll/ctocpp/string_visitor_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/string_visitor_ctocpp.h',
|
||||
'libcef_dll/ctocpp/task_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/task_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
|
||||
'libcef_dll/cpptoc/v8context_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8context_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8exception_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8exception_cpptoc.h',
|
||||
'libcef_dll/ctocpp/v8handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/v8value_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8value_cpptoc.h',
|
||||
'libcef_dll/ctocpp/write_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/write_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/xml_reader_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/xml_reader_cpptoc.h',
|
||||
'libcef_dll/cpptoc/zip_reader_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/zip_reader_cpptoc.h',
|
||||
],
|
||||
'autogen_client_side': [
|
||||
'libcef_dll/cpptoc/app_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/app_cpptoc.h',
|
||||
'libcef_dll/ctocpp/auth_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/auth_callback_ctocpp.h',
|
||||
'libcef_dll/ctocpp/binary_value_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/binary_value_ctocpp.h',
|
||||
'libcef_dll/ctocpp/browser_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/browser_ctocpp.h',
|
||||
'libcef_dll/ctocpp/browser_host_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/browser_host_ctocpp.h',
|
||||
'libcef_dll/ctocpp/callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/client_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/client_cpptoc.h',
|
||||
'libcef_dll/ctocpp/command_line_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/command_line_ctocpp.h',
|
||||
'libcef_dll/ctocpp/cookie_manager_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/cookie_manager_ctocpp.h',
|
||||
'libcef_dll/cpptoc/cookie_visitor_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/cookie_visitor_cpptoc.h',
|
||||
'libcef_dll/ctocpp/dictionary_value_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/dictionary_value_ctocpp.h',
|
||||
'libcef_dll/cpptoc/display_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/display_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/frame_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/frame_ctocpp.h',
|
||||
'libcef_dll/ctocpp/geolocation_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/geolocation_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/geolocation_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/geolocation_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/life_span_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/life_span_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/list_value_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/list_value_ctocpp.h',
|
||||
'libcef_dll/cpptoc/load_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/load_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/post_data_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/post_data_ctocpp.h',
|
||||
'libcef_dll/ctocpp/post_data_element_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/post_data_element_ctocpp.h',
|
||||
'libcef_dll/ctocpp/process_message_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/process_message_ctocpp.h',
|
||||
'libcef_dll/cpptoc/proxy_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/proxy_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/read_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/read_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/render_process_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/render_process_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/request_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/request_ctocpp.h',
|
||||
'libcef_dll/cpptoc/request_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/request_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/resource_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/resource_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/response_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/response_ctocpp.h',
|
||||
'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h',
|
||||
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/stream_reader_ctocpp.h',
|
||||
'libcef_dll/ctocpp/stream_writer_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/stream_writer_ctocpp.h',
|
||||
'libcef_dll/cpptoc/string_visitor_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/string_visitor_cpptoc.h',
|
||||
'libcef_dll/cpptoc/task_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/task_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8accessor_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8accessor_cpptoc.h',
|
||||
'libcef_dll/ctocpp/v8context_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8context_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8exception_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8exception_ctocpp.h',
|
||||
'libcef_dll/cpptoc/v8handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/v8value_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8value_ctocpp.h',
|
||||
'libcef_dll/cpptoc/write_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/write_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/xml_reader_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/xml_reader_ctocpp.h',
|
||||
'libcef_dll/ctocpp/zip_reader_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/zip_reader_ctocpp.h',
|
||||
],
|
||||
},
|
||||
}
|
135
cef_paths2.gypi
Normal file
135
cef_paths2.gypi
Normal file
@ -0,0 +1,135 @@
|
||||
# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
|
||||
# reserved. Use of this source code is governed by a BSD-style license that
|
||||
# can be found in the LICENSE file.
|
||||
|
||||
{
|
||||
'includes': [
|
||||
# Bring in the autogenerated source file lists.
|
||||
'cef_paths.gypi',
|
||||
],
|
||||
'variables': {
|
||||
'includes_common': [
|
||||
'include/cef_base.h',
|
||||
'include/cef_runnable.h',
|
||||
'include/cef_version.h',
|
||||
'include/internal/cef_build.h',
|
||||
'include/internal/cef_export.h',
|
||||
'include/internal/cef_ptr.h',
|
||||
'include/internal/cef_string.h',
|
||||
'include/internal/cef_string_list.h',
|
||||
'include/internal/cef_string_map.h',
|
||||
'include/internal/cef_string_multimap.h',
|
||||
'include/internal/cef_string_types.h',
|
||||
'include/internal/cef_string_wrappers.h',
|
||||
'include/internal/cef_time.h',
|
||||
'include/internal/cef_tuple.h',
|
||||
'include/internal/cef_types.h',
|
||||
'include/internal/cef_types_wrappers.h',
|
||||
'<@(autogen_cpp_includes)',
|
||||
],
|
||||
'includes_capi': [
|
||||
'include/capi/cef_base_capi.h',
|
||||
'<@(autogen_capi_includes)',
|
||||
],
|
||||
'includes_wrapper': [
|
||||
'include/wrapper/cef_byte_read_handler.h',
|
||||
'include/wrapper/cef_stream_resource_handler.h',
|
||||
'include/wrapper/cef_xml_object.h',
|
||||
'include/wrapper/cef_zip_archive.h',
|
||||
],
|
||||
'includes_win': [
|
||||
'include/internal/cef_types_win.h',
|
||||
'include/internal/cef_win.h',
|
||||
],
|
||||
'includes_mac': [
|
||||
'include/cef_application_mac.h',
|
||||
'include/internal/cef_mac.h',
|
||||
'include/internal/cef_types_mac.h',
|
||||
],
|
||||
'includes_linux': [
|
||||
'include/internal/cef_linux.h',
|
||||
'include/internal/cef_types_linux.h',
|
||||
],
|
||||
'libcef_sources_common': [
|
||||
'libcef_dll/cef_logging.h',
|
||||
'libcef_dll/cpptoc/cpptoc.h',
|
||||
'libcef_dll/ctocpp/ctocpp.h',
|
||||
'libcef_dll/libcef_dll.cc',
|
||||
'libcef_dll/libcef_dll2.cc',
|
||||
'libcef_dll/resource.h',
|
||||
'libcef_dll/transfer_util.cpp',
|
||||
'libcef_dll/transfer_util.h',
|
||||
'<@(autogen_library_side)',
|
||||
],
|
||||
'libcef_dll_wrapper_sources_common': [
|
||||
'libcef_dll/cef_logging.h',
|
||||
'libcef_dll/cpptoc/base_cpptoc.h',
|
||||
'libcef_dll/cpptoc/cpptoc.h',
|
||||
'libcef_dll/ctocpp/base_ctocpp.h',
|
||||
'libcef_dll/ctocpp/ctocpp.h',
|
||||
'libcef_dll/transfer_util.cpp',
|
||||
'libcef_dll/transfer_util.h',
|
||||
'libcef_dll/wrapper/cef_byte_read_handler.cc',
|
||||
'libcef_dll/wrapper/cef_stream_resource_handler.cc',
|
||||
'libcef_dll/wrapper/cef_xml_object.cc',
|
||||
'libcef_dll/wrapper/cef_zip_archive.cc',
|
||||
'libcef_dll/wrapper/libcef_dll_wrapper.cc',
|
||||
'libcef_dll/wrapper/libcef_dll_wrapper2.cc',
|
||||
'<@(autogen_client_side)',
|
||||
],
|
||||
'cefclient_sources_common': [
|
||||
'tests/cefclient/cefclient.cpp',
|
||||
'tests/cefclient/cefclient.h',
|
||||
'tests/cefclient/cefclient_switches.cpp',
|
||||
'tests/cefclient/cefclient_switches.h',
|
||||
'tests/cefclient/client_handler.cpp',
|
||||
'tests/cefclient/client_handler.h',
|
||||
'tests/cefclient/res/localstorage.html',
|
||||
'tests/cefclient/res/logo.png',
|
||||
'tests/cefclient/res/xmlhttprequest.html',
|
||||
'tests/cefclient/resource_util.h',
|
||||
'tests/cefclient/scheme_test.cpp',
|
||||
'tests/cefclient/scheme_test.h',
|
||||
'tests/cefclient/string_util.cpp',
|
||||
'tests/cefclient/string_util.h',
|
||||
'tests/cefclient/util.h',
|
||||
],
|
||||
'cefclient_sources_win': [
|
||||
'tests/cefclient/cefclient.rc',
|
||||
'tests/cefclient/cefclient_win.cpp',
|
||||
'tests/cefclient/client_handler_win.cpp',
|
||||
'tests/cefclient/Resource.h',
|
||||
'tests/cefclient/res/cefclient.ico',
|
||||
'tests/cefclient/res/logoball.png',
|
||||
'tests/cefclient/res/small.ico',
|
||||
'tests/cefclient/resource_util_win.cpp',
|
||||
],
|
||||
'cefclient_sources_mac': [
|
||||
'tests/cefclient/cefclient_mac.mm',
|
||||
'tests/cefclient/client_handler_mac.mm',
|
||||
'tests/cefclient/resource_util_mac.mm',
|
||||
],
|
||||
'cefclient_sources_mac_helper': [
|
||||
'tests/cefclient/cefclient_helper_mac.cc',
|
||||
],
|
||||
'cefclient_bundle_resources_mac': [
|
||||
'tests/cefclient/mac/cefclient.icns',
|
||||
'tests/cefclient/mac/English.lproj/InfoPlist.strings',
|
||||
'tests/cefclient/mac/English.lproj/MainMenu.xib',
|
||||
'tests/cefclient/mac/Info.plist',
|
||||
'tests/cefclient/res/localstorage.html',
|
||||
'tests/cefclient/res/logo.png',
|
||||
'tests/cefclient/res/xmlhttprequest.html',
|
||||
],
|
||||
'cefclient_sources_linux': [
|
||||
'tests/cefclient/cefclient_gtk.cpp',
|
||||
'tests/cefclient/client_handler_gtk.cpp',
|
||||
'tests/cefclient/resource_util_linux.cpp',
|
||||
],
|
||||
'cefclient_bundle_resources_linux': [
|
||||
'tests/cefclient/res/localstorage.html',
|
||||
'tests/cefclient/res/logo.png',
|
||||
'tests/cefclient/res/xmlhttprequest.html',
|
||||
],
|
||||
},
|
||||
}
|
159
include/capi/cef_app_capi.h
Normal file
159
include/capi/cef_app_capi.h
Normal file
@ -0,0 +1,159 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// This function should be called from the application entry point function to
|
||||
// execute a secondary process. It can be used to run secondary processes from
|
||||
// the browser client executable (default behavior) or from a separate
|
||||
// executable specified by the CefSettings.browser_subprocess_path value. If
|
||||
// called for the browser process (identified by no "type" command-line value)
|
||||
// it will return immediately with a value of -1. If called for a recognized
|
||||
// secondary process it will block until the process should exit and then return
|
||||
// the process exit code. The |application| parameter may be NULL.
|
||||
///
|
||||
CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
|
||||
struct _cef_app_t* application);
|
||||
|
||||
///
|
||||
// This function should be called on the main application thread to initialize
|
||||
// the CEF browser process. The |application| parameter may be NULL. A return
|
||||
// value of true (1) indicates that it succeeded and false (0) indicates that it
|
||||
// failed.
|
||||
///
|
||||
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
|
||||
const struct _cef_settings_t* settings, struct _cef_app_t* application);
|
||||
|
||||
///
|
||||
// This function should be called on the main application thread to shut down
|
||||
// the CEF browser process before the application exits.
|
||||
///
|
||||
CEF_EXPORT void cef_shutdown();
|
||||
|
||||
///
|
||||
// Perform a single iteration of CEF message loop processing. This function is
|
||||
// used to integrate the CEF message loop into an existing application message
|
||||
// loop. Care must be taken to balance performance against excessive CPU usage.
|
||||
// This function should only be called on the main application thread and only
|
||||
// if cef_initialize() is called with a CefSettings.multi_threaded_message_loop
|
||||
// value of false (0). This function will not block.
|
||||
///
|
||||
CEF_EXPORT void cef_do_message_loop_work();
|
||||
|
||||
///
|
||||
// Run the CEF message loop. Use this function instead of an application-
|
||||
// provided message loop to get the best balance between performance and CPU
|
||||
// usage. This function should only be called on the main application thread and
|
||||
// only if cef_initialize() is called with a
|
||||
// CefSettings.multi_threaded_message_loop value of false (0). This function
|
||||
// will block until a quit message is received by the system.
|
||||
///
|
||||
CEF_EXPORT void cef_run_message_loop();
|
||||
|
||||
///
|
||||
// Quit the CEF message loop that was started by calling cef_run_message_loop().
|
||||
// This function should only be called on the main application thread and only
|
||||
// if cef_run_message_loop() was used.
|
||||
///
|
||||
CEF_EXPORT void cef_quit_message_loop();
|
||||
|
||||
///
|
||||
// Implement this structure to provide handler implementations. Methods will be
|
||||
// called by the process and/or thread indicated.
|
||||
///
|
||||
typedef struct _cef_app_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Provides an opportunity to view and/or modify command-line arguments before
|
||||
// processing by CEF and Chromium. The |process_type| value will be NULL for
|
||||
// the browser process. Do not keep a reference to the cef_command_line_t
|
||||
// object passed to this function. The CefSettings.command_line_args_disabled
|
||||
// value can be used to start with an NULL command-line object. Any values
|
||||
// specified in CefSettings that equate to command-line arguments will be set
|
||||
// before this function is called. Be cautious when using this function to
|
||||
// modify command-line arguments for non-browser processes as this may result
|
||||
// in undefined behavior including crashes.
|
||||
///
|
||||
void (CEF_CALLBACK *on_before_command_line_processing)(
|
||||
struct _cef_app_t* self, const cef_string_t* process_type,
|
||||
struct _cef_command_line_t* command_line);
|
||||
|
||||
///
|
||||
// Return the handler for render process events. This function is called by
|
||||
// the render process main thread.
|
||||
///
|
||||
struct _cef_render_process_handler_t* (
|
||||
CEF_CALLBACK *get_render_process_handler)(struct _cef_app_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for resource bundle events. If
|
||||
// CefSettings.pack_loading_disabled is true (1) a handler must be returned.
|
||||
// If no handler is returned resources will be loaded from pack files. This
|
||||
// function is called by the browser and rendere processes on multiple
|
||||
// threads.
|
||||
///
|
||||
struct _cef_resource_bundle_handler_t* (
|
||||
CEF_CALLBACK *get_resource_bundle_handler)(struct _cef_app_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for proxy events. If no handler is returned the default
|
||||
// system handler will be used. This function is called by the browser process
|
||||
// IO thread.
|
||||
///
|
||||
struct _cef_proxy_handler_t* (CEF_CALLBACK *get_proxy_handler)(
|
||||
struct _cef_app_t* self);
|
||||
} cef_app_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
85
include/capi/cef_base_capi.h
Normal file
85
include/capi/cef_base_capi.h
Normal file
@ -0,0 +1,85 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/internal/cef_export.h"
|
||||
#include "include/internal/cef_string.h"
|
||||
#include "include/internal/cef_string_list.h"
|
||||
#include "include/internal/cef_string_map.h"
|
||||
#include "include/internal/cef_string_multimap.h"
|
||||
#include "include/internal/cef_types.h"
|
||||
|
||||
///
|
||||
// Structure defining the reference count implementation functions. All
|
||||
// framework structures must include the cef_base_t structure first.
|
||||
///
|
||||
typedef struct _cef_base_t {
|
||||
///
|
||||
// Size of the data structure.
|
||||
///
|
||||
size_t size;
|
||||
|
||||
///
|
||||
// Increment the reference count.
|
||||
///
|
||||
int (CEF_CALLBACK *add_ref)(struct _cef_base_t* self);
|
||||
|
||||
///
|
||||
// Decrement the reference count. Delete this object when no references
|
||||
// remain.
|
||||
///
|
||||
int (CEF_CALLBACK *release)(struct _cef_base_t* self);
|
||||
|
||||
///
|
||||
// Returns the current number of references.
|
||||
///
|
||||
int (CEF_CALLBACK *get_refct)(struct _cef_base_t* self);
|
||||
} cef_base_t;
|
||||
|
||||
|
||||
// Check that the structure |s|, which is defined with a cef_base_t member named
|
||||
// |base|, is large enough to contain the specified member |f|.
|
||||
#define CEF_MEMBER_EXISTS(s, f) \
|
||||
((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= (s)->base.size)
|
||||
|
||||
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
252
include/capi/cef_browser_capi.h
Normal file
252
include/capi/cef_browser_capi.h
Normal file
@ -0,0 +1,252 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a browser window. When used in the browser
|
||||
// process the functions of this structure may be called on any thread unless
|
||||
// otherwise indicated in the comments. When used in the render process the
|
||||
// functions of this structure may only be called on the main thread.
|
||||
///
|
||||
typedef struct _cef_browser_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns the browser host object. This function can only be called in the
|
||||
// browser process.
|
||||
///
|
||||
struct _cef_browser_host_t* (CEF_CALLBACK *get_host)(
|
||||
struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the browser can navigate backwards.
|
||||
///
|
||||
int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Navigate backwards.
|
||||
///
|
||||
void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the browser can navigate forwards.
|
||||
///
|
||||
int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Navigate forwards.
|
||||
///
|
||||
void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the browser is currently loading.
|
||||
///
|
||||
int (CEF_CALLBACK *is_loading)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Reload the current page.
|
||||
///
|
||||
void (CEF_CALLBACK *reload)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Reload the current page ignoring any cached data.
|
||||
///
|
||||
void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Stop loading the page.
|
||||
///
|
||||
void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns the globally unique identifier for this browser.
|
||||
///
|
||||
int (CEF_CALLBACK *get_identifier)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the window is a popup window.
|
||||
///
|
||||
int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self);
|
||||
|
||||
// Returns true (1) if a document has been loaded in the browser.
|
||||
int (CEF_CALLBACK *has_document)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns the main (top-level) frame for the browser window.
|
||||
///
|
||||
struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)(
|
||||
struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns the focused frame for the browser window.
|
||||
///
|
||||
struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)(
|
||||
struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns the frame with the specified identifier, or NULL if not found.
|
||||
///
|
||||
struct _cef_frame_t* (CEF_CALLBACK *get_frame_byident)(
|
||||
struct _cef_browser_t* self, int64 identifier);
|
||||
|
||||
///
|
||||
// Returns the frame with the specified name, or NULL if not found.
|
||||
///
|
||||
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns the number of frames that currently exist.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_frame_count)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns the identifiers of all existing frames.
|
||||
///
|
||||
void (CEF_CALLBACK *get_frame_identifiers)(struct _cef_browser_t* self,
|
||||
size_t* identifiersCount, int64* identifiers);
|
||||
|
||||
///
|
||||
// Returns the names of all existing frames.
|
||||
///
|
||||
void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self,
|
||||
cef_string_list_t names);
|
||||
|
||||
//
|
||||
// Send a message to the specified |target_process|. Returns true (1) if the
|
||||
// message was sent successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *send_process_message)(struct _cef_browser_t* self,
|
||||
enum cef_process_id_t target_process,
|
||||
struct _cef_process_message_t* message);
|
||||
} cef_browser_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent the browser process aspects of a browser window.
|
||||
// The functions of this structure can only be called in the browser process.
|
||||
///
|
||||
typedef struct _cef_browser_host_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns the hosted browser object.
|
||||
///
|
||||
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Call this function before destroying a contained browser window. This
|
||||
// function performs any internal cleanup that may be needed before the
|
||||
// browser window is destroyed.
|
||||
///
|
||||
void (CEF_CALLBACK *parent_window_will_close)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Closes this browser window.
|
||||
///
|
||||
void (CEF_CALLBACK *close_browser)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Set focus for the browser window. If |enable| is true (1) focus will be set
|
||||
// to the window. Otherwise, focus will be removed.
|
||||
///
|
||||
void (CEF_CALLBACK *set_focus)(struct _cef_browser_host_t* self, int enable);
|
||||
|
||||
///
|
||||
// Retrieve the window handle for this browser.
|
||||
///
|
||||
cef_window_handle_t (CEF_CALLBACK *get_window_handle)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Retrieve the window handle of the browser that opened this browser. Will
|
||||
// return NULL for non-popup windows. This function can be used in combination
|
||||
// with custom handling of modal windows.
|
||||
///
|
||||
cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Returns the client for this browser.
|
||||
///
|
||||
struct _cef_client_t* (CEF_CALLBACK *get_client)(
|
||||
struct _cef_browser_host_t* self);
|
||||
} cef_browser_host_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new browser window using the window parameters specified by
|
||||
// |windowInfo|. All values will be copied internally and the actual window will
|
||||
// be created on the UI thread. This function can be called on any browser
|
||||
// process thread and will not block.
|
||||
///
|
||||
CEF_EXPORT int cef_browser_host_create_browser(
|
||||
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
||||
const cef_string_t* url, const struct _cef_browser_settings_t* settings);
|
||||
|
||||
///
|
||||
// Create a new browser window using the window parameters specified by
|
||||
// |windowInfo|. This function can only be called on the browser process UI
|
||||
// thread.
|
||||
///
|
||||
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
|
||||
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
||||
const cef_string_t* url, const struct _cef_browser_settings_t* settings);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
73
include/capi/cef_callback_capi.h
Normal file
73
include/capi/cef_callback_capi.h
Normal file
@ -0,0 +1,73 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Generic callback structure used for asynchronous continuation.
|
||||
///
|
||||
typedef struct _cef_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Continue processing.
|
||||
///
|
||||
void (CEF_CALLBACK *cont)(struct _cef_callback_t* self);
|
||||
|
||||
///
|
||||
// Cancel processing.
|
||||
///
|
||||
void (CEF_CALLBACK *cancel)(struct _cef_callback_t* self);
|
||||
} cef_callback_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
103
include/capi/cef_client_capi.h
Normal file
103
include/capi/cef_client_capi.h
Normal file
@ -0,0 +1,103 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to provide handler implementations.
|
||||
///
|
||||
typedef struct _cef_client_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Return the handler for browser life span events.
|
||||
///
|
||||
struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for browser load status events.
|
||||
///
|
||||
struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for browser request events.
|
||||
///
|
||||
struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for browser display state events.
|
||||
///
|
||||
struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for geolocation permissions requests. If no handler is
|
||||
// provided geolocation access will be denied by default.
|
||||
///
|
||||
struct _cef_geolocation_handler_t* (CEF_CALLBACK *get_geolocation_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Called when a new message is received from a different process. Return true
|
||||
// (1) if the message was handled or false (0) otherwise. Do not keep a
|
||||
// reference to or attempt to access the message outside of this callback.
|
||||
///
|
||||
int (CEF_CALLBACK *on_process_message_recieved)(struct _cef_client_t* self,
|
||||
struct _cef_browser_t* browser, enum cef_process_id_t source_process,
|
||||
struct _cef_process_message_t* message);
|
||||
} cef_client_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
199
include/capi/cef_command_line_capi.h
Normal file
199
include/capi/cef_command_line_capi.h
Normal file
@ -0,0 +1,199 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to create and/or parse command line arguments. Arguments with
|
||||
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
|
||||
// will always precede any arguments without switch prefixes. Switches can
|
||||
// optionally have a value specified using the '=' delimiter (e.g.
|
||||
// "-switch=value"). An argument of "--" will terminate switch parsing with all
|
||||
// subsequent tokens, regardless of prefix, being interpreted as non-switch
|
||||
// arguments. Switch names are considered case-insensitive. This structure can
|
||||
// be used before cef_initialize() is called.
|
||||
///
|
||||
typedef struct _cef_command_line_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
int (CEF_CALLBACK *is_read_only)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object.
|
||||
///
|
||||
struct _cef_command_line_t* (CEF_CALLBACK *copy)(
|
||||
struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Initialize the command line with the specified |argc| and |argv| values.
|
||||
// The first argument must be the name of the program. This function is only
|
||||
// supported on non-Windows platforms.
|
||||
///
|
||||
void (CEF_CALLBACK *init_from_argv)(struct _cef_command_line_t* self,
|
||||
int argc, const char* const* argv);
|
||||
|
||||
///
|
||||
// Initialize the command line with the string returned by calling
|
||||
// GetCommandLineW(). This function is only supported on Windows.
|
||||
///
|
||||
void (CEF_CALLBACK *init_from_string)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* command_line);
|
||||
|
||||
///
|
||||
// Reset the command-line switches and arguments but leave the program
|
||||
// component unchanged.
|
||||
///
|
||||
void (CEF_CALLBACK *reset)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Constructs and returns the represented command line string. Use this
|
||||
// function cautiously because quoting behavior is unclear.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_command_line_string)(
|
||||
struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Get the program part of the command line string (the first item).
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_program)(
|
||||
struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Set the program part of the command line string (the first item).
|
||||
///
|
||||
void (CEF_CALLBACK *set_program)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* program);
|
||||
|
||||
///
|
||||
// Returns true (1) if the command line has switches.
|
||||
///
|
||||
int (CEF_CALLBACK *has_switches)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the command line contains the given switch.
|
||||
///
|
||||
int (CEF_CALLBACK *has_switch)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns the value associated with the given switch. If the switch has no
|
||||
// value or isn't present this function returns the NULL string.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_switch_value)(
|
||||
struct _cef_command_line_t* self, const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns the map of switch names and values. If a switch has no value an
|
||||
// NULL string is returned.
|
||||
///
|
||||
void (CEF_CALLBACK *get_switches)(struct _cef_command_line_t* self,
|
||||
cef_string_map_t switches);
|
||||
|
||||
///
|
||||
// Add a switch to the end of the command line. If the switch has no value
|
||||
// pass an NULL value string.
|
||||
///
|
||||
void (CEF_CALLBACK *append_switch)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Add a switch with the specified value to the end of the command line.
|
||||
///
|
||||
void (CEF_CALLBACK *append_switch_with_value)(
|
||||
struct _cef_command_line_t* self, const cef_string_t* name,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// True if there are remaining command line arguments.
|
||||
///
|
||||
int (CEF_CALLBACK *has_arguments)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Get the remaining command line arguments.
|
||||
///
|
||||
void (CEF_CALLBACK *get_arguments)(struct _cef_command_line_t* self,
|
||||
cef_string_list_t arguments);
|
||||
|
||||
///
|
||||
// Add an argument to the end of the command line.
|
||||
///
|
||||
void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* argument);
|
||||
} cef_command_line_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_command_line_t instance.
|
||||
///
|
||||
CEF_EXPORT cef_command_line_t* cef_command_line_create();
|
||||
|
||||
///
|
||||
// Returns the singleton global cef_command_line_t object. The returned object
|
||||
// will be read-only.
|
||||
///
|
||||
CEF_EXPORT cef_command_line_t* cef_command_line_get_global();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
150
include/capi/cef_cookie_capi.h
Normal file
150
include/capi/cef_cookie_capi.h
Normal file
@ -0,0 +1,150 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used for managing cookies. The functions of this structure may be
|
||||
// called on any thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_cookie_manager_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Visit all cookies. The returned cookies are ordered by longest path, then
|
||||
// by earliest creation date. Returns false (0) if cookies cannot be accessed.
|
||||
///
|
||||
int (CEF_CALLBACK *visit_all_cookies)(struct _cef_cookie_manager_t* self,
|
||||
struct _cef_cookie_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Visit a subset of cookies. The results are filtered by the given url
|
||||
// scheme, host, domain and path. If |includeHttpOnly| is true (1) HTTP-only
|
||||
// cookies will also be included in the results. The returned cookies are
|
||||
// ordered by longest path, then by earliest creation date. Returns false (0)
|
||||
// if cookies cannot be accessed.
|
||||
///
|
||||
int (CEF_CALLBACK *visit_url_cookies)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url, int includeHttpOnly,
|
||||
struct _cef_cookie_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Sets a cookie given a valid URL and explicit user-provided cookie
|
||||
// attributes. This function expects each attribute to be well-formed. It will
|
||||
// check for disallowed characters (e.g. the ';' character is disallowed
|
||||
// within the cookie value attribute) and will return false (0) without
|
||||
// setting the cookie if such characters are found. This function must be
|
||||
// called on the IO thread.
|
||||
///
|
||||
int (CEF_CALLBACK *set_cookie)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url, const struct _cef_cookie_t* cookie);
|
||||
|
||||
///
|
||||
// Delete all cookies that match the specified parameters. If both |url| and
|
||||
// values |cookie_name| are specified all host and domain cookies matching
|
||||
// both will be deleted. If only |url| is specified all host cookies (but not
|
||||
// domain cookies) irrespective of path will be deleted. If |url| is NULL all
|
||||
// cookies for all hosts and domains will be deleted. Returns false (0) if a
|
||||
// non- NULL invalid URL is specified or if cookies cannot be accessed. This
|
||||
// function must be called on the IO thread.
|
||||
///
|
||||
int (CEF_CALLBACK *delete_cookies)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url, const cef_string_t* cookie_name);
|
||||
|
||||
///
|
||||
// Sets the directory path that will be used for storing cookie data. If
|
||||
// |path| is NULL data will be stored in memory only. Returns false (0) if
|
||||
// cookies cannot be accessed.
|
||||
///
|
||||
int (CEF_CALLBACK *set_storage_path)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* path);
|
||||
} cef_cookie_manager_t;
|
||||
|
||||
|
||||
///
|
||||
// Returns the global cookie manager. By default data will be stored at
|
||||
// CefSettings.cache_path if specified or in memory otherwise.
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager();
|
||||
|
||||
///
|
||||
// Creates a new cookie manager. If |path| is NULL data will be stored in memory
|
||||
// only. Returns NULL if creation fails.
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
|
||||
const cef_string_t* path);
|
||||
|
||||
|
||||
///
|
||||
// Structure to implement for visiting cookie values. The functions of this
|
||||
// structure will always be called on the IO thread.
|
||||
///
|
||||
typedef struct _cef_cookie_visitor_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Method that will be called once for each cookie. |count| is the 0-based
|
||||
// index for the current cookie. |total| is the total number of cookies. Set
|
||||
// |deleteCookie| to true (1) to delete the cookie currently being visited.
|
||||
// Return false (0) to stop visiting cookies. This function may never be
|
||||
// called if no cookies are found.
|
||||
///
|
||||
int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self,
|
||||
const struct _cef_cookie_t* cookie, int count, int total,
|
||||
int* deleteCookie);
|
||||
} cef_cookie_visitor_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
111
include/capi/cef_display_handler_capi.h
Normal file
111
include/capi/cef_display_handler_capi.h
Normal file
@ -0,0 +1,111 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser display state.
|
||||
// The functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_display_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called when the loading state has changed.
|
||||
///
|
||||
void (CEF_CALLBACK *on_loading_state_change)(
|
||||
struct _cef_display_handler_t* self, struct _cef_browser_t* browser,
|
||||
int isLoading, int canGoBack, int canGoForward);
|
||||
|
||||
///
|
||||
// Called when a frame's address has changed.
|
||||
///
|
||||
void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Called when the page title changes.
|
||||
///
|
||||
void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* title);
|
||||
|
||||
///
|
||||
// Called when the browser is about to display a tooltip. |text| contains the
|
||||
// text that will be displayed in the tooltip. To handle the display of the
|
||||
// tooltip yourself return true (1). Otherwise, you can optionally modify
|
||||
// |text| and then return false (0) to allow the browser to display the
|
||||
// tooltip.
|
||||
///
|
||||
int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_string_t* text);
|
||||
|
||||
///
|
||||
// Called when the browser receives a status message. |text| contains the text
|
||||
// that will be displayed in the status message and |type| indicates the
|
||||
// status message type.
|
||||
///
|
||||
void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* value,
|
||||
enum cef_handler_statustype_t type);
|
||||
|
||||
///
|
||||
// Called to display a console message. Return true (1) to stop the message
|
||||
// from being output to the console.
|
||||
///
|
||||
int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* message,
|
||||
const cef_string_t* source, int line);
|
||||
} cef_display_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
205
include/capi/cef_frame_capi.h
Normal file
205
include/capi/cef_frame_capi.h
Normal file
@ -0,0 +1,205 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a frame in the browser window. When used in the
|
||||
// browser process the functions of this structure may be called on any thread
|
||||
// unless otherwise indicated in the comments. When used in the render process
|
||||
// the functions of this structure may only be called on the main thread.
|
||||
///
|
||||
typedef struct _cef_frame_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// True if this object is currently attached to a valid frame.
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Execute undo in this frame.
|
||||
///
|
||||
void (CEF_CALLBACK *undo)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Execute redo in this frame.
|
||||
///
|
||||
void (CEF_CALLBACK *redo)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Execute cut in this frame.
|
||||
///
|
||||
void (CEF_CALLBACK *cut)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Execute copy in this frame.
|
||||
///
|
||||
void (CEF_CALLBACK *copy)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Execute paste in this frame.
|
||||
///
|
||||
void (CEF_CALLBACK *paste)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Execute delete in this frame.
|
||||
///
|
||||
void (CEF_CALLBACK *del)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Execute select all in this frame.
|
||||
///
|
||||
void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Save this frame's HTML source to a temporary file and open it in the
|
||||
// default text viewing application. This function can only be called from the
|
||||
// browser process.
|
||||
///
|
||||
void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Retrieve this frame's HTML source as a string sent to the specified
|
||||
// visitor.
|
||||
///
|
||||
void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self,
|
||||
struct _cef_string_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Retrieve this frame's display text as a string sent to the specified
|
||||
// visitor.
|
||||
///
|
||||
void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self,
|
||||
struct _cef_string_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Load the request represented by the |request| object.
|
||||
///
|
||||
void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self,
|
||||
struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Load the specified |url|.
|
||||
///
|
||||
void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Load the contents of |string_val| with the optional dummy target |url|.
|
||||
///
|
||||
void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self,
|
||||
const cef_string_t* string_val, const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Execute a string of JavaScript code in this frame. The |script_url|
|
||||
// parameter is the URL where the script in question can be found, if any. The
|
||||
// renderer may request this URL to show the developer the source of the
|
||||
// error. The |start_line| parameter is the base line number to use for error
|
||||
// reporting.
|
||||
///
|
||||
void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self,
|
||||
const cef_string_t* jsCode, const cef_string_t* scriptUrl,
|
||||
int startLine);
|
||||
|
||||
///
|
||||
// Returns true (1) if this is the main (top-level) frame.
|
||||
///
|
||||
int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this is the focused frame.
|
||||
///
|
||||
int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns the name for this frame. If the frame has an assigned name (for
|
||||
// example, set via the iframe "name" attribute) then that value will be
|
||||
// returned. Otherwise a unique name will be constructed based on the frame
|
||||
// parent hierarchy. The main (top-level) frame will always have an NULL name
|
||||
// value.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns the globally unique identifier for this frame.
|
||||
///
|
||||
int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||
// frame.
|
||||
///
|
||||
struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns the URL currently loaded in this frame.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns the browser that this frame belongs to.
|
||||
///
|
||||
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Get the V8 context associated with the frame. This function can only be
|
||||
// called from the render process.
|
||||
///
|
||||
struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)(
|
||||
struct _cef_frame_t* self);
|
||||
} cef_frame_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
104
include/capi/cef_geolocation_handler_capi.h
Normal file
104
include/capi/cef_geolocation_handler_capi.h
Normal file
@ -0,0 +1,104 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of geolocation
|
||||
// permission requests.
|
||||
///
|
||||
typedef struct _cef_geolocation_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Call to allow or deny geolocation access.
|
||||
///
|
||||
void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self,
|
||||
int allow);
|
||||
} cef_geolocation_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to geolocation permission
|
||||
// requests. The functions of this structure will be called on the browser
|
||||
// process IO thread.
|
||||
///
|
||||
typedef struct _cef_geolocation_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called when a page requests permission to access geolocation information.
|
||||
// |requesting_url| is the URL requesting permission and |request_id| is the
|
||||
// unique ID for the permission request. Call
|
||||
// cef_geolocation_callback_t::Continue to allow or deny the permission
|
||||
// request.
|
||||
///
|
||||
void (CEF_CALLBACK *on_request_geolocation_permission)(
|
||||
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
|
||||
const cef_string_t* requesting_url, int request_id,
|
||||
struct _cef_geolocation_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called when a geolocation access request is canceled. |requesting_url| is
|
||||
// the URL that originally requested permission and |request_id| is the unique
|
||||
// ID for the permission request.
|
||||
///
|
||||
void (CEF_CALLBACK *on_cancel_geolocation_permission)(
|
||||
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
|
||||
const cef_string_t* requesting_url, int request_id);
|
||||
} cef_geolocation_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
114
include/capi/cef_life_span_handler_capi.h
Normal file
114
include/capi/cef_life_span_handler_capi.h
Normal file
@ -0,0 +1,114 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser life span. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_life_span_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called before a new popup window is created. The |parentBrowser| parameter
|
||||
// will point to the parent browser window. The |popupFeatures| parameter will
|
||||
// contain information about the style of popup window requested. Return false
|
||||
// (0) to have the framework create the new popup window based on the
|
||||
// parameters in |windowInfo|. Return true (1) to cancel creation of the popup
|
||||
// window. By default, a newly created popup window will have the same client
|
||||
// and settings as the parent window. To change the client for the new window
|
||||
// modify the object that |client| points to. To change the settings for the
|
||||
// new window modify the |settings| structure.
|
||||
///
|
||||
int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* parentBrowser,
|
||||
const struct _cef_popup_features_t* popupFeatures,
|
||||
struct _cef_window_info_t* windowInfo, const cef_string_t* url,
|
||||
struct _cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings);
|
||||
|
||||
///
|
||||
// Called after a new window is created.
|
||||
///
|
||||
void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when a modal window is about to display and the modal loop should
|
||||
// begin running. Return false (0) to use the default modal loop
|
||||
// implementation or true (1) to use a custom implementation.
|
||||
///
|
||||
int (CEF_CALLBACK *run_modal)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when a window has recieved a request to close. Return false (0) to
|
||||
// proceed with the window close or true (1) to cancel the window close. If
|
||||
// this is a modal window and a custom modal loop implementation was provided
|
||||
// in run_modal() this callback should be used to restore the opener window to
|
||||
// a usable state.
|
||||
///
|
||||
int (CEF_CALLBACK *do_close)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called just before a window is closed. If this is a modal window and a
|
||||
// custom modal loop implementation was provided in run_modal() this callback
|
||||
// should be used to exit the custom modal loop.
|
||||
///
|
||||
void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
} cef_life_span_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
98
include/capi/cef_load_handler_capi.h
Normal file
98
include/capi/cef_load_handler_capi.h
Normal file
@ -0,0 +1,98 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser load status. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_load_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called when the browser begins loading a frame. The |frame| value will
|
||||
// never be NULL -- call the is_main() function to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This
|
||||
// function may not be called for a particular frame if the load request for
|
||||
// that frame fails.
|
||||
///
|
||||
void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame);
|
||||
|
||||
///
|
||||
// Called when the browser is done loading a frame. The |frame| value will
|
||||
// never be NULL -- call the is_main() function to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This
|
||||
// function will always be called for all frames irrespective of whether the
|
||||
// request completes successfully.
|
||||
///
|
||||
void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
int httpStatusCode);
|
||||
|
||||
///
|
||||
// Called when the browser fails to load a resource. |errorCode| is the error
|
||||
// code number, |errorText| is the error text and and |failedUrl| is the URL
|
||||
// that failed to load. See net\base\net_error_list.h for complete
|
||||
// descriptions of the error codes.
|
||||
///
|
||||
void (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
enum cef_handler_errorcode_t errorCode, const cef_string_t* errorText,
|
||||
const cef_string_t* failedUrl);
|
||||
} cef_load_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
102
include/capi/cef_origin_whitelist_capi.h
Normal file
102
include/capi/cef_origin_whitelist_capi.h
Normal file
@ -0,0 +1,102 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Add an entry to the cross-origin access whitelist.
|
||||
//
|
||||
// The same-origin policy restricts how scripts hosted from different origins
|
||||
// (scheme + domain + port) can communicate. By default, scripts can only access
|
||||
// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes
|
||||
// (but no other schemes) can use the "Access-Control-Allow-Origin" header to
|
||||
// allow cross-origin requests. For example, https://source.example.com can make
|
||||
// XMLHttpRequest requests on http://target.example.com if the
|
||||
// http://target.example.com request returns an "Access-Control-Allow-Origin:
|
||||
// https://source.example.com" response header.
|
||||
//
|
||||
// Scripts in separate frames or iframes and hosted from the same protocol and
|
||||
// domain suffix can execute cross-origin JavaScript if both pages set the
|
||||
// document.domain value to the same domain suffix. For example,
|
||||
// scheme://foo.example.com and scheme://bar.example.com can communicate using
|
||||
// JavaScript if both domains set document.domain="example.com".
|
||||
//
|
||||
// This function is used to allow access to origins that would otherwise violate
|
||||
// the same-origin policy. Scripts hosted underneath the fully qualified
|
||||
// |source_origin| URL (like http://www.example.com) will be allowed access to
|
||||
// all resources hosted on the specified |target_protocol| and |target_domain|.
|
||||
// If |allow_target_subdomains| is true (1) access will also be allowed to all
|
||||
// subdomains of the target domain.
|
||||
//
|
||||
// This function cannot be used to bypass the restrictions on local or display
|
||||
// isolated schemes. See the comments on CefRegisterCustomScheme for more
|
||||
// information.
|
||||
//
|
||||
// This function may be called on any thread. Returns false (0) if
|
||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
||||
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
||||
const cef_string_t* target_domain, int allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
||||
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
||||
const cef_string_t* target_domain, int allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
||||
// if the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_clear_cross_origin_whitelist();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
101
include/capi/cef_process_message_capi.h
Normal file
101
include/capi/cef_process_message_capi.h
Normal file
@ -0,0 +1,101 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure representing a message. Can be used on any process and thread.
|
||||
///
|
||||
typedef struct _cef_process_message_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
int (CEF_CALLBACK *is_read_only)(struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object.
|
||||
///
|
||||
struct _cef_process_message_t* (CEF_CALLBACK *copy)(
|
||||
struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns the message name.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_name)(
|
||||
struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns the list of arguments.
|
||||
///
|
||||
struct _cef_list_value_t* (CEF_CALLBACK *get_argument_list)(
|
||||
struct _cef_process_message_t* self);
|
||||
} cef_process_message_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_process_message_t object with the specified name.
|
||||
///
|
||||
CEF_EXPORT cef_process_message_t* cef_process_message_create(
|
||||
const cef_string_t* name);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
69
include/capi/cef_proxy_handler_capi.h
Normal file
69
include/capi/cef_proxy_handler_capi.h
Normal file
@ -0,0 +1,69 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle proxy resolution events.
|
||||
///
|
||||
typedef struct _cef_proxy_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called to retrieve proxy information for the specified |url|.
|
||||
///
|
||||
void (CEF_CALLBACK *get_proxy_for_url)(struct _cef_proxy_handler_t* self,
|
||||
const cef_string_t* url, struct _cef_proxy_info_t* proxy_info);
|
||||
} cef_proxy_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_
|
119
include/capi/cef_render_process_handler_capi.h
Normal file
119
include/capi/cef_render_process_handler_capi.h
Normal file
@ -0,0 +1,119 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to implement render process callbacks. The functions of this
|
||||
// structure will always be called on the render process main thread.
|
||||
///
|
||||
typedef struct _cef_render_process_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called after the render process main thread has been created.
|
||||
///
|
||||
void (CEF_CALLBACK *on_render_thread_created)(
|
||||
struct _cef_render_process_handler_t* self);
|
||||
|
||||
///
|
||||
// Called after WebKit has been initialized.
|
||||
///
|
||||
void (CEF_CALLBACK *on_web_kit_initialized)(
|
||||
struct _cef_render_process_handler_t* self);
|
||||
|
||||
///
|
||||
// Called after a browser has been created.
|
||||
///
|
||||
void (CEF_CALLBACK *on_browser_created)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called before a browser is destroyed.
|
||||
///
|
||||
void (CEF_CALLBACK *on_browser_destroyed)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called immediately after the V8 context for a frame has been created. To
|
||||
// retrieve the JavaScript 'window' object use the
|
||||
// cef_v8context_t::get_global() function.
|
||||
///
|
||||
void (CEF_CALLBACK *on_context_created)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_v8context_t* context);
|
||||
|
||||
///
|
||||
// Called immediately before the V8 context for a frame is released. No
|
||||
// references to the context should be kept after this function is called.
|
||||
///
|
||||
void (CEF_CALLBACK *on_context_released)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_v8context_t* context);
|
||||
|
||||
///
|
||||
// Called when a new message is received from a different process. Return true
|
||||
// (1) if the message was handled or false (0) otherwise. Do not keep a
|
||||
// reference to or attempt to access the message outside of this callback.
|
||||
///
|
||||
int (CEF_CALLBACK *on_process_message_recieved)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, enum cef_process_id_t source_process,
|
||||
struct _cef_process_message_t* message);
|
||||
} cef_render_process_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
261
include/capi/cef_request_capi.h
Normal file
261
include/capi/cef_request_capi.h
Normal file
@ -0,0 +1,261 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a web request. The functions of this structure
|
||||
// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_request_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Get the fully qualified URL.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the fully qualified URL.
|
||||
///
|
||||
void (CEF_CALLBACK *set_url)(struct _cef_request_t* self,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Get the request function type. The value will default to POST if post data
|
||||
// is provided and GET otherwise.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the request function type.
|
||||
///
|
||||
void (CEF_CALLBACK *set_method)(struct _cef_request_t* self,
|
||||
const cef_string_t* method);
|
||||
|
||||
///
|
||||
// Get the post data.
|
||||
///
|
||||
struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)(
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the post data.
|
||||
///
|
||||
void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self,
|
||||
struct _cef_post_data_t* postData);
|
||||
|
||||
///
|
||||
// Get the header values.
|
||||
///
|
||||
void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Set the header values.
|
||||
///
|
||||
void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Set all values at one time.
|
||||
///
|
||||
void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
|
||||
const cef_string_t* method, struct _cef_post_data_t* postData,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Get the flags used in combination with CefWebURLRequest.
|
||||
///
|
||||
enum cef_weburlrequest_flags_t (CEF_CALLBACK *get_flags)(
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the flags used in combination with CefWebURLRequest.
|
||||
///
|
||||
void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self,
|
||||
enum cef_weburlrequest_flags_t flags);
|
||||
|
||||
///
|
||||
// Set the URL to the first party for cookies used in combination with
|
||||
// CefWebURLRequest.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)(
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Get the URL to the first party for cookies used in combination with
|
||||
// CefWebURLRequest.
|
||||
///
|
||||
void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self,
|
||||
const cef_string_t* url);
|
||||
} cef_request_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_request_t object.
|
||||
///
|
||||
CEF_EXPORT cef_request_t* cef_request_create();
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent post data for a web request. The functions of
|
||||
// this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_post_data_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns the number of existing post data elements.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self);
|
||||
|
||||
///
|
||||
// Retrieve the post data elements.
|
||||
///
|
||||
void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self,
|
||||
size_t* elementsCount, struct _cef_post_data_element_t** elements);
|
||||
|
||||
///
|
||||
// Remove the specified post data element. Returns true (1) if the removal
|
||||
// succeeds.
|
||||
///
|
||||
int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self,
|
||||
struct _cef_post_data_element_t* element);
|
||||
|
||||
///
|
||||
// Add the specified post data element. Returns true (1) if the add succeeds.
|
||||
///
|
||||
int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self,
|
||||
struct _cef_post_data_element_t* element);
|
||||
|
||||
///
|
||||
// Remove all existing post data elements.
|
||||
///
|
||||
void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self);
|
||||
} cef_post_data_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_post_data_t object.
|
||||
///
|
||||
CEF_EXPORT cef_post_data_t* cef_post_data_create();
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a single element in the request post data. The
|
||||
// functions of this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_post_data_element_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Remove all contents from the post data element.
|
||||
///
|
||||
void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self);
|
||||
|
||||
///
|
||||
// The post data element will represent a file.
|
||||
///
|
||||
void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self,
|
||||
const cef_string_t* fileName);
|
||||
|
||||
///
|
||||
// The post data element will represent bytes. The bytes passed in will be
|
||||
// copied.
|
||||
///
|
||||
void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self,
|
||||
size_t size, const void* bytes);
|
||||
|
||||
///
|
||||
// Return the type of this post data element.
|
||||
///
|
||||
enum cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
|
||||
struct _cef_post_data_element_t* self);
|
||||
|
||||
///
|
||||
// Return the file name.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_file)(
|
||||
struct _cef_post_data_element_t* self);
|
||||
|
||||
///
|
||||
// Return the number of bytes.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self);
|
||||
|
||||
///
|
||||
// Read up to |size| bytes into |bytes| and return the number of bytes
|
||||
// actually read.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self,
|
||||
size_t size, void* bytes);
|
||||
} cef_post_data_element_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_post_data_element_t object.
|
||||
///
|
||||
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
138
include/capi/cef_request_handler_capi.h
Normal file
138
include/capi/cef_request_handler_capi.h
Normal file
@ -0,0 +1,138 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of authentication
|
||||
// requests.
|
||||
///
|
||||
typedef struct _cef_auth_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Continue the authentication request.
|
||||
///
|
||||
void (CEF_CALLBACK *cont)(struct _cef_auth_callback_t* self,
|
||||
const cef_string_t* username, const cef_string_t* password);
|
||||
|
||||
///
|
||||
// Cancel the authentication request.
|
||||
///
|
||||
void (CEF_CALLBACK *cancel)(struct _cef_auth_callback_t* self);
|
||||
} cef_auth_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser requests. The
|
||||
// functions of this structure will be called on the thread indicated.
|
||||
///
|
||||
typedef struct _cef_request_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource request is loaded. The |request|
|
||||
// object may be modified. To cancel the request return true (1) otherwise
|
||||
// return false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *on_before_resource_load)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource is loaded. To allow the resource
|
||||
// to load normally return NULL. To specify a handler for the resource return
|
||||
// a cef_resource_handler_t object. The |request| object should not be
|
||||
// modified in this callback.
|
||||
///
|
||||
struct _cef_resource_handler_t* (CEF_CALLBACK *get_resource_handler)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource load is redirected. The |old_url|
|
||||
// parameter will contain the old URL. The |new_url| parameter will contain
|
||||
// the new URL and can be changed if desired.
|
||||
///
|
||||
void (CEF_CALLBACK *on_resource_redirect)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
const cef_string_t* old_url, cef_string_t* new_url);
|
||||
|
||||
///
|
||||
// Called on the IO thread when the browser needs credentials from the user.
|
||||
// |isProxy| indicates whether the host is a proxy server. |host| contains the
|
||||
// hostname and |port| contains the port number. Return true (1) to continue
|
||||
// the request and call cef_auth_callback_t::Complete() when the
|
||||
// authentication information is available. Return false (0) to cancel the
|
||||
// request.
|
||||
///
|
||||
int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame, int isProxy,
|
||||
const cef_string_t* host, int port, const cef_string_t* realm,
|
||||
const cef_string_t* scheme, struct _cef_auth_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the IO thread to retrieve the cookie manager. |main_url| is the
|
||||
// URL of the top-level frame. Cookies managers can be unique per browser or
|
||||
// shared across multiple browsers. The global cookie manager will be used if
|
||||
// this function returns NULL.
|
||||
///
|
||||
struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
const cef_string_t* main_url);
|
||||
} cef_request_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
95
include/capi/cef_resource_bundle_handler_capi.h
Normal file
95
include/capi/cef_resource_bundle_handler_capi.h
Normal file
@ -0,0 +1,95 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to implement a custom resource bundle structure. The functions
|
||||
// of this structure may be called on multiple threads.
|
||||
///
|
||||
typedef struct _cef_resource_bundle_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called to retrieve a localized translation for the string specified by
|
||||
// |message_id|. To provide the translation set |string| to the translation
|
||||
// string and return true (1). To use the default translation return false
|
||||
// (0).
|
||||
//
|
||||
// WARNING: Be cautious when implementing this function. ID values are auto-
|
||||
// generated when CEF is built and may change between versions. Existing ID
|
||||
// values can be discovered by searching for *_strings.h in the
|
||||
// "obj/global_intermediate" build output directory.
|
||||
///
|
||||
int (CEF_CALLBACK *get_localized_string)(
|
||||
struct _cef_resource_bundle_handler_t* self, int message_id,
|
||||
cef_string_t* string);
|
||||
|
||||
///
|
||||
// Called to retrieve data for the resource specified by |resource_id|. To
|
||||
// provide the resource data set |data| and |data_size| to the data pointer
|
||||
// and size respectively and return true (1). To use the default resource data
|
||||
// return false (0). The resource data will not be copied and must remain
|
||||
// resident in memory.
|
||||
//
|
||||
// WARNING: Be cautious when implementing this function. ID values are auto-
|
||||
// generated when CEF is built and may change between versions. Existing ID
|
||||
// values can be discovered by searching for *_resources.h in the
|
||||
// "obj/global_intermediate" build output directory.
|
||||
///
|
||||
int (CEF_CALLBACK *get_data_resource)(
|
||||
struct _cef_resource_bundle_handler_t* self, int resource_id, void** data,
|
||||
size_t* data_size);
|
||||
} cef_resource_bundle_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
104
include/capi/cef_resource_handler_capi.h
Normal file
104
include/capi/cef_resource_handler_capi.h
Normal file
@ -0,0 +1,104 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to implement a custom request handler structure. The functions
|
||||
// of this structure will always be called on the IO thread.
|
||||
///
|
||||
typedef struct _cef_resource_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Begin processing the request. To handle the request return true (1) and
|
||||
// call cef_callback_t::cont() once the response header information is
|
||||
// available (cef_callback_t::cont() can also be called from inside this
|
||||
// function if header information is available immediately). To cancel the
|
||||
// request return false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *process_request)(struct _cef_resource_handler_t* self,
|
||||
struct _cef_request_t* request, struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Retrieve response header information. If the response length is not known
|
||||
// set |response_length| to -1 and read_response() will be called until it
|
||||
// returns false (0). If the response length is known set |response_length| to
|
||||
// a positive value and read_response() will be called until it returns false
|
||||
// (0) or the specified number of bytes have been read. Use the |response|
|
||||
// object to set the mime type, http status code and other optional header
|
||||
// values. To redirect the request to a new URL set |redirectUrl| to the new
|
||||
// URL.
|
||||
///
|
||||
void (CEF_CALLBACK *get_response_headers)(
|
||||
struct _cef_resource_handler_t* self, struct _cef_response_t* response,
|
||||
int64* response_length, cef_string_t* redirectUrl);
|
||||
|
||||
///
|
||||
// Read response data. If data is available immediately copy up to
|
||||
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
|
||||
// bytes copied, and return true (1). To read the data at a later time set
|
||||
// |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the
|
||||
// data is available. To indicate response completion return false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *read_response)(struct _cef_resource_handler_t* self,
|
||||
void* data_out, int bytes_to_read, int* bytes_read,
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Request processing has been canceled.
|
||||
///
|
||||
void (CEF_CALLBACK *cancel)(struct _cef_resource_handler_t* self);
|
||||
} cef_resource_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
119
include/capi/cef_response_capi.h
Normal file
119
include/capi/cef_response_capi.h
Normal file
@ -0,0 +1,119 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a web response. The functions of this structure
|
||||
// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_response_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Get the response status code.
|
||||
///
|
||||
int (CEF_CALLBACK *get_status)(struct _cef_response_t* self);
|
||||
|
||||
///
|
||||
// Set the response status code.
|
||||
///
|
||||
void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status);
|
||||
|
||||
///
|
||||
// Get the response status text.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_status_text)(
|
||||
struct _cef_response_t* self);
|
||||
|
||||
///
|
||||
// Set the response status text.
|
||||
///
|
||||
void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self,
|
||||
const cef_string_t* statusText);
|
||||
|
||||
///
|
||||
// Get the response mime type.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
|
||||
struct _cef_response_t* self);
|
||||
|
||||
///
|
||||
// Set the response mime type.
|
||||
///
|
||||
void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self,
|
||||
const cef_string_t* mimeType);
|
||||
|
||||
///
|
||||
// Get the value for the specified response header field.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Get all response header fields.
|
||||
///
|
||||
void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Set all response header fields.
|
||||
///
|
||||
void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
} cef_response_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
145
include/capi/cef_scheme_capi.h
Normal file
145
include/capi/cef_scheme_capi.h
Normal file
@ -0,0 +1,145 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Register a custom scheme. This function should not be called for the built-in
|
||||
// HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
||||
//
|
||||
// If |is_standard| is true (1) the scheme will be treated as a standard scheme.
|
||||
// Standard schemes are subject to URL canonicalization and parsing rules as
|
||||
// defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available
|
||||
// at http://www.ietf.org/rfc/rfc1738.txt
|
||||
//
|
||||
// In particular, the syntax for standard scheme URLs must be of the form: <pre>
|
||||
// [scheme]://[username]:[password]@[host]:[port]/[url-path]
|
||||
// </pre> Standard scheme URLs must have a host component that is a fully
|
||||
// qualified domain name as defined in Section 3.5 of RFC 1034 [13] and Section
|
||||
// 2.1 of RFC 1123. These URLs will be canonicalized to "scheme://host/path" in
|
||||
// the simplest case and "scheme://username:password@host:port/path" in the most
|
||||
// explicit case. For example, "scheme:host/path" and "scheme:///host/path" will
|
||||
// both be canonicalized to "scheme://host/path". The origin of a standard
|
||||
// scheme URL is the combination of scheme, host and port (i.e.,
|
||||
// "scheme://host:port" in the most explicit case).
|
||||
//
|
||||
// For non-standard scheme URLs only the "scheme:" component is parsed and
|
||||
// canonicalized. The remainder of the URL will be passed to the handler as-is.
|
||||
// For example, "scheme:///some%20text" will remain the same. Non-standard
|
||||
// scheme URLs cannot be used as a target for form submission.
|
||||
//
|
||||
// If |is_local| is true (1) the scheme will be treated as local (i.e., with the
|
||||
// same security rules as those applied to "file" URLs). Normal pages cannot
|
||||
// link to or access local URLs. Also, by default, local URLs can only perform
|
||||
// XMLHttpRequest calls to the same URL (origin + path) that originated the
|
||||
// request. To allow XMLHttpRequest calls from a local URL to other URLs with
|
||||
// the same origin set the CefSettings.file_access_from_file_urls_allowed value
|
||||
// to true (1). To allow XMLHttpRequest calls from a local URL to all origins
|
||||
// set the CefSettings.universal_access_from_file_urls_allowed value to true
|
||||
// (1).
|
||||
//
|
||||
// If |is_display_isolated| is true (1) the scheme will be treated as display-
|
||||
// isolated. This means that pages cannot display these URLs unless they are
|
||||
// from the same scheme. For example, pages in another origin cannot create
|
||||
// iframes or hyperlinks to URLs with this scheme.
|
||||
//
|
||||
// This function may be called on any thread. It should only be called once per
|
||||
// unique |scheme_name| value. If |scheme_name| is already registered or if an
|
||||
// error occurs this function will return false (0).
|
||||
///
|
||||
CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name,
|
||||
int is_standard, int is_local, int is_display_isolated);
|
||||
|
||||
///
|
||||
// Register a scheme handler factory for the specified |scheme_name| and
|
||||
// optional |domain_name|. An NULL |domain_name| value for a standard scheme
|
||||
// will cause the factory to match all domain names. The |domain_name| value
|
||||
// will be ignored for non-standard schemes. If |scheme_name| is a built-in
|
||||
// scheme and no handler is returned by |factory| then the built-in scheme
|
||||
// handler factory will be called. If |scheme_name| is a custom scheme the
|
||||
// cef_register_custom_scheme() function should be called for that scheme. This
|
||||
// function may be called multiple times to change or remove the factory that
|
||||
// matches the specified |scheme_name| and optional |domain_name|. Returns false
|
||||
// (0) if an error occurs. This function may be called on any thread.
|
||||
///
|
||||
CEF_EXPORT int cef_register_scheme_handler_factory(
|
||||
const cef_string_t* scheme_name, const cef_string_t* domain_name,
|
||||
struct _cef_scheme_handler_factory_t* factory);
|
||||
|
||||
///
|
||||
// Clear all registered scheme handler factories. Returns false (0) on error.
|
||||
// This function may be called on any thread.
|
||||
///
|
||||
CEF_EXPORT int cef_clear_scheme_handler_factories();
|
||||
|
||||
///
|
||||
// Structure that creates cef_resource_handler_t instances for handling scheme
|
||||
// requests. The functions of this structure will always be called on the IO
|
||||
// thread.
|
||||
///
|
||||
typedef struct _cef_scheme_handler_factory_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Return a new resource handler instance to handle the request. |browser|
|
||||
// will be the browser window that initiated the request. If the request was
|
||||
// initiated using the CefWebURLRequest API |browser| will be NULL. The
|
||||
// |request| object passed to this function will not contain cookie data.
|
||||
///
|
||||
struct _cef_resource_handler_t* (CEF_CALLBACK *create)(
|
||||
struct _cef_scheme_handler_factory_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
const cef_string_t* scheme_name, struct _cef_request_t* request);
|
||||
} cef_scheme_handler_factory_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
224
include/capi/cef_stream_capi.h
Normal file
224
include/capi/cef_stream_capi.h
Normal file
@ -0,0 +1,224 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure the client can implement to provide a custom stream reader. The
|
||||
// functions of this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_read_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Read raw binary data.
|
||||
///
|
||||
size_t (CEF_CALLBACK *read)(struct _cef_read_handler_t* self, void* ptr,
|
||||
size_t size, size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
int64 (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self);
|
||||
|
||||
///
|
||||
// Return non-zero if at end of file.
|
||||
///
|
||||
int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self);
|
||||
} cef_read_handler_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to read data from a stream. The functions of this structure
|
||||
// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_stream_reader_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Read raw binary data.
|
||||
///
|
||||
size_t (CEF_CALLBACK *read)(struct _cef_stream_reader_t* self, void* ptr,
|
||||
size_t size, size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
int64 (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self);
|
||||
|
||||
///
|
||||
// Return non-zero if at end of file.
|
||||
///
|
||||
int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self);
|
||||
} cef_stream_reader_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_stream_reader_t object from a file.
|
||||
///
|
||||
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file(
|
||||
const cef_string_t* fileName);
|
||||
|
||||
///
|
||||
// Create a new cef_stream_reader_t object from data.
|
||||
///
|
||||
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data,
|
||||
size_t size);
|
||||
|
||||
///
|
||||
// Create a new cef_stream_reader_t object from a custom handler.
|
||||
///
|
||||
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler(
|
||||
cef_read_handler_t* handler);
|
||||
|
||||
|
||||
///
|
||||
// Structure the client can implement to provide a custom stream writer. The
|
||||
// functions of this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_write_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Write raw binary data.
|
||||
///
|
||||
size_t (CEF_CALLBACK *write)(struct _cef_write_handler_t* self,
|
||||
const void* ptr, size_t size, size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
int64 (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self);
|
||||
|
||||
///
|
||||
// Flush the stream.
|
||||
///
|
||||
int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self);
|
||||
} cef_write_handler_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to write data to a stream. The functions of this structure may
|
||||
// be called on any thread.
|
||||
///
|
||||
typedef struct _cef_stream_writer_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Write raw binary data.
|
||||
///
|
||||
size_t (CEF_CALLBACK *write)(struct _cef_stream_writer_t* self,
|
||||
const void* ptr, size_t size, size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
int64 (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self);
|
||||
|
||||
///
|
||||
// Flush the stream.
|
||||
///
|
||||
int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self);
|
||||
} cef_stream_writer_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_stream_writer_t object for a file.
|
||||
///
|
||||
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file(
|
||||
const cef_string_t* fileName);
|
||||
|
||||
///
|
||||
// Create a new cef_stream_writer_t object for a custom handler.
|
||||
///
|
||||
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler(
|
||||
cef_write_handler_t* handler);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
|
69
include/capi/cef_string_visitor_capi.h
Normal file
69
include/capi/cef_string_visitor_capi.h
Normal file
@ -0,0 +1,69 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to receive string values asynchronously.
|
||||
///
|
||||
typedef struct _cef_string_visitor_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Method that will be executed.
|
||||
///
|
||||
void (CEF_CALLBACK *visit)(struct _cef_string_visitor_t* self,
|
||||
const cef_string_t* string);
|
||||
} cef_string_visitor_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_
|
95
include/capi/cef_task_capi.h
Normal file
95
include/capi/cef_task_capi.h
Normal file
@ -0,0 +1,95 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// CEF maintains multiple internal threads that are used for handling different
|
||||
// types of tasks in different processes. See the cef_thread_id_t definitions in
|
||||
// cef_types.h for more information. This function will return true (1) if
|
||||
// called on the specified thread. It is an error to request a thread from the
|
||||
// wrong process.
|
||||
///
|
||||
CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId);
|
||||
|
||||
///
|
||||
// Post a task for execution on the specified thread. This function may be
|
||||
// called on any thread. It is an error to request a thread from the wrong
|
||||
// process.
|
||||
///
|
||||
CEF_EXPORT int cef_post_task(cef_thread_id_t threadId,
|
||||
struct _cef_task_t* task);
|
||||
|
||||
///
|
||||
// Post a task for delayed execution on the specified thread. This function may
|
||||
// be called on any thread. It is an error to request a thread from the wrong
|
||||
// process.
|
||||
///
|
||||
CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId,
|
||||
struct _cef_task_t* task, int64 delay_ms);
|
||||
|
||||
///
|
||||
// Implement this structure for task execution. The functions of this structure
|
||||
// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_task_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Method that will be executed. |threadId| is the thread executing the call.
|
||||
///
|
||||
void (CEF_CALLBACK *execute)(struct _cef_task_t* self,
|
||||
cef_thread_id_t threadId);
|
||||
} cef_task_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
|
67
include/capi/cef_url_capi.h
Normal file
67
include/capi/cef_url_capi.h
Normal file
@ -0,0 +1,67 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Parse the specified |url| into its component parts. Returns false (0) if the
|
||||
// URL is NULL or invalid.
|
||||
///
|
||||
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
||||
struct _cef_urlparts_t* parts);
|
||||
|
||||
///
|
||||
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
|
||||
// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
|
||||
// if |parts| isn't initialized as described.
|
||||
///
|
||||
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
|
||||
cef_string_t* url);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_
|
707
include/capi/cef_v8_capi.h
Normal file
707
include/capi/cef_v8_capi.h
Normal file
@ -0,0 +1,707 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Register a new V8 extension with the specified JavaScript extension code and
|
||||
// handler. Functions implemented by the handler are prototyped using the
|
||||
// keyword 'native'. The calling of a native function is restricted to the scope
|
||||
// in which the prototype of the native function is defined. This function may
|
||||
// only be called on the render process main thread.
|
||||
//
|
||||
// Example JavaScript extension code: <pre>
|
||||
// // create the 'example' global object if it doesn't already exist.
|
||||
// if (!example)
|
||||
// example = {};
|
||||
// // create the 'example.test' global object if it doesn't already exist.
|
||||
// if (!example.test)
|
||||
// example.test = {};
|
||||
// (function() {
|
||||
// // Define the function 'example.test.myfunction'.
|
||||
// example.test.myfunction = function() {
|
||||
// // Call CefV8Handler::Execute() with the function name 'MyFunction'
|
||||
// // and no arguments.
|
||||
// native function MyFunction();
|
||||
// return MyFunction();
|
||||
// };
|
||||
// // Define the getter function for parameter 'example.test.myparam'.
|
||||
// example.test.__defineGetter__('myparam', function() {
|
||||
// // Call CefV8Handler::Execute() with the function name 'GetMyParam'
|
||||
// // and no arguments.
|
||||
// native function GetMyParam();
|
||||
// return GetMyParam();
|
||||
// });
|
||||
// // Define the setter function for parameter 'example.test.myparam'.
|
||||
// example.test.__defineSetter__('myparam', function(b) {
|
||||
// // Call CefV8Handler::Execute() with the function name 'SetMyParam'
|
||||
// // and a single argument.
|
||||
// native function SetMyParam();
|
||||
// if(b) SetMyParam(b);
|
||||
// });
|
||||
//
|
||||
// // Extension definitions can also contain normal JavaScript variables
|
||||
// // and functions.
|
||||
// var myint = 0;
|
||||
// example.test.increment = function() {
|
||||
// myint += 1;
|
||||
// return myint;
|
||||
// };
|
||||
// })();
|
||||
// </pre> Example usage in the page: <pre>
|
||||
// // Call the function.
|
||||
// example.test.myfunction();
|
||||
// // Set the parameter.
|
||||
// example.test.myparam = value;
|
||||
// // Get the parameter.
|
||||
// value = example.test.myparam;
|
||||
// // Call another function.
|
||||
// example.test.increment();
|
||||
// </pre>
|
||||
///
|
||||
CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
|
||||
const cef_string_t* javascript_code, struct _cef_v8handler_t* handler);
|
||||
|
||||
///
|
||||
// Structure that encapsulates a V8 context handle. The functions of this
|
||||
// structure may only be called on the render process main thread.
|
||||
///
|
||||
typedef struct _cef_v8context_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns the browser for this context.
|
||||
///
|
||||
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
|
||||
struct _cef_v8context_t* self);
|
||||
|
||||
///
|
||||
// Returns the frame for this context.
|
||||
///
|
||||
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_v8context_t* self);
|
||||
|
||||
///
|
||||
// Returns the global object for this context. The context must be entered
|
||||
// before calling this function.
|
||||
///
|
||||
struct _cef_v8value_t* (CEF_CALLBACK *get_global)(
|
||||
struct _cef_v8context_t* self);
|
||||
|
||||
///
|
||||
// Enter this context. A context must be explicitly entered before creating a
|
||||
// V8 Object, Array, Function or Date asynchronously. exit() must be called
|
||||
// the same number of times as enter() before releasing this context. V8
|
||||
// objects belong to the context in which they are created. Returns true (1)
|
||||
// if the scope was entered successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *enter)(struct _cef_v8context_t* self);
|
||||
|
||||
///
|
||||
// Exit this context. Call this function only after calling enter(). Returns
|
||||
// true (1) if the scope was exited successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *exit)(struct _cef_v8context_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is pointing to the same handle as |that|
|
||||
// object.
|
||||
///
|
||||
int (CEF_CALLBACK *is_same)(struct _cef_v8context_t* self,
|
||||
struct _cef_v8context_t* that);
|
||||
|
||||
///
|
||||
// Evaluates the specified JavaScript code using this context's global object.
|
||||
// On success |retval| will be set to the return value, if any, and the
|
||||
// function will return true (1). On failure |exception| will be set to the
|
||||
// exception, if any, and the function will return false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *eval)(struct _cef_v8context_t* self,
|
||||
const cef_string_t* code, struct _cef_v8value_t** retval,
|
||||
struct _cef_v8exception_t** exception);
|
||||
} cef_v8context_t;
|
||||
|
||||
|
||||
///
|
||||
// Returns the current (top) context object in the V8 context stack.
|
||||
///
|
||||
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context();
|
||||
|
||||
///
|
||||
// Returns the entered (bottom) context object in the V8 context stack.
|
||||
///
|
||||
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context();
|
||||
|
||||
///
|
||||
// Returns true (1) if V8 is currently inside a context.
|
||||
///
|
||||
CEF_EXPORT int cef_v8context_in_context();
|
||||
|
||||
|
||||
///
|
||||
// Structure that should be implemented to handle V8 function calls. The
|
||||
// functions of this structure will always be called on the render process main
|
||||
// thread.
|
||||
///
|
||||
typedef struct _cef_v8handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Handle execution of the function identified by |name|. |object| is the
|
||||
// receiver ('this' object) of the function. |arguments| is the list of
|
||||
// arguments passed to the function. If execution succeeds set |retval| to the
|
||||
// function return value. If execution fails set |exception| to the exception
|
||||
// that will be thrown. Return true (1) if execution was handled.
|
||||
///
|
||||
int (CEF_CALLBACK *execute)(struct _cef_v8handler_t* self,
|
||||
const cef_string_t* name, struct _cef_v8value_t* object,
|
||||
size_t argumentsCount, struct _cef_v8value_t* const* arguments,
|
||||
struct _cef_v8value_t** retval, cef_string_t* exception);
|
||||
} cef_v8handler_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure that should be implemented to handle V8 accessor calls. Accessor
|
||||
// identifiers are registered by calling cef_v8value_t::set_value_byaccessor().
|
||||
// The functions of this structure will always be called on the render process
|
||||
// main thread.
|
||||
///
|
||||
typedef struct _cef_v8accessor_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Handle retrieval the accessor value identified by |name|. |object| is the
|
||||
// receiver ('this' object) of the accessor. If retrieval succeeds set
|
||||
// |retval| to the return value. If retrieval fails set |exception| to the
|
||||
// exception that will be thrown. Return true (1) if accessor retrieval was
|
||||
// handled.
|
||||
///
|
||||
int (CEF_CALLBACK *get)(struct _cef_v8accessor_t* self,
|
||||
const cef_string_t* name, struct _cef_v8value_t* object,
|
||||
struct _cef_v8value_t** retval, cef_string_t* exception);
|
||||
|
||||
///
|
||||
// Handle assignment of the accessor value identified by |name|. |object| is
|
||||
// the receiver ('this' object) of the accessor. |value| is the new value
|
||||
// being assigned to the accessor. If assignment fails set |exception| to the
|
||||
// exception that will be thrown. Return true (1) if accessor assignment was
|
||||
// handled.
|
||||
///
|
||||
int (CEF_CALLBACK *set)(struct _cef_v8accessor_t* self,
|
||||
const cef_string_t* name, struct _cef_v8value_t* object,
|
||||
struct _cef_v8value_t* value, cef_string_t* exception);
|
||||
} cef_v8accessor_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure representing a V8 exception.
|
||||
///
|
||||
typedef struct _cef_v8exception_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns the exception message.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_message)(
|
||||
struct _cef_v8exception_t* self);
|
||||
|
||||
///
|
||||
// Returns the line of source code that the exception occurred within.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_source_line)(
|
||||
struct _cef_v8exception_t* self);
|
||||
|
||||
///
|
||||
// Returns the resource name for the script from where the function causing
|
||||
// the error originates.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_script_resource_name)(
|
||||
struct _cef_v8exception_t* self);
|
||||
|
||||
///
|
||||
// Returns the 1-based number of the line where the error occurred or 0 if the
|
||||
// line number is unknown.
|
||||
///
|
||||
int (CEF_CALLBACK *get_line_number)(struct _cef_v8exception_t* self);
|
||||
|
||||
///
|
||||
// Returns the index within the script of the first character where the error
|
||||
// occurred.
|
||||
///
|
||||
int (CEF_CALLBACK *get_start_position)(struct _cef_v8exception_t* self);
|
||||
|
||||
///
|
||||
// Returns the index within the script of the last character where the error
|
||||
// occurred.
|
||||
///
|
||||
int (CEF_CALLBACK *get_end_position)(struct _cef_v8exception_t* self);
|
||||
|
||||
///
|
||||
// Returns the index within the line of the first character where the error
|
||||
// occurred.
|
||||
///
|
||||
int (CEF_CALLBACK *get_start_column)(struct _cef_v8exception_t* self);
|
||||
|
||||
///
|
||||
// Returns the index within the line of the last character where the error
|
||||
// occurred.
|
||||
///
|
||||
int (CEF_CALLBACK *get_end_column)(struct _cef_v8exception_t* self);
|
||||
} cef_v8exception_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure representing a V8 value. The functions of this structure may only
|
||||
// be called on the render process main thread.
|
||||
///
|
||||
typedef struct _cef_v8value_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// True if the value type is undefined.
|
||||
///
|
||||
int (CEF_CALLBACK *is_undefined)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is null.
|
||||
///
|
||||
int (CEF_CALLBACK *is_null)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is bool.
|
||||
///
|
||||
int (CEF_CALLBACK *is_bool)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is int.
|
||||
///
|
||||
int (CEF_CALLBACK *is_int)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is unsigned int.
|
||||
///
|
||||
int (CEF_CALLBACK *is_uint)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is double.
|
||||
///
|
||||
int (CEF_CALLBACK *is_double)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is Date.
|
||||
///
|
||||
int (CEF_CALLBACK *is_date)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is string.
|
||||
///
|
||||
int (CEF_CALLBACK *is_string)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is object.
|
||||
///
|
||||
int (CEF_CALLBACK *is_object)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is array.
|
||||
///
|
||||
int (CEF_CALLBACK *is_array)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is function.
|
||||
///
|
||||
int (CEF_CALLBACK *is_function)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is pointing to the same handle as |that|
|
||||
// object.
|
||||
///
|
||||
int (CEF_CALLBACK *is_same)(struct _cef_v8value_t* self,
|
||||
struct _cef_v8value_t* that);
|
||||
|
||||
///
|
||||
// Return a bool value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Return an int value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
int32 (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Return an unisgned int value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
uint32 (CEF_CALLBACK *get_uint_value)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Return a double value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Return a Date value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Return a string value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_string_value)(
|
||||
struct _cef_v8value_t* self);
|
||||
|
||||
|
||||
// OBJECT METHODS - These functions are only available on objects. Arrays and
|
||||
// functions are also objects. String- and integer-based keys can be used
|
||||
// interchangably with the framework converting between them as necessary.
|
||||
|
||||
///
|
||||
// Returns true (1) if this is a user created object.
|
||||
///
|
||||
int (CEF_CALLBACK *is_user_created)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the last function call resulted in an exception. This
|
||||
// attribute exists only in the scope of the current CEF value object.
|
||||
///
|
||||
int (CEF_CALLBACK *has_exception)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Returns the exception resulting from the last function call. This attribute
|
||||
// exists only in the scope of the current CEF value object.
|
||||
///
|
||||
struct _cef_v8exception_t* (CEF_CALLBACK *get_exception)(
|
||||
struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Clears the last exception and returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *clear_exception)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object will re-throw future exceptions. This
|
||||
// attribute exists only in the scope of the current CEF value object.
|
||||
///
|
||||
int (CEF_CALLBACK *will_rethrow_exceptions)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Set whether this object will re-throw future exceptions. By default
|
||||
// exceptions are not re-thrown. If a exception is re-thrown the current
|
||||
// context should not be accessed again until after the exception has been
|
||||
// caught and not re-thrown. Returns true (1) on success. This attribute
|
||||
// exists only in the scope of the current CEF value object.
|
||||
///
|
||||
int (CEF_CALLBACK *set_rethrow_exceptions)(struct _cef_v8value_t* self,
|
||||
int rethrow);
|
||||
|
||||
///
|
||||
// Returns true (1) if the object has a value with the specified identifier.
|
||||
///
|
||||
int (CEF_CALLBACK *has_value_bykey)(struct _cef_v8value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns true (1) if the object has a value with the specified identifier.
|
||||
///
|
||||
int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, int index);
|
||||
|
||||
///
|
||||
// Deletes the value with the specified identifier and returns true (1) on
|
||||
// success. Returns false (0) if this function is called incorrectly or an
|
||||
// exception is thrown. For read-only and don't-delete values this function
|
||||
// will return true (1) even though deletion failed.
|
||||
///
|
||||
int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Deletes the value with the specified identifier and returns true (1) on
|
||||
// success. Returns false (0) if this function is called incorrectly, deletion
|
||||
// fails or an exception is thrown. For read-only and don't-delete values this
|
||||
// function will return true (1) even though deletion failed.
|
||||
///
|
||||
int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self,
|
||||
int index);
|
||||
|
||||
///
|
||||
// Returns the value with the specified identifier on success. Returns NULL if
|
||||
// this function is called incorrectly or an exception is thrown.
|
||||
///
|
||||
struct _cef_v8value_t* (CEF_CALLBACK *get_value_bykey)(
|
||||
struct _cef_v8value_t* self, const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value with the specified identifier on success. Returns NULL if
|
||||
// this function is called incorrectly or an exception is thrown.
|
||||
///
|
||||
struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)(
|
||||
struct _cef_v8value_t* self, int index);
|
||||
|
||||
///
|
||||
// Associates a value with the specified identifier and returns true (1) on
|
||||
// success. Returns false (0) if this function is called incorrectly or an
|
||||
// exception is thrown. For read-only values this function will return true
|
||||
// (1) even though assignment failed.
|
||||
///
|
||||
int (CEF_CALLBACK *set_value_bykey)(struct _cef_v8value_t* self,
|
||||
const cef_string_t* key, struct _cef_v8value_t* value,
|
||||
enum cef_v8_propertyattribute_t attribute);
|
||||
|
||||
///
|
||||
// Associates a value with the specified identifier and returns true (1) on
|
||||
// success. Returns false (0) if this function is called incorrectly or an
|
||||
// exception is thrown. For read-only values this function will return true
|
||||
// (1) even though assignment failed.
|
||||
///
|
||||
int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index,
|
||||
struct _cef_v8value_t* value);
|
||||
|
||||
///
|
||||
// Registers an identifier and returns true (1) on success. Access to the
|
||||
// identifier will be forwarded to the cef_v8accessor_t instance passed to
|
||||
// cef_v8value_t::cef_v8value_create_object(). Returns false (0) if this
|
||||
// function is called incorrectly or an exception is thrown. For read-only
|
||||
// values this function will return true (1) even though assignment failed.
|
||||
///
|
||||
int (CEF_CALLBACK *set_value_byaccessor)(struct _cef_v8value_t* self,
|
||||
const cef_string_t* key, enum cef_v8_accesscontrol_t settings,
|
||||
enum cef_v8_propertyattribute_t attribute);
|
||||
|
||||
///
|
||||
// Read the keys for the object's values into the specified vector. Integer-
|
||||
// based keys will also be returned as strings.
|
||||
///
|
||||
int (CEF_CALLBACK *get_keys)(struct _cef_v8value_t* self,
|
||||
cef_string_list_t keys);
|
||||
|
||||
///
|
||||
// Sets the user data for this object and returns true (1) on success. Returns
|
||||
// false (0) if this function is called incorrectly. This function can only be
|
||||
// called on user created objects.
|
||||
///
|
||||
int (CEF_CALLBACK *set_user_data)(struct _cef_v8value_t* self,
|
||||
struct _cef_base_t* user_data);
|
||||
|
||||
///
|
||||
// Returns the user data, if any, assigned to this object.
|
||||
///
|
||||
struct _cef_base_t* (CEF_CALLBACK *get_user_data)(
|
||||
struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Returns the amount of externally allocated memory registered for the
|
||||
// object.
|
||||
///
|
||||
int (CEF_CALLBACK *get_externally_allocated_memory)(
|
||||
struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Adjusts the amount of registered external memory for the object. Used to
|
||||
// give V8 an indication of the amount of externally allocated memory that is
|
||||
// kept alive by JavaScript objects. V8 uses this information to decide when
|
||||
// to perform global garbage collection. Each cef_v8value_t tracks the amount
|
||||
// of external memory associated with it and automatically decreases the
|
||||
// global total by the appropriate amount on its destruction.
|
||||
// |change_in_bytes| specifies the number of bytes to adjust by. This function
|
||||
// returns the number of bytes associated with the object after the
|
||||
// adjustment. This function can only be called on user created objects.
|
||||
///
|
||||
int (CEF_CALLBACK *adjust_externally_allocated_memory)(
|
||||
struct _cef_v8value_t* self, int change_in_bytes);
|
||||
|
||||
|
||||
// ARRAY METHODS - These functions are only available on arrays.
|
||||
|
||||
///
|
||||
// Returns the number of elements in the array.
|
||||
///
|
||||
int (CEF_CALLBACK *get_array_length)(struct _cef_v8value_t* self);
|
||||
|
||||
|
||||
// FUNCTION METHODS - These functions are only available on functions.
|
||||
|
||||
///
|
||||
// Returns the function name.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_function_name)(
|
||||
struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Returns the function handler or NULL if not a CEF-created function.
|
||||
///
|
||||
struct _cef_v8handler_t* (CEF_CALLBACK *get_function_handler)(
|
||||
struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Execute the function using the current V8 context. This function should
|
||||
// only be called from within the scope of a cef_v8handler_t or
|
||||
// cef_v8accessor_t callback, or in combination with calling enter() and
|
||||
// exit() on a stored cef_v8context_t reference. |object| is the receiver
|
||||
// ('this' object) of the function. If |object| is NULL the current context's
|
||||
// global object will be used. |arguments| is the list of arguments that will
|
||||
// be passed to the function. Returns the function return value on success.
|
||||
// Returns NULL if this function is called incorrectly or an exception is
|
||||
// thrown.
|
||||
///
|
||||
struct _cef_v8value_t* (CEF_CALLBACK *execute_function)(
|
||||
struct _cef_v8value_t* self, struct _cef_v8value_t* object,
|
||||
size_t argumentsCount, struct _cef_v8value_t* const* arguments);
|
||||
|
||||
///
|
||||
// Execute the function using the specified V8 context. |object| is the
|
||||
// receiver ('this' object) of the function. If |object| is NULL the specified
|
||||
// context's global object will be used. |arguments| is the list of arguments
|
||||
// that will be passed to the function. Returns the function return value on
|
||||
// success. Returns NULL if this function is called incorrectly or an
|
||||
// exception is thrown.
|
||||
///
|
||||
struct _cef_v8value_t* (CEF_CALLBACK *execute_function_with_context)(
|
||||
struct _cef_v8value_t* self, struct _cef_v8context_t* context,
|
||||
struct _cef_v8value_t* object, size_t argumentsCount,
|
||||
struct _cef_v8value_t* const* arguments);
|
||||
} cef_v8value_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type undefined.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined();
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type null.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_null();
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type bool.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type int.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int32 value);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type unsigned int.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_uint(uint32 value);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type double.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type Date. This function should only be
|
||||
// called from within the scope of a cef_v8context_tHandler, cef_v8handler_t or
|
||||
// cef_v8accessor_t callback, or in combination with calling enter() and exit()
|
||||
// on a stored cef_v8context_t reference.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type string.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type object with optional accessor. This
|
||||
// function should only be called from within the scope of a
|
||||
// cef_v8context_tHandler, cef_v8handler_t or cef_v8accessor_t callback, or in
|
||||
// combination with calling enter() and exit() on a stored cef_v8context_t
|
||||
// reference.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type array with the specified |length|.
|
||||
// If |length| is negative the returned array will have length 0. This function
|
||||
// should only be called from within the scope of a cef_v8context_tHandler,
|
||||
// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
|
||||
// enter() and exit() on a stored cef_v8context_t reference.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type function. This function should only
|
||||
// be called from within the scope of a cef_v8context_tHandler, cef_v8handler_t
|
||||
// or cef_v8accessor_t callback, or in combination with calling enter() and
|
||||
// exit() on a stored cef_v8context_t reference.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name,
|
||||
cef_v8handler_t* handler);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
|
461
include/capi/cef_values_capi.h
Normal file
461
include/capi/cef_values_capi.h
Normal file
@ -0,0 +1,461 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure representing a binary value. Can be used on any process and thread.
|
||||
///
|
||||
typedef struct _cef_binary_value_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_binary_value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is currently owned by another object.
|
||||
///
|
||||
int (CEF_CALLBACK *is_owned)(struct _cef_binary_value_t* self);
|
||||
|
||||
///
|
||||
// Returns a copy of this object. The data in this object will also be copied.
|
||||
///
|
||||
struct _cef_binary_value_t* (CEF_CALLBACK *copy)(
|
||||
struct _cef_binary_value_t* self);
|
||||
|
||||
///
|
||||
// Returns the data size.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_size)(struct _cef_binary_value_t* self);
|
||||
|
||||
///
|
||||
// Read up to |buffer_size| number of bytes into |buffer|. Reading begins at
|
||||
// the specified byte |data_offset|. Returns the number of bytes read.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_data)(struct _cef_binary_value_t* self,
|
||||
void* buffer, size_t buffer_size, size_t data_offset);
|
||||
} cef_binary_value_t;
|
||||
|
||||
|
||||
///
|
||||
// Creates a new object that is not owned by any other object. The specified
|
||||
// |data| will be copied.
|
||||
///
|
||||
CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data,
|
||||
size_t data_size);
|
||||
|
||||
|
||||
///
|
||||
// Structure representing a dictionary value. Can be used on any process and
|
||||
// thread.
|
||||
///
|
||||
typedef struct _cef_dictionary_value_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_dictionary_value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is currently owned by another object.
|
||||
///
|
||||
int (CEF_CALLBACK *is_owned)(struct _cef_dictionary_value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
int (CEF_CALLBACK *is_read_only)(struct _cef_dictionary_value_t* self);
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object. If |exclude_NULL_children| is true
|
||||
// (1) any NULL dictionaries or lists will be excluded from the copy.
|
||||
///
|
||||
struct _cef_dictionary_value_t* (CEF_CALLBACK *copy)(
|
||||
struct _cef_dictionary_value_t* self, int exclude_empty_children);
|
||||
|
||||
///
|
||||
// Returns the number of values.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_size)(struct _cef_dictionary_value_t* self);
|
||||
|
||||
///
|
||||
// Removes all values. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *clear)(struct _cef_dictionary_value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the current dictionary has a value for the given key.
|
||||
///
|
||||
int (CEF_CALLBACK *has_key)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Reads all keys for this dictionary into the specified vector.
|
||||
///
|
||||
int (CEF_CALLBACK *get_keys)(struct _cef_dictionary_value_t* self,
|
||||
cef_string_list_t keys);
|
||||
|
||||
///
|
||||
// Removes the value at the specified key. Returns true (1) is the value was
|
||||
// removed successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *remove)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value type for the specified key.
|
||||
///
|
||||
enum cef_value_type_t (CEF_CALLBACK *get_type)(
|
||||
struct _cef_dictionary_value_t* self, const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type bool.
|
||||
///
|
||||
int (CEF_CALLBACK *get_bool)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type int.
|
||||
///
|
||||
int (CEF_CALLBACK *get_int)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type double.
|
||||
///
|
||||
double (CEF_CALLBACK *get_double)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type string.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_string)(
|
||||
struct _cef_dictionary_value_t* self, const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type binary.
|
||||
///
|
||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)(
|
||||
struct _cef_dictionary_value_t* self, const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type dictionary.
|
||||
///
|
||||
struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)(
|
||||
struct _cef_dictionary_value_t* self, const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type list.
|
||||
///
|
||||
struct _cef_list_value_t* (CEF_CALLBACK *get_list)(
|
||||
struct _cef_dictionary_value_t* self, const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type null. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_null)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type bool. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_bool)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key, int value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type int. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_int)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key, int value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type double. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_double)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key, double value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type string. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_string)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key, const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type binary. Returns true (1) if the
|
||||
// value was set successfully. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
int (CEF_CALLBACK *set_binary)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key, struct _cef_binary_value_t* value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type dict. Returns true (1) if the
|
||||
// value was set successfully. After calling this function the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
int (CEF_CALLBACK *set_dictionary)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key, struct _cef_dictionary_value_t* value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type list. Returns true (1) if the
|
||||
// value was set successfully. After calling this function the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
int (CEF_CALLBACK *set_list)(struct _cef_dictionary_value_t* self,
|
||||
const cef_string_t* key, struct _cef_list_value_t* value);
|
||||
} cef_dictionary_value_t;
|
||||
|
||||
|
||||
///
|
||||
// Creates a new object that is not owned by any other object.
|
||||
///
|
||||
CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create();
|
||||
|
||||
|
||||
///
|
||||
// Structure representing a list value. Can be used on any process and thread.
|
||||
///
|
||||
typedef struct _cef_list_value_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_list_value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is currently owned by another object.
|
||||
///
|
||||
int (CEF_CALLBACK *is_owned)(struct _cef_list_value_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
int (CEF_CALLBACK *is_read_only)(struct _cef_list_value_t* self);
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object.
|
||||
///
|
||||
struct _cef_list_value_t* (CEF_CALLBACK *copy)(
|
||||
struct _cef_list_value_t* self);
|
||||
|
||||
///
|
||||
// Sets the number of values. If the number of values is expanded all new
|
||||
// value slots will default to type null. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_size)(struct _cef_list_value_t* self, size_t size);
|
||||
|
||||
///
|
||||
// Returns the number of values.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_size)(struct _cef_list_value_t* self);
|
||||
|
||||
///
|
||||
// Removes all values. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *clear)(struct _cef_list_value_t* self);
|
||||
|
||||
///
|
||||
// Removes the value at the specified index.
|
||||
///
|
||||
int (CEF_CALLBACK *remove)(struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value type at the specified index.
|
||||
///
|
||||
enum cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_list_value_t* self,
|
||||
int index);
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type bool.
|
||||
///
|
||||
int (CEF_CALLBACK *get_bool)(struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type int.
|
||||
///
|
||||
int (CEF_CALLBACK *get_int)(struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type double.
|
||||
///
|
||||
double (CEF_CALLBACK *get_double)(struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type string.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_string)(
|
||||
struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type binary.
|
||||
///
|
||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)(
|
||||
struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type dictionary.
|
||||
///
|
||||
struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)(
|
||||
struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type list.
|
||||
///
|
||||
struct _cef_list_value_t* (CEF_CALLBACK *get_list)(
|
||||
struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type null. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_null)(struct _cef_list_value_t* self, int index);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type bool. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_bool)(struct _cef_list_value_t* self, int index,
|
||||
int value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type int. Returns true (1) if the
|
||||
// value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_int)(struct _cef_list_value_t* self, int index,
|
||||
int value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type double. Returns true (1) if
|
||||
// the value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_double)(struct _cef_list_value_t* self, int index,
|
||||
double value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type string. Returns true (1) if
|
||||
// the value was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *set_string)(struct _cef_list_value_t* self, int index,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type binary. Returns true (1) if
|
||||
// the value was set successfully. After calling this function the |value|
|
||||
// object will no longer be valid. If |value| is currently owned by another
|
||||
// object then the value will be copied and the |value| reference will not
|
||||
// change. Otherwise, ownership will be transferred to this object and the
|
||||
// |value| reference will be invalidated.
|
||||
///
|
||||
int (CEF_CALLBACK *set_binary)(struct _cef_list_value_t* self, int index,
|
||||
struct _cef_binary_value_t* value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type dict. Returns true (1) if the
|
||||
// value was set successfully. After calling this function the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
int (CEF_CALLBACK *set_dictionary)(struct _cef_list_value_t* self, int index,
|
||||
struct _cef_dictionary_value_t* value);
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type list. Returns true (1) if the
|
||||
// value was set successfully. After calling this function the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
int (CEF_CALLBACK *set_list)(struct _cef_list_value_t* self, int index,
|
||||
struct _cef_list_value_t* value);
|
||||
} cef_list_value_t;
|
||||
|
||||
|
||||
///
|
||||
// Creates a new object that is not owned by any other object.
|
||||
///
|
||||
CEF_EXPORT cef_list_value_t* cef_list_value_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_
|
278
include/capi/cef_xml_reader_capi.h
Normal file
278
include/capi/cef_xml_reader_capi.h
Normal file
@ -0,0 +1,278 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure that supports the reading of XML data via the libxml streaming API.
|
||||
// The functions of this structure should only be called on the thread that
|
||||
// creates the object.
|
||||
///
|
||||
typedef struct _cef_xml_reader_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Moves the cursor to the next node in the document. This function must be
|
||||
// called at least once to set the current cursor position. Returns true (1)
|
||||
// if the cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_next_node)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Close the document. This should be called directly to ensure that cleanup
|
||||
// occurs on the correct thread.
|
||||
///
|
||||
int (CEF_CALLBACK *close)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if an error has been reported by the XML parser.
|
||||
///
|
||||
int (CEF_CALLBACK *has_error)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the error string.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_error)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
|
||||
// The below functions retrieve data for the node at the current cursor
|
||||
// position.
|
||||
|
||||
///
|
||||
// Returns the node type.
|
||||
///
|
||||
enum cef_xml_node_type_t (CEF_CALLBACK *get_type)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the node depth. Depth starts at 0 for the root node.
|
||||
///
|
||||
int (CEF_CALLBACK *get_depth)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT-
|
||||
// LocalPart for additional details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_local_name)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for
|
||||
// additional details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_prefix)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the qualified name, equal to (Prefix:)LocalName. See
|
||||
// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_qualified_name)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the URI defining the namespace associated with the node. See
|
||||
// http://www.w3.org/TR/REC-xml-names/ for additional details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_namespace_uri)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for
|
||||
// additional details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_base_uri)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the xml:lang scope within which the node resides. See
|
||||
// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_xml_lang)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the node represents an NULL element. <a/> is considered
|
||||
// NULL but <a></a> is not.
|
||||
///
|
||||
int (CEF_CALLBACK *is_empty_element)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the node has a text value.
|
||||
///
|
||||
int (CEF_CALLBACK *has_value)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the text value.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_value)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the node has attributes.
|
||||
///
|
||||
int (CEF_CALLBACK *has_attributes)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the number of attributes.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_attribute_count)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the value of the attribute at the specified 0-based index.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_attribute_byindex)(
|
||||
struct _cef_xml_reader_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the value of the attribute with the specified qualified name.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_attribute_byqname)(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName);
|
||||
|
||||
///
|
||||
// Returns the value of the attribute with the specified local name and
|
||||
// namespace URI.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_attribute_bylname)(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* localName,
|
||||
const cef_string_t* namespaceURI);
|
||||
|
||||
///
|
||||
// Returns an XML representation of the current node's children.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_inner_xml)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns an XML representation of the current node including its children.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_outer_xml)(
|
||||
struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the line number for the current node.
|
||||
///
|
||||
int (CEF_CALLBACK *get_line_number)(struct _cef_xml_reader_t* self);
|
||||
|
||||
|
||||
// Attribute nodes are not traversed by default. The below functions can be
|
||||
// used to move the cursor to an attribute node. move_to_carrying_element()
|
||||
// can be called afterwards to return the cursor to the carrying element. The
|
||||
// depth of an attribute node will be 1 + the depth of the carrying element.
|
||||
|
||||
///
|
||||
// Moves the cursor to the attribute at the specified 0-based index. Returns
|
||||
// true (1) if the cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_attribute_byindex)(struct _cef_xml_reader_t* self,
|
||||
int index);
|
||||
|
||||
///
|
||||
// Moves the cursor to the attribute with the specified qualified name.
|
||||
// Returns true (1) if the cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_attribute_byqname)(struct _cef_xml_reader_t* self,
|
||||
const cef_string_t* qualifiedName);
|
||||
|
||||
///
|
||||
// Moves the cursor to the attribute with the specified local name and
|
||||
// namespace URI. Returns true (1) if the cursor position was set
|
||||
// successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_attribute_bylname)(struct _cef_xml_reader_t* self,
|
||||
const cef_string_t* localName, const cef_string_t* namespaceURI);
|
||||
|
||||
///
|
||||
// Moves the cursor to the first attribute in the current element. Returns
|
||||
// true (1) if the cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_first_attribute)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Moves the cursor to the next attribute in the current element. Returns true
|
||||
// (1) if the cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_next_attribute)(struct _cef_xml_reader_t* self);
|
||||
|
||||
///
|
||||
// Moves the cursor back to the carrying element. Returns true (1) if the
|
||||
// cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_carrying_element)(struct _cef_xml_reader_t* self);
|
||||
} cef_xml_reader_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_xml_reader_t object. The returned object's functions can
|
||||
// only be called from the thread that created the object.
|
||||
///
|
||||
CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(
|
||||
struct _cef_stream_reader_t* stream,
|
||||
enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_
|
148
include/capi/cef_zip_reader_capi.h
Normal file
148
include/capi/cef_zip_reader_capi.h
Normal file
@ -0,0 +1,148 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
|
||||
///
|
||||
// Structure that supports the reading of zip archives via the zlib unzip API.
|
||||
// The functions of this structure should only be called on the thread that
|
||||
// creates the object.
|
||||
///
|
||||
typedef struct _cef_zip_reader_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Moves the cursor to the first file in the archive. Returns true (1) if the
|
||||
// cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_first_file)(struct _cef_zip_reader_t* self);
|
||||
|
||||
///
|
||||
// Moves the cursor to the next file in the archive. Returns true (1) if the
|
||||
// cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_next_file)(struct _cef_zip_reader_t* self);
|
||||
|
||||
///
|
||||
// Moves the cursor to the specified file in the archive. If |caseSensitive|
|
||||
// is true (1) then the search will be case sensitive. Returns true (1) if the
|
||||
// cursor position was set successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *move_to_file)(struct _cef_zip_reader_t* self,
|
||||
const cef_string_t* fileName, int caseSensitive);
|
||||
|
||||
///
|
||||
// Closes the archive. This should be called directly to ensure that cleanup
|
||||
// occurs on the correct thread.
|
||||
///
|
||||
int (CEF_CALLBACK *close)(struct _cef_zip_reader_t* self);
|
||||
|
||||
|
||||
// The below functions act on the file at the current cursor position.
|
||||
|
||||
///
|
||||
// Returns the name of the file.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_file_name)(
|
||||
struct _cef_zip_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the uncompressed size of the file.
|
||||
///
|
||||
int64 (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns the last modified timestamp for the file.
|
||||
///
|
||||
time_t (CEF_CALLBACK *get_file_last_modified)(struct _cef_zip_reader_t* self);
|
||||
|
||||
///
|
||||
// Opens the file for reading of uncompressed data. A read password may
|
||||
// optionally be specified.
|
||||
///
|
||||
int (CEF_CALLBACK *open_file)(struct _cef_zip_reader_t* self,
|
||||
const cef_string_t* password);
|
||||
|
||||
///
|
||||
// Closes the file.
|
||||
///
|
||||
int (CEF_CALLBACK *close_file)(struct _cef_zip_reader_t* self);
|
||||
|
||||
///
|
||||
// Read uncompressed file contents into the specified buffer. Returns < 0 if
|
||||
// an error occurred, 0 if at the end of file, or the number of bytes read.
|
||||
///
|
||||
int (CEF_CALLBACK *read_file)(struct _cef_zip_reader_t* self, void* buffer,
|
||||
size_t bufferSize);
|
||||
|
||||
///
|
||||
// Returns the current offset in the uncompressed file contents.
|
||||
///
|
||||
int64 (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if at end of the file contents.
|
||||
///
|
||||
int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self);
|
||||
} cef_zip_reader_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_zip_reader_t object. The returned object's functions can
|
||||
// only be called from the thread that created the object.
|
||||
///
|
||||
CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create(
|
||||
struct _cef_stream_reader_t* stream);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_
|
164
include/cef_app.h
Normal file
164
include/cef_app.h
Normal file
@ -0,0 +1,164 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_APP_H_
|
||||
#define CEF_INCLUDE_CEF_APP_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_command_line.h"
|
||||
#include "include/cef_proxy_handler.h"
|
||||
#include "include/cef_render_process_handler.h"
|
||||
#include "include/cef_resource_bundle_handler.h"
|
||||
|
||||
class CefApp;
|
||||
|
||||
///
|
||||
// This function should be called from the application entry point function to
|
||||
// execute a secondary process. It can be used to run secondary processes from
|
||||
// the browser client executable (default behavior) or from a separate
|
||||
// executable specified by the CefSettings.browser_subprocess_path value. If
|
||||
// called for the browser process (identified by no "type" command-line value)
|
||||
// it will return immediately with a value of -1. If called for a recognized
|
||||
// secondary process it will block until the process should exit and then return
|
||||
// the process exit code. The |application| parameter may be empty.
|
||||
///
|
||||
/*--cef(revision_check,optional_param=application)--*/
|
||||
int CefExecuteProcess(const CefMainArgs& args, CefRefPtr<CefApp> application);
|
||||
|
||||
///
|
||||
// This function should be called on the main application thread to initialize
|
||||
// the CEF browser process. The |application| parameter may be empty. A return
|
||||
// value of true indicates that it succeeded and false indicates that it failed.
|
||||
///
|
||||
/*--cef(revision_check,optional_param=application)--*/
|
||||
bool CefInitialize(const CefMainArgs& args, const CefSettings& settings,
|
||||
CefRefPtr<CefApp> application);
|
||||
|
||||
///
|
||||
// This function should be called on the main application thread to shut down
|
||||
// the CEF browser process before the application exits.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void CefShutdown();
|
||||
|
||||
///
|
||||
// Perform a single iteration of CEF message loop processing. This function is
|
||||
// used to integrate the CEF message loop into an existing application message
|
||||
// loop. Care must be taken to balance performance against excessive CPU usage.
|
||||
// This function should only be called on the main application thread and only
|
||||
// if CefInitialize() is called with a CefSettings.multi_threaded_message_loop
|
||||
// value of false. This function will not block.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void CefDoMessageLoopWork();
|
||||
|
||||
///
|
||||
// Run the CEF message loop. Use this function instead of an application-
|
||||
// provided message loop to get the best balance between performance and CPU
|
||||
// usage. This function should only be called on the main application thread and
|
||||
// only if CefInitialize() is called with a
|
||||
// CefSettings.multi_threaded_message_loop value of false. This function will
|
||||
// block until a quit message is received by the system.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void CefRunMessageLoop();
|
||||
|
||||
///
|
||||
// Quit the CEF message loop that was started by calling CefRunMessageLoop().
|
||||
// This function should only be called on the main application thread and only
|
||||
// if CefRunMessageLoop() was used.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void CefQuitMessageLoop();
|
||||
|
||||
///
|
||||
// Implement this interface to provide handler implementations. Methods will be
|
||||
// called by the process and/or thread indicated.
|
||||
///
|
||||
/*--cef(source=client,no_debugct_check)--*/
|
||||
class CefApp : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Provides an opportunity to view and/or modify command-line arguments before
|
||||
// processing by CEF and Chromium. The |process_type| value will be empty for
|
||||
// the browser process. Do not keep a reference to the CefCommandLine object
|
||||
// passed to this method. The CefSettings.command_line_args_disabled value
|
||||
// can be used to start with an empty command-line object. Any values
|
||||
// specified in CefSettings that equate to command-line arguments will be set
|
||||
// before this method is called. Be cautious when using this method to modify
|
||||
// command-line arguments for non-browser processes as this may result in
|
||||
// undefined behavior including crashes.
|
||||
///
|
||||
/*--cef(optional_param=process_type)--*/
|
||||
virtual void OnBeforeCommandLineProcessing(
|
||||
const CefString& process_type,
|
||||
CefRefPtr<CefCommandLine> command_line) {
|
||||
}
|
||||
|
||||
///
|
||||
// Return the handler for render process events. This method is called by the
|
||||
// render process main thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Return the handler for resource bundle events. If
|
||||
// CefSettings.pack_loading_disabled is true a handler must be returned. If no
|
||||
// handler is returned resources will be loaded from pack files. This method
|
||||
// is called by the browser and rendere processes on multiple threads.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefResourceBundleHandler> GetResourceBundleHandler() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Return the handler for proxy events. If no handler is returned the default
|
||||
// system handler will be used. This method is called by the browser process
|
||||
// IO thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefProxyHandler> GetProxyHandler() {
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_APP_H_
|
127
include/cef_application_mac.h
Normal file
127
include/cef_application_mac.h
Normal file
@ -0,0 +1,127 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_APPLICATION_MAC_H_
|
||||
#define CEF_INCLUDE_CEF_APPLICATION_MAC_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
#if defined(OS_MACOSX) && defined(__OBJC__)
|
||||
|
||||
#ifdef BUILDING_CEF_SHARED
|
||||
|
||||
// Use the existing CrAppProtocol definition.
|
||||
#include "base/message_pump_mac.h"
|
||||
|
||||
// Use the existing CrAppControlProtocol definition.
|
||||
#include "base/mac/scoped_sending_event.h"
|
||||
|
||||
// Use the existing empty protocol definitions.
|
||||
#import "base/mac/cocoa_protocols.h"
|
||||
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
// Copy of CrAppProtocol definition from base/message_pump_mac.h.
|
||||
@protocol CrAppProtocol
|
||||
// Must return true if -[NSApplication sendEvent:] is currently on the stack.
|
||||
- (BOOL)isHandlingSendEvent;
|
||||
@end
|
||||
|
||||
// Copy of CrAppControlProtocol definition from base/mac/scoped_sending_event.h.
|
||||
@protocol CrAppControlProtocol<CrAppProtocol>
|
||||
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent;
|
||||
@end
|
||||
|
||||
// The Mac OS X 10.6 SDK introduced new protocols used for delegates. These
|
||||
// protocol defintions were not present in earlier releases of the Mac OS X
|
||||
// SDK. In order to support building against the new SDK, which requires
|
||||
// delegates to conform to these protocols, and earlier SDKs, which do not
|
||||
// define these protocols at all, this file will provide empty protocol
|
||||
// definitions when used with earlier SDK versions.
|
||||
|
||||
#if !defined(MAC_OS_X_VERSION_10_6) || \
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
|
||||
|
||||
#define DEFINE_EMPTY_PROTOCOL(p) \
|
||||
@protocol p \
|
||||
@end
|
||||
|
||||
DEFINE_EMPTY_PROTOCOL(NSAlertDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSApplicationDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSControlTextEditingDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSMatrixDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSMenuDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSOpenSavePanelDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSOutlineViewDataSource)
|
||||
DEFINE_EMPTY_PROTOCOL(NSOutlineViewDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSSpeechSynthesizerDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSSplitViewDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSTableViewDataSource)
|
||||
DEFINE_EMPTY_PROTOCOL(NSTableViewDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSTextFieldDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSTextViewDelegate)
|
||||
DEFINE_EMPTY_PROTOCOL(NSWindowDelegate)
|
||||
|
||||
#undef DEFINE_EMPTY_PROTOCOL
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
|
||||
// All CEF client applications must subclass NSApplication and implement this
|
||||
// protocol.
|
||||
@protocol CefAppProtocol<CrAppControlProtocol>
|
||||
@end
|
||||
|
||||
// Controls the state of |isHandlingSendEvent| in the event loop so that it is
|
||||
// reset properly.
|
||||
class CefScopedSendingEvent {
|
||||
public:
|
||||
CefScopedSendingEvent()
|
||||
: app_(static_cast<NSApplication<CefAppProtocol>*>(
|
||||
[NSApplication sharedApplication])),
|
||||
handling_([app_ isHandlingSendEvent]) {
|
||||
[app_ setHandlingSendEvent:YES];
|
||||
}
|
||||
~CefScopedSendingEvent() {
|
||||
[app_ setHandlingSendEvent:handling_];
|
||||
}
|
||||
|
||||
private:
|
||||
NSApplication<CefAppProtocol>* app_;
|
||||
BOOL handling_;
|
||||
};
|
||||
|
||||
#endif // defined(OS_MACOSX) && defined(__OBJC__)
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_APPLICATION_MAC_H_
|
154
include/cef_base.h
Normal file
154
include/cef_base.h
Normal file
@ -0,0 +1,154 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_BASE_H_
|
||||
#define CEF_INCLUDE_CEF_BASE_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_build.h"
|
||||
#include "include/internal/cef_ptr.h"
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
|
||||
// Bring in platform-specific definitions.
|
||||
#if defined(OS_WIN)
|
||||
#include "include/internal/cef_win.h"
|
||||
#elif defined(OS_MACOSX)
|
||||
#include "include/internal/cef_mac.h"
|
||||
#elif defined(OS_LINUX)
|
||||
#include "include/internal/cef_linux.h"
|
||||
#endif
|
||||
|
||||
///
|
||||
// Interface defining the reference count implementation methods. All framework
|
||||
// classes must extend the CefBase class.
|
||||
///
|
||||
class CefBase {
|
||||
public:
|
||||
///
|
||||
// The AddRef method increments the reference count for the object. It should
|
||||
// be called for every new copy of a pointer to a given object. The resulting
|
||||
// reference count value is returned and should be used for diagnostic/testing
|
||||
// purposes only.
|
||||
///
|
||||
virtual int AddRef() =0;
|
||||
|
||||
///
|
||||
// The Release method decrements the reference count for the object. If the
|
||||
// reference count on the object falls to 0, then the object should free
|
||||
// itself from memory. The resulting reference count value is returned and
|
||||
// should be used for diagnostic/testing purposes only.
|
||||
///
|
||||
virtual int Release() =0;
|
||||
|
||||
///
|
||||
// Return the current number of references.
|
||||
///
|
||||
virtual int GetRefCt() =0;
|
||||
|
||||
protected:
|
||||
virtual ~CefBase() {}
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class that implements atomic reference counting.
|
||||
///
|
||||
class CefRefCount {
|
||||
public:
|
||||
CefRefCount() : refct_(0) {}
|
||||
|
||||
///
|
||||
// Atomic reference increment.
|
||||
///
|
||||
int AddRef() {
|
||||
return CefAtomicIncrement(&refct_);
|
||||
}
|
||||
|
||||
///
|
||||
// Atomic reference decrement. Delete the object when no references remain.
|
||||
///
|
||||
int Release() {
|
||||
return CefAtomicDecrement(&refct_);
|
||||
}
|
||||
|
||||
///
|
||||
// Return the current number of references.
|
||||
///
|
||||
int GetRefCt() { return refct_; }
|
||||
|
||||
private:
|
||||
long refct_; // NOLINT(runtime/int)
|
||||
};
|
||||
|
||||
///
|
||||
// Macro that provides a reference counting implementation for classes extending
|
||||
// CefBase.
|
||||
///
|
||||
#define IMPLEMENT_REFCOUNTING(ClassName) \
|
||||
public: \
|
||||
int AddRef() { return refct_.AddRef(); } \
|
||||
int Release() { \
|
||||
int retval = refct_.Release(); \
|
||||
if (retval == 0) \
|
||||
delete this; \
|
||||
return retval; \
|
||||
} \
|
||||
int GetRefCt() { return refct_.GetRefCt(); } \
|
||||
private: \
|
||||
CefRefCount refct_;
|
||||
|
||||
///
|
||||
// Macro that provides a locking implementation. Use the Lock() and Unlock()
|
||||
// methods to protect a section of code from simultaneous access by multiple
|
||||
// threads. The AutoLock class is a helper that will hold the lock while in
|
||||
// scope.
|
||||
///
|
||||
#define IMPLEMENT_LOCKING(ClassName) \
|
||||
public: \
|
||||
class AutoLock { \
|
||||
public: \
|
||||
explicit AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \
|
||||
~AutoLock() { base_->Unlock(); } \
|
||||
private: \
|
||||
ClassName* base_; \
|
||||
}; \
|
||||
void Lock() { critsec_.Lock(); } \
|
||||
void Unlock() { critsec_.Unlock(); } \
|
||||
private: \
|
||||
CefCriticalSection critsec_;
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_BASE_H_
|
261
include/cef_browser.h
Normal file
261
include/cef_browser.h
Normal file
@ -0,0 +1,261 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_BROWSER_H_
|
||||
#define CEF_INCLUDE_CEF_BROWSER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include "include/cef_process_message.h"
|
||||
#include <vector>
|
||||
|
||||
class CefBrowserHost;
|
||||
class CefClient;
|
||||
|
||||
|
||||
///
|
||||
// Class used to represent a browser window. When used in the browser process
|
||||
// the methods of this class may be called on any thread unless otherwise
|
||||
// indicated in the comments. When used in the render process the methods of
|
||||
// this class may only be called on the main thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefBrowser : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Returns the browser host object. This method can only be called in the
|
||||
// browser process.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBrowserHost> GetHost() =0;
|
||||
|
||||
///
|
||||
// Returns true if the browser can navigate backwards.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool CanGoBack() =0;
|
||||
|
||||
///
|
||||
// Navigate backwards.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GoBack() =0;
|
||||
|
||||
///
|
||||
// Returns true if the browser can navigate forwards.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool CanGoForward() =0;
|
||||
|
||||
///
|
||||
// Navigate forwards.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GoForward() =0;
|
||||
|
||||
///
|
||||
// Returns true if the browser is currently loading.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsLoading() =0;
|
||||
|
||||
///
|
||||
// Reload the current page.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Reload() =0;
|
||||
|
||||
///
|
||||
// Reload the current page ignoring any cached data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void ReloadIgnoreCache() =0;
|
||||
|
||||
///
|
||||
// Stop loading the page.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void StopLoad() =0;
|
||||
|
||||
///
|
||||
// Returns the globally unique identifier for this browser.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetIdentifier() =0;
|
||||
|
||||
///
|
||||
// Returns true if the window is a popup window.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsPopup() =0;
|
||||
|
||||
// Returns true if a document has been loaded in the browser.
|
||||
/*--cef()--*/
|
||||
virtual bool HasDocument() =0;
|
||||
|
||||
///
|
||||
// Returns the main (top-level) frame for the browser window.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFrame> GetMainFrame() =0;
|
||||
|
||||
///
|
||||
// Returns the focused frame for the browser window.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFrame> GetFocusedFrame() =0;
|
||||
|
||||
///
|
||||
// Returns the frame with the specified identifier, or NULL if not found.
|
||||
///
|
||||
/*--cef(capi_name=get_frame_byident)--*/
|
||||
virtual CefRefPtr<CefFrame> GetFrame(int64 identifier) =0;
|
||||
|
||||
///
|
||||
// Returns the frame with the specified name, or NULL if not found.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFrame> GetFrame(const CefString& name) =0;
|
||||
|
||||
///
|
||||
// Returns the number of frames that currently exist.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetFrameCount() =0;
|
||||
|
||||
///
|
||||
// Returns the identifiers of all existing frames.
|
||||
///
|
||||
/*--cef(count_func=identifiers:GetFrameCount)--*/
|
||||
virtual void GetFrameIdentifiers(std::vector<int64>& identifiers) =0;
|
||||
|
||||
///
|
||||
// Returns the names of all existing frames.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetFrameNames(std::vector<CefString>& names) =0;
|
||||
|
||||
//
|
||||
// Send a message to the specified |target_process|. Returns true if the
|
||||
// message was sent successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SendProcessMessage(CefProcessId target_process,
|
||||
CefRefPtr<CefProcessMessage> message) =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class used to represent the browser process aspects of a browser window. The
|
||||
// methods of this class can only be called in the browser process.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefBrowserHost : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Create a new browser window using the window parameters specified by
|
||||
// |windowInfo|. All values will be copied internally and the actual window
|
||||
// will be created on the UI thread. This method can be called on any browser
|
||||
// process thread and will not block.
|
||||
///
|
||||
/*--cef(optional_param=url)--*/
|
||||
static bool CreateBrowser(const CefWindowInfo& windowInfo,
|
||||
CefRefPtr<CefClient> client,
|
||||
const CefString& url,
|
||||
const CefBrowserSettings& settings);
|
||||
|
||||
///
|
||||
// Create a new browser window using the window parameters specified by
|
||||
// |windowInfo|. This method can only be called on the browser process UI
|
||||
// thread.
|
||||
///
|
||||
/*--cef(optional_param=url)--*/
|
||||
static CefRefPtr<CefBrowser> CreateBrowserSync(
|
||||
const CefWindowInfo& windowInfo,
|
||||
CefRefPtr<CefClient> client,
|
||||
const CefString& url,
|
||||
const CefBrowserSettings& settings);
|
||||
|
||||
///
|
||||
// Returns the hosted browser object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBrowser> GetBrowser() =0;
|
||||
|
||||
///
|
||||
// Call this method before destroying a contained browser window. This method
|
||||
// performs any internal cleanup that may be needed before the browser window
|
||||
// is destroyed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void ParentWindowWillClose() =0;
|
||||
|
||||
///
|
||||
// Closes this browser window.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void CloseBrowser() =0;
|
||||
|
||||
///
|
||||
// Set focus for the browser window. If |enable| is true focus will be set to
|
||||
// the window. Otherwise, focus will be removed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetFocus(bool enable) =0;
|
||||
|
||||
///
|
||||
// Retrieve the window handle for this browser.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefWindowHandle GetWindowHandle() =0;
|
||||
|
||||
///
|
||||
// Retrieve the window handle of the browser that opened this browser. Will
|
||||
// return NULL for non-popup windows. This method can be used in combination
|
||||
// with custom handling of modal windows.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefWindowHandle GetOpenerWindowHandle() =0;
|
||||
|
||||
///
|
||||
// Returns the client for this browser.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefClient> GetClient() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_BROWSER_H_
|
62
include/cef_callback.h
Normal file
62
include/cef_callback.h
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_CALLBACK_H_
|
||||
#define CEF_INCLUDE_CEF_CALLBACK_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
// Generic callback interface used for asynchronous continuation.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefCallback : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Continue processing.
|
||||
///
|
||||
/*--cef(capi_name=cont)--*/
|
||||
virtual void Continue() =0;
|
||||
|
||||
///
|
||||
// Cancel processing.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Cancel() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_CALLBACK_H_
|
109
include/cef_client.h
Normal file
109
include/cef_client.h
Normal file
@ -0,0 +1,109 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_CLIENT_H_
|
||||
#define CEF_INCLUDE_CEF_CLIENT_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_display_handler.h"
|
||||
#include "include/cef_geolocation_handler.h"
|
||||
#include "include/cef_life_span_handler.h"
|
||||
#include "include/cef_load_handler.h"
|
||||
#include "include/cef_process_message.h"
|
||||
#include "include/cef_request_handler.h"
|
||||
|
||||
///
|
||||
// Implement this interface to provide handler implementations.
|
||||
///
|
||||
/*--cef(source=client,no_debugct_check)--*/
|
||||
class CefClient : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Return the handler for browser life span events.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Return the handler for browser load status events.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Return the handler for browser request events.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefRequestHandler> GetRequestHandler() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Return the handler for browser display state events.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Return the handler for geolocation permissions requests. If no handler is
|
||||
// provided geolocation access will be denied by default.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Called when a new message is received from a different process. Return true
|
||||
// if the message was handled or false otherwise. Do not keep a reference to
|
||||
// or attempt to access the message outside of this callback.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnProcessMessageRecieved(CefRefPtr<CefBrowser> browser,
|
||||
CefProcessId source_process,
|
||||
CefRefPtr<CefProcessMessage> message) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_CLIENT_H_
|
194
include/cef_command_line.h
Normal file
194
include/cef_command_line.h
Normal file
@ -0,0 +1,194 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_COMMAND_LINE_H_
|
||||
#define CEF_INCLUDE_CEF_COMMAND_LINE_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
///
|
||||
// Class used to create and/or parse command line arguments. Arguments with
|
||||
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
|
||||
// will always precede any arguments without switch prefixes. Switches can
|
||||
// optionally have a value specified using the '=' delimiter (e.g.
|
||||
// "-switch=value"). An argument of "--" will terminate switch parsing with all
|
||||
// subsequent tokens, regardless of prefix, being interpreted as non-switch
|
||||
// arguments. Switch names are considered case-insensitive. This class can be
|
||||
// used before CefInitialize() is called.
|
||||
///
|
||||
/*--cef(source=library,no_debugct_check)--*/
|
||||
class CefCommandLine : public virtual CefBase {
|
||||
public:
|
||||
typedef std::vector<CefString> ArgumentList;
|
||||
typedef std::map<CefString, CefString> SwitchMap;
|
||||
|
||||
///
|
||||
// Create a new CefCommandLine instance.
|
||||
///
|
||||
/*--cef(revision_check)--*/
|
||||
static CefRefPtr<CefCommandLine> CreateCommandLine();
|
||||
|
||||
///
|
||||
// Returns the singleton global CefCommandLine object. The returned object
|
||||
// will be read-only.
|
||||
///
|
||||
/*--cef(revision_check)--*/
|
||||
static CefRefPtr<CefCommandLine> GetGlobalCommandLine();
|
||||
|
||||
///
|
||||
// Returns true if this object is valid. Do not call any other methods if this
|
||||
// function returns false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsValid() =0;
|
||||
|
||||
///
|
||||
// Returns true if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsReadOnly() =0;
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefCommandLine> Copy() =0;
|
||||
|
||||
///
|
||||
// Initialize the command line with the specified |argc| and |argv| values.
|
||||
// The first argument must be the name of the program. This method is only
|
||||
// supported on non-Windows platforms.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void InitFromArgv(int argc, const char* const* argv) =0;
|
||||
|
||||
///
|
||||
// Initialize the command line with the string returned by calling
|
||||
// GetCommandLineW(). This method is only supported on Windows.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void InitFromString(const CefString& command_line) =0;
|
||||
|
||||
///
|
||||
// Reset the command-line switches and arguments but leave the program
|
||||
// component unchanged.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Reset() =0;
|
||||
|
||||
///
|
||||
// Constructs and returns the represented command line string. Use this method
|
||||
// cautiously because quoting behavior is unclear.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetCommandLineString() =0;
|
||||
|
||||
///
|
||||
// Get the program part of the command line string (the first item).
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetProgram() =0;
|
||||
|
||||
///
|
||||
// Set the program part of the command line string (the first item).
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetProgram(const CefString& program) =0;
|
||||
|
||||
///
|
||||
// Returns true if the command line has switches.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasSwitches() =0;
|
||||
|
||||
///
|
||||
// Returns true if the command line contains the given switch.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasSwitch(const CefString& name) =0;
|
||||
|
||||
///
|
||||
// Returns the value associated with the given switch. If the switch has no
|
||||
// value or isn't present this method returns the empty string.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetSwitchValue(const CefString& name) =0;
|
||||
|
||||
///
|
||||
// Returns the map of switch names and values. If a switch has no value an
|
||||
// empty string is returned.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetSwitches(SwitchMap& switches) =0;
|
||||
|
||||
///
|
||||
// Add a switch to the end of the command line. If the switch has no value
|
||||
// pass an empty value string.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void AppendSwitch(const CefString& name) =0;
|
||||
|
||||
///
|
||||
// Add a switch with the specified value to the end of the command line.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void AppendSwitchWithValue(const CefString& name,
|
||||
const CefString& value) =0;
|
||||
|
||||
///
|
||||
// True if there are remaining command line arguments.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasArguments() =0;
|
||||
|
||||
///
|
||||
// Get the remaining command line arguments.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetArguments(ArgumentList& arguments) =0;
|
||||
|
||||
///
|
||||
// Add an argument to the end of the command line.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void AppendArgument(const CefString& argument) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_COMMAND_LINE_H_
|
138
include/cef_cookie.h
Normal file
138
include/cef_cookie.h
Normal file
@ -0,0 +1,138 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_COOKIE_H_
|
||||
#define CEF_INCLUDE_CEF_COOKIE_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
class CefCookieVisitor;
|
||||
|
||||
|
||||
///
|
||||
// Class used for managing cookies. The methods of this class may be called on
|
||||
// any thread unless otherwise indicated.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefCookieManager : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Returns the global cookie manager. By default data will be stored at
|
||||
// CefSettings.cache_path if specified or in memory otherwise.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefCookieManager> GetGlobalManager();
|
||||
|
||||
///
|
||||
// Creates a new cookie manager. If |path| is empty data will be stored in
|
||||
// memory only. Returns NULL if creation fails.
|
||||
///
|
||||
/*--cef(optional_param=path)--*/
|
||||
static CefRefPtr<CefCookieManager> CreateManager(const CefString& path);
|
||||
|
||||
///
|
||||
// Visit all cookies. The returned cookies are ordered by longest path, then
|
||||
// by earliest creation date. Returns false if cookies cannot be accessed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool VisitAllCookies(CefRefPtr<CefCookieVisitor> visitor) =0;
|
||||
|
||||
///
|
||||
// Visit a subset of cookies. The results are filtered by the given url
|
||||
// scheme, host, domain and path. If |includeHttpOnly| is true HTTP-only
|
||||
// cookies will also be included in the results. The returned cookies are
|
||||
// ordered by longest path, then by earliest creation date. Returns false if
|
||||
// cookies cannot be accessed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool VisitUrlCookies(const CefString& url, bool includeHttpOnly,
|
||||
CefRefPtr<CefCookieVisitor> visitor) =0;
|
||||
|
||||
///
|
||||
// Sets a cookie given a valid URL and explicit user-provided cookie
|
||||
// attributes. This function expects each attribute to be well-formed. It will
|
||||
// check for disallowed characters (e.g. the ';' character is disallowed
|
||||
// within the cookie value attribute) and will return false without setting
|
||||
// the cookie if such characters are found. This method must be called on the
|
||||
// IO thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetCookie(const CefString& url, const CefCookie& cookie) =0;
|
||||
|
||||
///
|
||||
// Delete all cookies that match the specified parameters. If both |url| and
|
||||
// values |cookie_name| are specified all host and domain cookies matching
|
||||
// both will be deleted. If only |url| is specified all host cookies (but not
|
||||
// domain cookies) irrespective of path will be deleted. If |url| is empty all
|
||||
// cookies for all hosts and domains will be deleted. Returns false if a non-
|
||||
// empty invalid URL is specified or if cookies cannot be accessed. This
|
||||
// method must be called on the IO thread.
|
||||
///
|
||||
/*--cef(optional_param=url,optional_param=cookie_name)--*/
|
||||
virtual bool DeleteCookies(const CefString& url,
|
||||
const CefString& cookie_name) =0;
|
||||
|
||||
///
|
||||
// Sets the directory path that will be used for storing cookie data. If
|
||||
// |path| is empty data will be stored in memory only. Returns false if
|
||||
// cookies cannot be accessed.
|
||||
///
|
||||
/*--cef(optional_param=path)--*/
|
||||
virtual bool SetStoragePath(const CefString& path) =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Interface to implement for visiting cookie values. The methods of this class
|
||||
// will always be called on the IO thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefCookieVisitor : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Method that will be called once for each cookie. |count| is the 0-based
|
||||
// index for the current cookie. |total| is the total number of cookies.
|
||||
// Set |deleteCookie| to true to delete the cookie currently being visited.
|
||||
// Return false to stop visiting cookies. This method may never be called if
|
||||
// no cookies are found.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Visit(const CefCookie& cookie, int count, int total,
|
||||
bool& deleteCookie) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_COOKIE_H_
|
109
include/cef_display_handler.h
Normal file
109
include/cef_display_handler.h
Normal file
@ -0,0 +1,109 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_frame.h"
|
||||
|
||||
///
|
||||
// Implement this interface to handle events related to browser display state.
|
||||
// The methods of this class will be called on the UI thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefDisplayHandler : public virtual CefBase {
|
||||
public:
|
||||
typedef cef_handler_statustype_t StatusType;
|
||||
|
||||
///
|
||||
// Called when the loading state has changed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
|
||||
bool isLoading,
|
||||
bool canGoBack,
|
||||
bool canGoForward) {}
|
||||
|
||||
///
|
||||
// Called when a frame's address has changed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnAddressChange(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
const CefString& url) {}
|
||||
|
||||
///
|
||||
// Called when the page title changes.
|
||||
///
|
||||
/*--cef(optional_param=title)--*/
|
||||
virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& title) {}
|
||||
|
||||
///
|
||||
// Called when the browser is about to display a tooltip. |text| contains the
|
||||
// text that will be displayed in the tooltip. To handle the display of the
|
||||
// tooltip yourself return true. Otherwise, you can optionally modify |text|
|
||||
// and then return false to allow the browser to display the tooltip.
|
||||
///
|
||||
/*--cef(optional_param=text)--*/
|
||||
virtual bool OnTooltip(CefRefPtr<CefBrowser> browser,
|
||||
CefString& text) { return false; }
|
||||
|
||||
///
|
||||
// Called when the browser receives a status message. |text| contains the text
|
||||
// that will be displayed in the status message and |type| indicates the
|
||||
// status message type.
|
||||
///
|
||||
/*--cef(optional_param=value)--*/
|
||||
virtual void OnStatusMessage(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& value,
|
||||
StatusType type) {}
|
||||
|
||||
///
|
||||
// Called to display a console message. Return true to stop the message from
|
||||
// being output to the console.
|
||||
///
|
||||
/*--cef(optional_param=message,optional_param=source)--*/
|
||||
virtual bool OnConsoleMessage(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& message,
|
||||
const CefString& source,
|
||||
int line) { return false; }
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_
|
214
include/cef_frame.h
Normal file
214
include/cef_frame.h
Normal file
@ -0,0 +1,214 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_FRAME_H_
|
||||
#define CEF_INCLUDE_CEF_FRAME_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_request.h"
|
||||
#include "include/cef_stream.h"
|
||||
#include "include/cef_string_visitor.h"
|
||||
|
||||
class CefBrowser;
|
||||
class CefV8Context;
|
||||
|
||||
///
|
||||
// Class used to represent a frame in the browser window. When used in the
|
||||
// browser process the methods of this class may be called on any thread unless
|
||||
// otherwise indicated in the comments. When used in the render process the
|
||||
// methods of this class may only be called on the main thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefFrame : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// True if this object is currently attached to a valid frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsValid() =0;
|
||||
|
||||
///
|
||||
// Execute undo in this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Undo() =0;
|
||||
|
||||
///
|
||||
// Execute redo in this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Redo() =0;
|
||||
|
||||
///
|
||||
// Execute cut in this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Cut() =0;
|
||||
|
||||
///
|
||||
// Execute copy in this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Copy() =0;
|
||||
|
||||
///
|
||||
// Execute paste in this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Paste() =0;
|
||||
|
||||
///
|
||||
// Execute delete in this frame.
|
||||
///
|
||||
/*--cef(capi_name=del)--*/
|
||||
virtual void Delete() =0;
|
||||
|
||||
///
|
||||
// Execute select all in this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SelectAll() =0;
|
||||
|
||||
///
|
||||
// Save this frame's HTML source to a temporary file and open it in the
|
||||
// default text viewing application. This method can only be called from the
|
||||
// browser process.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void ViewSource() =0;
|
||||
|
||||
///
|
||||
// Retrieve this frame's HTML source as a string sent to the specified
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetSource(CefRefPtr<CefStringVisitor> visitor) =0;
|
||||
|
||||
///
|
||||
// Retrieve this frame's display text as a string sent to the specified
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetText(CefRefPtr<CefStringVisitor> visitor) =0;
|
||||
|
||||
///
|
||||
// Load the request represented by the |request| object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void LoadRequest(CefRefPtr<CefRequest> request) =0;
|
||||
|
||||
///
|
||||
// Load the specified |url|.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void LoadURL(const CefString& url) =0;
|
||||
|
||||
///
|
||||
// Load the contents of |string_val| with the optional dummy target |url|.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void LoadString(const CefString& string_val,
|
||||
const CefString& url) =0;
|
||||
|
||||
///
|
||||
// Execute a string of JavaScript code in this frame. The |script_url|
|
||||
// parameter is the URL where the script in question can be found, if any.
|
||||
// The renderer may request this URL to show the developer the source of the
|
||||
// error. The |start_line| parameter is the base line number to use for error
|
||||
// reporting.
|
||||
///
|
||||
/*--cef(optional_param=scriptUrl)--*/
|
||||
virtual void ExecuteJavaScript(const CefString& jsCode,
|
||||
const CefString& scriptUrl,
|
||||
int startLine) =0;
|
||||
|
||||
///
|
||||
// Returns true if this is the main (top-level) frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsMain() =0;
|
||||
|
||||
///
|
||||
// Returns true if this is the focused frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsFocused() =0;
|
||||
|
||||
///
|
||||
// Returns the name for this frame. If the frame has an assigned name (for
|
||||
// example, set via the iframe "name" attribute) then that value will be
|
||||
// returned. Otherwise a unique name will be constructed based on the frame
|
||||
// parent hierarchy. The main (top-level) frame will always have an empty name
|
||||
// value.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetName() =0;
|
||||
|
||||
///
|
||||
// Returns the globally unique identifier for this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64 GetIdentifier() =0;
|
||||
|
||||
///
|
||||
// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||
// frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFrame> GetParent() =0;
|
||||
|
||||
///
|
||||
// Returns the URL currently loaded in this frame.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetURL() =0;
|
||||
|
||||
///
|
||||
// Returns the browser that this frame belongs to.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBrowser> GetBrowser() =0;
|
||||
|
||||
///
|
||||
// Get the V8 context associated with the frame. This method can only be
|
||||
// called from the render process.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefV8Context> GetV8Context() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_FRAME_H_
|
94
include/cef_geolocation_handler.h
Normal file
94
include/cef_geolocation_handler.h
Normal file
@ -0,0 +1,94 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
|
||||
///
|
||||
// Callback interface used for asynchronous continuation of geolocation
|
||||
// permission requests.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefGeolocationCallback : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Call to allow or deny geolocation access.
|
||||
///
|
||||
/*--cef(capi_name=cont)--*/
|
||||
virtual void Continue(bool allow) =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Implement this interface to handle events related to geolocation permission
|
||||
// requests. The methods of this class will be called on the browser process IO
|
||||
// thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefGeolocationHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Called when a page requests permission to access geolocation information.
|
||||
// |requesting_url| is the URL requesting permission and |request_id| is the
|
||||
// unique ID for the permission request. Call CefGeolocationCallback::Continue
|
||||
// to allow or deny the permission request.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnRequestGeolocationPermission(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
const CefString& requesting_url,
|
||||
int request_id,
|
||||
CefRefPtr<CefGeolocationCallback> callback) {
|
||||
}
|
||||
|
||||
///
|
||||
// Called when a geolocation access request is canceled. |requesting_url| is
|
||||
// the URL that originally requested permission and |request_id| is the unique
|
||||
// ID for the permission request.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnCancelGeolocationPermission(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
const CefString& requesting_url,
|
||||
int request_id) {
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_
|
105
include/cef_life_span_handler.h
Normal file
105
include/cef_life_span_handler.h
Normal file
@ -0,0 +1,105 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
|
||||
class CefClient;
|
||||
|
||||
///
|
||||
// Implement this interface to handle events related to browser life span. The
|
||||
// methods of this class will be called on the UI thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefLifeSpanHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Called before a new popup window is created. The |parentBrowser| parameter
|
||||
// will point to the parent browser window. The |popupFeatures| parameter will
|
||||
// contain information about the style of popup window requested. Return false
|
||||
// to have the framework create the new popup window based on the parameters
|
||||
// in |windowInfo|. Return true to cancel creation of the popup window. By
|
||||
// default, a newly created popup window will have the same client and
|
||||
// settings as the parent window. To change the client for the new window
|
||||
// modify the object that |client| points to. To change the settings for the
|
||||
// new window modify the |settings| structure.
|
||||
///
|
||||
/*--cef(optional_param=url)--*/
|
||||
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser,
|
||||
const CefPopupFeatures& popupFeatures,
|
||||
CefWindowInfo& windowInfo,
|
||||
const CefString& url,
|
||||
CefRefPtr<CefClient>& client,
|
||||
CefBrowserSettings& settings) { return false; }
|
||||
|
||||
///
|
||||
// Called after a new window is created.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) {}
|
||||
|
||||
///
|
||||
// Called when a modal window is about to display and the modal loop should
|
||||
// begin running. Return false to use the default modal loop implementation or
|
||||
// true to use a custom implementation.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool RunModal(CefRefPtr<CefBrowser> browser) { return false; }
|
||||
|
||||
///
|
||||
// Called when a window has recieved a request to close. Return false to
|
||||
// proceed with the window close or true to cancel the window close. If this
|
||||
// is a modal window and a custom modal loop implementation was provided in
|
||||
// RunModal() this callback should be used to restore the opener window to a
|
||||
// usable state.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool DoClose(CefRefPtr<CefBrowser> browser) { return false; }
|
||||
|
||||
///
|
||||
// Called just before a window is closed. If this is a modal window and a
|
||||
// custom modal loop implementation was provided in RunModal() this callback
|
||||
// should be used to exit the custom modal loop.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_
|
93
include/cef_load_handler.h
Normal file
93
include/cef_load_handler.h
Normal file
@ -0,0 +1,93 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_LOAD_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_LOAD_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_frame.h"
|
||||
|
||||
///
|
||||
// Implement this interface to handle events related to browser load status. The
|
||||
// methods of this class will be called on the UI thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefLoadHandler : public virtual CefBase {
|
||||
public:
|
||||
typedef cef_handler_errorcode_t ErrorCode;
|
||||
|
||||
///
|
||||
// Called when the browser begins loading a frame. The |frame| value will
|
||||
// never be empty -- call the IsMain() method to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This method
|
||||
// may not be called for a particular frame if the load request for that frame
|
||||
// fails.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) {}
|
||||
|
||||
///
|
||||
// Called when the browser is done loading a frame. The |frame| value will
|
||||
// never be empty -- call the IsMain() method to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This method
|
||||
// will always be called for all frames irrespective of whether the request
|
||||
// completes successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int httpStatusCode) {}
|
||||
|
||||
///
|
||||
// Called when the browser fails to load a resource. |errorCode| is the error
|
||||
// code number, |errorText| is the error text and and |failedUrl| is the URL
|
||||
// that failed to load. See net\base\net_error_list.h for complete
|
||||
// descriptions of the error codes.
|
||||
///
|
||||
/*--cef(optional_param=errorText)--*/
|
||||
virtual void OnLoadError(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
ErrorCode errorCode,
|
||||
const CefString& errorText,
|
||||
const CefString& failedUrl) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_LOAD_HANDLER_H_
|
99
include/cef_origin_whitelist.h
Normal file
99
include/cef_origin_whitelist.h
Normal file
@ -0,0 +1,99 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_
|
||||
#define CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
|
||||
///
|
||||
// Add an entry to the cross-origin access whitelist.
|
||||
//
|
||||
// The same-origin policy restricts how scripts hosted from different origins
|
||||
// (scheme + domain + port) can communicate. By default, scripts can only access
|
||||
// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes
|
||||
// (but no other schemes) can use the "Access-Control-Allow-Origin" header to
|
||||
// allow cross-origin requests. For example, https://source.example.com can make
|
||||
// XMLHttpRequest requests on http://target.example.com if the
|
||||
// http://target.example.com request returns an "Access-Control-Allow-Origin:
|
||||
// https://source.example.com" response header.
|
||||
//
|
||||
// Scripts in separate frames or iframes and hosted from the same protocol and
|
||||
// domain suffix can execute cross-origin JavaScript if both pages set the
|
||||
// document.domain value to the same domain suffix. For example,
|
||||
// scheme://foo.example.com and scheme://bar.example.com can communicate using
|
||||
// JavaScript if both domains set document.domain="example.com".
|
||||
//
|
||||
// This method is used to allow access to origins that would otherwise violate
|
||||
// the same-origin policy. Scripts hosted underneath the fully qualified
|
||||
// |source_origin| URL (like http://www.example.com) will be allowed access to
|
||||
// all resources hosted on the specified |target_protocol| and |target_domain|.
|
||||
// If |allow_target_subdomains| is true access will also be allowed to all
|
||||
// subdomains of the target domain.
|
||||
//
|
||||
// This method cannot be used to bypass the restrictions on local or display
|
||||
// isolated schemes. See the comments on CefRegisterCustomScheme for more
|
||||
// information.
|
||||
//
|
||||
// This function may be called on any thread. Returns false if |source_origin|
|
||||
// is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
|
||||
const CefString& target_protocol,
|
||||
const CefString& target_domain,
|
||||
bool allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove an entry from the cross-origin access whitelist. Returns false if
|
||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
|
||||
const CefString& target_protocol,
|
||||
const CefString& target_domain,
|
||||
bool allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove all entries from the cross-origin access whitelist. Returns false if
|
||||
// the whitelist cannot be accessed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefClearCrossOriginWhitelist();
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_
|
91
include/cef_process_message.h
Normal file
91
include/cef_process_message.h
Normal file
@ -0,0 +1,91 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_MESSAGE_H_
|
||||
#define CEF_INCLUDE_CEF_MESSAGE_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_values.h"
|
||||
|
||||
typedef cef_process_id_t CefProcessId;
|
||||
|
||||
///
|
||||
// Class representing a message. Can be used on any process and thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefProcessMessage : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Create a new CefProcessMessage object with the specified name.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefProcessMessage> Create(const CefString& name);
|
||||
|
||||
///
|
||||
// Returns true if this object is valid. Do not call any other methods if this
|
||||
// function returns false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsValid() =0;
|
||||
|
||||
///
|
||||
// Returns true if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsReadOnly() =0;
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefProcessMessage> Copy() =0;
|
||||
|
||||
///
|
||||
// Returns the message name.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetName() =0;
|
||||
|
||||
///
|
||||
// Returns the list of arguments.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefListValue> GetArgumentList() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_MESSAGE_H_
|
57
include/cef_proxy_handler.h
Normal file
57
include/cef_proxy_handler.h
Normal file
@ -0,0 +1,57 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_PROXY_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_PROXY_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
// Implement this interface to handle proxy resolution events.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefProxyHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Called to retrieve proxy information for the specified |url|.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetProxyForUrl(const CefString& url,
|
||||
CefProxyInfo& proxy_info) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_PROXY_HANDLER_H_
|
110
include/cef_render_process_handler.h
Normal file
110
include/cef_render_process_handler.h
Normal file
@ -0,0 +1,110 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include "include/cef_process_message.h"
|
||||
#include "include/cef_v8.h"
|
||||
|
||||
///
|
||||
// Class used to implement render process callbacks. The methods of this class
|
||||
// will always be called on the render process main thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefRenderProcessHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Called after the render process main thread has been created.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnRenderThreadCreated() {}
|
||||
|
||||
///
|
||||
// Called after WebKit has been initialized.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnWebKitInitialized() {}
|
||||
|
||||
///
|
||||
// Called after a browser has been created.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnBrowserCreated(CefRefPtr<CefBrowser> browser) {}
|
||||
|
||||
///
|
||||
// Called before a browser is destroyed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) {}
|
||||
|
||||
///
|
||||
// Called immediately after the V8 context for a frame has been created. To
|
||||
// retrieve the JavaScript 'window' object use the CefV8Context::GetGlobal()
|
||||
// method.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefV8Context> context) {}
|
||||
|
||||
///
|
||||
// Called immediately before the V8 context for a frame is released. No
|
||||
// references to the context should be kept after this method is called.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnContextReleased(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefV8Context> context) {}
|
||||
|
||||
///
|
||||
// Called when a new message is received from a different process. Return true
|
||||
// if the message was handled or false otherwise. Do not keep a reference to
|
||||
// or attempt to access the message outside of this callback.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnProcessMessageRecieved(CefRefPtr<CefBrowser> browser,
|
||||
CefProcessId source_process,
|
||||
CefRefPtr<CefProcessMessage> message) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_
|
255
include/cef_request.h
Normal file
255
include/cef_request.h
Normal file
@ -0,0 +1,255 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_REQUEST_H_
|
||||
#define CEF_INCLUDE_CEF_REQUEST_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class CefPostData;
|
||||
class CefPostDataElement;
|
||||
|
||||
///
|
||||
// Class used to represent a web request. The methods of this class may be
|
||||
// called on any thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefRequest : public virtual CefBase {
|
||||
public:
|
||||
typedef std::multimap<CefString, CefString> HeaderMap;
|
||||
typedef cef_weburlrequest_flags_t RequestFlags;
|
||||
|
||||
///
|
||||
// Create a new CefRequest object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefRequest> CreateRequest();
|
||||
|
||||
///
|
||||
// Get the fully qualified URL.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetURL() =0;
|
||||
///
|
||||
// Set the fully qualified URL.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetURL(const CefString& url) =0;
|
||||
|
||||
///
|
||||
// Get the request method type. The value will default to POST if post data
|
||||
// is provided and GET otherwise.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetMethod() =0;
|
||||
///
|
||||
// Set the request method type.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetMethod(const CefString& method) =0;
|
||||
|
||||
///
|
||||
// Get the post data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefPostData> GetPostData() =0;
|
||||
///
|
||||
// Set the post data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetPostData(CefRefPtr<CefPostData> postData) =0;
|
||||
|
||||
///
|
||||
// Get the header values.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetHeaderMap(HeaderMap& headerMap) =0;
|
||||
///
|
||||
// Set the header values.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetHeaderMap(const HeaderMap& headerMap) =0;
|
||||
|
||||
///
|
||||
// Set all values at one time.
|
||||
///
|
||||
/*--cef(optional_param=postData)--*/
|
||||
virtual void Set(const CefString& url,
|
||||
const CefString& method,
|
||||
CefRefPtr<CefPostData> postData,
|
||||
const HeaderMap& headerMap) =0;
|
||||
|
||||
///
|
||||
// Get the flags used in combination with CefWebURLRequest.
|
||||
///
|
||||
/*--cef(default_retval=WUR_FLAG_NONE)--*/
|
||||
virtual RequestFlags GetFlags() =0;
|
||||
///
|
||||
// Set the flags used in combination with CefWebURLRequest.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetFlags(RequestFlags flags) =0;
|
||||
|
||||
///
|
||||
// Set the URL to the first party for cookies used in combination with
|
||||
// CefWebURLRequest.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetFirstPartyForCookies() =0;
|
||||
///
|
||||
// Get the URL to the first party for cookies used in combination with
|
||||
// CefWebURLRequest.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetFirstPartyForCookies(const CefString& url) =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class used to represent post data for a web request. The methods of this
|
||||
// class may be called on any thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefPostData : public virtual CefBase {
|
||||
public:
|
||||
typedef std::vector<CefRefPtr<CefPostDataElement> > ElementVector;
|
||||
|
||||
///
|
||||
// Create a new CefPostData object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefPostData> CreatePostData();
|
||||
|
||||
///
|
||||
// Returns the number of existing post data elements.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetElementCount() =0;
|
||||
|
||||
///
|
||||
// Retrieve the post data elements.
|
||||
///
|
||||
/*--cef(count_func=elements:GetElementCount)--*/
|
||||
virtual void GetElements(ElementVector& elements) =0;
|
||||
|
||||
///
|
||||
// Remove the specified post data element. Returns true if the removal
|
||||
// succeeds.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element) =0;
|
||||
|
||||
///
|
||||
// Add the specified post data element. Returns true if the add succeeds.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool AddElement(CefRefPtr<CefPostDataElement> element) =0;
|
||||
|
||||
///
|
||||
// Remove all existing post data elements.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void RemoveElements() =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class used to represent a single element in the request post data. The
|
||||
// methods of this class may be called on any thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefPostDataElement : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Post data elements may represent either bytes or files.
|
||||
///
|
||||
typedef cef_postdataelement_type_t Type;
|
||||
|
||||
///
|
||||
// Create a new CefPostDataElement object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefPostDataElement> CreatePostDataElement();
|
||||
|
||||
///
|
||||
// Remove all contents from the post data element.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetToEmpty() =0;
|
||||
|
||||
///
|
||||
// The post data element will represent a file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetToFile(const CefString& fileName) =0;
|
||||
|
||||
///
|
||||
// The post data element will represent bytes. The bytes passed
|
||||
// in will be copied.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetToBytes(size_t size, const void* bytes) =0;
|
||||
|
||||
///
|
||||
// Return the type of this post data element.
|
||||
///
|
||||
/*--cef(default_retval=PDE_TYPE_EMPTY)--*/
|
||||
virtual Type GetType() =0;
|
||||
|
||||
///
|
||||
// Return the file name.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetFile() =0;
|
||||
|
||||
///
|
||||
// Return the number of bytes.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetBytesCount() =0;
|
||||
|
||||
///
|
||||
// Read up to |size| bytes into |bytes| and return the number of bytes
|
||||
// actually read.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetBytes(size_t size, void* bytes) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_REQUEST_H_
|
146
include/cef_request_handler.h
Normal file
146
include/cef_request_handler.h
Normal file
@ -0,0 +1,146 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_REQUEST_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_cookie.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include "include/cef_resource_handler.h"
|
||||
#include "include/cef_response.h"
|
||||
#include "include/cef_request.h"
|
||||
|
||||
///
|
||||
// Callback interface used for asynchronous continuation of authentication
|
||||
// requests.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefAuthCallback : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Continue the authentication request.
|
||||
///
|
||||
/*--cef(capi_name=cont)--*/
|
||||
virtual void Continue(const CefString& username,
|
||||
const CefString& password) =0;
|
||||
|
||||
///
|
||||
// Cancel the authentication request.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Cancel() =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Implement this interface to handle events related to browser requests. The
|
||||
// methods of this class will be called on the thread indicated.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefRequestHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Called on the IO thread before a resource request is loaded. The |request|
|
||||
// object may be modified. To cancel the request return true otherwise return
|
||||
// false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource is loaded. To allow the resource
|
||||
// to load normally return NULL. To specify a handler for the resource return
|
||||
// a CefResourceHandler object. The |request| object should not be modified in
|
||||
// this callback.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefResourceHandler> GetResourceHandler(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource load is redirected. The |old_url|
|
||||
// parameter will contain the old URL. The |new_url| parameter will contain
|
||||
// the new URL and can be changed if desired.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnResourceRedirect(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
const CefString& old_url,
|
||||
CefString& new_url) {}
|
||||
|
||||
///
|
||||
// Called on the IO thread when the browser needs credentials from the user.
|
||||
// |isProxy| indicates whether the host is a proxy server. |host| contains the
|
||||
// hostname and |port| contains the port number. Return true to continue the
|
||||
// request and call CefAuthCallback::Complete() when the authentication
|
||||
// information is available. Return false to cancel the request.
|
||||
///
|
||||
/*--cef(optional_param=realm)--*/
|
||||
virtual bool GetAuthCredentials(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
bool isProxy,
|
||||
const CefString& host,
|
||||
int port,
|
||||
const CefString& realm,
|
||||
const CefString& scheme,
|
||||
CefRefPtr<CefAuthCallback> callback) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
// Called on the IO thread to retrieve the cookie manager. |main_url| is the
|
||||
// URL of the top-level frame. Cookies managers can be unique per browser or
|
||||
// shared across multiple browsers. The global cookie manager will be used if
|
||||
// this method returns NULL.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefCookieManager> GetCookieManager(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
const CefString& main_url) { return NULL; }
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_REQUEST_HANDLER_H_
|
82
include/cef_resource_bundle_handler.h
Normal file
82
include/cef_resource_bundle_handler.h
Normal file
@ -0,0 +1,82 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
// Class used to implement a custom resource bundle interface. The methods of
|
||||
// this class may be called on multiple threads.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefResourceBundleHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Called to retrieve a localized translation for the string specified by
|
||||
// |message_id|. To provide the translation set |string| to the translation
|
||||
// string and return true. To use the default translation return false.
|
||||
//
|
||||
// WARNING: Be cautious when implementing this method. ID values are auto-
|
||||
// generated when CEF is built and may change between versions. Existing ID
|
||||
// values can be discovered by searching for *_strings.h in the
|
||||
// "obj/global_intermediate" build output directory.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetLocalizedString(int message_id,
|
||||
CefString& string) =0;
|
||||
|
||||
///
|
||||
// Called to retrieve data for the resource specified by |resource_id|. To
|
||||
// provide the resource data set |data| and |data_size| to the data pointer
|
||||
// and size respectively and return true. To use the default resource data
|
||||
// return false. The resource data will not be copied and must remain resident
|
||||
// in memory.
|
||||
//
|
||||
// WARNING: Be cautious when implementing this method. ID values are auto-
|
||||
// generated when CEF is built and may change between versions. Existing ID
|
||||
// values can be discovered by searching for *_resources.h in the
|
||||
// "obj/global_intermediate" build output directory.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetDataResource(int resource_id,
|
||||
void*& data,
|
||||
size_t& data_size) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_
|
100
include/cef_resource_handler.h
Normal file
100
include/cef_resource_handler.h
Normal file
@ -0,0 +1,100 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_callback.h"
|
||||
#include "include/cef_request.h"
|
||||
#include "include/cef_response.h"
|
||||
|
||||
///
|
||||
// Class used to implement a custom request handler interface. The methods of
|
||||
// this class will always be called on the IO thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefResourceHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Begin processing the request. To handle the request return true and call
|
||||
// CefCallback::Continue() once the response header information is available
|
||||
// (CefCallback::Continue() can also be called from inside this method if
|
||||
// header information is available immediately). To cancel the request return
|
||||
// false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefCallback> callback) =0;
|
||||
|
||||
///
|
||||
// Retrieve response header information. If the response length is not known
|
||||
// set |response_length| to -1 and ReadResponse() will be called until it
|
||||
// returns false. If the response length is known set |response_length|
|
||||
// to a positive value and ReadResponse() will be called until it returns
|
||||
// false or the specified number of bytes have been read. Use the |response|
|
||||
// object to set the mime type, http status code and other optional header
|
||||
// values. To redirect the request to a new URL set |redirectUrl| to the new
|
||||
// URL.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
|
||||
int64& response_length,
|
||||
CefString& redirectUrl) =0;
|
||||
|
||||
///
|
||||
// Read response data. If data is available immediately copy up to
|
||||
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
|
||||
// bytes copied, and return true. To read the data at a later time set
|
||||
// |bytes_read| to 0, return true and call CefCallback::Continue() when the
|
||||
// data is available. To indicate response completion return false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool ReadResponse(void* data_out,
|
||||
int bytes_to_read,
|
||||
int& bytes_read,
|
||||
CefRefPtr<CefCallback> callback) =0;
|
||||
|
||||
///
|
||||
// Request processing has been canceled.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Cancel() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_
|
104
include/cef_response.h
Normal file
104
include/cef_response.h
Normal file
@ -0,0 +1,104 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_RESPONSE_H_
|
||||
#define CEF_INCLUDE_CEF_RESPONSE_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include <map>
|
||||
|
||||
///
|
||||
// Class used to represent a web response. The methods of this class may be
|
||||
// called on any thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefResponse : public virtual CefBase {
|
||||
public:
|
||||
typedef std::multimap<CefString, CefString> HeaderMap;
|
||||
|
||||
///
|
||||
// Get the response status code.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetStatus() =0;
|
||||
///
|
||||
// Set the response status code.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetStatus(int status) = 0;
|
||||
|
||||
///
|
||||
// Get the response status text.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetStatusText() =0;
|
||||
///
|
||||
// Set the response status text.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetStatusText(const CefString& statusText) = 0;
|
||||
|
||||
///
|
||||
// Get the response mime type.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetMimeType() = 0;
|
||||
///
|
||||
// Set the response mime type.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetMimeType(const CefString& mimeType) = 0;
|
||||
|
||||
///
|
||||
// Get the value for the specified response header field.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetHeader(const CefString& name) =0;
|
||||
|
||||
///
|
||||
// Get all response header fields.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetHeaderMap(HeaderMap& headerMap) =0;
|
||||
///
|
||||
// Set all response header fields.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetHeaderMap(const HeaderMap& headerMap) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RESPONSE_H_
|
346
include/cef_runnable.h
Normal file
346
include/cef_runnable.h
Normal file
@ -0,0 +1,346 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. Portions Copyright (c)
|
||||
// 2006-2011 Google Inc. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// The contents of this file are a modified extract of base/task.h
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_RUNNABLE_H_
|
||||
#define CEF_INCLUDE_CEF_RUNNABLE_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_task.h"
|
||||
#ifdef BUILDING_CEF_SHARED
|
||||
#include "base/tuple.h"
|
||||
#else
|
||||
#include "internal/cef_tuple.h"
|
||||
#endif
|
||||
|
||||
// CefRunnableMethodTraits -----------------------------------------------------
|
||||
//
|
||||
// This traits-class is used by CefRunnableMethod to manage the lifetime of the
|
||||
// callee object. By default, it is assumed that the callee supports AddRef
|
||||
// and Release methods. A particular class can specialize this template to
|
||||
// define other lifetime management. For example, if the callee is known to
|
||||
// live longer than the CefRunnableMethod object, then a CefRunnableMethodTraits
|
||||
// struct could be defined with empty RetainCallee and ReleaseCallee methods.
|
||||
//
|
||||
// The DISABLE_RUNNABLE_METHOD_REFCOUNT macro is provided as a convenient way
|
||||
// for declaring a CefRunnableMethodTraits that disables refcounting.
|
||||
|
||||
template <class T>
|
||||
struct CefRunnableMethodTraits {
|
||||
CefRunnableMethodTraits() {
|
||||
}
|
||||
|
||||
~CefRunnableMethodTraits() {
|
||||
}
|
||||
|
||||
void RetainCallee(T* obj) {
|
||||
#ifndef NDEBUG
|
||||
// Catch NewCefRunnableMethod being called in an object's constructor.
|
||||
// This isn't safe since the method can be invoked before the constructor
|
||||
// completes, causing the object to be deleted.
|
||||
obj->AddRef();
|
||||
obj->Release();
|
||||
#endif
|
||||
obj->AddRef();
|
||||
}
|
||||
|
||||
void ReleaseCallee(T* obj) {
|
||||
obj->Release();
|
||||
}
|
||||
};
|
||||
|
||||
// Convenience macro for declaring a CefRunnableMethodTraits that disables
|
||||
// refcounting of a class. This is useful if you know that the callee
|
||||
// will outlive the CefRunnableMethod object and thus do not need the ref
|
||||
// counts.
|
||||
//
|
||||
// The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the
|
||||
// global namespace scope. Example:
|
||||
//
|
||||
// namespace foo {
|
||||
// class Bar {
|
||||
// ...
|
||||
// };
|
||||
// } // namespace foo
|
||||
//
|
||||
// DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar);
|
||||
//
|
||||
// This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the
|
||||
// class.
|
||||
#define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \
|
||||
template <> \
|
||||
struct CefRunnableMethodTraits<TypeName> { \
|
||||
void RetainCallee(TypeName* manager) {} \
|
||||
void ReleaseCallee(TypeName* manager) {} \
|
||||
}
|
||||
|
||||
// CefRunnableMethod and CefRunnableFunction ----------------------------------
|
||||
//
|
||||
// CefRunnable methods are a type of task that call a function on an object
|
||||
// when they are run. We implement both an object and a set of
|
||||
// NewCefRunnableMethod and NewCefRunnableFunction functions for convenience.
|
||||
// These functions are overloaded and will infer the template types,
|
||||
// simplifying calling code.
|
||||
//
|
||||
// The template definitions all use the following names:
|
||||
// T - the class type of the object you're supplying
|
||||
// this is not needed for the Static version of the call
|
||||
// Method/Function - the signature of a pointer to the method or function you
|
||||
// want to call
|
||||
// Param - the parameter(s) to the method, possibly packed as a Tuple
|
||||
// A - the first parameter (if any) to the method
|
||||
// B - the second parameter (if any) to the method
|
||||
//
|
||||
// Put these all together and you get an object that can call a method whose
|
||||
// signature is:
|
||||
// R T::MyFunction([A[, B]])
|
||||
//
|
||||
// Usage:
|
||||
// CefPostTask(TID_UI, NewCefRunnableMethod(object, &Object::method[, a[, b]])
|
||||
// CefPostTask(TID_UI, NewCefRunnableFunction(&function[, a[, b]])
|
||||
|
||||
// CefRunnableMethod and NewCefRunnableMethod implementation ------------------
|
||||
|
||||
template <class T, class Method, class Params>
|
||||
class CefRunnableMethod : public CefTask {
|
||||
public:
|
||||
CefRunnableMethod(T* obj, Method meth, const Params& params)
|
||||
: obj_(obj), meth_(meth), params_(params) {
|
||||
traits_.RetainCallee(obj_);
|
||||
}
|
||||
|
||||
~CefRunnableMethod() {
|
||||
T* obj = obj_;
|
||||
obj_ = NULL;
|
||||
if (obj)
|
||||
traits_.ReleaseCallee(obj);
|
||||
}
|
||||
|
||||
virtual void Execute(CefThreadId threadId) {
|
||||
if (obj_)
|
||||
DispatchToMethod(obj_, meth_, params_);
|
||||
}
|
||||
|
||||
private:
|
||||
T* obj_;
|
||||
Method meth_;
|
||||
Params params_;
|
||||
CefRunnableMethodTraits<T> traits_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefRunnableMethod);
|
||||
};
|
||||
|
||||
template <class T, class Method>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method) {
|
||||
return new CefRunnableMethod<T, Method, Tuple0>(object, method, MakeTuple());
|
||||
}
|
||||
|
||||
template <class T, class Method, class A>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a) {
|
||||
return new CefRunnableMethod<T, Method, Tuple1<A> >(object,
|
||||
method,
|
||||
MakeTuple(a));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b) {
|
||||
return new CefRunnableMethod<T, Method, Tuple2<A, B> >(object, method,
|
||||
MakeTuple(a, b));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c) {
|
||||
return new CefRunnableMethod<T, Method, Tuple3<A, B, C> >(object, method,
|
||||
MakeTuple(a, b,
|
||||
c));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d) {
|
||||
return new CefRunnableMethod<T, Method, Tuple4<A, B, C, D> >(object, method,
|
||||
MakeTuple(a, b,
|
||||
c,
|
||||
d));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D, class E>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e) {
|
||||
return new CefRunnableMethod<T,
|
||||
Method,
|
||||
Tuple5<A, B, C, D, E> >(object,
|
||||
method,
|
||||
MakeTuple(a, b, c, d,
|
||||
e));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D, class E,
|
||||
class F>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f) {
|
||||
return new CefRunnableMethod<T,
|
||||
Method,
|
||||
Tuple6<A, B, C, D, E, F> >(object,
|
||||
method,
|
||||
MakeTuple(a, b, c, d,
|
||||
e, f));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D, class E,
|
||||
class F, class G>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f,
|
||||
const G& g) {
|
||||
return new CefRunnableMethod<T,
|
||||
Method,
|
||||
Tuple7<A, B, C, D, E, F, G> >(object,
|
||||
method,
|
||||
MakeTuple(a, b, c,
|
||||
d, e, f,
|
||||
g));
|
||||
}
|
||||
|
||||
// CefRunnableFunction and NewCefRunnableFunction implementation --------------
|
||||
|
||||
template <class Function, class Params>
|
||||
class CefRunnableFunction : public CefTask {
|
||||
public:
|
||||
CefRunnableFunction(Function function, const Params& params)
|
||||
: function_(function), params_(params) {
|
||||
}
|
||||
|
||||
~CefRunnableFunction() {
|
||||
}
|
||||
|
||||
virtual void Execute(CefThreadId threadId) {
|
||||
if (function_)
|
||||
DispatchToFunction(function_, params_);
|
||||
}
|
||||
|
||||
private:
|
||||
Function function_;
|
||||
Params params_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefRunnableFunction);
|
||||
};
|
||||
|
||||
template <class Function>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function) {
|
||||
return new CefRunnableFunction<Function, Tuple0>(function, MakeTuple());
|
||||
}
|
||||
|
||||
template <class Function, class A>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a) {
|
||||
return new CefRunnableFunction<Function, Tuple1<A> >(function, MakeTuple(a));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b) {
|
||||
return new CefRunnableFunction<Function, Tuple2<A, B> >(function,
|
||||
MakeTuple(a, b));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c) {
|
||||
return new CefRunnableFunction<Function, Tuple3<A, B, C> >(function,
|
||||
MakeTuple(a, b,
|
||||
c));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d) {
|
||||
return new CefRunnableFunction<Function, Tuple4<A, B, C, D> >(function,
|
||||
MakeTuple(a, b,
|
||||
c,
|
||||
d));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e) {
|
||||
return new CefRunnableFunction<Function, Tuple5<A, B, C, D, E> >(function,
|
||||
MakeTuple(a, b, c, d, e));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E,
|
||||
class F>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f) {
|
||||
return new CefRunnableFunction<Function, Tuple6<A, B, C, D, E, F> >(function,
|
||||
MakeTuple(a, b, c, d, e, f));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E,
|
||||
class F, class G>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f,
|
||||
const G& g) {
|
||||
return new CefRunnableFunction<Function, Tuple7<A, B, C, D, E, F, G> >(
|
||||
function, MakeTuple(a, b, c, d, e, f, g));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E,
|
||||
class F, class G, class H>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f,
|
||||
const G& g, const H& h) {
|
||||
return new CefRunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >(
|
||||
function, MakeTuple(a, b, c, d, e, f, g, h));
|
||||
}
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RUNNABLE_H_
|
148
include/cef_scheme.h
Normal file
148
include/cef_scheme.h
Normal file
@ -0,0 +1,148 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_SCHEME_H_
|
||||
#define CEF_INCLUDE_CEF_SCHEME_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include "include/cef_request.h"
|
||||
#include "include/cef_response.h"
|
||||
#include "include/cef_resource_handler.h"
|
||||
|
||||
class CefSchemeHandlerFactory;
|
||||
|
||||
///
|
||||
// Register a custom scheme. This method should not be called for the built-in
|
||||
// HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
||||
//
|
||||
// If |is_standard| is true the scheme will be treated as a standard scheme.
|
||||
// Standard schemes are subject to URL canonicalization and parsing rules as
|
||||
// defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available
|
||||
// at http://www.ietf.org/rfc/rfc1738.txt
|
||||
//
|
||||
// In particular, the syntax for standard scheme URLs must be of the form:
|
||||
// <pre>
|
||||
// [scheme]://[username]:[password]@[host]:[port]/[url-path]
|
||||
// </pre>
|
||||
// Standard scheme URLs must have a host component that is a fully qualified
|
||||
// domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC
|
||||
// 1123. These URLs will be canonicalized to "scheme://host/path" in the
|
||||
// simplest case and "scheme://username:password@host:port/path" in the most
|
||||
// explicit case. For example, "scheme:host/path" and "scheme:///host/path" will
|
||||
// both be canonicalized to "scheme://host/path". The origin of a standard
|
||||
// scheme URL is the combination of scheme, host and port (i.e.,
|
||||
// "scheme://host:port" in the most explicit case).
|
||||
//
|
||||
// For non-standard scheme URLs only the "scheme:" component is parsed and
|
||||
// canonicalized. The remainder of the URL will be passed to the handler as-is.
|
||||
// For example, "scheme:///some%20text" will remain the same. Non-standard
|
||||
// scheme URLs cannot be used as a target for form submission.
|
||||
//
|
||||
// If |is_local| is true the scheme will be treated as local (i.e., with the
|
||||
// same security rules as those applied to "file" URLs). Normal pages cannot
|
||||
// link to or access local URLs. Also, by default, local URLs can only perform
|
||||
// XMLHttpRequest calls to the same URL (origin + path) that originated the
|
||||
// request. To allow XMLHttpRequest calls from a local URL to other URLs with
|
||||
// the same origin set the CefSettings.file_access_from_file_urls_allowed value
|
||||
// to true. To allow XMLHttpRequest calls from a local URL to all origins set
|
||||
// the CefSettings.universal_access_from_file_urls_allowed value to true.
|
||||
//
|
||||
// If |is_display_isolated| is true the scheme will be treated as display-
|
||||
// isolated. This means that pages cannot display these URLs unless they are
|
||||
// from the same scheme. For example, pages in another origin cannot create
|
||||
// iframes or hyperlinks to URLs with this scheme.
|
||||
//
|
||||
// This function may be called on any thread. It should only be called once
|
||||
// per unique |scheme_name| value. If |scheme_name| is already registered or if
|
||||
// an error occurs this method will return false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefRegisterCustomScheme(const CefString& scheme_name,
|
||||
bool is_standard,
|
||||
bool is_local,
|
||||
bool is_display_isolated);
|
||||
|
||||
///
|
||||
// Register a scheme handler factory for the specified |scheme_name| and
|
||||
// optional |domain_name|. An empty |domain_name| value for a standard scheme
|
||||
// will cause the factory to match all domain names. The |domain_name| value
|
||||
// will be ignored for non-standard schemes. If |scheme_name| is a built-in
|
||||
// scheme and no handler is returned by |factory| then the built-in scheme
|
||||
// handler factory will be called. If |scheme_name| is a custom scheme the
|
||||
// CefRegisterCustomScheme() function should be called for that scheme.
|
||||
// This function may be called multiple times to change or remove the factory
|
||||
// that matches the specified |scheme_name| and optional |domain_name|.
|
||||
// Returns false if an error occurs. This function may be called on any thread.
|
||||
///
|
||||
/*--cef(optional_param=domain_name,optional_param=factory)--*/
|
||||
bool CefRegisterSchemeHandlerFactory(
|
||||
const CefString& scheme_name,
|
||||
const CefString& domain_name,
|
||||
CefRefPtr<CefSchemeHandlerFactory> factory);
|
||||
|
||||
///
|
||||
// Clear all registered scheme handler factories. Returns false on error. This
|
||||
// function may be called on any thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefClearSchemeHandlerFactories();
|
||||
|
||||
|
||||
///
|
||||
// Class that creates CefResourceHandler instances for handling scheme requests. The
|
||||
// methods of this class will always be called on the IO thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefSchemeHandlerFactory : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Return a new resource handler instance to handle the request. |browser| will
|
||||
// be the browser window that initiated the request. If the request was
|
||||
// initiated using the CefWebURLRequest API |browser| will be NULL. The
|
||||
// |request| object passed to this method will not contain cookie data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefResourceHandler> Create(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
const CefString& scheme_name,
|
||||
CefRefPtr<CefRequest> request) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_SCHEME_H_
|
210
include/cef_stream.h
Normal file
210
include/cef_stream.h
Normal file
@ -0,0 +1,210 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_STREAM_H_
|
||||
#define CEF_INCLUDE_CEF_STREAM_H_
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
// Interface the client can implement to provide a custom stream reader. The
|
||||
// methods of this class may be called on any thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefReadHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Read raw binary data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t Read(void* ptr, size_t size, size_t n) =0;
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of
|
||||
// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
|
||||
// failure.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Seek(int64 offset, int whence) =0;
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64 Tell() =0;
|
||||
|
||||
///
|
||||
// Return non-zero if at end of file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Eof() =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class used to read data from a stream. The methods of this class may be
|
||||
// called on any thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefStreamReader : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Create a new CefStreamReader object from a file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefStreamReader> CreateForFile(const CefString& fileName);
|
||||
///
|
||||
// Create a new CefStreamReader object from data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefStreamReader> CreateForData(void* data, size_t size);
|
||||
///
|
||||
// Create a new CefStreamReader object from a custom handler.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefStreamReader> CreateForHandler(
|
||||
CefRefPtr<CefReadHandler> handler);
|
||||
|
||||
///
|
||||
// Read raw binary data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t Read(void* ptr, size_t size, size_t n) =0;
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of
|
||||
// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
|
||||
// failure.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Seek(int64 offset, int whence) =0;
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64 Tell() =0;
|
||||
|
||||
///
|
||||
// Return non-zero if at end of file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Eof() =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Interface the client can implement to provide a custom stream writer. The
|
||||
// methods of this class may be called on any thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefWriteHandler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Write raw binary data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t Write(const void* ptr, size_t size, size_t n) =0;
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of
|
||||
// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
|
||||
// failure.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Seek(int64 offset, int whence) =0;
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64 Tell() =0;
|
||||
|
||||
///
|
||||
// Flush the stream.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Flush() =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class used to write data to a stream. The methods of this class may be called
|
||||
// on any thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefStreamWriter : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Create a new CefStreamWriter object for a file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefStreamWriter> CreateForFile(const CefString& fileName);
|
||||
///
|
||||
// Create a new CefStreamWriter object for a custom handler.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefStreamWriter> CreateForHandler(
|
||||
CefRefPtr<CefWriteHandler> handler);
|
||||
|
||||
///
|
||||
// Write raw binary data.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t Write(const void* ptr, size_t size, size_t n) =0;
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of
|
||||
// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
|
||||
// failure.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Seek(int64 offset, int whence) =0;
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64 Tell() =0;
|
||||
|
||||
///
|
||||
// Flush the stream.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int Flush() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_STREAM_H_
|
55
include/cef_string_visitor.h
Normal file
55
include/cef_string_visitor.h
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_STRING_VISITOR_H_
|
||||
#define CEF_INCLUDE_CEF_STRING_VISITOR_H_
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
// Implement this interface to receive string values asynchronously.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefStringVisitor : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Method that will be executed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Visit(const CefString& string) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_STRING_VISITOR_H_
|
88
include/cef_task.h
Normal file
88
include/cef_task.h
Normal file
@ -0,0 +1,88 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_TASK_H_
|
||||
#define CEF_INCLUDE_CEF_TASK_H_
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
class CefTask;
|
||||
|
||||
typedef cef_thread_id_t CefThreadId;
|
||||
|
||||
///
|
||||
// CEF maintains multiple internal threads that are used for handling different
|
||||
// types of tasks in different processes. See the cef_thread_id_t definitions in
|
||||
// cef_types.h for more information. This function will return true if called on
|
||||
// the specified thread. It is an error to request a thread from the wrong
|
||||
// process.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefCurrentlyOn(CefThreadId threadId);
|
||||
|
||||
///
|
||||
// Post a task for execution on the specified thread. This function may be
|
||||
// called on any thread. It is an error to request a thread from the wrong
|
||||
// process.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefPostTask(CefThreadId threadId, CefRefPtr<CefTask> task);
|
||||
|
||||
///
|
||||
// Post a task for delayed execution on the specified thread. This function may
|
||||
// be called on any thread. It is an error to request a thread from the wrong
|
||||
// process.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr<CefTask> task,
|
||||
int64 delay_ms);
|
||||
|
||||
|
||||
///
|
||||
// Implement this interface for task execution. The methods of this class may
|
||||
// be called on any thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefTask : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Method that will be executed. |threadId| is the thread executing the call.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Execute(CefThreadId threadId) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_TASK_H_
|
60
include/cef_url.h
Normal file
60
include/cef_url.h
Normal file
@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_URL_H_
|
||||
#define CEF_INCLUDE_CEF_URL_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
// Parse the specified |url| into its component parts.
|
||||
// Returns false if the URL is empty or invalid.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefParseURL(const CefString& url,
|
||||
CefURLParts& parts);
|
||||
|
||||
///
|
||||
// Creates a URL from the specified |parts|, which must contain a non-empty
|
||||
// spec or a non-empty host and path (at a minimum), but not both.
|
||||
// Returns false if |parts| isn't initialized as described.
|
||||
///
|
||||
/*--cef()--*/
|
||||
bool CefCreateURL(const CefURLParts& parts,
|
||||
CefString& url);
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_URL_H_
|
742
include/cef_v8.h
Normal file
742
include/cef_v8.h
Normal file
@ -0,0 +1,742 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_V8_H_
|
||||
#define CEF_INCLUDE_CEF_V8_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include <vector>
|
||||
|
||||
class CefV8Exception;
|
||||
class CefV8Handler;
|
||||
class CefV8Value;
|
||||
|
||||
|
||||
///
|
||||
// Register a new V8 extension with the specified JavaScript extension code and
|
||||
// handler. Functions implemented by the handler are prototyped using the
|
||||
// keyword 'native'. The calling of a native function is restricted to the scope
|
||||
// in which the prototype of the native function is defined. This function may
|
||||
// only be called on the render process main thread.
|
||||
//
|
||||
// Example JavaScript extension code:
|
||||
// <pre>
|
||||
// // create the 'example' global object if it doesn't already exist.
|
||||
// if (!example)
|
||||
// example = {};
|
||||
// // create the 'example.test' global object if it doesn't already exist.
|
||||
// if (!example.test)
|
||||
// example.test = {};
|
||||
// (function() {
|
||||
// // Define the function 'example.test.myfunction'.
|
||||
// example.test.myfunction = function() {
|
||||
// // Call CefV8Handler::Execute() with the function name 'MyFunction'
|
||||
// // and no arguments.
|
||||
// native function MyFunction();
|
||||
// return MyFunction();
|
||||
// };
|
||||
// // Define the getter function for parameter 'example.test.myparam'.
|
||||
// example.test.__defineGetter__('myparam', function() {
|
||||
// // Call CefV8Handler::Execute() with the function name 'GetMyParam'
|
||||
// // and no arguments.
|
||||
// native function GetMyParam();
|
||||
// return GetMyParam();
|
||||
// });
|
||||
// // Define the setter function for parameter 'example.test.myparam'.
|
||||
// example.test.__defineSetter__('myparam', function(b) {
|
||||
// // Call CefV8Handler::Execute() with the function name 'SetMyParam'
|
||||
// // and a single argument.
|
||||
// native function SetMyParam();
|
||||
// if(b) SetMyParam(b);
|
||||
// });
|
||||
//
|
||||
// // Extension definitions can also contain normal JavaScript variables
|
||||
// // and functions.
|
||||
// var myint = 0;
|
||||
// example.test.increment = function() {
|
||||
// myint += 1;
|
||||
// return myint;
|
||||
// };
|
||||
// })();
|
||||
// </pre>
|
||||
// Example usage in the page:
|
||||
// <pre>
|
||||
// // Call the function.
|
||||
// example.test.myfunction();
|
||||
// // Set the parameter.
|
||||
// example.test.myparam = value;
|
||||
// // Get the parameter.
|
||||
// value = example.test.myparam;
|
||||
// // Call another function.
|
||||
// example.test.increment();
|
||||
// </pre>
|
||||
///
|
||||
/*--cef(optional_param=handler)--*/
|
||||
bool CefRegisterExtension(const CefString& extension_name,
|
||||
const CefString& javascript_code,
|
||||
CefRefPtr<CefV8Handler> handler);
|
||||
|
||||
|
||||
///
|
||||
// Class that encapsulates a V8 context handle. The methods of this class may
|
||||
// only be called on the render process main thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefV8Context : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Returns the current (top) context object in the V8 context stack.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Context> GetCurrentContext();
|
||||
|
||||
///
|
||||
// Returns the entered (bottom) context object in the V8 context stack.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Context> GetEnteredContext();
|
||||
|
||||
///
|
||||
// Returns true if V8 is currently inside a context.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static bool InContext();
|
||||
|
||||
///
|
||||
// Returns the browser for this context.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBrowser> GetBrowser() =0;
|
||||
|
||||
///
|
||||
// Returns the frame for this context.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFrame> GetFrame() =0;
|
||||
|
||||
///
|
||||
// Returns the global object for this context. The context must be entered
|
||||
// before calling this method.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefV8Value> GetGlobal() =0;
|
||||
|
||||
///
|
||||
// Enter this context. A context must be explicitly entered before creating a
|
||||
// V8 Object, Array, Function or Date asynchronously. Exit() must be called
|
||||
// the same number of times as Enter() before releasing this context. V8
|
||||
// objects belong to the context in which they are created. Returns true if
|
||||
// the scope was entered successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Enter() =0;
|
||||
|
||||
///
|
||||
// Exit this context. Call this method only after calling Enter(). Returns
|
||||
// true if the scope was exited successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Exit() =0;
|
||||
|
||||
///
|
||||
// Returns true if this object is pointing to the same handle as |that|
|
||||
// object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsSame(CefRefPtr<CefV8Context> that) =0;
|
||||
|
||||
///
|
||||
// Evaluates the specified JavaScript code using this context's global object.
|
||||
// On success |retval| will be set to the return value, if any, and the
|
||||
// function will return true. On failure |exception| will be set to the
|
||||
// exception, if any, and the function will return false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Eval(const CefString& code,
|
||||
CefRefPtr<CefV8Value>& retval,
|
||||
CefRefPtr<CefV8Exception>& exception) =0;
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<CefRefPtr<CefV8Value> > CefV8ValueList;
|
||||
|
||||
///
|
||||
// Interface that should be implemented to handle V8 function calls. The methods
|
||||
// of this class will always be called on the render process main thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefV8Handler : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Handle execution of the function identified by |name|. |object| is the
|
||||
// receiver ('this' object) of the function. |arguments| is the list of
|
||||
// arguments passed to the function. If execution succeeds set |retval| to the
|
||||
// function return value. If execution fails set |exception| to the exception
|
||||
// that will be thrown. Return true if execution was handled.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Execute(const CefString& name,
|
||||
CefRefPtr<CefV8Value> object,
|
||||
const CefV8ValueList& arguments,
|
||||
CefRefPtr<CefV8Value>& retval,
|
||||
CefString& exception) =0;
|
||||
};
|
||||
|
||||
///
|
||||
// Interface that should be implemented to handle V8 accessor calls. Accessor
|
||||
// identifiers are registered by calling CefV8Value::SetValue(). The methods
|
||||
// of this class will always be called on the render process main thread.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefV8Accessor : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Handle retrieval the accessor value identified by |name|. |object| is the
|
||||
// receiver ('this' object) of the accessor. If retrieval succeeds set
|
||||
// |retval| to the return value. If retrieval fails set |exception| to the
|
||||
// exception that will be thrown. Return true if accessor retrieval was
|
||||
// handled.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Get(const CefString& name,
|
||||
const CefRefPtr<CefV8Value> object,
|
||||
CefRefPtr<CefV8Value>& retval,
|
||||
CefString& exception) =0;
|
||||
|
||||
///
|
||||
// Handle assignment of the accessor value identified by |name|. |object| is
|
||||
// the receiver ('this' object) of the accessor. |value| is the new value
|
||||
// being assigned to the accessor. If assignment fails set |exception| to the
|
||||
// exception that will be thrown. Return true if accessor assignment was
|
||||
// handled.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Set(const CefString& name,
|
||||
const CefRefPtr<CefV8Value> object,
|
||||
const CefRefPtr<CefV8Value> value,
|
||||
CefString& exception) =0;
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a V8 exception.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefV8Exception : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Returns the exception message.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetMessage() =0;
|
||||
|
||||
///
|
||||
// Returns the line of source code that the exception occurred within.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetSourceLine() =0;
|
||||
|
||||
///
|
||||
// Returns the resource name for the script from where the function causing
|
||||
// the error originates.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetScriptResourceName() =0;
|
||||
|
||||
///
|
||||
// Returns the 1-based number of the line where the error occurred or 0 if the
|
||||
// line number is unknown.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetLineNumber() =0;
|
||||
|
||||
///
|
||||
// Returns the index within the script of the first character where the error
|
||||
// occurred.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetStartPosition() =0;
|
||||
|
||||
///
|
||||
// Returns the index within the script of the last character where the error
|
||||
// occurred.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetEndPosition() =0;
|
||||
|
||||
///
|
||||
// Returns the index within the line of the first character where the error
|
||||
// occurred.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetStartColumn() =0;
|
||||
|
||||
///
|
||||
// Returns the index within the line of the last character where the error
|
||||
// occurred.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetEndColumn() =0;
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a V8 value. The methods of this class may only be called
|
||||
// on the render process main thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefV8Value : public virtual CefBase {
|
||||
public:
|
||||
typedef cef_v8_accesscontrol_t AccessControl;
|
||||
typedef cef_v8_propertyattribute_t PropertyAttribute;
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type undefined.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateUndefined();
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type null.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateNull();
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type bool.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateBool(bool value);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type int.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateInt(int32 value);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type unsigned int.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateUInt(uint32 value);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type double.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateDouble(double value);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type Date. This method should only be
|
||||
// called from within the scope of a CefV8ContextHandler, CefV8Handler or
|
||||
// CefV8Accessor callback, or in combination with calling Enter() and Exit()
|
||||
// on a stored CefV8Context reference.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateDate(const CefTime& date);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type string.
|
||||
///
|
||||
/*--cef(optional_param=value)--*/
|
||||
static CefRefPtr<CefV8Value> CreateString(const CefString& value);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type object with optional accessor. This
|
||||
// method should only be called from within the scope of a
|
||||
// CefV8ContextHandler, CefV8Handler or CefV8Accessor callback, or in
|
||||
// combination with calling Enter() and Exit() on a stored CefV8Context
|
||||
// reference.
|
||||
///
|
||||
/*--cef(optional_param=accessor)--*/
|
||||
static CefRefPtr<CefV8Value> CreateObject(CefRefPtr<CefV8Accessor> accessor);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type array with the specified |length|.
|
||||
// If |length| is negative the returned array will have length 0. This method
|
||||
// should only be called from within the scope of a CefV8ContextHandler,
|
||||
// CefV8Handler or CefV8Accessor callback, or in combination with calling
|
||||
// Enter() and Exit() on a stored CefV8Context reference.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateArray(int length);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type function. This method should only be
|
||||
// called from within the scope of a CefV8ContextHandler, CefV8Handler or
|
||||
// CefV8Accessor callback, or in combination with calling Enter() and Exit()
|
||||
// on a stored CefV8Context reference.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateFunction(const CefString& name,
|
||||
CefRefPtr<CefV8Handler> handler);
|
||||
|
||||
///
|
||||
// True if the value type is undefined.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsUndefined() =0;
|
||||
|
||||
///
|
||||
// True if the value type is null.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsNull() =0;
|
||||
|
||||
///
|
||||
// True if the value type is bool.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsBool() =0;
|
||||
|
||||
///
|
||||
// True if the value type is int.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsInt() =0;
|
||||
|
||||
///
|
||||
// True if the value type is unsigned int.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsUInt() =0;
|
||||
|
||||
///
|
||||
// True if the value type is double.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsDouble() =0;
|
||||
|
||||
///
|
||||
// True if the value type is Date.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsDate() =0;
|
||||
|
||||
///
|
||||
// True if the value type is string.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsString() =0;
|
||||
|
||||
///
|
||||
// True if the value type is object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsObject() =0;
|
||||
|
||||
///
|
||||
// True if the value type is array.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsArray() =0;
|
||||
|
||||
///
|
||||
// True if the value type is function.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsFunction() =0;
|
||||
|
||||
///
|
||||
// Returns true if this object is pointing to the same handle as |that|
|
||||
// object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsSame(CefRefPtr<CefV8Value> that) =0;
|
||||
|
||||
///
|
||||
// Return a bool value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetBoolValue() =0;
|
||||
|
||||
///
|
||||
// Return an int value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int32 GetIntValue() =0;
|
||||
|
||||
///
|
||||
// Return an unisgned int value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual uint32 GetUIntValue() =0;
|
||||
|
||||
///
|
||||
// Return a double value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual double GetDoubleValue() =0;
|
||||
|
||||
///
|
||||
// Return a Date value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefTime GetDateValue() =0;
|
||||
|
||||
///
|
||||
// Return a string value. The underlying data will be converted to if
|
||||
// necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetStringValue() =0;
|
||||
|
||||
|
||||
// OBJECT METHODS - These methods are only available on objects. Arrays and
|
||||
// functions are also objects. String- and integer-based keys can be used
|
||||
// interchangably with the framework converting between them as necessary.
|
||||
|
||||
///
|
||||
// Returns true if this is a user created object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsUserCreated() =0;
|
||||
|
||||
///
|
||||
// Returns true if the last method call resulted in an exception. This
|
||||
// attribute exists only in the scope of the current CEF value object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasException() =0;
|
||||
|
||||
///
|
||||
// Returns the exception resulting from the last method call. This attribute
|
||||
// exists only in the scope of the current CEF value object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefV8Exception> GetException() =0;
|
||||
|
||||
///
|
||||
// Clears the last exception and returns true on success.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool ClearException() =0;
|
||||
|
||||
///
|
||||
// Returns true if this object will re-throw future exceptions. This attribute
|
||||
// exists only in the scope of the current CEF value object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool WillRethrowExceptions() =0;
|
||||
|
||||
///
|
||||
// Set whether this object will re-throw future exceptions. By default
|
||||
// exceptions are not re-thrown. If a exception is re-thrown the current
|
||||
// context should not be accessed again until after the exception has been
|
||||
// caught and not re-thrown. Returns true on success. This attribute exists
|
||||
// only in the scope of the current CEF value object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetRethrowExceptions(bool rethrow) =0;
|
||||
|
||||
///
|
||||
// Returns true if the object has a value with the specified identifier.
|
||||
///
|
||||
/*--cef(capi_name=has_value_bykey)--*/
|
||||
virtual bool HasValue(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns true if the object has a value with the specified identifier.
|
||||
///
|
||||
/*--cef(capi_name=has_value_byindex,index_param=index)--*/
|
||||
virtual bool HasValue(int index) =0;
|
||||
|
||||
///
|
||||
// Deletes the value with the specified identifier and returns true on
|
||||
// success. Returns false if this method is called incorrectly or an exception
|
||||
// is thrown. For read-only and don't-delete values this method will return
|
||||
// true even though deletion failed.
|
||||
///
|
||||
/*--cef(capi_name=delete_value_bykey)--*/
|
||||
virtual bool DeleteValue(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Deletes the value with the specified identifier and returns true on
|
||||
// success. Returns false if this method is called incorrectly, deletion fails
|
||||
// or an exception is thrown. For read-only and don't-delete values this
|
||||
// method will return true even though deletion failed.
|
||||
///
|
||||
/*--cef(capi_name=delete_value_byindex,index_param=index)--*/
|
||||
virtual bool DeleteValue(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value with the specified identifier on success. Returns NULL
|
||||
// if this method is called incorrectly or an exception is thrown.
|
||||
///
|
||||
/*--cef(capi_name=get_value_bykey)--*/
|
||||
virtual CefRefPtr<CefV8Value> GetValue(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value with the specified identifier on success. Returns NULL
|
||||
// if this method is called incorrectly or an exception is thrown.
|
||||
///
|
||||
/*--cef(capi_name=get_value_byindex,index_param=index)--*/
|
||||
virtual CefRefPtr<CefV8Value> GetValue(int index) =0;
|
||||
|
||||
///
|
||||
// Associates a value with the specified identifier and returns true on
|
||||
// success. Returns false if this method is called incorrectly or an exception
|
||||
// is thrown. For read-only values this method will return true even though
|
||||
// assignment failed.
|
||||
///
|
||||
/*--cef(capi_name=set_value_bykey)--*/
|
||||
virtual bool SetValue(const CefString& key, CefRefPtr<CefV8Value> value,
|
||||
PropertyAttribute attribute) =0;
|
||||
|
||||
///
|
||||
// Associates a value with the specified identifier and returns true on
|
||||
// success. Returns false if this method is called incorrectly or an exception
|
||||
// is thrown. For read-only values this method will return true even though
|
||||
// assignment failed.
|
||||
///
|
||||
/*--cef(capi_name=set_value_byindex,index_param=index)--*/
|
||||
virtual bool SetValue(int index, CefRefPtr<CefV8Value> value) =0;
|
||||
|
||||
///
|
||||
// Registers an identifier and returns true on success. Access to the
|
||||
// identifier will be forwarded to the CefV8Accessor instance passed to
|
||||
// CefV8Value::CreateObject(). Returns false if this method is called
|
||||
// incorrectly or an exception is thrown. For read-only values this method
|
||||
// will return true even though assignment failed.
|
||||
///
|
||||
/*--cef(capi_name=set_value_byaccessor)--*/
|
||||
virtual bool SetValue(const CefString& key, AccessControl settings,
|
||||
PropertyAttribute attribute) =0;
|
||||
|
||||
///
|
||||
// Read the keys for the object's values into the specified vector. Integer-
|
||||
// based keys will also be returned as strings.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetKeys(std::vector<CefString>& keys) =0;
|
||||
|
||||
///
|
||||
// Sets the user data for this object and returns true on success. Returns
|
||||
// false if this method is called incorrectly. This method can only be called
|
||||
// on user created objects.
|
||||
///
|
||||
/*--cef(optional_param=user_data)--*/
|
||||
virtual bool SetUserData(CefRefPtr<CefBase> user_data) =0;
|
||||
|
||||
///
|
||||
// Returns the user data, if any, assigned to this object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBase> GetUserData() =0;
|
||||
|
||||
///
|
||||
// Returns the amount of externally allocated memory registered for the
|
||||
// object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetExternallyAllocatedMemory() =0;
|
||||
|
||||
///
|
||||
// Adjusts the amount of registered external memory for the object. Used to
|
||||
// give V8 an indication of the amount of externally allocated memory that is
|
||||
// kept alive by JavaScript objects. V8 uses this information to decide when
|
||||
// to perform global garbage collection. Each CefV8Value tracks the amount of
|
||||
// external memory associated with it and automatically decreases the global
|
||||
// total by the appropriate amount on its destruction. |change_in_bytes|
|
||||
// specifies the number of bytes to adjust by. This method returns the number
|
||||
// of bytes associated with the object after the adjustment. This method can
|
||||
// only be called on user created objects.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) =0;
|
||||
|
||||
|
||||
// ARRAY METHODS - These methods are only available on arrays.
|
||||
|
||||
///
|
||||
// Returns the number of elements in the array.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetArrayLength() =0;
|
||||
|
||||
|
||||
// FUNCTION METHODS - These methods are only available on functions.
|
||||
|
||||
///
|
||||
// Returns the function name.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetFunctionName() =0;
|
||||
|
||||
///
|
||||
// Returns the function handler or NULL if not a CEF-created function.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefV8Handler> GetFunctionHandler() =0;
|
||||
|
||||
///
|
||||
// Execute the function using the current V8 context. This method should only
|
||||
// be called from within the scope of a CefV8Handler or CefV8Accessor
|
||||
// callback, or in combination with calling Enter() and Exit() on a stored
|
||||
// CefV8Context reference. |object| is the receiver ('this' object) of the
|
||||
// function. If |object| is empty the current context's global object will be
|
||||
// used. |arguments| is the list of arguments that will be passed to the
|
||||
// function. Returns the function return value on success. Returns NULL if
|
||||
// this method is called incorrectly or an exception is thrown.
|
||||
///
|
||||
/*--cef(optional_param=object)--*/
|
||||
virtual CefRefPtr<CefV8Value> ExecuteFunction(
|
||||
CefRefPtr<CefV8Value> object,
|
||||
const CefV8ValueList& arguments) =0;
|
||||
|
||||
///
|
||||
// Execute the function using the specified V8 context. |object| is the
|
||||
// receiver ('this' object) of the function. If |object| is empty the
|
||||
// specified context's global object will be used. |arguments| is the list of
|
||||
// arguments that will be passed to the function. Returns the function return
|
||||
// value on success. Returns NULL if this method is called incorrectly or an
|
||||
// exception is thrown.
|
||||
///
|
||||
/*--cef(optional_param=object)--*/
|
||||
virtual CefRefPtr<CefV8Value> ExecuteFunctionWithContext(
|
||||
CefRefPtr<CefV8Context> context,
|
||||
CefRefPtr<CefV8Value> object,
|
||||
const CefV8ValueList& arguments) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_V8_H_
|
471
include/cef_values.h
Normal file
471
include/cef_values.h
Normal file
@ -0,0 +1,471 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_VALUES_H_
|
||||
#define CEF_INCLUDE_CEF_VALUES_H_
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "include/cef_base.h"
|
||||
|
||||
class CefDictionaryValue;
|
||||
class CefListValue;
|
||||
|
||||
typedef cef_value_type_t CefValueType;
|
||||
|
||||
///
|
||||
// Class representing a binary value. Can be used on any process and thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefBinaryValue : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Creates a new object that is not owned by any other object. The specified
|
||||
// |data| will be copied.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefBinaryValue> Create(const void* data,
|
||||
size_t data_size);
|
||||
|
||||
///
|
||||
// Returns true if this object is valid. Do not call any other methods if this
|
||||
// method returns false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsValid() =0;
|
||||
|
||||
///
|
||||
// Returns true if this object is currently owned by another object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsOwned() =0;
|
||||
|
||||
///
|
||||
// Returns a copy of this object. The data in this object will also be copied.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBinaryValue> Copy() =0;
|
||||
|
||||
///
|
||||
// Returns the data size.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetSize() =0;
|
||||
|
||||
///
|
||||
// Read up to |buffer_size| number of bytes into |buffer|. Reading begins at
|
||||
// the specified byte |data_offset|. Returns the number of bytes read.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetData(void* buffer,
|
||||
size_t buffer_size,
|
||||
size_t data_offset) =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class representing a dictionary value. Can be used on any process and thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefDictionaryValue : public virtual CefBase {
|
||||
public:
|
||||
typedef std::vector<CefString> KeyList;
|
||||
|
||||
///
|
||||
// Creates a new object that is not owned by any other object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefDictionaryValue> Create();
|
||||
|
||||
///
|
||||
// Returns true if this object is valid. Do not call any other methods if this
|
||||
// method returns false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsValid() =0;
|
||||
|
||||
///
|
||||
// Returns true if this object is currently owned by another object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsOwned() =0;
|
||||
|
||||
///
|
||||
// Returns true if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsReadOnly() =0;
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object. If |exclude_empty_children| is true
|
||||
// any empty dictionaries or lists will be excluded from the copy.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefDictionaryValue> Copy(bool exclude_empty_children) =0;
|
||||
|
||||
///
|
||||
// Returns the number of values.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetSize() =0;
|
||||
|
||||
///
|
||||
// Removes all values. Returns true on success.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Clear() =0;
|
||||
|
||||
///
|
||||
// Returns true if the current dictionary has a value for the given key.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasKey(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Reads all keys for this dictionary into the specified vector.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetKeys(KeyList& keys) =0;
|
||||
|
||||
///
|
||||
// Removes the value at the specified key. Returns true is the value was
|
||||
// removed successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Remove(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value type for the specified key.
|
||||
///
|
||||
/*--cef(default_retval=VTYPE_INVALID)--*/
|
||||
virtual CefValueType GetType(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type bool.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetBool(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type int.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetInt(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type double.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual double GetDouble(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type string.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetString(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type binary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBinaryValue> GetBinary(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type dictionary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefDictionaryValue> GetDictionary(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified key as type list.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefListValue> GetList(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type null. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetNull(const CefString& key) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type bool. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetBool(const CefString& key, bool value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type int. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetInt(const CefString& key, int value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type double. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetDouble(const CefString& key, double value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type string. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef(optional_param=value)--*/
|
||||
virtual bool SetString(const CefString& key, const CefString& value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type binary. Returns true if the
|
||||
// value was set successfully. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetBinary(const CefString& key,
|
||||
CefRefPtr<CefBinaryValue> value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type dict. Returns true if the
|
||||
// value was set successfully. After calling this method the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetDictionary(const CefString& key,
|
||||
CefRefPtr<CefDictionaryValue> value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified key as type list. Returns true if the
|
||||
// value was set successfully. After calling this method the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetList(const CefString& key,
|
||||
CefRefPtr<CefListValue> value) =0;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
// Class representing a list value. Can be used on any process and thread.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefListValue : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Creates a new object that is not owned by any other object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefListValue> Create();
|
||||
|
||||
///
|
||||
// Returns true if this object is valid. Do not call any other methods if this
|
||||
// method returns false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsValid() =0;
|
||||
|
||||
///
|
||||
// Returns true if this object is currently owned by another object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsOwned() =0;
|
||||
|
||||
///
|
||||
// Returns true if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsReadOnly() =0;
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefListValue> Copy() =0;
|
||||
|
||||
///
|
||||
// Sets the number of values. If the number of values is expanded all
|
||||
// new value slots will default to type null. Returns true on success.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool SetSize(size_t size) =0;
|
||||
|
||||
///
|
||||
// Returns the number of values.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetSize() =0;
|
||||
|
||||
///
|
||||
// Removes all values. Returns true on success.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Clear() =0;
|
||||
|
||||
///
|
||||
// Removes the value at the specified index.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool Remove(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value type at the specified index.
|
||||
///
|
||||
/*--cef(default_retval=VTYPE_INVALID,index_param=index)--*/
|
||||
virtual CefValueType GetType(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type bool.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool GetBool(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type int.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual int GetInt(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type double.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual double GetDouble(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type string.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual CefString GetString(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type binary.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual CefRefPtr<CefBinaryValue> GetBinary(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type dictionary.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual CefRefPtr<CefDictionaryValue> GetDictionary(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value at the specified index as type list.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual CefRefPtr<CefListValue> GetList(int index) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type null. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool SetNull(int index) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type bool. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool SetBool(int index, bool value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type int. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool SetInt(int index, int value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type double. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool SetDouble(int index, double value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type string. Returns true if the
|
||||
// value was set successfully.
|
||||
///
|
||||
/*--cef(optional_param=value,index_param=index)--*/
|
||||
virtual bool SetString(int index, const CefString& value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type binary. Returns true if the
|
||||
// value was set successfully. After calling this method the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool SetBinary(int index, CefRefPtr<CefBinaryValue> value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type dict. Returns true if the
|
||||
// value was set successfully. After calling this method the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool SetDictionary(int index, CefRefPtr<CefDictionaryValue> value) =0;
|
||||
|
||||
///
|
||||
// Sets the value at the specified index as type list. Returns true if the
|
||||
// value was set successfully. After calling this method the |value| object
|
||||
// will no longer be valid. If |value| is currently owned by another object
|
||||
// then the value will be copied and the |value| reference will not change.
|
||||
// Otherwise, ownership will be transferred to this object and the |value|
|
||||
// reference will be invalidated.
|
||||
///
|
||||
/*--cef(index_param=index)--*/
|
||||
virtual bool SetList(int index, CefRefPtr<CefListValue> value) =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_VALUES_H_
|
268
include/cef_xml_reader.h
Normal file
268
include/cef_xml_reader.h
Normal file
@ -0,0 +1,268 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_XML_READER_H_
|
||||
#define CEF_INCLUDE_CEF_XML_READER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_stream.h"
|
||||
|
||||
///
|
||||
// Class that supports the reading of XML data via the libxml streaming API.
|
||||
// The methods of this class should only be called on the thread that creates
|
||||
// the object.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefXmlReader : public virtual CefBase {
|
||||
public:
|
||||
typedef cef_xml_encoding_type_t EncodingType;
|
||||
typedef cef_xml_node_type_t NodeType;
|
||||
|
||||
///
|
||||
// Create a new CefXmlReader object. The returned object's methods can only
|
||||
// be called from the thread that created the object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefXmlReader> Create(CefRefPtr<CefStreamReader> stream,
|
||||
EncodingType encodingType,
|
||||
const CefString& URI);
|
||||
|
||||
///
|
||||
// Moves the cursor to the next node in the document. This method must be
|
||||
// called at least once to set the current cursor position. Returns true if
|
||||
// the cursor position was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool MoveToNextNode() =0;
|
||||
|
||||
///
|
||||
// Close the document. This should be called directly to ensure that cleanup
|
||||
// occurs on the correct thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Close() =0;
|
||||
|
||||
///
|
||||
// Returns true if an error has been reported by the XML parser.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasError() =0;
|
||||
|
||||
///
|
||||
// Returns the error string.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetError() =0;
|
||||
|
||||
|
||||
// The below methods retrieve data for the node at the current cursor
|
||||
// position.
|
||||
|
||||
///
|
||||
// Returns the node type.
|
||||
///
|
||||
/*--cef(default_retval=XML_NODE_UNSUPPORTED)--*/
|
||||
virtual NodeType GetType() =0;
|
||||
|
||||
///
|
||||
// Returns the node depth. Depth starts at 0 for the root node.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetDepth() =0;
|
||||
|
||||
///
|
||||
// Returns the local name. See
|
||||
// http://www.w3.org/TR/REC-xml-names/#NT-LocalPart for additional details.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetLocalName() =0;
|
||||
|
||||
///
|
||||
// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for
|
||||
// additional details.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetPrefix() =0;
|
||||
|
||||
///
|
||||
// Returns the qualified name, equal to (Prefix:)LocalName. See
|
||||
// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetQualifiedName() =0;
|
||||
|
||||
///
|
||||
// Returns the URI defining the namespace associated with the node. See
|
||||
// http://www.w3.org/TR/REC-xml-names/ for additional details.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetNamespaceURI() =0;
|
||||
|
||||
///
|
||||
// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for
|
||||
// additional details.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetBaseURI() =0;
|
||||
|
||||
///
|
||||
// Returns the xml:lang scope within which the node resides. See
|
||||
// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetXmlLang() =0;
|
||||
|
||||
///
|
||||
// Returns true if the node represents an empty element. <a/> is considered
|
||||
// empty but <a></a> is not.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsEmptyElement() =0;
|
||||
|
||||
///
|
||||
// Returns true if the node has a text value.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasValue() =0;
|
||||
|
||||
///
|
||||
// Returns the text value.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetValue() =0;
|
||||
|
||||
///
|
||||
// Returns true if the node has attributes.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasAttributes() =0;
|
||||
|
||||
///
|
||||
// Returns the number of attributes.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual size_t GetAttributeCount() =0;
|
||||
|
||||
///
|
||||
// Returns the value of the attribute at the specified 0-based index.
|
||||
///
|
||||
/*--cef(capi_name=get_attribute_byindex,index_param=index)--*/
|
||||
virtual CefString GetAttribute(int index) =0;
|
||||
|
||||
///
|
||||
// Returns the value of the attribute with the specified qualified name.
|
||||
///
|
||||
/*--cef(capi_name=get_attribute_byqname)--*/
|
||||
virtual CefString GetAttribute(const CefString& qualifiedName) =0;
|
||||
|
||||
///
|
||||
// Returns the value of the attribute with the specified local name and
|
||||
// namespace URI.
|
||||
///
|
||||
/*--cef(capi_name=get_attribute_bylname)--*/
|
||||
virtual CefString GetAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI) =0;
|
||||
|
||||
///
|
||||
// Returns an XML representation of the current node's children.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetInnerXml() =0;
|
||||
|
||||
///
|
||||
// Returns an XML representation of the current node including its children.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetOuterXml() =0;
|
||||
|
||||
///
|
||||
// Returns the line number for the current node.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetLineNumber() =0;
|
||||
|
||||
|
||||
// Attribute nodes are not traversed by default. The below methods can be
|
||||
// used to move the cursor to an attribute node. MoveToCarryingElement() can
|
||||
// be called afterwards to return the cursor to the carrying element. The
|
||||
// depth of an attribute node will be 1 + the depth of the carrying element.
|
||||
|
||||
///
|
||||
// Moves the cursor to the attribute at the specified 0-based index. Returns
|
||||
// true if the cursor position was set successfully.
|
||||
///
|
||||
/*--cef(capi_name=move_to_attribute_byindex,index_param=index)--*/
|
||||
virtual bool MoveToAttribute(int index) =0;
|
||||
|
||||
///
|
||||
// Moves the cursor to the attribute with the specified qualified name.
|
||||
// Returns true if the cursor position was set successfully.
|
||||
///
|
||||
/*--cef(capi_name=move_to_attribute_byqname)--*/
|
||||
virtual bool MoveToAttribute(const CefString& qualifiedName) =0;
|
||||
|
||||
///
|
||||
// Moves the cursor to the attribute with the specified local name and
|
||||
// namespace URI. Returns true if the cursor position was set successfully.
|
||||
///
|
||||
/*--cef(capi_name=move_to_attribute_bylname)--*/
|
||||
virtual bool MoveToAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI) =0;
|
||||
|
||||
///
|
||||
// Moves the cursor to the first attribute in the current element. Returns
|
||||
// true if the cursor position was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool MoveToFirstAttribute() =0;
|
||||
|
||||
///
|
||||
// Moves the cursor to the next attribute in the current element. Returns
|
||||
// true if the cursor position was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool MoveToNextAttribute() =0;
|
||||
|
||||
///
|
||||
// Moves the cursor back to the carrying element. Returns true if the cursor
|
||||
// position was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool MoveToCarryingElement() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_XML_READER_H_
|
141
include/cef_zip_reader.h
Normal file
141
include/cef_zip_reader.h
Normal file
@ -0,0 +1,141 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_ZIP_READER_H_
|
||||
#define CEF_INCLUDE_CEF_ZIP_READER_H_
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_stream.h"
|
||||
|
||||
///
|
||||
// Class that supports the reading of zip archives via the zlib unzip API.
|
||||
// The methods of this class should only be called on the thread that creates
|
||||
// the object.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefZipReader : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Create a new CefZipReader object. The returned object's methods can only
|
||||
// be called from the thread that created the object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefZipReader> Create(CefRefPtr<CefStreamReader> stream);
|
||||
|
||||
///
|
||||
// Moves the cursor to the first file in the archive. Returns true if the
|
||||
// cursor position was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool MoveToFirstFile() =0;
|
||||
|
||||
///
|
||||
// Moves the cursor to the next file in the archive. Returns true if the
|
||||
// cursor position was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool MoveToNextFile() =0;
|
||||
|
||||
///
|
||||
// Moves the cursor to the specified file in the archive. If |caseSensitive|
|
||||
// is true then the search will be case sensitive. Returns true if the cursor
|
||||
// position was set successfully.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) =0;
|
||||
|
||||
///
|
||||
// Closes the archive. This should be called directly to ensure that cleanup
|
||||
// occurs on the correct thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Close() =0;
|
||||
|
||||
|
||||
// The below methods act on the file at the current cursor position.
|
||||
|
||||
///
|
||||
// Returns the name of the file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetFileName() =0;
|
||||
|
||||
///
|
||||
// Returns the uncompressed size of the file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64 GetFileSize() =0;
|
||||
|
||||
///
|
||||
// Returns the last modified timestamp for the file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual time_t GetFileLastModified() =0;
|
||||
|
||||
///
|
||||
// Opens the file for reading of uncompressed data. A read password may
|
||||
// optionally be specified.
|
||||
///
|
||||
/*--cef(optional_param=password)--*/
|
||||
virtual bool OpenFile(const CefString& password) =0;
|
||||
|
||||
///
|
||||
// Closes the file.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool CloseFile() =0;
|
||||
|
||||
///
|
||||
// Read uncompressed file contents into the specified buffer. Returns < 0 if
|
||||
// an error occurred, 0 if at the end of file, or the number of bytes read.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int ReadFile(void* buffer, size_t bufferSize) =0;
|
||||
|
||||
///
|
||||
// Returns the current offset in the uncompressed file contents.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64 Tell() =0;
|
||||
|
||||
///
|
||||
// Returns true if at end of the file contents.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool Eof() =0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_ZIP_READER_H_
|
129
include/internal/cef_build.h
Normal file
129
include/internal/cef_build.h
Normal file
@ -0,0 +1,129 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_BUILD_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_BUILD_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifndef OS_WIN
|
||||
#define OS_WIN 1
|
||||
#endif
|
||||
#elif defined(__APPLE__)
|
||||
#ifndef OS_MACOSX
|
||||
#define OS_MACOSX 1
|
||||
#endif
|
||||
#elif defined(__linux__)
|
||||
#ifndef OS_LINUX
|
||||
#define OS_LINUX 1
|
||||
#endif
|
||||
#else
|
||||
#error Please add support for your platform in cef_build.h
|
||||
#endif
|
||||
|
||||
// For access to standard POSIXish features, use OS_POSIX instead of a
|
||||
// more specific macro.
|
||||
#if defined(OS_MACOSX) || defined(OS_LINUX)
|
||||
#ifndef OS_POSIX
|
||||
#define OS_POSIX 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Compiler detection.
|
||||
#if defined(__GNUC__)
|
||||
#ifndef COMPILER_GCC
|
||||
#define COMPILER_GCC 1
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#ifndef COMPILER_MSVC
|
||||
#define COMPILER_MSVC 1
|
||||
#endif
|
||||
#else
|
||||
#error Please add support for your compiler in cef_build.h
|
||||
#endif
|
||||
|
||||
// Annotate a virtual method indicating it must be overriding a virtual
|
||||
// method in the parent class.
|
||||
// Use like:
|
||||
// virtual void foo() OVERRIDE;
|
||||
#ifndef OVERRIDE
|
||||
#if defined(COMPILER_MSVC)
|
||||
#define OVERRIDE override
|
||||
#elif defined(__clang__)
|
||||
#define OVERRIDE override
|
||||
#else
|
||||
#define OVERRIDE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALLOW_THIS_IN_INITIALIZER_LIST
|
||||
#if defined(COMPILER_MSVC)
|
||||
|
||||
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
|
||||
// The warning remains disabled until popped by MSVC_POP_WARNING.
|
||||
#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
|
||||
__pragma(warning(disable:n))
|
||||
|
||||
// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level
|
||||
// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
|
||||
// warnings.
|
||||
#define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n))
|
||||
|
||||
// Pop effects of innermost MSVC_PUSH_* macro.
|
||||
#define MSVC_POP_WARNING() __pragma(warning(pop))
|
||||
|
||||
// Allows |this| to be passed as an argument in constructor initializer lists.
|
||||
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
|
||||
// having the warning be disabled for more than just |code|.
|
||||
//
|
||||
// Example usage:
|
||||
// Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {}
|
||||
//
|
||||
// Compiler warning C4355: 'this': used in base member initializer list:
|
||||
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
|
||||
code \
|
||||
MSVC_POP_WARNING()
|
||||
#else // !COMPILER_MSVC
|
||||
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
|
||||
|
||||
#endif // !COMPILER_MSVC
|
||||
#endif
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_BUILD_H_
|
55
include/internal/cef_export.h
Normal file
55
include/internal/cef_export.h
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_build.h"
|
||||
|
||||
#if defined(COMPILER_MSVC)
|
||||
|
||||
#ifdef BUILDING_CEF_SHARED
|
||||
#define CEF_EXPORT __declspec(dllexport)
|
||||
#elif USING_CEF_SHARED
|
||||
#define CEF_EXPORT __declspec(dllimport)
|
||||
#else
|
||||
#define CEF_EXPORT
|
||||
#endif
|
||||
#define CEF_CALLBACK __stdcall
|
||||
|
||||
#elif defined(COMPILER_GCC)
|
||||
|
||||
#define CEF_EXPORT __attribute__ ((visibility("default")))
|
||||
#define CEF_CALLBACK
|
||||
|
||||
#endif // COMPILER_GCC
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
|
131
include/internal/cef_linux.h
Normal file
131
include/internal/cef_linux.h
Normal file
@ -0,0 +1,131 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_LINUX_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_LINUX_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include <pthread.h>
|
||||
#include "include/internal/cef_types_linux.h"
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
|
||||
// Atomic increment and decrement.
|
||||
inline long CefAtomicIncrement(long volatile *pDest) { // NOLINT(runtime/int)
|
||||
return __sync_add_and_fetch(pDest, 1);
|
||||
}
|
||||
inline long CefAtomicDecrement(long volatile *pDest) { // NOLINT(runtime/int)
|
||||
return __sync_sub_and_fetch(pDest, 1);
|
||||
}
|
||||
|
||||
// Critical section wrapper.
|
||||
class CefCriticalSection {
|
||||
public:
|
||||
CefCriticalSection() {
|
||||
pthread_mutexattr_init(&attr_);
|
||||
pthread_mutexattr_settype(&attr_, PTHREAD_MUTEX_RECURSIVE);
|
||||
pthread_mutex_init(&lock_, &attr_);
|
||||
}
|
||||
virtual ~CefCriticalSection() {
|
||||
pthread_mutex_destroy(&lock_);
|
||||
pthread_mutexattr_destroy(&attr_);
|
||||
}
|
||||
void Lock() {
|
||||
pthread_mutex_lock(&lock_);
|
||||
}
|
||||
void Unlock() {
|
||||
pthread_mutex_unlock(&lock_);
|
||||
}
|
||||
|
||||
pthread_mutex_t lock_;
|
||||
pthread_mutexattr_t attr_;
|
||||
};
|
||||
|
||||
// Handle types.
|
||||
#define CefWindowHandle cef_window_handle_t
|
||||
#define CefCursorHandle cef_cursor_handle_t
|
||||
|
||||
struct CefMainArgsTraits {
|
||||
typedef cef_main_args_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->argc = src->argc;
|
||||
target->argv = src->argv;
|
||||
}
|
||||
};
|
||||
|
||||
// Class representing CefExecuteProcess arguments.
|
||||
class CefMainArgs : public CefStructBase<CefMainArgsTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefMainArgsTraits> parent;
|
||||
|
||||
CefMainArgs() : parent() {}
|
||||
explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {}
|
||||
explicit CefMainArgs(const CefMainArgs& r) : parent(r) {}
|
||||
CefMainArgs(int argc_arg, char** argv_arg) : parent() {
|
||||
argc = argc_arg;
|
||||
argv = argv_arg;
|
||||
}
|
||||
};
|
||||
|
||||
struct CefWindowInfoTraits {
|
||||
typedef cef_window_info_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->widget = src->widget;
|
||||
target->parent_widget = src->parent_widget;
|
||||
}
|
||||
};
|
||||
|
||||
// Class representing window information.
|
||||
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefWindowInfoTraits> parent;
|
||||
|
||||
CefWindowInfo() : parent() {}
|
||||
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
void SetAsChild(CefWindowHandle ParentWidget) {
|
||||
parent_widget = ParentWidget;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // OS_LINUX
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_LINUX_H_
|
147
include/internal/cef_mac.h
Normal file
147
include/internal/cef_mac.h
Normal file
@ -0,0 +1,147 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_MAC_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_MAC_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include <pthread.h>
|
||||
#include "include/internal/cef_types_mac.h"
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
|
||||
// Atomic increment and decrement.
|
||||
inline long CefAtomicIncrement(long volatile *pDest) { // NOLINT(runtime/int)
|
||||
return __sync_add_and_fetch(pDest, 1);
|
||||
}
|
||||
inline long CefAtomicDecrement(long volatile *pDest) { // NOLINT(runtime/int)
|
||||
return __sync_sub_and_fetch(pDest, 1);
|
||||
}
|
||||
|
||||
// Handle types.
|
||||
#define CefWindowHandle cef_window_handle_t
|
||||
#define CefCursorHandle cef_cursor_handle_t
|
||||
|
||||
// Critical section wrapper.
|
||||
class CefCriticalSection {
|
||||
public:
|
||||
CefCriticalSection() {
|
||||
pthread_mutexattr_init(&attr_);
|
||||
pthread_mutexattr_settype(&attr_, PTHREAD_MUTEX_RECURSIVE);
|
||||
pthread_mutex_init(&lock_, &attr_);
|
||||
}
|
||||
virtual ~CefCriticalSection() {
|
||||
pthread_mutex_destroy(&lock_);
|
||||
pthread_mutexattr_destroy(&attr_);
|
||||
}
|
||||
void Lock() {
|
||||
pthread_mutex_lock(&lock_);
|
||||
}
|
||||
void Unlock() {
|
||||
pthread_mutex_unlock(&lock_);
|
||||
}
|
||||
|
||||
pthread_mutex_t lock_;
|
||||
pthread_mutexattr_t attr_;
|
||||
};
|
||||
|
||||
struct CefMainArgsTraits {
|
||||
typedef cef_main_args_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->argc = src->argc;
|
||||
target->argv = src->argv;
|
||||
}
|
||||
};
|
||||
|
||||
// Class representing CefExecuteProcess arguments.
|
||||
class CefMainArgs : public CefStructBase<CefMainArgsTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefMainArgsTraits> parent;
|
||||
|
||||
CefMainArgs() : parent() {}
|
||||
explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {}
|
||||
explicit CefMainArgs(const CefMainArgs& r) : parent(r) {}
|
||||
CefMainArgs(int argc, char** argv) : parent() {
|
||||
this->argc = argc;
|
||||
this->argv = argv;
|
||||
}
|
||||
};
|
||||
|
||||
struct CefWindowInfoTraits {
|
||||
typedef cef_window_info_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->window_name);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->view = src->view;
|
||||
target->parent_view = src->parent_view;
|
||||
cef_string_set(src->window_name.str, src->window_name.length,
|
||||
&target->window_name, copy);
|
||||
target->x = src->x;
|
||||
target->y = src->y;
|
||||
target->width = src->width;
|
||||
target->height = src->height;
|
||||
target->hidden = src->hidden;
|
||||
}
|
||||
};
|
||||
|
||||
// Class representing window information.
|
||||
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefWindowInfoTraits> parent;
|
||||
|
||||
CefWindowInfo() : parent() {}
|
||||
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
void SetAsChild(CefWindowHandle ParentView, int x, int y, int width,
|
||||
int height) {
|
||||
parent_view = ParentView;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
hidden = false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // OS_MACOSX
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_MAC_H_
|
199
include/internal/cef_ptr.h
Normal file
199
include/internal/cef_ptr.h
Normal file
@ -0,0 +1,199 @@
|
||||
// Copyright (c) 2008 Marshall A. Greenblatt. Portions Copyright (c)
|
||||
// 2006-2008 Google Inc. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_PTR_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_PTR_H_
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
///
|
||||
// Smart pointer implementation borrowed from base/ref_counted.h
|
||||
// <p>
|
||||
// A smart pointer class for reference counted objects. Use this class instead
|
||||
// of calling AddRef and Release manually on a reference counted object to
|
||||
// avoid common memory leaks caused by forgetting to Release an object
|
||||
// reference. Sample usage:
|
||||
// <pre>
|
||||
// class MyFoo : public CefBase {
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// void some_function() {
|
||||
// // The MyFoo object that |foo| represents starts with a single
|
||||
// // reference.
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
// foo->Method(param);
|
||||
// // |foo| is released when this function returns
|
||||
// }
|
||||
//
|
||||
// void some_other_function() {
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
// ...
|
||||
// foo = NULL; // explicitly releases |foo|
|
||||
// ...
|
||||
// if (foo)
|
||||
// foo->Method(param);
|
||||
// }
|
||||
// </pre>
|
||||
// The above examples show how CefRefPtr<T> acts like a pointer to T.
|
||||
// Given two CefRefPtr<T> classes, it is also possible to exchange
|
||||
// references between the two objects, like so:
|
||||
// <pre>
|
||||
// {
|
||||
// CefRefPtr<MyFoo> a = new MyFoo();
|
||||
// CefRefPtr<MyFoo> b;
|
||||
//
|
||||
// b.swap(a);
|
||||
// // now, |b| references the MyFoo object, and |a| references NULL.
|
||||
// }
|
||||
// </pre>
|
||||
// To make both |a| and |b| in the above example reference the same MyFoo
|
||||
// object, simply use the assignment operator:
|
||||
// <pre>
|
||||
// {
|
||||
// CefRefPtr<MyFoo> a = new MyFoo();
|
||||
// CefRefPtr<MyFoo> b;
|
||||
//
|
||||
// b = a;
|
||||
// // now, |a| and |b| each own a reference to the same MyFoo object.
|
||||
// // the reference count of the underlying MyFoo object will be 2.
|
||||
// }
|
||||
// </pre>
|
||||
// Reference counted objects can also be passed as function parameters and
|
||||
// used as function return values:
|
||||
// <pre>
|
||||
// void some_func_with_param(CefRefPtr<MyFoo> param) {
|
||||
// // A reference is added to the MyFoo object that |param| represents
|
||||
// // during the scope of some_func_with_param() and released when
|
||||
// // some_func_with_param() goes out of scope.
|
||||
// }
|
||||
//
|
||||
// CefRefPtr<MyFoo> some_func_with_retval() {
|
||||
// // The MyFoo object that |foox| represents starts with a single
|
||||
// // reference.
|
||||
// CefRefPtr<MyFoo> foox = new MyFoo();
|
||||
//
|
||||
// // Creating the return value adds an additional reference.
|
||||
// return foox;
|
||||
//
|
||||
// // When some_func_with_retval() goes out of scope the original |foox|
|
||||
// // reference is released.
|
||||
// }
|
||||
//
|
||||
// void and_another_function() {
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
//
|
||||
// // pass |foo| as a parameter.
|
||||
// some_function(foo);
|
||||
//
|
||||
// CefRefPtr<MyFoo> foo2 = some_func_with_retval();
|
||||
// // Now, since we kept a reference to the some_func_with_retval() return
|
||||
// // value, |foo2| is the only class pointing to the MyFoo object created
|
||||
// in some_func_with_retval(), and it has a reference count of 1.
|
||||
//
|
||||
// some_func_with_retval();
|
||||
// // Now, since we didn't keep a reference to the some_func_with_retval()
|
||||
// // return value, the MyFoo object created in some_func_with_retval()
|
||||
// // will automatically be released.
|
||||
// }
|
||||
// </pre>
|
||||
// And in standard containers:
|
||||
// <pre>
|
||||
// {
|
||||
// // Create a vector that holds MyFoo objects.
|
||||
// std::vector<CefRefPtr<MyFoo> > MyFooVec;
|
||||
//
|
||||
// // The MyFoo object that |foo| represents starts with a single
|
||||
// // reference.
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
//
|
||||
// // When the MyFoo object is added to |MyFooVec| the reference count
|
||||
// // is increased to 2.
|
||||
// MyFooVec.push_back(foo);
|
||||
// }
|
||||
// </pre>
|
||||
// </p>
|
||||
///
|
||||
template <class T>
|
||||
class CefRefPtr {
|
||||
public:
|
||||
CefRefPtr() : ptr_(NULL) {
|
||||
}
|
||||
|
||||
CefRefPtr(T* p) : ptr_(p) { // NOLINT(runtime/explicit)
|
||||
if (ptr_)
|
||||
ptr_->AddRef();
|
||||
}
|
||||
|
||||
CefRefPtr(const CefRefPtr<T>& r) : ptr_(r.ptr_) {
|
||||
if (ptr_)
|
||||
ptr_->AddRef();
|
||||
}
|
||||
|
||||
~CefRefPtr() {
|
||||
if (ptr_)
|
||||
ptr_->Release();
|
||||
}
|
||||
|
||||
T* get() const { return ptr_; }
|
||||
operator T*() const { return ptr_; }
|
||||
T* operator->() const { return ptr_; }
|
||||
|
||||
CefRefPtr<T>& operator=(T* p) {
|
||||
// AddRef first so that self assignment should work
|
||||
if (p)
|
||||
p->AddRef();
|
||||
if (ptr_ )
|
||||
ptr_ ->Release();
|
||||
ptr_ = p;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CefRefPtr<T>& operator=(const CefRefPtr<T>& r) {
|
||||
return *this = r.ptr_;
|
||||
}
|
||||
|
||||
void swap(T** pp) {
|
||||
T* p = ptr_;
|
||||
ptr_ = *pp;
|
||||
*pp = p;
|
||||
}
|
||||
|
||||
void swap(CefRefPtr<T>& r) {
|
||||
swap(&r.ptr_); // NOLINT(build/include_what_you_use)
|
||||
}
|
||||
|
||||
private:
|
||||
T* ptr_;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_PTR_H_
|
113
include/internal/cef_string.h
Normal file
113
include/internal/cef_string.h
Normal file
@ -0,0 +1,113 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_STRING_H_
|
||||
#pragma once
|
||||
|
||||
// The CEF interface is built with one string type as the default. Comment out
|
||||
// all but one of the CEF_STRING_TYPE_* defines below to specify the default.
|
||||
// If you change the default you MUST recompile all of CEF.
|
||||
|
||||
// Build with the UTF8 string type as default.
|
||||
// #define CEF_STRING_TYPE_UTF8 1
|
||||
|
||||
// Build with the UTF16 string type as default.
|
||||
#define CEF_STRING_TYPE_UTF16 1
|
||||
|
||||
// Build with the wide string type as default.
|
||||
// #define CEF_STRING_TYPE_WIDE 1
|
||||
|
||||
|
||||
#include "include/internal/cef_string_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "include/internal/cef_string_wrappers.h"
|
||||
#if defined(CEF_STRING_TYPE_UTF16)
|
||||
typedef CefStringUTF16 CefString;
|
||||
#elif defined(CEF_STRING_TYPE_UTF8)
|
||||
typedef CefStringUTF8 CefString;
|
||||
#elif defined(CEF_STRING_TYPE_WIDE)
|
||||
typedef CefStringWide CefString;
|
||||
#endif
|
||||
#endif // __cplusplus
|
||||
|
||||
#if defined(CEF_STRING_TYPE_UTF8)
|
||||
typedef char cef_char_t;
|
||||
typedef cef_string_utf8_t cef_string_t;
|
||||
typedef cef_string_userfree_utf8_t cef_string_userfree_t;
|
||||
#define cef_string_set cef_string_utf8_set
|
||||
#define cef_string_copy cef_string_utf8_copy
|
||||
#define cef_string_clear cef_string_utf8_clear
|
||||
#define cef_string_userfree_alloc cef_string_userfree_utf8_alloc
|
||||
#define cef_string_userfree_free cef_string_userfree_utf8_free
|
||||
#define cef_string_from_ascii cef_string_utf8_copy
|
||||
#define cef_string_to_utf8 cef_string_utf8_copy
|
||||
#define cef_string_from_utf8 cef_string_utf8_copy
|
||||
#define cef_string_to_utf16 cef_string_utf8_to_utf16
|
||||
#define cef_string_from_utf16 cef_string_utf16_to_utf8
|
||||
#define cef_string_to_wide cef_string_utf8_to_wide
|
||||
#define cef_string_from_wide cef_string_wide_to_utf8
|
||||
#elif defined(CEF_STRING_TYPE_UTF16)
|
||||
typedef char16 cef_char_t;
|
||||
typedef cef_string_userfree_utf16_t cef_string_userfree_t;
|
||||
typedef cef_string_utf16_t cef_string_t;
|
||||
#define cef_string_set cef_string_utf16_set
|
||||
#define cef_string_copy cef_string_utf16_copy
|
||||
#define cef_string_clear cef_string_utf16_clear
|
||||
#define cef_string_userfree_alloc cef_string_userfree_utf16_alloc
|
||||
#define cef_string_userfree_free cef_string_userfree_utf16_free
|
||||
#define cef_string_from_ascii cef_string_ascii_to_utf16
|
||||
#define cef_string_to_utf8 cef_string_utf16_to_utf8
|
||||
#define cef_string_from_utf8 cef_string_utf8_to_utf16
|
||||
#define cef_string_to_utf16 cef_string_utf16_copy
|
||||
#define cef_string_from_utf16 cef_string_utf16_copy
|
||||
#define cef_string_to_wide cef_string_utf16_to_wide
|
||||
#define cef_string_from_wide cef_string_wide_to_utf16
|
||||
#elif defined(CEF_STRING_TYPE_WIDE)
|
||||
typedef wchar_t cef_char_t;
|
||||
typedef cef_string_wide_t cef_string_t;
|
||||
typedef cef_string_userfree_wide_t cef_string_userfree_t;
|
||||
#define cef_string_set cef_string_wide_set
|
||||
#define cef_string_copy cef_string_wide_copy
|
||||
#define cef_string_clear cef_string_wide_clear
|
||||
#define cef_string_userfree_alloc cef_string_userfree_wide_alloc
|
||||
#define cef_string_userfree_free cef_string_userfree_wide_free
|
||||
#define cef_string_from_ascii cef_string_ascii_to_wide
|
||||
#define cef_string_to_utf8 cef_string_wide_to_utf8
|
||||
#define cef_string_from_utf8 cef_string_utf8_to_wide
|
||||
#define cef_string_to_utf16 cef_string_wide_to_utf16
|
||||
#define cef_string_from_utf16 cef_string_utf16_to_wide
|
||||
#define cef_string_to_wide cef_string_wide_copy
|
||||
#define cef_string_from_wide cef_string_wide_copy
|
||||
#else
|
||||
#error Please choose a string type.
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_H_
|
88
include/internal/cef_string_list.h
Normal file
88
include/internal/cef_string_list.h
Normal file
@ -0,0 +1,88 @@
|
||||
// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_export.h"
|
||||
#include "include/internal/cef_string.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// CEF string maps are a set of key/value string pairs.
|
||||
///
|
||||
typedef void* cef_string_list_t;
|
||||
|
||||
///
|
||||
// Allocate a new string map.
|
||||
///
|
||||
CEF_EXPORT cef_string_list_t cef_string_list_alloc();
|
||||
|
||||
///
|
||||
// Return the number of elements in the string list.
|
||||
///
|
||||
CEF_EXPORT int cef_string_list_size(cef_string_list_t list);
|
||||
|
||||
///
|
||||
// Retrieve the value at the specified zero-based string list index. Returns
|
||||
// true (1) if the value was successfully retrieved.
|
||||
///
|
||||
CEF_EXPORT int cef_string_list_value(cef_string_list_t list,
|
||||
int index, cef_string_t* value);
|
||||
|
||||
///
|
||||
// Append a new value at the end of the string list.
|
||||
///
|
||||
CEF_EXPORT void cef_string_list_append(cef_string_list_t list,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Clear the string list.
|
||||
///
|
||||
CEF_EXPORT void cef_string_list_clear(cef_string_list_t list);
|
||||
|
||||
///
|
||||
// Free the string list.
|
||||
///
|
||||
CEF_EXPORT void cef_string_list_free(cef_string_list_t list);
|
||||
|
||||
///
|
||||
// Creates a copy of an existing string list.
|
||||
///
|
||||
CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_
|
97
include/internal/cef_string_map.h
Normal file
97
include/internal/cef_string_map.h
Normal file
@ -0,0 +1,97 @@
|
||||
// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_export.h"
|
||||
#include "include/internal/cef_string.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// CEF string maps are a set of key/value string pairs.
|
||||
///
|
||||
typedef void* cef_string_map_t;
|
||||
|
||||
///
|
||||
// Allocate a new string map.
|
||||
///
|
||||
CEF_EXPORT cef_string_map_t cef_string_map_alloc();
|
||||
|
||||
///
|
||||
// Return the number of elements in the string map.
|
||||
///
|
||||
CEF_EXPORT int cef_string_map_size(cef_string_map_t map);
|
||||
|
||||
///
|
||||
// Return the value assigned to the specified key.
|
||||
///
|
||||
CEF_EXPORT int cef_string_map_find(cef_string_map_t map,
|
||||
const cef_string_t* key,
|
||||
cef_string_t* value);
|
||||
|
||||
///
|
||||
// Return the key at the specified zero-based string map index.
|
||||
///
|
||||
CEF_EXPORT int cef_string_map_key(cef_string_map_t map, int index,
|
||||
cef_string_t* key);
|
||||
|
||||
///
|
||||
// Return the value at the specified zero-based string map index.
|
||||
///
|
||||
CEF_EXPORT int cef_string_map_value(cef_string_map_t map, int index,
|
||||
cef_string_t* value);
|
||||
|
||||
///
|
||||
// Append a new key/value pair at the end of the string map.
|
||||
///
|
||||
CEF_EXPORT int cef_string_map_append(cef_string_map_t map,
|
||||
const cef_string_t* key,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Clear the string map.
|
||||
///
|
||||
CEF_EXPORT void cef_string_map_clear(cef_string_map_t map);
|
||||
|
||||
///
|
||||
// Free the string map.
|
||||
///
|
||||
CEF_EXPORT void cef_string_map_free(cef_string_map_t map);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_
|
105
include/internal/cef_string_multimap.h
Normal file
105
include/internal/cef_string_multimap.h
Normal file
@ -0,0 +1,105 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_export.h"
|
||||
#include "include/internal/cef_string.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// CEF string multimaps are a set of key/value string pairs.
|
||||
// More than one value can be assigned to a single key.
|
||||
///
|
||||
typedef void* cef_string_multimap_t;
|
||||
|
||||
///
|
||||
// Allocate a new string multimap.
|
||||
///
|
||||
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc();
|
||||
|
||||
///
|
||||
// Return the number of elements in the string multimap.
|
||||
///
|
||||
CEF_EXPORT int cef_string_multimap_size(cef_string_multimap_t map);
|
||||
|
||||
///
|
||||
// Return the number of values with the specified key.
|
||||
///
|
||||
CEF_EXPORT int cef_string_multimap_find_count(cef_string_multimap_t map,
|
||||
const cef_string_t* key);
|
||||
|
||||
///
|
||||
// Return the value_index-th value with the specified key.
|
||||
///
|
||||
CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map,
|
||||
const cef_string_t* key,
|
||||
int value_index,
|
||||
cef_string_t* value);
|
||||
|
||||
///
|
||||
// Return the key at the specified zero-based string multimap index.
|
||||
///
|
||||
CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, int index,
|
||||
cef_string_t* key);
|
||||
|
||||
///
|
||||
// Return the value at the specified zero-based string multimap index.
|
||||
///
|
||||
CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, int index,
|
||||
cef_string_t* value);
|
||||
|
||||
///
|
||||
// Append a new key/value pair at the end of the string multimap.
|
||||
///
|
||||
CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map,
|
||||
const cef_string_t* key,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Clear the string multimap.
|
||||
///
|
||||
CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map);
|
||||
|
||||
///
|
||||
// Free the string multimap.
|
||||
///
|
||||
CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
|
204
include/internal/cef_string_types.h
Normal file
204
include/internal/cef_string_types.h
Normal file
@ -0,0 +1,204 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_
|
||||
#pragma once
|
||||
|
||||
// CEF provides functions for converting between UTF-8, -16 and -32 strings.
|
||||
// CEF string types are safe for reading from multiple threads but not for
|
||||
// modification. It is the user's responsibility to provide synchronization if
|
||||
// modifying CEF strings from multiple threads.
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/internal/cef_build.h"
|
||||
#include "include/internal/cef_export.h"
|
||||
#include <stddef.h>
|
||||
|
||||
// CEF character type definitions. wchar_t is 2 bytes on Windows and 4 bytes on
|
||||
// most other platforms.
|
||||
|
||||
#if defined(OS_WIN)
|
||||
typedef wchar_t char16;
|
||||
#else // !OS_WIN
|
||||
typedef unsigned short char16; // NOLINT (runtime/int)
|
||||
#ifndef WCHAR_T_IS_UTF32
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // !OS_WIN
|
||||
|
||||
|
||||
// CEF string type definitions. Whomever allocates |str| is responsible for
|
||||
// providing an appropriate |dtor| implementation that will free the string in
|
||||
// the same memory space. When reusing an existing string structure make sure
|
||||
// to call |dtor| for the old value before assigning new |str| and |dtor|
|
||||
// values. Static strings will have a NULL |dtor| value. Using the below
|
||||
// functions if you want this managed for you.
|
||||
|
||||
typedef struct _cef_string_wide_t {
|
||||
wchar_t* str;
|
||||
size_t length;
|
||||
void (*dtor)(wchar_t* str);
|
||||
} cef_string_wide_t;
|
||||
|
||||
typedef struct _cef_string_utf8_t {
|
||||
char* str;
|
||||
size_t length;
|
||||
void (*dtor)(char* str);
|
||||
} cef_string_utf8_t;
|
||||
|
||||
typedef struct _cef_string_utf16_t {
|
||||
char16* str;
|
||||
size_t length;
|
||||
void (*dtor)(char16* str);
|
||||
} cef_string_utf16_t;
|
||||
|
||||
|
||||
///
|
||||
// These functions set string values. If |copy| is true (1) the value will be
|
||||
// copied instead of referenced. It is up to the user to properly manage
|
||||
// the lifespan of references.
|
||||
///
|
||||
|
||||
CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len,
|
||||
cef_string_wide_t* output, int copy);
|
||||
CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len,
|
||||
cef_string_utf8_t* output, int copy);
|
||||
CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len,
|
||||
cef_string_utf16_t* output, int copy);
|
||||
|
||||
|
||||
///
|
||||
// Convenience macros for copying values.
|
||||
///
|
||||
|
||||
#define cef_string_wide_copy(src, src_len, output) \
|
||||
cef_string_wide_set(src, src_len, output, true)
|
||||
#define cef_string_utf8_copy(src, src_len, output) \
|
||||
cef_string_utf8_set(src, src_len, output, true)
|
||||
#define cef_string_utf16_copy(src, src_len, output) \
|
||||
cef_string_utf16_set(src, src_len, output, true)
|
||||
|
||||
|
||||
///
|
||||
// These functions clear string values. The structure itself is not freed.
|
||||
///
|
||||
|
||||
CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str);
|
||||
CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str);
|
||||
CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str);
|
||||
|
||||
|
||||
///
|
||||
// These functions compare two string values with the same results as strcmp().
|
||||
///
|
||||
|
||||
CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1,
|
||||
const cef_string_wide_t* str2);
|
||||
CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1,
|
||||
const cef_string_utf8_t* str2);
|
||||
CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
|
||||
const cef_string_utf16_t* str2);
|
||||
|
||||
|
||||
///
|
||||
// These functions convert between UTF-8, -16, and -32 strings. They are
|
||||
// potentially slow so unnecessary conversions should be avoided. The best
|
||||
// possible result will always be written to |output| with the boolean return
|
||||
// value indicating whether the conversion is 100% valid.
|
||||
///
|
||||
|
||||
CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len,
|
||||
cef_string_utf8_t* output);
|
||||
CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
|
||||
CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len,
|
||||
cef_string_utf16_t* output);
|
||||
CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
|
||||
CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len,
|
||||
cef_string_utf16_t* output);
|
||||
CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len,
|
||||
cef_string_utf8_t* output);
|
||||
|
||||
|
||||
///
|
||||
// These functions convert an ASCII string, typically a hardcoded constant, to a
|
||||
// Wide/UTF16 string. Use instead of the UTF8 conversion routines if you know
|
||||
// the string is ASCII.
|
||||
///
|
||||
|
||||
CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len,
|
||||
cef_string_utf16_t* output);
|
||||
|
||||
|
||||
|
||||
///
|
||||
// It is sometimes necessary for the system to allocate string structures with
|
||||
// the expectation that the user will free them. The userfree types act as a
|
||||
// hint that the user is responsible for freeing the structure.
|
||||
///
|
||||
|
||||
typedef cef_string_wide_t* cef_string_userfree_wide_t;
|
||||
typedef cef_string_utf8_t* cef_string_userfree_utf8_t;
|
||||
typedef cef_string_utf16_t* cef_string_userfree_utf16_t;
|
||||
|
||||
|
||||
///
|
||||
// These functions allocate a new string structure. They must be freed by
|
||||
// calling the associated free function.
|
||||
///
|
||||
|
||||
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc();
|
||||
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc();
|
||||
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc();
|
||||
|
||||
|
||||
///
|
||||
// These functions free the string structure allocated by the associated
|
||||
// alloc function. Any string contents will first be cleared.
|
||||
///
|
||||
|
||||
CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str);
|
||||
CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str);
|
||||
CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_
|
708
include/internal/cef_string_wrappers.h
Normal file
708
include/internal/cef_string_wrappers.h
Normal file
@ -0,0 +1,708 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory.h>
|
||||
#include <string>
|
||||
#include "include/internal/cef_string_types.h"
|
||||
|
||||
#ifdef BUILDING_CEF_SHARED
|
||||
#include "base/string16.h"
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Traits implementation for wide character strings.
|
||||
///
|
||||
struct CefStringTraitsWide {
|
||||
typedef wchar_t char_type;
|
||||
typedef cef_string_wide_t struct_type;
|
||||
typedef cef_string_userfree_wide_t userfree_struct_type;
|
||||
|
||||
static inline void clear(struct_type *s) { cef_string_wide_clear(s); }
|
||||
static inline int set(const char_type* src, size_t src_size,
|
||||
struct_type* output, int copy) {
|
||||
return cef_string_wide_set(src, src_size, output, copy);
|
||||
}
|
||||
static inline int compare(const struct_type* s1, const struct_type* s2) {
|
||||
return cef_string_wide_cmp(s1, s2);
|
||||
}
|
||||
static inline userfree_struct_type userfree_alloc() {
|
||||
return cef_string_userfree_wide_alloc();
|
||||
}
|
||||
static inline void userfree_free(userfree_struct_type ufs) {
|
||||
return cef_string_userfree_wide_free(ufs);
|
||||
}
|
||||
|
||||
// Conversion methods.
|
||||
static inline bool from_ascii(const char* str, size_t len, struct_type *s) {
|
||||
return cef_string_ascii_to_wide(str, len, s) ? true : false;
|
||||
}
|
||||
static inline std::string to_string(const struct_type *s) {
|
||||
cef_string_utf8_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
cef_string_wide_to_utf8(s->str, s->length, &cstr);
|
||||
std::string str;
|
||||
if (cstr.length > 0)
|
||||
str = std::string(cstr.str, cstr.length);
|
||||
cef_string_utf8_clear(&cstr);
|
||||
return str;
|
||||
}
|
||||
static inline bool from_string(const std::string& str, struct_type *s) {
|
||||
return cef_string_utf8_to_wide(str.c_str(), str.length(), s) ? true : false;
|
||||
}
|
||||
static inline std::wstring to_wstring(const struct_type *s) {
|
||||
return std::wstring(s->str, s->length);
|
||||
}
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type *s) {
|
||||
return cef_string_wide_set(str.c_str(), str.length(), s, true) ?
|
||||
true : false;
|
||||
}
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
static inline string16 to_string16(const struct_type *s) {
|
||||
cef_string_utf16_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
cef_string_wide_to_utf16(s->str, s->length, &cstr);
|
||||
string16 str;
|
||||
if (cstr.length > 0)
|
||||
str = string16(cstr.str, cstr.length);
|
||||
cef_string_utf16_clear(&cstr);
|
||||
return str;
|
||||
}
|
||||
static inline bool from_string16(const string16& str, struct_type *s) {
|
||||
return cef_string_utf16_to_wide(str.c_str(), str.length(), s) ?
|
||||
true : false;
|
||||
}
|
||||
#else // WCHAR_T_IS_UTF32
|
||||
static inline string16 to_string16(const struct_type *s) {
|
||||
return string16(s->str, s->length);
|
||||
}
|
||||
static inline bool from_string16(const string16& str, struct_type *s) {
|
||||
return cef_string_wide_set(str.c_str(), str.length(), s, true) ?
|
||||
true : false;
|
||||
}
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
};
|
||||
|
||||
///
|
||||
// Traits implementation for utf8 character strings.
|
||||
///
|
||||
struct CefStringTraitsUTF8 {
|
||||
typedef char char_type;
|
||||
typedef cef_string_utf8_t struct_type;
|
||||
typedef cef_string_userfree_utf8_t userfree_struct_type;
|
||||
|
||||
static inline void clear(struct_type *s) { cef_string_utf8_clear(s); }
|
||||
static inline int set(const char_type* src, size_t src_size,
|
||||
struct_type* output, int copy) {
|
||||
return cef_string_utf8_set(src, src_size, output, copy);
|
||||
}
|
||||
static inline int compare(const struct_type* s1, const struct_type* s2) {
|
||||
return cef_string_utf8_cmp(s1, s2);
|
||||
}
|
||||
static inline userfree_struct_type userfree_alloc() {
|
||||
return cef_string_userfree_utf8_alloc();
|
||||
}
|
||||
static inline void userfree_free(userfree_struct_type ufs) {
|
||||
return cef_string_userfree_utf8_free(ufs);
|
||||
}
|
||||
|
||||
// Conversion methods.
|
||||
static inline bool from_ascii(const char* str, size_t len, struct_type* s) {
|
||||
return cef_string_utf8_copy(str, len, s) ? true : false;
|
||||
}
|
||||
static inline std::string to_string(const struct_type* s) {
|
||||
return std::string(s->str, s->length);
|
||||
}
|
||||
static inline bool from_string(const std::string& str, struct_type* s) {
|
||||
return cef_string_utf8_copy(str.c_str(), str.length(), s) ? true : false;
|
||||
}
|
||||
static inline std::wstring to_wstring(const struct_type* s) {
|
||||
cef_string_wide_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
cef_string_utf8_to_wide(s->str, s->length, &cstr);
|
||||
std::wstring str;
|
||||
if (cstr.length > 0)
|
||||
str = std::wstring(cstr.str, cstr.length);
|
||||
cef_string_wide_clear(&cstr);
|
||||
return str;
|
||||
}
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
|
||||
return cef_string_wide_to_utf8(str.c_str(), str.length(), s) ? true : false;
|
||||
}
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
static inline string16 to_string16(const struct_type* s) {
|
||||
cef_string_utf16_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
cef_string_utf8_to_utf16(s->str, s->length, &cstr);
|
||||
string16 str;
|
||||
if (cstr.length > 0)
|
||||
str = string16(cstr.str, cstr.length);
|
||||
cef_string_utf16_clear(&cstr);
|
||||
return str;
|
||||
}
|
||||
static inline bool from_string16(const string16& str, struct_type* s) {
|
||||
return cef_string_utf16_to_utf8(str.c_str(), str.length(), s) ?
|
||||
true : false;
|
||||
}
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
};
|
||||
|
||||
///
|
||||
// Traits implementation for utf16 character strings.
|
||||
///
|
||||
struct CefStringTraitsUTF16 {
|
||||
typedef char16 char_type;
|
||||
typedef cef_string_utf16_t struct_type;
|
||||
typedef cef_string_userfree_utf16_t userfree_struct_type;
|
||||
|
||||
static inline void clear(struct_type *s) { cef_string_utf16_clear(s); }
|
||||
static inline int set(const char_type* src, size_t src_size,
|
||||
struct_type* output, int copy) {
|
||||
return cef_string_utf16_set(src, src_size, output, copy);
|
||||
}
|
||||
static inline int compare(const struct_type* s1, const struct_type* s2) {
|
||||
return cef_string_utf16_cmp(s1, s2);
|
||||
}
|
||||
static inline userfree_struct_type userfree_alloc() {
|
||||
return cef_string_userfree_utf16_alloc();
|
||||
}
|
||||
static inline void userfree_free(userfree_struct_type ufs) {
|
||||
return cef_string_userfree_utf16_free(ufs);
|
||||
}
|
||||
|
||||
// Conversion methods.
|
||||
static inline bool from_ascii(const char* str, size_t len, struct_type* s) {
|
||||
return cef_string_ascii_to_utf16(str, len, s) ? true : false;
|
||||
}
|
||||
static inline std::string to_string(const struct_type* s) {
|
||||
cef_string_utf8_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
cef_string_utf16_to_utf8(s->str, s->length, &cstr);
|
||||
std::string str;
|
||||
if (cstr.length > 0)
|
||||
str = std::string(cstr.str, cstr.length);
|
||||
cef_string_utf8_clear(&cstr);
|
||||
return str;
|
||||
}
|
||||
static inline bool from_string(const std::string& str, struct_type* s) {
|
||||
return cef_string_utf8_to_utf16(str.c_str(), str.length(), s) ?
|
||||
true : false;
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
static inline std::wstring to_wstring(const struct_type* s) {
|
||||
cef_string_wide_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
cef_string_utf16_to_wide(s->str, s->length, &cstr);
|
||||
std::wstring str;
|
||||
if (cstr.length > 0)
|
||||
str = std::wstring(cstr.str, cstr.length);
|
||||
cef_string_wide_clear(&cstr);
|
||||
return str;
|
||||
}
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
|
||||
return cef_string_wide_to_utf16(str.c_str(), str.length(), s) ?
|
||||
true : false;
|
||||
}
|
||||
#else // WCHAR_T_IS_UTF32
|
||||
static inline std::wstring to_wstring(const struct_type* s) {
|
||||
return std::wstring(s->str, s->length);
|
||||
}
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
|
||||
return cef_string_utf16_set(str.c_str(), str.length(), s, true) ?
|
||||
true : false;
|
||||
}
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
static inline string16 to_string16(const struct_type* s) {
|
||||
return string16(s->str, s->length);
|
||||
}
|
||||
static inline bool from_string16(const string16& str, struct_type* s) {
|
||||
return cef_string_utf16_set(str.c_str(), str.length(), s, true) ?
|
||||
true : false;
|
||||
}
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
};
|
||||
|
||||
///
|
||||
// CEF string classes can convert between all supported string types. For
|
||||
// example, the CefStringWide class uses wchar_t as the underlying character
|
||||
// type and provides two approaches for converting data to/from a UTF8 string
|
||||
// (std::string).
|
||||
// <p>
|
||||
// 1. Implicit conversion using the assignment operator overload.
|
||||
// <pre>
|
||||
// CefStringWide aCefString;
|
||||
// std::string aUTF8String;
|
||||
// aCefString = aUTF8String; // Assign std::string to CefStringWide
|
||||
// aUTF8String = aCefString; // Assign CefStringWide to std::string
|
||||
// </pre>
|
||||
// 2. Explicit conversion using the FromString/ToString methods.
|
||||
// <pre>
|
||||
// CefStringWide aCefString;
|
||||
// std::string aUTF8String;
|
||||
// aCefString.FromString(aUTF8String); // Assign std::string to CefStringWide
|
||||
// aUTF8String = aCefString.ToString(); // Assign CefStringWide to std::string
|
||||
// </pre>
|
||||
// Conversion will only occur if the assigned value is a different string type.
|
||||
// Assigning a std::string to a CefStringUTF8, for example, will copy the data
|
||||
// without performing a conversion.
|
||||
// </p>
|
||||
// CEF string classes are safe for reading from multiple threads but not for
|
||||
// modification. It is the user's responsibility to provide synchronization if
|
||||
// modifying CEF strings from multiple threads.
|
||||
///
|
||||
template <class traits>
|
||||
class CefStringBase {
|
||||
public:
|
||||
typedef typename traits::char_type char_type;
|
||||
typedef typename traits::struct_type struct_type;
|
||||
typedef typename traits::userfree_struct_type userfree_struct_type;
|
||||
|
||||
///
|
||||
// Default constructor.
|
||||
///
|
||||
CefStringBase() : string_(NULL), owner_(false) {}
|
||||
|
||||
///
|
||||
// Create a new string from an existing string. Data will always be copied.
|
||||
///
|
||||
CefStringBase(const CefStringBase& str)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromString(str.c_str(), str.length(), true);
|
||||
}
|
||||
|
||||
///
|
||||
// Create a new string from an existing std::string. Data will be always
|
||||
// copied. Translation will occur if necessary based on the underlying string
|
||||
// type.
|
||||
///
|
||||
CefStringBase(const std::string& src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromString(src);
|
||||
}
|
||||
CefStringBase(const char* src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromString(std::string(src));
|
||||
}
|
||||
|
||||
///
|
||||
// Create a new string from an existing std::wstring. Data will be always
|
||||
// copied. Translation will occur if necessary based on the underlying string
|
||||
// type.
|
||||
///
|
||||
CefStringBase(const std::wstring& src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromWString(src);
|
||||
}
|
||||
CefStringBase(const wchar_t* src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromWString(std::wstring(src));
|
||||
}
|
||||
|
||||
#if (defined(BUILDING_CEF_SHARED) && defined(WCHAR_T_IS_UTF32))
|
||||
///
|
||||
// Create a new string from an existing string16. Data will be always
|
||||
// copied. Translation will occur if necessary based on the underlying string
|
||||
// type.
|
||||
///
|
||||
CefStringBase(const string16& src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromString16(src);
|
||||
}
|
||||
CefStringBase(const char16* src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromString16(string16(src));
|
||||
}
|
||||
#endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
|
||||
|
||||
///
|
||||
// Create a new string from an existing character array. If |copy| is true
|
||||
// this class will copy the data. Otherwise, this class will reference the
|
||||
// existing data. Referenced data must exist for the lifetime of this class
|
||||
// and will not be freed by this class.
|
||||
///
|
||||
CefStringBase(const char_type* src, size_t src_len, bool copy)
|
||||
: string_(NULL), owner_(false) {
|
||||
FromString(src, src_len, copy);
|
||||
}
|
||||
|
||||
///
|
||||
// Create a new string referencing an existing string structure without taking
|
||||
// ownership. Referenced structures must exist for the lifetime of this class
|
||||
// and will not be freed by this class.
|
||||
///
|
||||
CefStringBase(const struct_type* src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
if (!src)
|
||||
return;
|
||||
// Reference the existing structure without taking ownership.
|
||||
Attach(const_cast<struct_type*>(src), false);
|
||||
}
|
||||
|
||||
virtual ~CefStringBase() { ClearAndFree(); }
|
||||
|
||||
|
||||
// The following methods are named for compatibility with the standard library
|
||||
// string template types.
|
||||
|
||||
///
|
||||
// Return a read-only pointer to the string data.
|
||||
///
|
||||
const char_type* c_str() const { return (string_ ? string_->str : NULL); }
|
||||
|
||||
///
|
||||
// Return the length of the string data.
|
||||
///
|
||||
size_t length() const { return (string_ ? string_->length : 0); }
|
||||
|
||||
///
|
||||
// Return the length of the string data.
|
||||
///
|
||||
inline size_t size() const { return length(); }
|
||||
|
||||
///
|
||||
// Returns true if the string is empty.
|
||||
///
|
||||
bool empty() const { return (string_ == NULL || string_->length == 0); }
|
||||
|
||||
///
|
||||
// Compare this string to the specified string.
|
||||
///
|
||||
int compare(const CefStringBase& str) const {
|
||||
if (empty() && str.empty())
|
||||
return 0;
|
||||
if (empty())
|
||||
return -1;
|
||||
if (str.empty())
|
||||
return 1;
|
||||
return traits::compare(string_, str.GetStruct());
|
||||
}
|
||||
|
||||
///
|
||||
// Clear the string data.
|
||||
///
|
||||
void clear() {
|
||||
if (!empty())
|
||||
traits::clear(string_);
|
||||
}
|
||||
|
||||
|
||||
// The following methods are unique to CEF string template types.
|
||||
|
||||
///
|
||||
// Returns true if this class owns the underlying string structure.
|
||||
///
|
||||
bool IsOwner() const { return owner_; }
|
||||
|
||||
///
|
||||
// Returns a read-only pointer to the underlying string structure. May return
|
||||
// NULL if no structure is currently allocated.
|
||||
///
|
||||
const struct_type* GetStruct() const { return string_; }
|
||||
|
||||
///
|
||||
// Returns a writable pointer to the underlying string structure. Will never
|
||||
// return NULL.
|
||||
///
|
||||
struct_type* GetWritableStruct() {
|
||||
AllocIfNeeded();
|
||||
return string_;
|
||||
}
|
||||
|
||||
///
|
||||
// Clear the state of this class. The underlying string structure and data
|
||||
// will be freed if this class owns the structure.
|
||||
///
|
||||
void ClearAndFree() {
|
||||
if (!string_)
|
||||
return;
|
||||
if (owner_) {
|
||||
clear();
|
||||
delete string_;
|
||||
}
|
||||
string_ = NULL;
|
||||
owner_ = false;
|
||||
}
|
||||
|
||||
///
|
||||
// Attach to the specified string structure. If |owner| is true this class
|
||||
// will take ownership of the structure.
|
||||
///
|
||||
void Attach(struct_type* str, bool owner) {
|
||||
// Free the previous structure and data, if any.
|
||||
ClearAndFree();
|
||||
|
||||
string_ = str;
|
||||
owner_ = owner;
|
||||
}
|
||||
|
||||
///
|
||||
// Take ownership of the specified userfree structure's string data. The
|
||||
// userfree structure itself will be freed. Only use this method with userfree
|
||||
// structures.
|
||||
///
|
||||
void AttachToUserFree(userfree_struct_type str) {
|
||||
// Free the previous structure and data, if any.
|
||||
ClearAndFree();
|
||||
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
AllocIfNeeded();
|
||||
owner_ = true;
|
||||
memcpy(string_, str, sizeof(struct_type));
|
||||
|
||||
// Free the |str| structure but not the data.
|
||||
memset(str, 0, sizeof(struct_type));
|
||||
traits::userfree_free(str);
|
||||
}
|
||||
|
||||
///
|
||||
// Detach from the underlying string structure. To avoid memory leaks only use
|
||||
// this method if you already hold a pointer to the underlying string
|
||||
// structure.
|
||||
///
|
||||
void Detach() {
|
||||
string_ = NULL;
|
||||
owner_ = false;
|
||||
}
|
||||
|
||||
///
|
||||
// Create a userfree structure and give it ownership of this class' string
|
||||
// data. This class will be disassociated from the data. May return NULL if
|
||||
// this string class currently contains no data.
|
||||
///
|
||||
userfree_struct_type DetachToUserFree() {
|
||||
if (empty())
|
||||
return NULL;
|
||||
|
||||
userfree_struct_type str = traits::userfree_alloc();
|
||||
memcpy(str, string_, sizeof(struct_type));
|
||||
|
||||
// Free this class' structure but not the data.
|
||||
memset(string_, 0, sizeof(struct_type));
|
||||
ClearAndFree();
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
///
|
||||
// Set this string's data to the specified character array. If |copy| is true
|
||||
// this class will copy the data. Otherwise, this class will reference the
|
||||
// existing data. Referenced data must exist for the lifetime of this class
|
||||
// and will not be freed by this class.
|
||||
///
|
||||
bool FromString(const char_type* src, size_t src_len, bool copy) {
|
||||
if (src == NULL || src_len == 0) {
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
AllocIfNeeded();
|
||||
return traits::set(src, src_len, string_, copy) ? true : false;
|
||||
}
|
||||
|
||||
///
|
||||
// Set this string's data from an existing ASCII string. Data will be always
|
||||
// copied. Translation will occur if necessary based on the underlying string
|
||||
// type.
|
||||
///
|
||||
bool FromASCII(const char* str) {
|
||||
size_t len = str ? strlen(str) : 0;
|
||||
if (len == 0) {
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
AllocIfNeeded();
|
||||
return traits::from_ascii(str, len, string_);
|
||||
}
|
||||
|
||||
///
|
||||
// Return this string's data as a std::string. Translation will occur if
|
||||
// necessary based on the underlying string type.
|
||||
///
|
||||
std::string ToString() const {
|
||||
if (empty())
|
||||
return std::string();
|
||||
return traits::to_string(string_);
|
||||
}
|
||||
|
||||
///
|
||||
// Set this string's data from an existing std::string. Data will be always
|
||||
// copied. Translation will occur if necessary based on the underlying string
|
||||
// type.
|
||||
///
|
||||
bool FromString(const std::string& str) {
|
||||
if (str.empty()) {
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
AllocIfNeeded();
|
||||
return traits::from_string(str, string_);
|
||||
}
|
||||
|
||||
///
|
||||
// Return this string's data as a std::wstring. Translation will occur if
|
||||
// necessary based on the underlying string type.
|
||||
///
|
||||
std::wstring ToWString() const {
|
||||
if (empty())
|
||||
return std::wstring();
|
||||
return traits::to_wstring(string_);
|
||||
}
|
||||
|
||||
///
|
||||
// Set this string's data from an existing std::wstring. Data will be always
|
||||
// copied. Translation will occur if necessary based on the underlying string
|
||||
// type.
|
||||
///
|
||||
bool FromWString(const std::wstring& str) {
|
||||
if (str.empty()) {
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
AllocIfNeeded();
|
||||
return traits::from_wstring(str, string_);
|
||||
}
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
///
|
||||
// Return this string's data as a string16. Translation will occur if
|
||||
// necessary based on the underlying string type.
|
||||
///
|
||||
string16 ToString16() const {
|
||||
if (empty())
|
||||
return string16();
|
||||
return traits::to_string16(string_);
|
||||
}
|
||||
|
||||
///
|
||||
// Set this string's data from an existing string16. Data will be always
|
||||
// copied. Translation will occur if necessary based on the underlying string
|
||||
// type.
|
||||
///
|
||||
bool FromString16(const string16& str) {
|
||||
if (str.empty()) {
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
AllocIfNeeded();
|
||||
return traits::from_string16(str, string_);
|
||||
}
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
|
||||
///
|
||||
// Comparison operator overloads.
|
||||
///
|
||||
bool operator<(const CefStringBase& str) const {
|
||||
return (compare(str) < 0);
|
||||
}
|
||||
bool operator<=(const CefStringBase& str) const {
|
||||
return (compare(str) <= 0);
|
||||
}
|
||||
bool operator>(const CefStringBase& str) const {
|
||||
return (compare(str) > 0);
|
||||
}
|
||||
bool operator>=(const CefStringBase& str) const {
|
||||
return (compare(str) >= 0);
|
||||
}
|
||||
bool operator==(const CefStringBase& str) const {
|
||||
return (compare(str) == 0);
|
||||
}
|
||||
bool operator!=(const CefStringBase& str) const {
|
||||
return (compare(str) != 0);
|
||||
}
|
||||
|
||||
///
|
||||
// Assignment operator overloads.
|
||||
///
|
||||
CefStringBase& operator=(const CefStringBase& str) {
|
||||
FromString(str.c_str(), str.length(), true);
|
||||
return *this;
|
||||
}
|
||||
operator std::string() const {
|
||||
return ToString();
|
||||
}
|
||||
CefStringBase& operator=(const std::string& str) {
|
||||
FromString(str);
|
||||
return *this;
|
||||
}
|
||||
CefStringBase& operator=(const char* str) {
|
||||
FromString(std::string(str));
|
||||
return *this;
|
||||
}
|
||||
operator std::wstring() const {
|
||||
return ToWString();
|
||||
}
|
||||
CefStringBase& operator=(const std::wstring& str) {
|
||||
FromWString(str);
|
||||
return *this;
|
||||
}
|
||||
CefStringBase& operator=(const wchar_t* str) {
|
||||
FromWString(std::wstring(str));
|
||||
return *this;
|
||||
}
|
||||
#if (defined(BUILDING_CEF_SHARED) && defined(WCHAR_T_IS_UTF32))
|
||||
operator string16() const {
|
||||
return ToString16();
|
||||
}
|
||||
CefStringBase& operator=(const string16& str) {
|
||||
FromString16(str);
|
||||
return *this;
|
||||
}
|
||||
CefStringBase& operator=(const char16* str) {
|
||||
FromString16(string16(str));
|
||||
return *this;
|
||||
}
|
||||
#endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
|
||||
|
||||
private:
|
||||
// Allocate the string structure if it doesn't already exist.
|
||||
void AllocIfNeeded() {
|
||||
if (string_ == NULL) {
|
||||
string_ = new struct_type;
|
||||
memset(string_, 0, sizeof(struct_type));
|
||||
owner_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
struct_type* string_;
|
||||
bool owner_;
|
||||
};
|
||||
|
||||
|
||||
typedef CefStringBase<CefStringTraitsWide> CefStringWide;
|
||||
typedef CefStringBase<CefStringTraitsUTF8> CefStringUTF8;
|
||||
typedef CefStringBase<CefStringTraitsUTF16> CefStringUTF16;
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_
|
78
include/internal/cef_time.h
Normal file
78
include/internal/cef_time.h
Normal file
@ -0,0 +1,78 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_TIME_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_TIME_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/internal/cef_export.h"
|
||||
#include <time.h>
|
||||
|
||||
///
|
||||
// Time information. Values should always be in UTC.
|
||||
///
|
||||
typedef struct _cef_time_t {
|
||||
int year; // Four digit year "2007"
|
||||
int month; // 1-based month (values 1 = January, etc.)
|
||||
#if !defined(OS_MACOSX)
|
||||
int day_of_week; // 0-based day of week (0 = Sunday, etc.)
|
||||
#endif
|
||||
int day_of_month; // 1-based day of month (1-31)
|
||||
int hour; // Hour within the current day (0-23)
|
||||
int minute; // Minute within the current hour (0-59)
|
||||
int second; // Second within the current minute (0-59 plus leap
|
||||
// seconds which may take it up to 60).
|
||||
int millisecond; // Milliseconds within the current second (0-999)
|
||||
} cef_time_t;
|
||||
|
||||
///
|
||||
// Converts cef_time_t to/from time_t. Returns true (1) on success and false (0)
|
||||
// on failure.
|
||||
///
|
||||
CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time);
|
||||
CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time);
|
||||
|
||||
///
|
||||
// Converts cef_time_t to/from a double which is the number of seconds since
|
||||
// epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0
|
||||
// means "not initialized". Returns true (1) on success and false (0) on
|
||||
// failure.
|
||||
///
|
||||
CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time);
|
||||
CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TIME_H_
|
1082
include/internal/cef_tuple.h
Normal file
1082
include/internal/cef_tuple.h
Normal file
File diff suppressed because it is too large
Load Diff
858
include/internal/cef_types.h
Normal file
858
include/internal/cef_types.h
Normal file
@ -0,0 +1,858 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_build.h"
|
||||
#include "include/internal/cef_string.h"
|
||||
#include "include/internal/cef_string_list.h"
|
||||
#include "include/internal/cef_time.h"
|
||||
|
||||
// Bring in platform-specific definitions.
|
||||
#if defined(OS_WIN)
|
||||
#include "include/internal/cef_types_win.h"
|
||||
#elif defined(OS_MACOSX)
|
||||
#include "include/internal/cef_types_mac.h"
|
||||
#elif defined(OS_LINUX)
|
||||
#include "include/internal/cef_types_linux.h"
|
||||
#endif
|
||||
|
||||
#include <stddef.h> // For size_t
|
||||
|
||||
// The NSPR system headers define 64-bit as |long| when possible, except on
|
||||
// Mac OS X. In order to not have typedef mismatches, we do the same on LP64.
|
||||
//
|
||||
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
|
||||
// <inttypes.h> format macros even in the LP64 model.
|
||||
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
|
||||
typedef long int64; // NOLINT(runtime/int)
|
||||
typedef unsigned long uint64; // NOLINT(runtime/int)
|
||||
#else
|
||||
typedef long long int64; // NOLINT(runtime/int)
|
||||
typedef unsigned long long uint64; // NOLINT(runtime/int)
|
||||
#endif
|
||||
|
||||
// TODO: Remove these type guards. These are to avoid conflicts with
|
||||
// obsolete/protypes.h in the Gecko SDK.
|
||||
#ifndef _INT32
|
||||
#define _INT32
|
||||
typedef int int32;
|
||||
#endif
|
||||
|
||||
// TODO: Remove these type guards. These are to avoid conflicts with
|
||||
// obsolete/protypes.h in the Gecko SDK.
|
||||
#ifndef _UINT32
|
||||
#define _UINT32
|
||||
typedef unsigned int uint32;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Log severity levels.
|
||||
///
|
||||
enum cef_log_severity_t {
|
||||
LOGSEVERITY_VERBOSE = -1,
|
||||
LOGSEVERITY_INFO,
|
||||
LOGSEVERITY_WARNING,
|
||||
LOGSEVERITY_ERROR,
|
||||
LOGSEVERITY_ERROR_REPORT,
|
||||
// Disables logging completely.
|
||||
LOGSEVERITY_DISABLE = 99
|
||||
};
|
||||
|
||||
///
|
||||
// Initialization settings. Specify NULL or 0 to get the recommended default
|
||||
// values.
|
||||
///
|
||||
typedef struct _cef_settings_t {
|
||||
///
|
||||
// Size of this structure.
|
||||
///
|
||||
size_t size;
|
||||
|
||||
///
|
||||
// Set to true (1) to use a single process for the browser and renderer. This
|
||||
// run mode is not officially supported by Chromium and is less stable than
|
||||
// the multi-process default.
|
||||
///
|
||||
bool single_process;
|
||||
|
||||
///
|
||||
// The path to a separate executable that will be launched for sub-processes.
|
||||
// By default the browser process executable is used. See the comments on
|
||||
// CefExecuteProcess() for details.
|
||||
///
|
||||
cef_string_t browser_subprocess_path;
|
||||
|
||||
///
|
||||
// Set to true (1) to have the browser process message loop run in a separate
|
||||
// thread. If false (0) than the CefDoMessageLoopWork() function must be
|
||||
// called from your application message loop.
|
||||
///
|
||||
bool multi_threaded_message_loop;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable configuration of browser process features using
|
||||
// standard CEF and Chromium command-line arguments. Configuration can still
|
||||
// be specified using CEF data structures or via the
|
||||
// CefApp::OnBeforeCommandLineProcessing() method.
|
||||
///
|
||||
bool command_line_args_disabled;
|
||||
|
||||
///
|
||||
// The location where cache data will be stored on disk. If empty an in-memory
|
||||
// cache will be used. HTML5 databases such as localStorage will only persist
|
||||
// across sessions if a cache path is specified.
|
||||
///
|
||||
cef_string_t cache_path;
|
||||
|
||||
///
|
||||
// Value that will be returned as the User-Agent HTTP header. If empty the
|
||||
// default User-Agent string will be used.
|
||||
///
|
||||
cef_string_t user_agent;
|
||||
|
||||
///
|
||||
// Value that will be inserted as the product portion of the default
|
||||
// User-Agent string. If empty the Chromium product version will be used. If
|
||||
// |userAgent| is specified this value will be ignored.
|
||||
///
|
||||
cef_string_t product_version;
|
||||
|
||||
///
|
||||
// The locale string that will be passed to WebKit. If empty the default
|
||||
// locale of "en-US" will be used. This value is ignored on Linux where locale
|
||||
// is determined using environment variable parsing with the precedence order:
|
||||
// LANGUAGE, LC_ALL, LC_MESSAGES and LANG.
|
||||
///
|
||||
cef_string_t locale;
|
||||
|
||||
///
|
||||
// List of fully qualified paths to plugins (including plugin name) that will
|
||||
// be loaded in addition to any plugins found in the default search paths.
|
||||
///
|
||||
cef_string_list_t extra_plugin_paths;
|
||||
|
||||
///
|
||||
// The directory and file name to use for the debug log. If empty, the
|
||||
// default name of "debug.log" will be used and the file will be written
|
||||
// to the application directory.
|
||||
///
|
||||
cef_string_t log_file;
|
||||
|
||||
///
|
||||
// The log severity. Only messages of this severity level or higher will be
|
||||
// logged.
|
||||
///
|
||||
cef_log_severity_t log_severity;
|
||||
|
||||
///
|
||||
// The graphics implementation that CEF will use for rendering GPU accelerated
|
||||
// content like WebGL, accelerated layers and 3D CSS.
|
||||
///
|
||||
cef_graphics_implementation_t graphics_implementation;
|
||||
|
||||
///
|
||||
// Quota limit for localStorage data across all origins. Default size is 5MB.
|
||||
///
|
||||
unsigned int local_storage_quota;
|
||||
|
||||
///
|
||||
// Quota limit for sessionStorage data per namespace. Default size is 5MB.
|
||||
///
|
||||
unsigned int session_storage_quota;
|
||||
|
||||
///
|
||||
// Custom flags that will be used when initializing the V8 JavaScript engine.
|
||||
// The consequences of using custom flags may not be well tested.
|
||||
///
|
||||
cef_string_t javascript_flags;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
///
|
||||
// Set to true (1) to use the system proxy resolver on Windows when
|
||||
// "Automatically detect settings" is checked. This setting is disabled
|
||||
// by default for performance reasons.
|
||||
///
|
||||
bool auto_detect_proxy_settings_enabled;
|
||||
#endif
|
||||
|
||||
///
|
||||
// The fully qualified path for the cef.pak file. If this value is empty
|
||||
// the cef.pak file must be located in the module directory. This value is
|
||||
// ignored on Mac OS X where pack files are always loaded from the app bundle
|
||||
// resource directory.
|
||||
///
|
||||
cef_string_t pack_file_path;
|
||||
|
||||
///
|
||||
// The fully qualified path for the locales directory. If this value is empty
|
||||
// the locales directory must be located in the module directory. This value
|
||||
// is ignored on Mac OS X where pack files are always loaded from the app
|
||||
// bundle resource directory.
|
||||
///
|
||||
cef_string_t locales_dir_path;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable loading of pack files for resources and locales.
|
||||
// A resource bundle handler must be provided for the browser and render
|
||||
// processes via CefApp::GetResourceBundleHandler() if loading of pack files
|
||||
// is disabled.
|
||||
///
|
||||
bool pack_loading_disabled;
|
||||
} cef_settings_t;
|
||||
|
||||
///
|
||||
// Browser initialization settings. Specify NULL or 0 to get the recommended
|
||||
// default values. The consequences of using custom values may not be well
|
||||
// tested.
|
||||
///
|
||||
typedef struct _cef_browser_settings_t {
|
||||
///
|
||||
// Size of this structure.
|
||||
///
|
||||
size_t size;
|
||||
|
||||
///
|
||||
// Disable drag & drop of URLs from other windows.
|
||||
///
|
||||
bool drag_drop_disabled;
|
||||
|
||||
///
|
||||
// Disable default navigation resulting from drag & drop of URLs.
|
||||
///
|
||||
bool load_drops_disabled;
|
||||
|
||||
///
|
||||
// Disable history back/forward navigation.
|
||||
///
|
||||
bool history_disabled;
|
||||
|
||||
// The below values map to WebPreferences settings.
|
||||
|
||||
///
|
||||
// Font settings.
|
||||
///
|
||||
cef_string_t standard_font_family;
|
||||
cef_string_t fixed_font_family;
|
||||
cef_string_t serif_font_family;
|
||||
cef_string_t sans_serif_font_family;
|
||||
cef_string_t cursive_font_family;
|
||||
cef_string_t fantasy_font_family;
|
||||
int default_font_size;
|
||||
int default_fixed_font_size;
|
||||
int minimum_font_size;
|
||||
int minimum_logical_font_size;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable loading of fonts from remote sources.
|
||||
///
|
||||
bool remote_fonts_disabled;
|
||||
|
||||
///
|
||||
// Default encoding for Web content. If empty "ISO-8859-1" will be used.
|
||||
///
|
||||
cef_string_t default_encoding;
|
||||
|
||||
///
|
||||
// Set to true (1) to attempt automatic detection of content encoding.
|
||||
///
|
||||
bool encoding_detector_enabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable JavaScript.
|
||||
///
|
||||
bool javascript_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disallow JavaScript from opening windows.
|
||||
///
|
||||
bool javascript_open_windows_disallowed;
|
||||
|
||||
///
|
||||
// Set to true (1) to disallow JavaScript from closing windows.
|
||||
///
|
||||
bool javascript_close_windows_disallowed;
|
||||
|
||||
///
|
||||
// Set to true (1) to disallow JavaScript from accessing the clipboard.
|
||||
///
|
||||
bool javascript_access_clipboard_disallowed;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable DOM pasting in the editor. DOM pasting also
|
||||
// depends on |javascript_cannot_access_clipboard| being false (0).
|
||||
///
|
||||
bool dom_paste_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to enable drawing of the caret position.
|
||||
///
|
||||
bool caret_browsing_enabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable Java.
|
||||
///
|
||||
bool java_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable plugins.
|
||||
///
|
||||
bool plugins_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to allow access to all URLs from file URLs.
|
||||
///
|
||||
bool universal_access_from_file_urls_allowed;
|
||||
|
||||
///
|
||||
// Set to true (1) to allow access to file URLs from other file URLs.
|
||||
///
|
||||
bool file_access_from_file_urls_allowed;
|
||||
|
||||
///
|
||||
// Set to true (1) to allow risky security behavior such as cross-site
|
||||
// scripting (XSS). Use with extreme care.
|
||||
///
|
||||
bool web_security_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to enable console warnings about XSS attempts.
|
||||
///
|
||||
bool xss_auditor_enabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to suppress the network load of image URLs. A cached
|
||||
// image will still be rendered if requested.
|
||||
///
|
||||
bool image_load_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to shrink standalone images to fit the page.
|
||||
///
|
||||
bool shrink_standalone_images_to_fit;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable browser backwards compatibility features.
|
||||
///
|
||||
bool site_specific_quirks_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable resize of text areas.
|
||||
///
|
||||
bool text_area_resize_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable use of the page cache.
|
||||
///
|
||||
bool page_cache_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to not have the tab key advance focus to links.
|
||||
///
|
||||
bool tab_to_links_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable hyperlink pings (<a ping> and window.sendPing).
|
||||
///
|
||||
bool hyperlink_auditing_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to enable the user style sheet for all pages.
|
||||
///
|
||||
bool user_style_sheet_enabled;
|
||||
|
||||
///
|
||||
// Location of the user style sheet. This must be a data URL of the form
|
||||
// "data:text/css;charset=utf-8;base64,csscontent" where "csscontent" is the
|
||||
// base64 encoded contents of the CSS file.
|
||||
///
|
||||
cef_string_t user_style_sheet_location;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable style sheets.
|
||||
///
|
||||
bool author_and_user_styles_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable local storage.
|
||||
///
|
||||
bool local_storage_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable databases.
|
||||
///
|
||||
bool databases_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable application cache.
|
||||
///
|
||||
bool application_cache_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable WebGL.
|
||||
///
|
||||
bool webgl_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable accelerated compositing.
|
||||
///
|
||||
bool accelerated_compositing_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable accelerated layers. This affects features like
|
||||
// 3D CSS transforms.
|
||||
///
|
||||
bool accelerated_layers_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable accelerated video.
|
||||
///
|
||||
bool accelerated_video_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable accelerated 2d canvas.
|
||||
///
|
||||
bool accelerated_2d_canvas_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to enable accelerated painting.
|
||||
///
|
||||
bool accelerated_painting_enabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to enable accelerated filters.
|
||||
///
|
||||
bool accelerated_filters_enabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable accelerated plugins.
|
||||
///
|
||||
bool accelerated_plugins_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable developer tools (WebKit inspector).
|
||||
///
|
||||
bool developer_tools_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to enable fullscreen mode.
|
||||
///
|
||||
bool fullscreen_enabled;
|
||||
} cef_browser_settings_t;
|
||||
|
||||
///
|
||||
// URL component parts.
|
||||
///
|
||||
typedef struct _cef_urlparts_t {
|
||||
///
|
||||
// The complete URL specification.
|
||||
///
|
||||
cef_string_t spec;
|
||||
|
||||
///
|
||||
// Scheme component not including the colon (e.g., "http").
|
||||
///
|
||||
cef_string_t scheme;
|
||||
|
||||
///
|
||||
// User name component.
|
||||
///
|
||||
cef_string_t username;
|
||||
|
||||
///
|
||||
// Password component.
|
||||
///
|
||||
cef_string_t password;
|
||||
|
||||
///
|
||||
// Host component. This may be a hostname, an IPv4 address or an IPv6 literal
|
||||
// surrounded by square brackets (e.g., "[2001:db8::1]").
|
||||
///
|
||||
cef_string_t host;
|
||||
|
||||
///
|
||||
// Port number component.
|
||||
///
|
||||
cef_string_t port;
|
||||
|
||||
///
|
||||
// Path component including the first slash following the host.
|
||||
///
|
||||
cef_string_t path;
|
||||
|
||||
///
|
||||
// Query string component (i.e., everything following the '?').
|
||||
///
|
||||
cef_string_t query;
|
||||
} cef_urlparts_t;
|
||||
|
||||
///
|
||||
// Cookie information.
|
||||
///
|
||||
typedef struct _cef_cookie_t {
|
||||
///
|
||||
// The cookie name.
|
||||
///
|
||||
cef_string_t name;
|
||||
|
||||
///
|
||||
// The cookie value.
|
||||
///
|
||||
cef_string_t value;
|
||||
|
||||
///
|
||||
// If |domain| is empty a host cookie will be created instead of a domain
|
||||
// cookie. Domain cookies are stored with a leading "." and are visible to
|
||||
// sub-domains whereas host cookies are not.
|
||||
///
|
||||
cef_string_t domain;
|
||||
|
||||
///
|
||||
// If |path| is non-empty only URLs at or below the path will get the cookie
|
||||
// value.
|
||||
///
|
||||
cef_string_t path;
|
||||
|
||||
///
|
||||
// If |secure| is true the cookie will only be sent for HTTPS requests.
|
||||
///
|
||||
bool secure;
|
||||
|
||||
///
|
||||
// If |httponly| is true the cookie will only be sent for HTTP requests.
|
||||
///
|
||||
bool httponly;
|
||||
|
||||
///
|
||||
// The cookie creation date. This is automatically populated by the system on
|
||||
// cookie creation.
|
||||
///
|
||||
cef_time_t creation;
|
||||
|
||||
///
|
||||
// The cookie last access date. This is automatically populated by the system
|
||||
// on access.
|
||||
///
|
||||
cef_time_t last_access;
|
||||
|
||||
///
|
||||
// The cookie expiration date is only valid if |has_expires| is true.
|
||||
///
|
||||
bool has_expires;
|
||||
cef_time_t expires;
|
||||
} cef_cookie_t;
|
||||
|
||||
///
|
||||
// Storage types.
|
||||
///
|
||||
enum cef_storage_type_t {
|
||||
ST_LOCALSTORAGE = 0,
|
||||
ST_SESSIONSTORAGE,
|
||||
};
|
||||
|
||||
///
|
||||
// Supported error code values. See net\base\net_error_list.h for complete
|
||||
// descriptions of the error codes.
|
||||
///
|
||||
enum cef_handler_errorcode_t {
|
||||
ERR_FAILED = -2,
|
||||
ERR_ABORTED = -3,
|
||||
ERR_INVALID_ARGUMENT = -4,
|
||||
ERR_INVALID_HANDLE = -5,
|
||||
ERR_FILE_NOT_FOUND = -6,
|
||||
ERR_TIMED_OUT = -7,
|
||||
ERR_FILE_TOO_BIG = -8,
|
||||
ERR_UNEXPECTED = -9,
|
||||
ERR_ACCESS_DENIED = -10,
|
||||
ERR_NOT_IMPLEMENTED = -11,
|
||||
ERR_CONNECTION_CLOSED = -100,
|
||||
ERR_CONNECTION_RESET = -101,
|
||||
ERR_CONNECTION_REFUSED = -102,
|
||||
ERR_CONNECTION_ABORTED = -103,
|
||||
ERR_CONNECTION_FAILED = -104,
|
||||
ERR_NAME_NOT_RESOLVED = -105,
|
||||
ERR_INTERNET_DISCONNECTED = -106,
|
||||
ERR_SSL_PROTOCOL_ERROR = -107,
|
||||
ERR_ADDRESS_INVALID = -108,
|
||||
ERR_ADDRESS_UNREACHABLE = -109,
|
||||
ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110,
|
||||
ERR_TUNNEL_CONNECTION_FAILED = -111,
|
||||
ERR_NO_SSL_VERSIONS_ENABLED = -112,
|
||||
ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113,
|
||||
ERR_SSL_RENEGOTIATION_REQUESTED = -114,
|
||||
ERR_CERT_COMMON_NAME_INVALID = -200,
|
||||
ERR_CERT_DATE_INVALID = -201,
|
||||
ERR_CERT_AUTHORITY_INVALID = -202,
|
||||
ERR_CERT_CONTAINS_ERRORS = -203,
|
||||
ERR_CERT_NO_REVOCATION_MECHANISM = -204,
|
||||
ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205,
|
||||
ERR_CERT_REVOKED = -206,
|
||||
ERR_CERT_INVALID = -207,
|
||||
ERR_CERT_END = -208,
|
||||
ERR_INVALID_URL = -300,
|
||||
ERR_DISALLOWED_URL_SCHEME = -301,
|
||||
ERR_UNKNOWN_URL_SCHEME = -302,
|
||||
ERR_TOO_MANY_REDIRECTS = -310,
|
||||
ERR_UNSAFE_REDIRECT = -311,
|
||||
ERR_UNSAFE_PORT = -312,
|
||||
ERR_INVALID_RESPONSE = -320,
|
||||
ERR_INVALID_CHUNKED_ENCODING = -321,
|
||||
ERR_METHOD_NOT_SUPPORTED = -322,
|
||||
ERR_UNEXPECTED_PROXY_AUTH = -323,
|
||||
ERR_EMPTY_RESPONSE = -324,
|
||||
ERR_RESPONSE_HEADERS_TOO_BIG = -325,
|
||||
ERR_CACHE_MISS = -400,
|
||||
ERR_INSECURE_RESPONSE = -501,
|
||||
};
|
||||
|
||||
///
|
||||
// V8 access control values.
|
||||
///
|
||||
enum cef_v8_accesscontrol_t {
|
||||
V8_ACCESS_CONTROL_DEFAULT = 0,
|
||||
V8_ACCESS_CONTROL_ALL_CAN_READ = 1,
|
||||
V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1,
|
||||
V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2
|
||||
};
|
||||
|
||||
///
|
||||
// V8 property attribute values.
|
||||
///
|
||||
enum cef_v8_propertyattribute_t {
|
||||
V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable,
|
||||
// Configurable
|
||||
V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, // Not writeable
|
||||
V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, // Not enumerable
|
||||
V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable
|
||||
};
|
||||
|
||||
///
|
||||
// Post data elements may represent either bytes or files.
|
||||
///
|
||||
enum cef_postdataelement_type_t {
|
||||
PDE_TYPE_EMPTY = 0,
|
||||
PDE_TYPE_BYTES,
|
||||
PDE_TYPE_FILE,
|
||||
};
|
||||
|
||||
enum cef_weburlrequest_flags_t {
|
||||
WUR_FLAG_NONE = 0,
|
||||
WUR_FLAG_SKIP_CACHE = 0x1,
|
||||
WUR_FLAG_ALLOW_CACHED_CREDENTIALS = 0x2,
|
||||
WUR_FLAG_ALLOW_COOKIES = 0x4,
|
||||
WUR_FLAG_REPORT_UPLOAD_PROGRESS = 0x8,
|
||||
WUR_FLAG_REPORT_LOAD_TIMING = 0x10,
|
||||
WUR_FLAG_REPORT_RAW_HEADERS = 0x20
|
||||
};
|
||||
|
||||
///
|
||||
// Structure representing a rectangle.
|
||||
///
|
||||
typedef struct _cef_rect_t {
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
} cef_rect_t;
|
||||
|
||||
///
|
||||
// Existing process IDs.
|
||||
///
|
||||
enum cef_process_id_t {
|
||||
///
|
||||
// Browser process.
|
||||
///
|
||||
PID_BROWSER,
|
||||
///
|
||||
// Renderer process.
|
||||
///
|
||||
PID_RENDERER,
|
||||
};
|
||||
|
||||
///
|
||||
// Existing thread IDs.
|
||||
///
|
||||
enum cef_thread_id_t {
|
||||
// BROWSER PROCESS THREADS -- Only available in the browser process.
|
||||
|
||||
///
|
||||
// The main thread in the browser. This will be the same as the main
|
||||
// application thread if CefInitialize() is called with a
|
||||
// CefSettings.multi_threaded_message_loop value of false.
|
||||
///
|
||||
TID_UI,
|
||||
|
||||
///
|
||||
// Used to interact with the database.
|
||||
///
|
||||
TID_DB,
|
||||
|
||||
///
|
||||
// Used to interact with the file system.
|
||||
///
|
||||
TID_FILE,
|
||||
|
||||
///
|
||||
// Used for file system operations that block user interactions.
|
||||
// Responsiveness of this thread affects users.
|
||||
///
|
||||
TID_FILE_USER_BLOCKING,
|
||||
|
||||
///
|
||||
// Used to launch and terminate browser processes.
|
||||
///
|
||||
TID_PROCESS_LAUNCHER,
|
||||
|
||||
///
|
||||
// Used to handle slow HTTP cache operations.
|
||||
///
|
||||
TID_CACHE,
|
||||
|
||||
///
|
||||
// Used to process IPC and network messages.
|
||||
///
|
||||
TID_IO,
|
||||
|
||||
// RENDER PROCESS THREADS -- Only available in the render process.
|
||||
|
||||
///
|
||||
// The main thread in the renderer. Used for all WebKit and V8 interaction.
|
||||
///
|
||||
TID_RENDERER,
|
||||
};
|
||||
|
||||
///
|
||||
// Supported value types.
|
||||
///
|
||||
enum cef_value_type_t {
|
||||
VTYPE_INVALID = 0,
|
||||
VTYPE_NULL,
|
||||
VTYPE_BOOL,
|
||||
VTYPE_INT,
|
||||
VTYPE_DOUBLE,
|
||||
VTYPE_STRING,
|
||||
VTYPE_BINARY,
|
||||
VTYPE_DICTIONARY,
|
||||
VTYPE_LIST,
|
||||
};
|
||||
|
||||
///
|
||||
// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and
|
||||
// UTF16 (LE and BE) by default. All other types must be translated to UTF8
|
||||
// before being passed to the parser. If a BOM is detected and the correct
|
||||
// decoder is available then that decoder will be used automatically.
|
||||
///
|
||||
enum cef_xml_encoding_type_t {
|
||||
XML_ENCODING_NONE = 0,
|
||||
XML_ENCODING_UTF8,
|
||||
XML_ENCODING_UTF16LE,
|
||||
XML_ENCODING_UTF16BE,
|
||||
XML_ENCODING_ASCII,
|
||||
};
|
||||
|
||||
///
|
||||
// XML node types.
|
||||
///
|
||||
enum cef_xml_node_type_t {
|
||||
XML_NODE_UNSUPPORTED = 0,
|
||||
XML_NODE_PROCESSING_INSTRUCTION,
|
||||
XML_NODE_DOCUMENT_TYPE,
|
||||
XML_NODE_ELEMENT_START,
|
||||
XML_NODE_ELEMENT_END,
|
||||
XML_NODE_ATTRIBUTE,
|
||||
XML_NODE_TEXT,
|
||||
XML_NODE_CDATA,
|
||||
XML_NODE_ENTITY_REFERENCE,
|
||||
XML_NODE_WHITESPACE,
|
||||
XML_NODE_COMMENT,
|
||||
};
|
||||
|
||||
///
|
||||
// Status message types.
|
||||
///
|
||||
enum cef_handler_statustype_t {
|
||||
STATUSTYPE_TEXT = 0,
|
||||
STATUSTYPE_MOUSEOVER_URL,
|
||||
STATUSTYPE_KEYBOARD_FOCUS_URL,
|
||||
};
|
||||
|
||||
///
|
||||
// Popup window features.
|
||||
///
|
||||
typedef struct _cef_popup_features_t {
|
||||
int x;
|
||||
bool xSet;
|
||||
int y;
|
||||
bool ySet;
|
||||
int width;
|
||||
bool widthSet;
|
||||
int height;
|
||||
bool heightSet;
|
||||
|
||||
bool menuBarVisible;
|
||||
bool statusBarVisible;
|
||||
bool toolBarVisible;
|
||||
bool locationBarVisible;
|
||||
bool scrollbarsVisible;
|
||||
bool resizable;
|
||||
|
||||
bool fullscreen;
|
||||
bool dialog;
|
||||
cef_string_list_t additionalFeatures;
|
||||
} cef_popup_features_t;
|
||||
|
||||
///
|
||||
// Proxy types.
|
||||
///
|
||||
enum cef_proxy_type_t {
|
||||
PROXY_TYPE_DIRECT = 0,
|
||||
PROXY_TYPE_NAMED,
|
||||
PROXY_TYPE_PAC_STRING,
|
||||
};
|
||||
|
||||
///
|
||||
// Proxy information.
|
||||
///
|
||||
typedef struct _cef_proxy_info_t {
|
||||
enum cef_proxy_type_t proxyType;
|
||||
cef_string_t proxyList;
|
||||
} cef_proxy_info_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
|
82
include/internal/cef_types_linux.h
Normal file
82
include/internal/cef_types_linux.h
Normal file
@ -0,0 +1,82 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_build.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include <gtk/gtk.h>
|
||||
#include "include/internal/cef_string.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Window handle.
|
||||
#define cef_window_handle_t GtkWidget*
|
||||
#define cef_cursor_handle_t void*
|
||||
|
||||
///
|
||||
// Structure representing CefExecuteProcess arguments.
|
||||
///
|
||||
typedef struct _cef_main_args_t {
|
||||
int argc;
|
||||
char** argv;
|
||||
} cef_main_args_t;
|
||||
|
||||
///
|
||||
// Supported graphics implementations.
|
||||
///
|
||||
enum cef_graphics_implementation_t {
|
||||
DESKTOP_IN_PROCESS = 0,
|
||||
DESKTOP_IN_PROCESS_COMMAND_BUFFER,
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing window information.
|
||||
///
|
||||
typedef struct _cef_window_info_t {
|
||||
// Pointer for the parent GtkBox widget.
|
||||
cef_window_handle_t parent_widget;
|
||||
|
||||
// Pointer for the new browser widget.
|
||||
cef_window_handle_t widget;
|
||||
} cef_window_info_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OS_LINUX
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_
|
97
include/internal/cef_types_mac.h
Normal file
97
include/internal/cef_types_mac.h
Normal file
@ -0,0 +1,97 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_build.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "include/internal/cef_string.h"
|
||||
|
||||
// Window handle.
|
||||
#ifdef __cplusplus
|
||||
#ifdef __OBJC__
|
||||
@class NSView;
|
||||
#else
|
||||
struct NSView;
|
||||
#endif
|
||||
#define cef_window_handle_t NSView*
|
||||
#else
|
||||
#define cef_window_handle_t void*
|
||||
#endif
|
||||
#define cef_cursor_handle_t void*
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure representing CefExecuteProcess arguments.
|
||||
///
|
||||
typedef struct _cef_main_args_t {
|
||||
int argc;
|
||||
char** argv;
|
||||
} cef_main_args_t;
|
||||
|
||||
///
|
||||
// Supported graphics implementations.
|
||||
///
|
||||
enum cef_graphics_implementation_t {
|
||||
DESKTOP_IN_PROCESS = 0,
|
||||
DESKTOP_IN_PROCESS_COMMAND_BUFFER,
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing window information.
|
||||
///
|
||||
typedef struct _cef_window_info_t {
|
||||
cef_string_t window_name;
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
int hidden;
|
||||
|
||||
// NSView pointer for the parent view.
|
||||
cef_window_handle_t parent_view;
|
||||
|
||||
// NSView pointer for the new browser view.
|
||||
cef_window_handle_t view;
|
||||
} cef_window_info_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OS_MACOSX
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
|
94
include/internal/cef_types_win.h
Normal file
94
include/internal/cef_types_win.h
Normal file
@ -0,0 +1,94 @@
|
||||
// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_build.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <windows.h>
|
||||
#include "include/internal/cef_string.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Window handle.
|
||||
#define cef_window_handle_t HWND
|
||||
#define cef_cursor_handle_t HCURSOR
|
||||
|
||||
///
|
||||
// Structure representing CefExecuteProcess arguments.
|
||||
///
|
||||
typedef struct _cef_main_args_t {
|
||||
HINSTANCE instance;
|
||||
} cef_main_args_t;
|
||||
|
||||
///
|
||||
// Supported graphics implementations.
|
||||
///
|
||||
enum cef_graphics_implementation_t {
|
||||
ANGLE_IN_PROCESS = 0,
|
||||
ANGLE_IN_PROCESS_COMMAND_BUFFER,
|
||||
DESKTOP_IN_PROCESS,
|
||||
DESKTOP_IN_PROCESS_COMMAND_BUFFER,
|
||||
};
|
||||
|
||||
///
|
||||
// Structure representing window information.
|
||||
///
|
||||
typedef struct _cef_window_info_t {
|
||||
// Standard parameters required by CreateWindowEx()
|
||||
DWORD ex_style;
|
||||
cef_string_t window_name;
|
||||
DWORD style;
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
cef_window_handle_t parent_window;
|
||||
HMENU menu;
|
||||
|
||||
// Set to true to enable transparent painting.
|
||||
BOOL transparent_painting;
|
||||
|
||||
// Handle for the new browser window.
|
||||
cef_window_handle_t window;
|
||||
} cef_window_info_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OS_WIN
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_
|
582
include/internal/cef_types_wrappers.h
Normal file
582
include/internal/cef_types_wrappers.h
Normal file
@ -0,0 +1,582 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/internal/cef_string.h"
|
||||
#include "include/internal/cef_string_list.h"
|
||||
#include "include/internal/cef_types.h"
|
||||
|
||||
///
|
||||
// Template class that provides common functionality for CEF structure wrapping.
|
||||
///
|
||||
template <class traits>
|
||||
class CefStructBase : public traits::struct_type {
|
||||
public:
|
||||
typedef typename traits::struct_type struct_type;
|
||||
|
||||
CefStructBase() : attached_to_(NULL) {
|
||||
Init();
|
||||
}
|
||||
virtual ~CefStructBase() {
|
||||
// Only clear this object's data if it isn't currently attached to a
|
||||
// structure.
|
||||
if (!attached_to_)
|
||||
Clear(this);
|
||||
}
|
||||
|
||||
CefStructBase(const CefStructBase& r) {
|
||||
Init();
|
||||
*this = r;
|
||||
}
|
||||
CefStructBase(const struct_type& r) { // NOLINT(runtime/explicit)
|
||||
Init();
|
||||
*this = r;
|
||||
}
|
||||
|
||||
///
|
||||
// Clear this object's values.
|
||||
///
|
||||
void Reset() {
|
||||
Clear(this);
|
||||
Init();
|
||||
}
|
||||
|
||||
///
|
||||
// Attach to the source structure's existing values. DetachTo() can be called
|
||||
// to insert the values back into the existing structure.
|
||||
///
|
||||
void AttachTo(struct_type& source) {
|
||||
// Only clear this object's data if it isn't currently attached to a
|
||||
// structure.
|
||||
if (!attached_to_)
|
||||
Clear(this);
|
||||
|
||||
// This object is now attached to the new structure.
|
||||
attached_to_ = &source;
|
||||
|
||||
// Transfer ownership of the values from the source structure.
|
||||
memcpy(static_cast<struct_type*>(this), &source, sizeof(struct_type));
|
||||
}
|
||||
|
||||
///
|
||||
// Relinquish ownership of values to the target structure.
|
||||
///
|
||||
void DetachTo(struct_type& target) {
|
||||
if (attached_to_ != &target) {
|
||||
// Clear the target structure's values only if we are not currently
|
||||
// attached to that structure.
|
||||
Clear(&target);
|
||||
}
|
||||
|
||||
// Transfer ownership of the values to the target structure.
|
||||
memcpy(&target, static_cast<struct_type*>(this), sizeof(struct_type));
|
||||
|
||||
// Remove the references from this object.
|
||||
Init();
|
||||
}
|
||||
|
||||
///
|
||||
// Set this object's values. If |copy| is true the source structure's values
|
||||
// will be copied instead of referenced.
|
||||
///
|
||||
void Set(const struct_type& source, bool copy) {
|
||||
traits::set(&source, this, copy);
|
||||
}
|
||||
|
||||
CefStructBase& operator=(const CefStructBase& s) {
|
||||
return operator=(static_cast<const struct_type&>(s));
|
||||
}
|
||||
|
||||
CefStructBase& operator=(const struct_type& s) {
|
||||
Set(s, true);
|
||||
return *this;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init() {
|
||||
memset(static_cast<struct_type*>(this), 0, sizeof(struct_type));
|
||||
attached_to_ = NULL;
|
||||
traits::init(this);
|
||||
}
|
||||
|
||||
static void Clear(struct_type* s) { traits::clear(s); }
|
||||
|
||||
struct_type* attached_to_;
|
||||
};
|
||||
|
||||
|
||||
struct CefRectTraits {
|
||||
typedef cef_rect_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
*target = *src;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a rectangle.
|
||||
///
|
||||
class CefRect : public CefStructBase<CefRectTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefRectTraits> parent;
|
||||
|
||||
CefRect() : parent() {}
|
||||
CefRect(const cef_rect_t& r) : parent(r) {} // NOLINT(runtime/explicit)
|
||||
CefRect(const CefRect& r) : parent(r) {} // NOLINT(runtime/explicit)
|
||||
CefRect(int x, int y, int width, int height) : parent() {
|
||||
Set(x, y, width, height);
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return width <= 0 || height <= 0; }
|
||||
void Set(int x, int y, int width, int height) {
|
||||
this->x = x, this->y = y, this->width = width, this->height = height;
|
||||
}
|
||||
};
|
||||
|
||||
inline bool operator==(const CefRect& a, const CefRect& b) {
|
||||
return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;
|
||||
}
|
||||
|
||||
inline bool operator!=(const CefRect& a, const CefRect& b) {
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
|
||||
struct CefPopupFeaturesTraits {
|
||||
typedef cef_popup_features_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {
|
||||
s->menuBarVisible = true;
|
||||
s->statusBarVisible = true;
|
||||
s->toolBarVisible = true;
|
||||
s->locationBarVisible = true;
|
||||
s->scrollbarsVisible = true;
|
||||
s->resizable = true;
|
||||
}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
if (s->additionalFeatures)
|
||||
cef_string_list_free(s->additionalFeatures);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
if (target->additionalFeatures)
|
||||
cef_string_list_free(target->additionalFeatures);
|
||||
target->additionalFeatures = src->additionalFeatures ?
|
||||
cef_string_list_copy(src->additionalFeatures) : NULL;
|
||||
|
||||
target->x = src->x;
|
||||
target->xSet = src->xSet;
|
||||
target->y = src->y;
|
||||
target->ySet = src->ySet;
|
||||
target->width = src->width;
|
||||
target->widthSet = src->widthSet;
|
||||
target->height = src->height;
|
||||
target->heightSet = src->heightSet;
|
||||
target->menuBarVisible = src->menuBarVisible;
|
||||
target->statusBarVisible = src->statusBarVisible;
|
||||
target->toolBarVisible = src->toolBarVisible;
|
||||
target->locationBarVisible = src->locationBarVisible;
|
||||
target->scrollbarsVisible = src->scrollbarsVisible;
|
||||
target->resizable = src->resizable;
|
||||
target->fullscreen = src->fullscreen;
|
||||
target->dialog = src->dialog;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing popup window features.
|
||||
///
|
||||
typedef CefStructBase<CefPopupFeaturesTraits> CefPopupFeatures;
|
||||
|
||||
|
||||
struct CefSettingsTraits {
|
||||
typedef cef_settings_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {
|
||||
s->size = sizeof(struct_type);
|
||||
}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->browser_subprocess_path);
|
||||
cef_string_clear(&s->cache_path);
|
||||
cef_string_clear(&s->user_agent);
|
||||
cef_string_clear(&s->product_version);
|
||||
cef_string_clear(&s->locale);
|
||||
if (s->extra_plugin_paths)
|
||||
cef_string_list_free(s->extra_plugin_paths);
|
||||
cef_string_clear(&s->log_file);
|
||||
cef_string_clear(&s->javascript_flags);
|
||||
cef_string_clear(&s->pack_file_path);
|
||||
cef_string_clear(&s->locales_dir_path);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->single_process = src->single_process;
|
||||
cef_string_set(src->browser_subprocess_path.str,
|
||||
src->browser_subprocess_path.length,
|
||||
&target->browser_subprocess_path, copy);
|
||||
target->multi_threaded_message_loop = src->multi_threaded_message_loop;
|
||||
target->command_line_args_disabled = src->command_line_args_disabled;
|
||||
|
||||
cef_string_set(src->cache_path.str, src->cache_path.length,
|
||||
&target->cache_path, copy);
|
||||
cef_string_set(src->user_agent.str, src->user_agent.length,
|
||||
&target->user_agent, copy);
|
||||
cef_string_set(src->product_version.str, src->product_version.length,
|
||||
&target->product_version, copy);
|
||||
cef_string_set(src->locale.str, src->locale.length, &target->locale, copy);
|
||||
|
||||
if (target->extra_plugin_paths)
|
||||
cef_string_list_free(target->extra_plugin_paths);
|
||||
target->extra_plugin_paths = src->extra_plugin_paths ?
|
||||
cef_string_list_copy(src->extra_plugin_paths) : NULL;
|
||||
|
||||
cef_string_set(src->log_file.str, src->log_file.length, &target->log_file,
|
||||
copy);
|
||||
target->log_severity = src->log_severity;
|
||||
target->graphics_implementation = src->graphics_implementation;
|
||||
target->local_storage_quota = src->local_storage_quota;
|
||||
target->session_storage_quota = src->session_storage_quota;
|
||||
cef_string_set(src->javascript_flags.str, src->javascript_flags.length,
|
||||
&target->javascript_flags, copy);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
target->auto_detect_proxy_settings_enabled =
|
||||
src->auto_detect_proxy_settings_enabled;
|
||||
#endif
|
||||
|
||||
cef_string_set(src->pack_file_path.str, src->pack_file_path.length,
|
||||
&target->pack_file_path, copy);
|
||||
cef_string_set(src->locales_dir_path.str, src->locales_dir_path.length,
|
||||
&target->locales_dir_path, copy);
|
||||
target->pack_loading_disabled = src->pack_loading_disabled;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing initialization settings.
|
||||
///
|
||||
typedef CefStructBase<CefSettingsTraits> CefSettings;
|
||||
|
||||
|
||||
struct CefBrowserSettingsTraits {
|
||||
typedef cef_browser_settings_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {
|
||||
s->size = sizeof(struct_type);
|
||||
}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->standard_font_family);
|
||||
cef_string_clear(&s->fixed_font_family);
|
||||
cef_string_clear(&s->serif_font_family);
|
||||
cef_string_clear(&s->sans_serif_font_family);
|
||||
cef_string_clear(&s->cursive_font_family);
|
||||
cef_string_clear(&s->fantasy_font_family);
|
||||
cef_string_clear(&s->default_encoding);
|
||||
cef_string_clear(&s->user_style_sheet_location);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->drag_drop_disabled = src->drag_drop_disabled;
|
||||
target->load_drops_disabled = src->load_drops_disabled;
|
||||
target->history_disabled = src->history_disabled;
|
||||
|
||||
cef_string_set(src->standard_font_family.str,
|
||||
src->standard_font_family.length, &target->standard_font_family, copy);
|
||||
cef_string_set(src->fixed_font_family.str, src->fixed_font_family.length,
|
||||
&target->fixed_font_family, copy);
|
||||
cef_string_set(src->serif_font_family.str, src->serif_font_family.length,
|
||||
&target->serif_font_family, copy);
|
||||
cef_string_set(src->sans_serif_font_family.str,
|
||||
src->sans_serif_font_family.length, &target->sans_serif_font_family,
|
||||
copy);
|
||||
cef_string_set(src->cursive_font_family.str,
|
||||
src->cursive_font_family.length, &target->cursive_font_family, copy);
|
||||
cef_string_set(src->fantasy_font_family.str,
|
||||
src->fantasy_font_family.length, &target->fantasy_font_family, copy);
|
||||
|
||||
target->default_font_size = src->default_font_size;
|
||||
target->default_fixed_font_size = src->default_fixed_font_size;
|
||||
target->minimum_font_size = src->minimum_font_size;
|
||||
target->minimum_logical_font_size = src->minimum_logical_font_size;
|
||||
target->remote_fonts_disabled = src->remote_fonts_disabled;
|
||||
|
||||
cef_string_set(src->default_encoding.str, src->default_encoding.length,
|
||||
&target->default_encoding, copy);
|
||||
|
||||
target->encoding_detector_enabled = src->encoding_detector_enabled;
|
||||
target->javascript_disabled = src->javascript_disabled;
|
||||
target->javascript_open_windows_disallowed =
|
||||
src->javascript_open_windows_disallowed;
|
||||
target->javascript_close_windows_disallowed =
|
||||
src->javascript_close_windows_disallowed;
|
||||
target->javascript_access_clipboard_disallowed =
|
||||
src->javascript_access_clipboard_disallowed;
|
||||
target->dom_paste_disabled = src->dom_paste_disabled;
|
||||
target->caret_browsing_enabled = src->caret_browsing_enabled;
|
||||
target->java_disabled = src->java_disabled;
|
||||
target->plugins_disabled = src->plugins_disabled;
|
||||
target->universal_access_from_file_urls_allowed =
|
||||
src->universal_access_from_file_urls_allowed;
|
||||
target->file_access_from_file_urls_allowed =
|
||||
src->file_access_from_file_urls_allowed;
|
||||
target->web_security_disabled = src->web_security_disabled;
|
||||
target->xss_auditor_enabled = src->xss_auditor_enabled;
|
||||
target->image_load_disabled = src->image_load_disabled;
|
||||
target->shrink_standalone_images_to_fit =
|
||||
src->shrink_standalone_images_to_fit;
|
||||
target->site_specific_quirks_disabled = src->site_specific_quirks_disabled;
|
||||
target->text_area_resize_disabled = src->text_area_resize_disabled;
|
||||
target->page_cache_disabled = src->page_cache_disabled;
|
||||
target->tab_to_links_disabled = src->tab_to_links_disabled;
|
||||
target->hyperlink_auditing_disabled = src->hyperlink_auditing_disabled;
|
||||
target->user_style_sheet_enabled = src->user_style_sheet_enabled;
|
||||
|
||||
cef_string_set(src->user_style_sheet_location.str,
|
||||
src->user_style_sheet_location.length,
|
||||
&target->user_style_sheet_location, copy);
|
||||
|
||||
target->author_and_user_styles_disabled =
|
||||
src->author_and_user_styles_disabled;
|
||||
target->local_storage_disabled = src->local_storage_disabled;
|
||||
target->databases_disabled = src->databases_disabled;
|
||||
target->application_cache_disabled = src->application_cache_disabled;
|
||||
target->webgl_disabled = src->webgl_disabled;
|
||||
target->accelerated_compositing_disabled =
|
||||
src->accelerated_compositing_disabled;
|
||||
target->accelerated_layers_disabled = src->accelerated_layers_disabled;
|
||||
target->accelerated_video_disabled = src->accelerated_video_disabled;
|
||||
target->accelerated_2d_canvas_disabled =
|
||||
src->accelerated_2d_canvas_disabled;
|
||||
target->accelerated_painting_enabled = src->accelerated_painting_enabled;
|
||||
target->accelerated_filters_enabled = src->accelerated_filters_enabled;
|
||||
target->accelerated_plugins_disabled = src->accelerated_plugins_disabled;
|
||||
target->developer_tools_disabled = src->developer_tools_disabled;
|
||||
target->fullscreen_enabled = src->fullscreen_enabled;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing browser initialization settings.
|
||||
///
|
||||
typedef CefStructBase<CefBrowserSettingsTraits> CefBrowserSettings;
|
||||
|
||||
|
||||
struct CefURLPartsTraits {
|
||||
typedef cef_urlparts_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->spec);
|
||||
cef_string_clear(&s->scheme);
|
||||
cef_string_clear(&s->username);
|
||||
cef_string_clear(&s->password);
|
||||
cef_string_clear(&s->host);
|
||||
cef_string_clear(&s->port);
|
||||
cef_string_clear(&s->path);
|
||||
cef_string_clear(&s->query);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
cef_string_set(src->spec.str, src->spec.length, &target->spec, copy);
|
||||
cef_string_set(src->scheme.str, src->scheme.length, &target->scheme, copy);
|
||||
cef_string_set(src->username.str, src->username.length, &target->username,
|
||||
copy);
|
||||
cef_string_set(src->password.str, src->password.length, &target->password,
|
||||
copy);
|
||||
cef_string_set(src->host.str, src->host.length, &target->host, copy);
|
||||
cef_string_set(src->port.str, src->port.length, &target->port, copy);
|
||||
cef_string_set(src->path.str, src->path.length, &target->path, copy);
|
||||
cef_string_set(src->query.str, src->query.length, &target->query, copy);
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a URL's component parts.
|
||||
///
|
||||
typedef CefStructBase<CefURLPartsTraits> CefURLParts;
|
||||
|
||||
|
||||
struct CefTimeTraits {
|
||||
typedef cef_time_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
*target = *src;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a time.
|
||||
///
|
||||
class CefTime : public CefStructBase<CefTimeTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefTimeTraits> parent;
|
||||
|
||||
CefTime() : parent() {}
|
||||
CefTime(const cef_time_t& r) : parent(r) {} // NOLINT(runtime/explicit)
|
||||
CefTime(const CefTime& r) : parent(r) {} // NOLINT(runtime/explicit)
|
||||
explicit CefTime(time_t r) : parent() { SetTimeT(r); }
|
||||
explicit CefTime(double r) : parent() { SetDoubleT(r); }
|
||||
|
||||
// Converts to/from time_t.
|
||||
void SetTimeT(time_t r) {
|
||||
cef_time_from_timet(r, this);
|
||||
}
|
||||
time_t GetTimeT() const {
|
||||
time_t time = 0;
|
||||
cef_time_to_timet(this, &time);
|
||||
return time;
|
||||
}
|
||||
|
||||
// Converts to/from a double which is the number of seconds since epoch
|
||||
// (Jan 1, 1970). Webkit uses this format to represent time. A value of 0
|
||||
// means "not initialized".
|
||||
void SetDoubleT(double r) {
|
||||
cef_time_from_doublet(r, this);
|
||||
}
|
||||
double GetDoubleT() const {
|
||||
double time = 0;
|
||||
cef_time_to_doublet(this, &time);
|
||||
return time;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct CefCookieTraits {
|
||||
typedef cef_cookie_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->name);
|
||||
cef_string_clear(&s->value);
|
||||
cef_string_clear(&s->domain);
|
||||
cef_string_clear(&s->path);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
cef_string_set(src->name.str, src->name.length, &target->name, copy);
|
||||
cef_string_set(src->value.str, src->value.length, &target->value, copy);
|
||||
cef_string_set(src->domain.str, src->domain.length, &target->domain, copy);
|
||||
cef_string_set(src->path.str, src->path.length, &target->path, copy);
|
||||
target->secure = src->secure;
|
||||
target->httponly = src->httponly;
|
||||
target->creation = src->creation;
|
||||
target->last_access = src->last_access;
|
||||
target->has_expires = src->has_expires;
|
||||
target->expires = src->expires;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a cookie.
|
||||
///
|
||||
typedef CefStructBase<CefCookieTraits> CefCookie;
|
||||
|
||||
|
||||
struct CefProxyInfoTraits {
|
||||
typedef cef_proxy_info_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->proxyList);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->proxyType = src->proxyType;
|
||||
cef_string_set(src->proxyList.str, src->proxyList.length,
|
||||
&target->proxyList, copy);
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing the results of proxy resolution.
|
||||
///
|
||||
class CefProxyInfo : public CefStructBase<CefProxyInfoTraits> {
|
||||
public:
|
||||
///
|
||||
// Use a direction connection instead of a proxy.
|
||||
///
|
||||
void UseDirect() {
|
||||
proxyType = PROXY_TYPE_DIRECT;
|
||||
}
|
||||
|
||||
///
|
||||
// Use one or more named proxy servers specified in WinHTTP format. Each proxy
|
||||
// server is of the form:
|
||||
//
|
||||
// [<scheme>"://"]<server>[":"<port>]
|
||||
//
|
||||
// Multiple values may be separated by semicolons or whitespace. For example,
|
||||
// "foo1:80;foo2:80".
|
||||
///
|
||||
void UseNamedProxy(const CefString& proxy_uri_list) {
|
||||
proxyType = PROXY_TYPE_NAMED;
|
||||
(CefString(&proxyList)) = proxy_uri_list;
|
||||
}
|
||||
|
||||
///
|
||||
// Use one or more named proxy servers specified in PAC script format. For
|
||||
// example, "PROXY foobar:99; SOCKS fml:2; DIRECT".
|
||||
///
|
||||
void UsePacString(const CefString& pac_string) {
|
||||
proxyType = PROXY_TYPE_PAC_STRING;
|
||||
(CefString(&proxyList)) = pac_string;
|
||||
}
|
||||
|
||||
bool IsDirect() const { return proxyType == PROXY_TYPE_DIRECT; }
|
||||
bool IsNamedProxy() const { return proxyType == PROXY_TYPE_NAMED; }
|
||||
bool IsPacString() const { return proxyType == PROXY_TYPE_PAC_STRING; }
|
||||
|
||||
CefString ProxyList() const { return CefString(&proxyList); }
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
|
165
include/internal/cef_win.h
Normal file
165
include/internal/cef_win.h
Normal file
@ -0,0 +1,165 @@
|
||||
// Copyright (c) 2008 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_WIN_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_WIN_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <windows.h>
|
||||
#include "include/internal/cef_types_win.h"
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
|
||||
///
|
||||
// Atomic increment and decrement.
|
||||
///
|
||||
#define CefAtomicIncrement(p) InterlockedIncrement(p)
|
||||
#define CefAtomicDecrement(p) InterlockedDecrement(p)
|
||||
|
||||
///
|
||||
// Critical section wrapper.
|
||||
///
|
||||
class CefCriticalSection {
|
||||
public:
|
||||
CefCriticalSection() {
|
||||
memset(&m_sec, 0, sizeof(CRITICAL_SECTION));
|
||||
InitializeCriticalSection(&m_sec);
|
||||
}
|
||||
virtual ~CefCriticalSection() {
|
||||
DeleteCriticalSection(&m_sec);
|
||||
}
|
||||
void Lock() {
|
||||
EnterCriticalSection(&m_sec);
|
||||
}
|
||||
void Unlock() {
|
||||
LeaveCriticalSection(&m_sec);
|
||||
}
|
||||
|
||||
CRITICAL_SECTION m_sec;
|
||||
};
|
||||
|
||||
///
|
||||
// Handle types.
|
||||
///
|
||||
#define CefWindowHandle cef_window_handle_t
|
||||
#define CefCursorHandle cef_cursor_handle_t
|
||||
|
||||
struct CefMainArgsTraits {
|
||||
typedef cef_main_args_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->instance = src->instance;
|
||||
}
|
||||
};
|
||||
|
||||
// Class representing CefExecuteProcess arguments.
|
||||
class CefMainArgs : public CefStructBase<CefMainArgsTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefMainArgsTraits> parent;
|
||||
|
||||
CefMainArgs() : parent() {}
|
||||
explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {}
|
||||
explicit CefMainArgs(const CefMainArgs& r) : parent(r) {}
|
||||
explicit CefMainArgs(HINSTANCE hInstance) : parent() {
|
||||
instance = hInstance;
|
||||
}
|
||||
};
|
||||
|
||||
struct CefWindowInfoTraits {
|
||||
typedef cef_window_info_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->window_name);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->ex_style = src->ex_style;
|
||||
cef_string_set(src->window_name.str, src->window_name.length,
|
||||
&target->window_name, copy);
|
||||
target->style = src->style;
|
||||
target->x = src->x;
|
||||
target->y = src->y;
|
||||
target->width = src->width;
|
||||
target->height = src->height;
|
||||
target->parent_window = src->parent_window;
|
||||
target->menu = src->menu;
|
||||
target->window = src->window;
|
||||
target->transparent_painting = src->transparent_painting;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing window information.
|
||||
///
|
||||
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefWindowInfoTraits> parent;
|
||||
|
||||
CefWindowInfo() : parent() {}
|
||||
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
void SetAsChild(HWND hWndParent, RECT windowRect) {
|
||||
style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP |
|
||||
WS_VISIBLE;
|
||||
parent_window = hWndParent;
|
||||
x = windowRect.left;
|
||||
y = windowRect.top;
|
||||
width = windowRect.right - windowRect.left;
|
||||
height = windowRect.bottom - windowRect.top;
|
||||
}
|
||||
|
||||
void SetAsPopup(HWND hWndParent, const CefString& windowName) {
|
||||
style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
|
||||
WS_VISIBLE;
|
||||
parent_window = hWndParent;
|
||||
x = CW_USEDEFAULT;
|
||||
y = CW_USEDEFAULT;
|
||||
width = CW_USEDEFAULT;
|
||||
height = CW_USEDEFAULT;
|
||||
|
||||
cef_string_copy(windowName.c_str(), windowName.length(), &window_name);
|
||||
}
|
||||
|
||||
void SetTransparentPainting(BOOL transparentPainting) {
|
||||
transparent_painting = transparentPainting;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // OS_WIN
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_WIN_H_
|
74
include/wrapper/cef_byte_read_handler.h
Normal file
74
include/wrapper/cef_byte_read_handler.h
Normal file
@ -0,0 +1,74 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file are only available to applications that link
|
||||
// against the libcef_dll_wrapper target.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_
|
||||
#define CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_stream.h"
|
||||
|
||||
///
|
||||
// Thread safe implementation of the CefReadHandler class for reading an
|
||||
// in-memory array of bytes.
|
||||
///
|
||||
class CefByteReadHandler : public CefReadHandler {
|
||||
public:
|
||||
///
|
||||
// Create a new object for reading an array of bytes. An optional |source|
|
||||
// reference can be kept to keep the underlying data source from being
|
||||
// released while the reader exists.
|
||||
///
|
||||
CefByteReadHandler(const unsigned char* bytes,
|
||||
size_t size,
|
||||
CefRefPtr<CefBase> source);
|
||||
|
||||
// CefReadHandler methods.
|
||||
virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE;
|
||||
virtual int Seek(int64 offset, int whence) OVERRIDE;
|
||||
virtual int64 Tell() OVERRIDE;
|
||||
virtual int Eof() OVERRIDE;
|
||||
|
||||
private:
|
||||
const unsigned char* bytes_;
|
||||
int64 size_;
|
||||
int64 offset_;
|
||||
CefRefPtr<CefBase> source_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefByteReadHandler);
|
||||
IMPLEMENT_LOCKING(CefByteReadHandler);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_
|
85
include/wrapper/cef_stream_resource_handler.h
Normal file
85
include/wrapper/cef_stream_resource_handler.h
Normal file
@ -0,0 +1,85 @@
|
||||
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file are only available to applications that link
|
||||
// against the libcef_dll_wrapper target.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
|
||||
#define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_resource_handler.h"
|
||||
#include "include/cef_response.h"
|
||||
|
||||
class CefStreamReader;
|
||||
|
||||
///
|
||||
// Implementation of the CefResourceHandler class for reading from a CefStream.
|
||||
///
|
||||
class CefStreamResourceHandler : public CefResourceHandler {
|
||||
public:
|
||||
///
|
||||
// Create a new object with default response values.
|
||||
///
|
||||
CefStreamResourceHandler(const CefString& mime_type,
|
||||
CefRefPtr<CefStreamReader> stream);
|
||||
///
|
||||
// Create a new object with explicit response values.
|
||||
///
|
||||
CefStreamResourceHandler(int status_code,
|
||||
const CefString& mime_type,
|
||||
CefResponse::HeaderMap header_map,
|
||||
CefRefPtr<CefStreamReader> stream);
|
||||
|
||||
// CefStreamResourceHandler methods.
|
||||
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefCallback> callback) OVERRIDE;
|
||||
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
|
||||
int64& response_length,
|
||||
CefString& redirectUrl) OVERRIDE;
|
||||
virtual bool ReadResponse(void* data_out,
|
||||
int bytes_to_read,
|
||||
int& bytes_read,
|
||||
CefRefPtr<CefCallback> callback) OVERRIDE;
|
||||
virtual void Cancel() OVERRIDE;
|
||||
|
||||
private:
|
||||
int status_code_;
|
||||
CefString mime_type_;
|
||||
CefResponse::HeaderMap header_map_;
|
||||
CefRefPtr<CefStreamReader> stream_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefStreamResourceHandler);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
|
188
include/wrapper/cef_xml_object.h
Normal file
188
include/wrapper/cef_xml_object.h
Normal file
@ -0,0 +1,188 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file are only available to applications that link
|
||||
// against the libcef_dll_wrapper target.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_
|
||||
#define CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_xml_reader.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class CefStreamReader;
|
||||
|
||||
///
|
||||
// Thread safe class for representing XML data as a structured object. This
|
||||
// class should not be used with large XML documents because all data will be
|
||||
// resident in memory at the same time. This implementation supports a
|
||||
// restricted set of XML features:
|
||||
// <pre>
|
||||
// (1) Processing instructions, whitespace and comments are ignored.
|
||||
// (2) Elements and attributes must always be referenced using the fully
|
||||
// qualified name (ie, namespace:localname).
|
||||
// (3) Empty elements (<a/>) and elements with zero-length values (<a></a>)
|
||||
// are considered the same.
|
||||
// (4) Element nodes are considered part of a value if:
|
||||
// (a) The element node follows a non-element node at the same depth
|
||||
// (see 5), or
|
||||
// (b) The element node does not have a namespace and the parent node does.
|
||||
// (5) Mixed node types at the same depth are combined into a single element
|
||||
// value as follows:
|
||||
// (a) All node values are concatenated to form a single string value.
|
||||
// (b) Entity reference nodes are resolved to the corresponding entity
|
||||
// value.
|
||||
// (c) Element nodes are represented by their outer XML string.
|
||||
// </pre>
|
||||
///
|
||||
class CefXmlObject : public CefBase {
|
||||
public:
|
||||
typedef std::vector<CefRefPtr<CefXmlObject> > ObjectVector;
|
||||
typedef std::map<CefString, CefString > AttributeMap;
|
||||
|
||||
///
|
||||
// Create a new object with the specified name. An object name must always be
|
||||
// at least one character long.
|
||||
///
|
||||
explicit CefXmlObject(const CefString& name);
|
||||
virtual ~CefXmlObject();
|
||||
|
||||
///
|
||||
// Load the contents of the specified XML stream into this object. The
|
||||
// existing children and attributes, if any, will first be cleared.
|
||||
///
|
||||
bool Load(CefRefPtr<CefStreamReader> stream,
|
||||
CefXmlReader::EncodingType encodingType,
|
||||
const CefString& URI, CefString* loadError);
|
||||
|
||||
///
|
||||
// Set the name, children and attributes of this object to a duplicate of the
|
||||
// specified object's contents. The existing children and attributes, if any,
|
||||
// will first be cleared.
|
||||
///
|
||||
void Set(CefRefPtr<CefXmlObject> object);
|
||||
|
||||
///
|
||||
// Append a duplicate of the children and attributes of the specified object
|
||||
// to this object. If |overwriteAttributes| is true then any attributes in
|
||||
// this object that also exist in the specified object will be overwritten
|
||||
// with the new values. The name of this object is not changed.
|
||||
///
|
||||
void Append(CefRefPtr<CefXmlObject> object, bool overwriteAttributes);
|
||||
|
||||
///
|
||||
// Return a new object with the same name, children and attributes as this
|
||||
// object. The parent of the new object will be NULL.
|
||||
///
|
||||
CefRefPtr<CefXmlObject> Duplicate();
|
||||
|
||||
///
|
||||
// Clears this object's children and attributes. The name and parenting of
|
||||
// this object are not changed.
|
||||
///
|
||||
void Clear();
|
||||
|
||||
///
|
||||
// Access the object's name. An object name must always be at least one
|
||||
// character long.
|
||||
///
|
||||
CefString GetName();
|
||||
bool SetName(const CefString& name);
|
||||
|
||||
///
|
||||
// Access the object's parent. The parent can be NULL if this object has not
|
||||
// been added as the child on another object.
|
||||
///
|
||||
bool HasParent();
|
||||
CefRefPtr<CefXmlObject> GetParent();
|
||||
|
||||
///
|
||||
// Access the object's value. An object cannot have a value if it also has
|
||||
// children. Attempting to set the value while children exist will fail.
|
||||
///
|
||||
bool HasValue();
|
||||
CefString GetValue();
|
||||
bool SetValue(const CefString& value);
|
||||
|
||||
///
|
||||
// Access the object's attributes. Attributes must have unique names.
|
||||
///
|
||||
bool HasAttributes();
|
||||
size_t GetAttributeCount();
|
||||
bool HasAttribute(const CefString& name);
|
||||
CefString GetAttributeValue(const CefString& name);
|
||||
bool SetAttributeValue(const CefString& name, const CefString& value);
|
||||
size_t GetAttributes(AttributeMap& attributes);
|
||||
void ClearAttributes();
|
||||
|
||||
///
|
||||
// Access the object's children. Each object can only have one parent so
|
||||
// attempting to add an object that already has a parent will fail. Removing a
|
||||
// child will set the child's parent to NULL. Adding a child will set the
|
||||
// child's parent to this object. This object's value, if any, will be cleared
|
||||
// if a child is added.
|
||||
///
|
||||
bool HasChildren();
|
||||
size_t GetChildCount();
|
||||
bool HasChild(CefRefPtr<CefXmlObject> child);
|
||||
bool AddChild(CefRefPtr<CefXmlObject> child);
|
||||
bool RemoveChild(CefRefPtr<CefXmlObject> child);
|
||||
size_t GetChildren(ObjectVector& children);
|
||||
void ClearChildren();
|
||||
|
||||
///
|
||||
// Find the first child with the specified name.
|
||||
///
|
||||
CefRefPtr<CefXmlObject> FindChild(const CefString& name);
|
||||
|
||||
///
|
||||
// Find all children with the specified name.
|
||||
///
|
||||
size_t FindChildren(const CefString& name, ObjectVector& children);
|
||||
|
||||
private:
|
||||
void SetParent(CefXmlObject* parent);
|
||||
|
||||
CefString name_;
|
||||
CefXmlObject* parent_;
|
||||
CefString value_;
|
||||
AttributeMap attributes_;
|
||||
ObjectVector children_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefXmlObject);
|
||||
IMPLEMENT_LOCKING(CefXmlObject);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_
|
132
include/wrapper/cef_zip_archive.h
Normal file
132
include/wrapper/cef_zip_archive.h
Normal file
@ -0,0 +1,132 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file are only available to applications that link
|
||||
// against the libcef_dll_wrapper target.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_
|
||||
#define CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include <map>
|
||||
|
||||
class CefStreamReader;
|
||||
|
||||
///
|
||||
// Thread-safe class for accessing zip archive file contents. This class should
|
||||
// not be used with large archive files because all data will be resident in
|
||||
// memory at the same time. This implementation supports a restricted set of zip
|
||||
// archive features:
|
||||
// (1) Password-protected files are not supported.
|
||||
// (2) All file names are stored and compared in lower case.
|
||||
// (3) File ordering from the original zip archive is not maintained. This
|
||||
// means that files from the same folder may not be located together in the
|
||||
// file content map.
|
||||
///
|
||||
class CefZipArchive : public CefBase {
|
||||
public:
|
||||
///
|
||||
// Class representing a file in the archive. Accessing the file data from
|
||||
// multiple threads is safe provided a reference to the File object is kept.
|
||||
///
|
||||
class File : public CefBase {
|
||||
public:
|
||||
///
|
||||
// Returns the read-only data contained in the file.
|
||||
///
|
||||
virtual const unsigned char* GetData() =0;
|
||||
|
||||
///
|
||||
// Returns the size of the data in the file.
|
||||
///
|
||||
virtual size_t GetDataSize() =0;
|
||||
|
||||
///
|
||||
// Returns a CefStreamReader object for streaming the contents of the file.
|
||||
///
|
||||
virtual CefRefPtr<CefStreamReader> GetStreamReader() =0;
|
||||
};
|
||||
typedef std::map<CefString, CefRefPtr<File> > FileMap;
|
||||
|
||||
///
|
||||
// Create a new object.
|
||||
///
|
||||
CefZipArchive();
|
||||
virtual ~CefZipArchive();
|
||||
|
||||
///
|
||||
// Load the contents of the specified zip archive stream into this object.
|
||||
// If |overwriteExisting| is true then any files in this object that also
|
||||
// exist in the specified archive will be replaced with the new files.
|
||||
// Returns the number of files successfully loaded.
|
||||
///
|
||||
size_t Load(CefRefPtr<CefStreamReader> stream, bool overwriteExisting);
|
||||
|
||||
///
|
||||
// Clears the contents of this object.
|
||||
///
|
||||
void Clear();
|
||||
|
||||
///
|
||||
// Returns the number of files in the archive.
|
||||
///
|
||||
size_t GetFileCount();
|
||||
|
||||
///
|
||||
// Returns true if the specified file exists and has contents.
|
||||
///
|
||||
bool HasFile(const CefString& fileName);
|
||||
|
||||
///
|
||||
// Returns the specified file.
|
||||
///
|
||||
CefRefPtr<File> GetFile(const CefString& fileName);
|
||||
|
||||
///
|
||||
// Removes the specified file.
|
||||
///
|
||||
bool RemoveFile(const CefString& fileName);
|
||||
|
||||
///
|
||||
// Returns the map of all files.
|
||||
///
|
||||
size_t GetFiles(FileMap& map);
|
||||
|
||||
private:
|
||||
FileMap contents_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefZipArchive);
|
||||
IMPLEMENT_LOCKING(CefZipArchive);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_
|
11
libcef/browser/application_mac.h
Normal file
11
libcef/browser/application_mac.h
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that can
|
||||
// be found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_APPLICATION_MAC_H_
|
||||
#define CEF_LIBCEF_BROWSER_APPLICATION_MAC_H_
|
||||
|
||||
// Create the CefCrApplication instance used by secondary processes.
|
||||
void CefCrApplicationCreate();
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_APPLICATION_MAC_H_
|
46
libcef/browser/application_mac.mm
Normal file
46
libcef/browser/application_mac.mm
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2012 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/application_mac.h"
|
||||
|
||||
#include "base/message_pump_mac.h"
|
||||
#include "base/mac/scoped_sending_event.h"
|
||||
|
||||
@interface CefCrApplication : NSApplication<CrAppProtocol,
|
||||
CrAppControlProtocol> {
|
||||
@private
|
||||
BOOL handlingSendEvent_;
|
||||
}
|
||||
|
||||
// CrAppProtocol:
|
||||
- (BOOL)isHandlingSendEvent;
|
||||
|
||||
// CrAppControlProtocol:
|
||||
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CefCrApplication
|
||||
|
||||
- (BOOL)isHandlingSendEvent {
|
||||
return handlingSendEvent_;
|
||||
}
|
||||
|
||||
- (void)sendEvent:(NSEvent*)event {
|
||||
BOOL wasHandlingSendEvent = handlingSendEvent_;
|
||||
handlingSendEvent_ = YES;
|
||||
[super sendEvent:event];
|
||||
handlingSendEvent_ = wasHandlingSendEvent;
|
||||
}
|
||||
|
||||
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
|
||||
handlingSendEvent_ = handlingSendEvent;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
void CefCrApplicationCreate() {
|
||||
[CefCrApplication sharedApplication];
|
||||
}
|
300
libcef/browser/browser_context.cc
Normal file
300
libcef/browser/browser_context.cc
Normal file
@ -0,0 +1,300 @@
|
||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/browser_context.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/browser_main.h"
|
||||
#include "libcef/browser/download_manager_delegate.h"
|
||||
#include "libcef/browser/resource_context.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/browser/url_request_context_getter.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "content/browser/download/download_manager_impl.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/geolocation_permission_context.h"
|
||||
#include "content/public/browser/speech_recognition_preferences.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/base_paths_win.h"
|
||||
#elif defined(OS_LINUX)
|
||||
#include "base/nix/xdg_util.h"
|
||||
#endif
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace {
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
const char kDotConfigDir[] = ".config";
|
||||
const char kXdgConfigHomeEnvVar[] = "XDG_CONFIG_HOME";
|
||||
#endif
|
||||
|
||||
|
||||
class CefGeolocationPermissionContext
|
||||
: public content::GeolocationPermissionContext {
|
||||
public:
|
||||
// CefGeolocationCallback implementation.
|
||||
class CallbackImpl : public CefGeolocationCallback {
|
||||
public:
|
||||
typedef base::Callback<void(bool)> // NOLINT(readability/function)
|
||||
CallbackType;
|
||||
|
||||
explicit CallbackImpl(
|
||||
CefGeolocationPermissionContext* context,
|
||||
int bridge_id,
|
||||
const CallbackType& callback)
|
||||
: context_(context),
|
||||
bridge_id_(bridge_id),
|
||||
callback_(callback) {}
|
||||
|
||||
virtual void Continue(bool allow) OVERRIDE {
|
||||
if (CEF_CURRENTLY_ON_IOT()) {
|
||||
if (!callback_.is_null()) {
|
||||
// Callback must be executed on the UI thread.
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CallbackImpl::Run, callback_, allow));
|
||||
context_->RemoveCallback(bridge_id_);
|
||||
}
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_IOT,
|
||||
base::Bind(&CallbackImpl::Continue, this, allow));
|
||||
}
|
||||
}
|
||||
|
||||
void Disconnect() {
|
||||
callback_.Reset();
|
||||
context_ = NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
static void Run(const CallbackType& callback, bool allow) {
|
||||
CEF_REQUIRE_UIT();
|
||||
callback.Run(allow);
|
||||
}
|
||||
|
||||
CefGeolocationPermissionContext* context_;
|
||||
int bridge_id_;
|
||||
CallbackType callback_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CallbackImpl);
|
||||
};
|
||||
|
||||
CefGeolocationPermissionContext() {}
|
||||
|
||||
virtual void RequestGeolocationPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame,
|
||||
base::Callback<void(bool)> callback) // NOLINT(readability/function)
|
||||
OVERRIDE {
|
||||
CEF_REQUIRE_IOT();
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id,
|
||||
render_view_id);
|
||||
if (browser.get()) {
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
if (client.get()) {
|
||||
CefRefPtr<CefGeolocationHandler> handler =
|
||||
client->GetGeolocationHandler();
|
||||
if (handler.get()) {
|
||||
CefRefPtr<CallbackImpl> callbackPtr(
|
||||
new CallbackImpl(this, bridge_id, callback));
|
||||
|
||||
// Add the callback reference to the map.
|
||||
callback_map_.insert(std::make_pair(bridge_id, callbackPtr));
|
||||
|
||||
// Notify the handler.
|
||||
handler->OnRequestGeolocationPermission(browser.get(),
|
||||
requesting_frame.spec(), bridge_id, callbackPtr.get());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disallow geolocation access by default.
|
||||
callback.Run(false);
|
||||
}
|
||||
|
||||
virtual void CancelGeolocationPermissionRequest(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame) OVERRIDE {
|
||||
RemoveCallback(bridge_id);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id,
|
||||
render_view_id);
|
||||
if (browser.get()) {
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
if (client.get()) {
|
||||
CefRefPtr<CefGeolocationHandler> handler =
|
||||
client->GetGeolocationHandler();
|
||||
if (handler.get()) {
|
||||
// Notify the handler.
|
||||
handler->OnCancelGeolocationPermission(browser.get(),
|
||||
requesting_frame.spec(), bridge_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveCallback(int bridge_id) {
|
||||
CEF_REQUIRE_IOT();
|
||||
|
||||
// Disconnect the callback and remove the reference from the map.
|
||||
CallbackMap::iterator it = callback_map_.find(bridge_id);
|
||||
if (it != callback_map_.end()) {
|
||||
it->second->Disconnect();
|
||||
callback_map_.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
// Map of bridge ids to callback references.
|
||||
typedef std::map<int, CefRefPtr<CallbackImpl> > CallbackMap;
|
||||
CallbackMap callback_map_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefGeolocationPermissionContext);
|
||||
};
|
||||
|
||||
class CefSpeechRecognitionPreferences
|
||||
: public content::SpeechRecognitionPreferences {
|
||||
public:
|
||||
CefSpeechRecognitionPreferences() {
|
||||
}
|
||||
|
||||
// Overridden from SpeechRecognitionPreferences:
|
||||
virtual bool FilterProfanities() const OVERRIDE {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void SetFilterProfanities(bool filter_profanities) OVERRIDE {
|
||||
}
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionPreferences);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
CefBrowserContext::CefBrowserContext(
|
||||
CefBrowserMainParts* main_parts)
|
||||
: main_parts_(main_parts) {
|
||||
// Initialize the request context getter.
|
||||
url_request_getter_ = new CefURLRequestContextGetter(
|
||||
GetPath(),
|
||||
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
|
||||
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE));
|
||||
}
|
||||
|
||||
CefBrowserContext::~CefBrowserContext() {
|
||||
if (resource_context_.get()) {
|
||||
BrowserThread::DeleteSoon(
|
||||
BrowserThread::IO, FROM_HERE, resource_context_.release());
|
||||
}
|
||||
}
|
||||
|
||||
FilePath CefBrowserContext::GetPath() {
|
||||
if (!path_.empty())
|
||||
return path_;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path_));
|
||||
path_ = path_.Append(std::wstring(L"cef_data"));
|
||||
#elif defined(OS_LINUX)
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
FilePath config_dir(base::nix::GetXDGDirectory(env.get(),
|
||||
kXdgConfigHomeEnvVar,
|
||||
kDotConfigDir));
|
||||
path_ = config_dir.Append("cef_data");
|
||||
#elif defined(OS_MACOSX)
|
||||
CHECK(PathService::Get(base::DIR_APP_DATA, &path_));
|
||||
path_ = path_.Append("cef_data");
|
||||
#else
|
||||
NOTIMPLEMENTED();
|
||||
#endif
|
||||
|
||||
if (!file_util::PathExists(path_))
|
||||
file_util::CreateDirectory(path_);
|
||||
|
||||
return path_;
|
||||
}
|
||||
|
||||
bool CefBrowserContext::IsOffTheRecord() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
content::DownloadManager* CefBrowserContext::GetDownloadManager() {
|
||||
if (!download_manager_.get()) {
|
||||
download_manager_delegate_ = new CefDownloadManagerDelegate();
|
||||
download_manager_ = new DownloadManagerImpl(download_manager_delegate_,
|
||||
NULL);
|
||||
download_manager_delegate_->SetDownloadManager(download_manager_.get());
|
||||
download_manager_->Init(this);
|
||||
}
|
||||
return download_manager_.get();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter* CefBrowserContext::GetRequestContext() {
|
||||
return url_request_getter_;
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
CefBrowserContext::GetRequestContextForRenderProcess(
|
||||
int renderer_child_id) {
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserByChildID(renderer_child_id);
|
||||
if (browser.get())
|
||||
return browser->GetRequestContext();
|
||||
return GetRequestContext();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
CefBrowserContext::GetRequestContextForMedia() {
|
||||
return GetRequestContext();
|
||||
}
|
||||
|
||||
content::ResourceContext* CefBrowserContext::GetResourceContext() {
|
||||
if (!resource_context_.get()) {
|
||||
resource_context_.reset(new CefResourceContext(
|
||||
static_cast<CefURLRequestContextGetter*>(GetRequestContext())));
|
||||
}
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
||||
content::GeolocationPermissionContext*
|
||||
CefBrowserContext::GetGeolocationPermissionContext() {
|
||||
if (!geolocation_permission_context_) {
|
||||
geolocation_permission_context_ =
|
||||
new CefGeolocationPermissionContext();
|
||||
}
|
||||
return geolocation_permission_context_;
|
||||
}
|
||||
|
||||
content::SpeechRecognitionPreferences*
|
||||
CefBrowserContext::GetSpeechRecognitionPreferences() {
|
||||
if (!speech_recognition_preferences_.get())
|
||||
speech_recognition_preferences_ = new CefSpeechRecognitionPreferences();
|
||||
return speech_recognition_preferences_.get();
|
||||
}
|
||||
|
||||
bool CefBrowserContext::DidLastSessionExitCleanly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
quota::SpecialStoragePolicy* CefBrowserContext::GetSpecialStoragePolicy() {
|
||||
return NULL;
|
||||
}
|
64
libcef/browser/browser_context.h
Normal file
64
libcef/browser/browser_context.h
Normal file
@ -0,0 +1,64 @@
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_H_
|
||||
#define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/file_path.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
|
||||
class DownloadManager;
|
||||
|
||||
namespace content {
|
||||
class DownloadManagerDelegate;
|
||||
class ResourceContext;
|
||||
class SpeechRecognitionPreferences;
|
||||
}
|
||||
|
||||
class CefBrowserMainParts;
|
||||
class CefDownloadManagerDelegate;
|
||||
|
||||
class CefBrowserContext : public content::BrowserContext {
|
||||
public:
|
||||
explicit CefBrowserContext(CefBrowserMainParts* main_parts);
|
||||
virtual ~CefBrowserContext();
|
||||
|
||||
// BrowserContext methods.
|
||||
virtual FilePath GetPath() OVERRIDE;
|
||||
virtual bool IsOffTheRecord() const OVERRIDE;
|
||||
virtual content::DownloadManager* GetDownloadManager() OVERRIDE;
|
||||
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
|
||||
virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
|
||||
int renderer_child_id) OVERRIDE;
|
||||
virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE;
|
||||
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
|
||||
virtual content::GeolocationPermissionContext*
|
||||
GetGeolocationPermissionContext() OVERRIDE;
|
||||
virtual content::SpeechRecognitionPreferences*
|
||||
GetSpeechRecognitionPreferences() OVERRIDE;
|
||||
virtual bool DidLastSessionExitCleanly() OVERRIDE;
|
||||
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
FilePath path_;
|
||||
scoped_ptr<content::ResourceContext> resource_context_;
|
||||
scoped_refptr<CefDownloadManagerDelegate> download_manager_delegate_;
|
||||
scoped_refptr<content::DownloadManager> download_manager_;
|
||||
scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
|
||||
scoped_refptr<content::GeolocationPermissionContext>
|
||||
geolocation_permission_context_;
|
||||
scoped_refptr<content::SpeechRecognitionPreferences>
|
||||
speech_recognition_preferences_;
|
||||
|
||||
CefBrowserMainParts* main_parts_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBrowserContext);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_H_
|
1240
libcef/browser/browser_host_impl.cc
Normal file
1240
libcef/browser/browser_host_impl.cc
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user