diff --git a/cef.gyp b/cef.gyp index 62a51dcaa..bd248d202 100644 --- a/cef.gyp +++ b/cef.gyp @@ -19,9 +19,9 @@ }], ], 'includes': [ - # Bring in the source file lists for cefclient. - 'cef_paths.gypi', - ], + # Bring in the source file lists. + 'cef_paths2.gypi', + ], 'targets': [ { 'target_name': 'cefclient', @@ -42,6 +42,7 @@ ], 'sources': [ '<@(includes_common)', + '<@(includes_wrapper)', '<@(cefclient_sources_common)', ], 'mac_bundle_resources': [ @@ -389,114 +390,8 @@ ], 'sources': [ '<@(includes_common)', - 'libcef_dll/cef_logging.h', - 'libcef_dll/cpptoc/browser_cpptoc.cc', - 'libcef_dll/cpptoc/browser_cpptoc.h', - 'libcef_dll/cpptoc/command_line_cpptoc.cc', - 'libcef_dll/cpptoc/command_line_cpptoc.h', - 'libcef_dll/cpptoc/cpptoc.h', - 'libcef_dll/cpptoc/domdocument_cpptoc.cc', - 'libcef_dll/cpptoc/domdocument_cpptoc.h', - 'libcef_dll/cpptoc/domevent_cpptoc.cc', - 'libcef_dll/cpptoc/domevent_cpptoc.h', - 'libcef_dll/cpptoc/domnode_cpptoc.cc', - 'libcef_dll/cpptoc/domnode_cpptoc.h', - 'libcef_dll/cpptoc/drag_data_cpptoc.cc', - 'libcef_dll/cpptoc/drag_data_cpptoc.h', - 'libcef_dll/cpptoc/frame_cpptoc.cc', - 'libcef_dll/cpptoc/frame_cpptoc.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/request_cpptoc.cc', - 'libcef_dll/cpptoc/request_cpptoc.h', - 'libcef_dll/cpptoc/response_cpptoc.cc', - 'libcef_dll/cpptoc/response_cpptoc.h', - 'libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc', - 'libcef_dll/cpptoc/scheme_handler_callback_cpptoc.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/cpptoc/v8context_cpptoc.cc', - 'libcef_dll/cpptoc/v8context_cpptoc.h', - 'libcef_dll/cpptoc/v8exception_cpptoc.cc', - 'libcef_dll/cpptoc/v8exception_cpptoc.h', - 'libcef_dll/cpptoc/v8value_cpptoc.cc', - 'libcef_dll/cpptoc/v8value_cpptoc.h', - 'libcef_dll/cpptoc/web_urlrequest_cpptoc.cc', - 'libcef_dll/cpptoc/web_urlrequest_cpptoc.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', - 'libcef_dll/ctocpp/app_ctocpp.cc', - 'libcef_dll/ctocpp/app_ctocpp.h', - 'libcef_dll/ctocpp/client_ctocpp.cc', - 'libcef_dll/ctocpp/client_ctocpp.h', - 'libcef_dll/ctocpp/content_filter_ctocpp.cc', - 'libcef_dll/ctocpp/content_filter_ctocpp.h', - 'libcef_dll/ctocpp/cookie_visitor_ctocpp.cc', - 'libcef_dll/ctocpp/cookie_visitor_ctocpp.h', - 'libcef_dll/ctocpp/ctocpp.h', - 'libcef_dll/ctocpp/display_handler_ctocpp.cc', - 'libcef_dll/ctocpp/display_handler_ctocpp.h', - 'libcef_dll/ctocpp/domevent_listener_ctocpp.cc', - 'libcef_dll/ctocpp/domevent_listener_ctocpp.h', - 'libcef_dll/ctocpp/domvisitor_ctocpp.cc', - 'libcef_dll/ctocpp/domvisitor_ctocpp.h', - 'libcef_dll/ctocpp/download_handler_ctocpp.cc', - 'libcef_dll/ctocpp/download_handler_ctocpp.h', - 'libcef_dll/ctocpp/drag_handler_ctocpp.cc', - 'libcef_dll/ctocpp/drag_handler_ctocpp.h', - 'libcef_dll/ctocpp/find_handler_ctocpp.cc', - 'libcef_dll/ctocpp/find_handler_ctocpp.h', - 'libcef_dll/ctocpp/focus_handler_ctocpp.cc', - 'libcef_dll/ctocpp/focus_handler_ctocpp.h', - 'libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc', - 'libcef_dll/ctocpp/jsdialog_handler_ctocpp.h', - 'libcef_dll/ctocpp/keyboard_handler_ctocpp.cc', - 'libcef_dll/ctocpp/keyboard_handler_ctocpp.h', - 'libcef_dll/ctocpp/life_span_handler_ctocpp.cc', - 'libcef_dll/ctocpp/life_span_handler_ctocpp.h', - 'libcef_dll/ctocpp/load_handler_ctocpp.cc', - 'libcef_dll/ctocpp/load_handler_ctocpp.h', - 'libcef_dll/ctocpp/menu_handler_ctocpp.cc', - 'libcef_dll/ctocpp/menu_handler_ctocpp.h', - 'libcef_dll/ctocpp/print_handler_ctocpp.cc', - 'libcef_dll/ctocpp/print_handler_ctocpp.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_handler_ctocpp.cc', - 'libcef_dll/ctocpp/render_handler_ctocpp.h', - 'libcef_dll/ctocpp/request_handler_ctocpp.cc', - 'libcef_dll/ctocpp/request_handler_ctocpp.h', - 'libcef_dll/ctocpp/scheme_handler_ctocpp.cc', - 'libcef_dll/ctocpp/scheme_handler_ctocpp.h', - 'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc', - 'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h', - 'libcef_dll/ctocpp/storage_visitor_ctocpp.cc', - 'libcef_dll/ctocpp/storage_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/ctocpp/v8context_handler_ctocpp.cc', - 'libcef_dll/ctocpp/v8context_handler_ctocpp.h', - 'libcef_dll/ctocpp/v8handler_ctocpp.cc', - 'libcef_dll/ctocpp/v8handler_ctocpp.h', - 'libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc', - 'libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h', - 'libcef_dll/ctocpp/write_handler_ctocpp.cc', - 'libcef_dll/ctocpp/write_handler_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', + '<@(includes_capi)', + '<@(libcef_sources_common)', ], 'xcode_settings': { 'INSTALL_PATH': '@executable_path', @@ -569,6 +464,8 @@ ], 'sources': [ '<@(includes_common)', + '<@(includes_capi)', + '<@(includes_wrapper)', '<@(libcef_dll_wrapper_sources_common)', ], }, @@ -730,6 +627,7 @@ 'libcef/cef_time.cc', 'libcef/cef_time_util.h', 'libcef/command_line_impl.cc', + 'libcef/cookie_impl.cc', 'libcef/drag_data_impl.cc', 'libcef/drag_data_impl.h', 'libcef/drag_download_file.cc', @@ -754,6 +652,7 @@ 'libcef/external_protocol_handler.h', 'libcef/http_header_utils.cc', 'libcef/http_header_utils.h', + 'libcef/nplugin_impl.cc', 'libcef/origin_whitelist_impl.cc', 'libcef/request_impl.cc', 'libcef/request_impl.h', @@ -762,9 +661,12 @@ 'libcef/scheme_impl.cc', 'libcef/simple_clipboard_impl.cc', 'libcef/simple_clipboard_impl.h', + 'libcef/storage_impl.cc', 'libcef/stream_impl.cc', 'libcef/stream_impl.h', + 'libcef/task_impl.cc', 'libcef/tracker.h', + 'libcef/url_impl.cc', 'libcef/v8_impl.cc', 'libcef/v8_impl.h', 'libcef/web_urlrequest_impl.cc', diff --git a/cef_paths.gypi b/cef_paths.gypi index 79f11871b..5ed01db3c 100644 --- a/cef_paths.gypi +++ b/cef_paths.gypi @@ -1,240 +1,295 @@ -# 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. - -{ - 'variables': { - 'includes_common': [ - 'include/cef.h', - 'include/cef_capi.h', - 'include/cef_nplugin.h', - 'include/cef_nplugin_capi.h', - 'include/cef_runnable.h', - 'include/cef_version.h', - 'include/cef_wrapper.h', - 'include/internal/cef_build.h', - 'include/internal/cef_export.h', - 'include/internal/cef_nplugin_types.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', - ], - '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', - ], - 'cefclient_sources_common': [ - 'tests/cefclient/binding_test.cpp', - 'tests/cefclient/binding_test.h', - '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/client_popup_handler.cpp', - 'tests/cefclient/client_popup_handler.h', - 'tests/cefclient/download_handler.cpp', - 'tests/cefclient/download_handler.h', - 'tests/cefclient/extension_test.cpp', - 'tests/cefclient/extension_test.h', - 'tests/cefclient/res/domaccess.html', - 'tests/cefclient/res/extensionperf.html', - '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/clientplugin.cpp', - 'tests/cefclient/clientplugin.h', - 'tests/cefclient/osrplugin.cpp', - 'tests/cefclient/osrplugin.h', - 'tests/cefclient/osrplugin_test.cpp', - 'tests/cefclient/osrplugin_test.h', - 'tests/cefclient/plugin_test.cpp', - 'tests/cefclient/plugin_test.h', - 'tests/cefclient/Resource.h', - 'tests/cefclient/res/cefclient.ico', - 'tests/cefclient/res/logoball.png', - 'tests/cefclient/res/modaldialog.html', - 'tests/cefclient/res/modalmain.html', - 'tests/cefclient/res/osrplugin.html', - 'tests/cefclient/res/small.ico', - 'tests/cefclient/res/transparency.html', - 'tests/cefclient/res/uiplugin.html', - 'tests/cefclient/resource_util_win.cpp', - 'tests/cefclient/uiplugin.cpp', - 'tests/cefclient/uiplugin.h', - 'tests/cefclient/uiplugin_test.cpp', - 'tests/cefclient/uiplugin_test.h', - ], - 'cefclient_sources_mac': [ - 'tests/cefclient/cefclient_mac.mm', - 'tests/cefclient/client_handler_mac.mm', - 'tests/cefclient/resource_util_mac.mm', - ], - '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/domaccess.html', - 'tests/cefclient/res/extensionperf.html', - '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/domaccess.html', - 'tests/cefclient/res/extensionperf.html', - 'tests/cefclient/res/localstorage.html', - 'tests/cefclient/res/logo.png', - 'tests/cefclient/res/xmlhttprequest.html', - ], - 'libcef_dll_wrapper_sources_common': [ - 'libcef_dll/cef_logging.h', - 'libcef_dll/cpptoc/app_cpptoc.cc', - 'libcef_dll/cpptoc/app_cpptoc.h', - 'libcef_dll/cpptoc/base_cpptoc.h', - 'libcef_dll/cpptoc/client_cpptoc.cc', - 'libcef_dll/cpptoc/client_cpptoc.h', - 'libcef_dll/cpptoc/content_filter_cpptoc.cc', - 'libcef_dll/cpptoc/content_filter_cpptoc.h', - 'libcef_dll/cpptoc/cookie_visitor_cpptoc.cc', - 'libcef_dll/cpptoc/cookie_visitor_cpptoc.h', - 'libcef_dll/cpptoc/cpptoc.h', - 'libcef_dll/cpptoc/display_handler_cpptoc.cc', - 'libcef_dll/cpptoc/display_handler_cpptoc.h', - 'libcef_dll/cpptoc/domevent_listener_cpptoc.cc', - 'libcef_dll/cpptoc/domevent_listener_cpptoc.h', - 'libcef_dll/cpptoc/domvisitor_cpptoc.cc', - 'libcef_dll/cpptoc/domvisitor_cpptoc.h', - 'libcef_dll/cpptoc/download_handler_cpptoc.cc', - 'libcef_dll/cpptoc/download_handler_cpptoc.h', - 'libcef_dll/cpptoc/drag_handler_cpptoc.cc', - 'libcef_dll/cpptoc/drag_handler_cpptoc.h', - 'libcef_dll/cpptoc/find_handler_cpptoc.cc', - 'libcef_dll/cpptoc/find_handler_cpptoc.h', - 'libcef_dll/cpptoc/focus_handler_cpptoc.cc', - 'libcef_dll/cpptoc/focus_handler_cpptoc.h', - 'libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc', - 'libcef_dll/cpptoc/jsdialog_handler_cpptoc.h', - 'libcef_dll/cpptoc/keyboard_handler_cpptoc.cc', - 'libcef_dll/cpptoc/keyboard_handler_cpptoc.h', - 'libcef_dll/cpptoc/life_span_handler_cpptoc.cc', - 'libcef_dll/cpptoc/life_span_handler_cpptoc.h', - 'libcef_dll/cpptoc/load_handler_cpptoc.cc', - 'libcef_dll/cpptoc/load_handler_cpptoc.h', - 'libcef_dll/cpptoc/menu_handler_cpptoc.cc', - 'libcef_dll/cpptoc/menu_handler_cpptoc.h', - 'libcef_dll/cpptoc/print_handler_cpptoc.cc', - 'libcef_dll/cpptoc/print_handler_cpptoc.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_handler_cpptoc.cc', - 'libcef_dll/cpptoc/render_handler_cpptoc.h', - 'libcef_dll/cpptoc/request_handler_cpptoc.cc', - 'libcef_dll/cpptoc/request_handler_cpptoc.h', - 'libcef_dll/cpptoc/scheme_handler_cpptoc.cc', - 'libcef_dll/cpptoc/scheme_handler_cpptoc.h', - 'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc', - 'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h', - 'libcef_dll/cpptoc/storage_visitor_cpptoc.cc', - 'libcef_dll/cpptoc/storage_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/cpptoc/v8context_handler_cpptoc.cc', - 'libcef_dll/cpptoc/v8context_handler_cpptoc.h', - 'libcef_dll/cpptoc/v8handler_cpptoc.cc', - 'libcef_dll/cpptoc/v8handler_cpptoc.h', - 'libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc', - 'libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h', - 'libcef_dll/cpptoc/write_handler_cpptoc.cc', - 'libcef_dll/cpptoc/write_handler_cpptoc.h', - 'libcef_dll/ctocpp/base_ctocpp.h', - 'libcef_dll/ctocpp/browser_ctocpp.cc', - 'libcef_dll/ctocpp/browser_ctocpp.h', - 'libcef_dll/ctocpp/command_line_ctocpp.cc', - 'libcef_dll/ctocpp/command_line_ctocpp.h', - 'libcef_dll/ctocpp/ctocpp.h', - 'libcef_dll/ctocpp/domdocument_ctocpp.cc', - 'libcef_dll/ctocpp/domdocument_ctocpp.h', - 'libcef_dll/ctocpp/domevent_ctocpp.cc', - 'libcef_dll/ctocpp/domevent_ctocpp.h', - 'libcef_dll/ctocpp/domnode_ctocpp.cc', - 'libcef_dll/ctocpp/domnode_ctocpp.h', - 'libcef_dll/ctocpp/drag_data_ctocpp.cc', - 'libcef_dll/ctocpp/drag_data_ctocpp.h', - 'libcef_dll/ctocpp/frame_ctocpp.cc', - 'libcef_dll/ctocpp/frame_ctocpp.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/request_ctocpp.cc', - 'libcef_dll/ctocpp/request_ctocpp.h', - 'libcef_dll/ctocpp/response_ctocpp.cc', - 'libcef_dll/ctocpp/response_ctocpp.h', - 'libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc', - 'libcef_dll/ctocpp/scheme_handler_callback_ctocpp.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/ctocpp/v8context_ctocpp.cc', - 'libcef_dll/ctocpp/v8context_ctocpp.h', - 'libcef_dll/ctocpp/v8exception_ctocpp.cc', - 'libcef_dll/ctocpp/v8exception_ctocpp.h', - 'libcef_dll/ctocpp/v8value_ctocpp.cc', - 'libcef_dll/ctocpp/v8value_ctocpp.h', - 'libcef_dll/ctocpp/web_urlrequest_ctocpp.cc', - 'libcef_dll/ctocpp/web_urlrequest_ctocpp.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', - 'libcef_dll/transfer_util.cpp', - 'libcef_dll/transfer_util.h', - 'libcef_dll/wrapper/cef_byte_read_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', - ], - }, -} +# 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. +# +# --------------------------------------------------------------------------- +# +# 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_client.h', + 'include/cef_command_line.h', + 'include/cef_content_filter.h', + 'include/cef_cookie.h', + 'include/cef_display_handler.h', + 'include/cef_dom.h', + 'include/cef_download_handler.h', + 'include/cef_drag_data.h', + 'include/cef_drag_handler.h', + 'include/cef_find_handler.h', + 'include/cef_focus_handler.h', + 'include/cef_frame.h', + 'include/cef_jsdialog_handler.h', + 'include/cef_keyboard_handler.h', + 'include/cef_life_span_handler.h', + 'include/cef_load_handler.h', + 'include/cef_menu_handler.h', + 'include/cef_origin_whitelist.h', + 'include/cef_print_handler.h', + 'include/cef_proxy_handler.h', + 'include/cef_render_handler.h', + 'include/cef_request.h', + 'include/cef_request_handler.h', + 'include/cef_response.h', + 'include/cef_scheme.h', + 'include/cef_storage.h', + 'include/cef_stream.h', + 'include/cef_task.h', + 'include/cef_url.h', + 'include/cef_v8.h', + 'include/cef_v8context_handler.h', + 'include/cef_web_urlrequest.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_client_capi.h', + 'include/capi/cef_command_line_capi.h', + 'include/capi/cef_content_filter_capi.h', + 'include/capi/cef_cookie_capi.h', + 'include/capi/cef_display_handler_capi.h', + 'include/capi/cef_dom_capi.h', + 'include/capi/cef_download_handler_capi.h', + 'include/capi/cef_drag_data_capi.h', + 'include/capi/cef_drag_handler_capi.h', + 'include/capi/cef_find_handler_capi.h', + 'include/capi/cef_focus_handler_capi.h', + 'include/capi/cef_frame_capi.h', + 'include/capi/cef_jsdialog_handler_capi.h', + 'include/capi/cef_keyboard_handler_capi.h', + 'include/capi/cef_life_span_handler_capi.h', + 'include/capi/cef_load_handler_capi.h', + 'include/capi/cef_menu_handler_capi.h', + 'include/capi/cef_origin_whitelist_capi.h', + 'include/capi/cef_print_handler_capi.h', + 'include/capi/cef_proxy_handler_capi.h', + 'include/capi/cef_render_handler_capi.h', + 'include/capi/cef_request_capi.h', + 'include/capi/cef_request_handler_capi.h', + 'include/capi/cef_response_capi.h', + 'include/capi/cef_scheme_capi.h', + 'include/capi/cef_storage_capi.h', + 'include/capi/cef_stream_capi.h', + 'include/capi/cef_task_capi.h', + 'include/capi/cef_url_capi.h', + 'include/capi/cef_v8_capi.h', + 'include/capi/cef_v8context_handler_capi.h', + 'include/capi/cef_web_urlrequest_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/browser_cpptoc.cc', + 'libcef_dll/cpptoc/browser_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/ctocpp/content_filter_ctocpp.cc', + 'libcef_dll/ctocpp/content_filter_ctocpp.h', + 'libcef_dll/ctocpp/cookie_visitor_ctocpp.cc', + 'libcef_dll/ctocpp/cookie_visitor_ctocpp.h', + 'libcef_dll/cpptoc/domdocument_cpptoc.cc', + 'libcef_dll/cpptoc/domdocument_cpptoc.h', + 'libcef_dll/cpptoc/domevent_cpptoc.cc', + 'libcef_dll/cpptoc/domevent_cpptoc.h', + 'libcef_dll/ctocpp/domevent_listener_ctocpp.cc', + 'libcef_dll/ctocpp/domevent_listener_ctocpp.h', + 'libcef_dll/cpptoc/domnode_cpptoc.cc', + 'libcef_dll/cpptoc/domnode_cpptoc.h', + 'libcef_dll/ctocpp/domvisitor_ctocpp.cc', + 'libcef_dll/ctocpp/domvisitor_ctocpp.h', + 'libcef_dll/ctocpp/display_handler_ctocpp.cc', + 'libcef_dll/ctocpp/display_handler_ctocpp.h', + 'libcef_dll/ctocpp/download_handler_ctocpp.cc', + 'libcef_dll/ctocpp/download_handler_ctocpp.h', + 'libcef_dll/cpptoc/drag_data_cpptoc.cc', + 'libcef_dll/cpptoc/drag_data_cpptoc.h', + 'libcef_dll/ctocpp/drag_handler_ctocpp.cc', + 'libcef_dll/ctocpp/drag_handler_ctocpp.h', + 'libcef_dll/ctocpp/find_handler_ctocpp.cc', + 'libcef_dll/ctocpp/find_handler_ctocpp.h', + 'libcef_dll/ctocpp/focus_handler_ctocpp.cc', + 'libcef_dll/ctocpp/focus_handler_ctocpp.h', + 'libcef_dll/cpptoc/frame_cpptoc.cc', + 'libcef_dll/cpptoc/frame_cpptoc.h', + 'libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc', + 'libcef_dll/ctocpp/jsdialog_handler_ctocpp.h', + 'libcef_dll/ctocpp/keyboard_handler_ctocpp.cc', + 'libcef_dll/ctocpp/keyboard_handler_ctocpp.h', + 'libcef_dll/ctocpp/life_span_handler_ctocpp.cc', + 'libcef_dll/ctocpp/life_span_handler_ctocpp.h', + 'libcef_dll/ctocpp/load_handler_ctocpp.cc', + 'libcef_dll/ctocpp/load_handler_ctocpp.h', + 'libcef_dll/ctocpp/menu_handler_ctocpp.cc', + 'libcef_dll/ctocpp/menu_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/ctocpp/print_handler_ctocpp.cc', + 'libcef_dll/ctocpp/print_handler_ctocpp.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_handler_ctocpp.cc', + 'libcef_dll/ctocpp/render_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/cpptoc/response_cpptoc.cc', + 'libcef_dll/cpptoc/response_cpptoc.h', + 'libcef_dll/ctocpp/scheme_handler_ctocpp.cc', + 'libcef_dll/ctocpp/scheme_handler_ctocpp.h', + 'libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc', + 'libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h', + 'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc', + 'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h', + 'libcef_dll/ctocpp/storage_visitor_ctocpp.cc', + 'libcef_dll/ctocpp/storage_visitor_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/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/ctocpp/v8context_handler_ctocpp.cc', + 'libcef_dll/ctocpp/v8context_handler_ctocpp.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/cpptoc/web_urlrequest_cpptoc.cc', + 'libcef_dll/cpptoc/web_urlrequest_cpptoc.h', + 'libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc', + 'libcef_dll/ctocpp/web_urlrequest_client_ctocpp.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/browser_ctocpp.cc', + 'libcef_dll/ctocpp/browser_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/cpptoc/content_filter_cpptoc.cc', + 'libcef_dll/cpptoc/content_filter_cpptoc.h', + 'libcef_dll/cpptoc/cookie_visitor_cpptoc.cc', + 'libcef_dll/cpptoc/cookie_visitor_cpptoc.h', + 'libcef_dll/ctocpp/domdocument_ctocpp.cc', + 'libcef_dll/ctocpp/domdocument_ctocpp.h', + 'libcef_dll/ctocpp/domevent_ctocpp.cc', + 'libcef_dll/ctocpp/domevent_ctocpp.h', + 'libcef_dll/cpptoc/domevent_listener_cpptoc.cc', + 'libcef_dll/cpptoc/domevent_listener_cpptoc.h', + 'libcef_dll/ctocpp/domnode_ctocpp.cc', + 'libcef_dll/ctocpp/domnode_ctocpp.h', + 'libcef_dll/cpptoc/domvisitor_cpptoc.cc', + 'libcef_dll/cpptoc/domvisitor_cpptoc.h', + 'libcef_dll/cpptoc/display_handler_cpptoc.cc', + 'libcef_dll/cpptoc/display_handler_cpptoc.h', + 'libcef_dll/cpptoc/download_handler_cpptoc.cc', + 'libcef_dll/cpptoc/download_handler_cpptoc.h', + 'libcef_dll/ctocpp/drag_data_ctocpp.cc', + 'libcef_dll/ctocpp/drag_data_ctocpp.h', + 'libcef_dll/cpptoc/drag_handler_cpptoc.cc', + 'libcef_dll/cpptoc/drag_handler_cpptoc.h', + 'libcef_dll/cpptoc/find_handler_cpptoc.cc', + 'libcef_dll/cpptoc/find_handler_cpptoc.h', + 'libcef_dll/cpptoc/focus_handler_cpptoc.cc', + 'libcef_dll/cpptoc/focus_handler_cpptoc.h', + 'libcef_dll/ctocpp/frame_ctocpp.cc', + 'libcef_dll/ctocpp/frame_ctocpp.h', + 'libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc', + 'libcef_dll/cpptoc/jsdialog_handler_cpptoc.h', + 'libcef_dll/cpptoc/keyboard_handler_cpptoc.cc', + 'libcef_dll/cpptoc/keyboard_handler_cpptoc.h', + 'libcef_dll/cpptoc/life_span_handler_cpptoc.cc', + 'libcef_dll/cpptoc/life_span_handler_cpptoc.h', + 'libcef_dll/cpptoc/load_handler_cpptoc.cc', + 'libcef_dll/cpptoc/load_handler_cpptoc.h', + 'libcef_dll/cpptoc/menu_handler_cpptoc.cc', + 'libcef_dll/cpptoc/menu_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/cpptoc/print_handler_cpptoc.cc', + 'libcef_dll/cpptoc/print_handler_cpptoc.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_handler_cpptoc.cc', + 'libcef_dll/cpptoc/render_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/ctocpp/response_ctocpp.cc', + 'libcef_dll/ctocpp/response_ctocpp.h', + 'libcef_dll/cpptoc/scheme_handler_cpptoc.cc', + 'libcef_dll/cpptoc/scheme_handler_cpptoc.h', + 'libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc', + 'libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h', + 'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc', + 'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h', + 'libcef_dll/cpptoc/storage_visitor_cpptoc.cc', + 'libcef_dll/cpptoc/storage_visitor_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/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/cpptoc/v8context_handler_cpptoc.cc', + 'libcef_dll/cpptoc/v8context_handler_cpptoc.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/ctocpp/web_urlrequest_ctocpp.cc', + 'libcef_dll/ctocpp/web_urlrequest_ctocpp.h', + 'libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc', + 'libcef_dll/cpptoc/web_urlrequest_client_cpptoc.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', + ], + }, +} diff --git a/cef_paths2.gypi b/cef_paths2.gypi new file mode 100644 index 000000000..e8abb29c0 --- /dev/null +++ b/cef_paths2.gypi @@ -0,0 +1,164 @@ +# 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_nplugin.h', + 'include/cef_runnable.h', + 'include/cef_version.h', + 'include/internal/cef_build.h', + 'include/internal/cef_export.h', + 'include/internal/cef_nplugin_types.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', + 'include/capi/cef_nplugin_capi.h', + '<@(autogen_capi_includes)', + ], + 'includes_wrapper': [ + 'include/wrapper/cef_byte_read_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_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/binding_test.cpp', + 'tests/cefclient/binding_test.h', + '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/client_popup_handler.cpp', + 'tests/cefclient/client_popup_handler.h', + 'tests/cefclient/download_handler.cpp', + 'tests/cefclient/download_handler.h', + 'tests/cefclient/extension_test.cpp', + 'tests/cefclient/extension_test.h', + 'tests/cefclient/res/domaccess.html', + 'tests/cefclient/res/extensionperf.html', + '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/clientplugin.cpp', + 'tests/cefclient/clientplugin.h', + 'tests/cefclient/osrplugin.cpp', + 'tests/cefclient/osrplugin.h', + 'tests/cefclient/osrplugin_test.cpp', + 'tests/cefclient/osrplugin_test.h', + 'tests/cefclient/plugin_test.cpp', + 'tests/cefclient/plugin_test.h', + 'tests/cefclient/Resource.h', + 'tests/cefclient/res/cefclient.ico', + 'tests/cefclient/res/logoball.png', + 'tests/cefclient/res/modaldialog.html', + 'tests/cefclient/res/modalmain.html', + 'tests/cefclient/res/osrplugin.html', + 'tests/cefclient/res/small.ico', + 'tests/cefclient/res/transparency.html', + 'tests/cefclient/res/uiplugin.html', + 'tests/cefclient/resource_util_win.cpp', + 'tests/cefclient/uiplugin.cpp', + 'tests/cefclient/uiplugin.h', + 'tests/cefclient/uiplugin_test.cpp', + 'tests/cefclient/uiplugin_test.h', + ], + 'cefclient_sources_mac': [ + 'tests/cefclient/cefclient_mac.mm', + 'tests/cefclient/client_handler_mac.mm', + 'tests/cefclient/resource_util_mac.mm', + ], + '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/domaccess.html', + 'tests/cefclient/res/extensionperf.html', + '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/domaccess.html', + 'tests/cefclient/res/extensionperf.html', + 'tests/cefclient/res/localstorage.html', + 'tests/cefclient/res/logo.png', + 'tests/cefclient/res/xmlhttprequest.html', + ], + }, +} diff --git a/include/capi/cef_app_capi.h b/include/capi/cef_app_capi.h new file mode 100644 index 000000000..743b7f5ad --- /dev/null +++ b/include/capi/cef_app_capi.h @@ -0,0 +1,113 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_APP_CAPI_H +#define _CEF_APP_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// This function should be called on the main application thread to initialize +// CEF when the application is started. 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_settings_t* settings, + struct _cef_app_t* application); + +/// +// This function should be called on the main application thread to shut down +// CEF 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. +/// +typedef struct _cef_app_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Return the handler for proxy events. If not handler is returned the default + // system handler will be used. + /// + struct _cef_proxy_handler_t* (CEF_CALLBACK *get_proxy_handler)( + struct _cef_app_t* self); + +} cef_app_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_APP_CAPI_H diff --git a/include/capi/cef_base_capi.h b/include/capi/cef_base_capi.h new file mode 100644 index 000000000..6834ed655 --- /dev/null +++ b/include/capi/cef_base_capi.h @@ -0,0 +1,87 @@ +// 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_BASE_CAPI_H +#define _CEF_BASE_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../internal/cef_export.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_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_BASE_CAPI_H diff --git a/include/capi/cef_browser_capi.h b/include/capi/cef_browser_capi.h new file mode 100644 index 000000000..80dc7efd4 --- /dev/null +++ b/include/capi/cef_browser_capi.h @@ -0,0 +1,323 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_BROWSER_CAPI_H +#define _CEF_BROWSER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Structure used to represent a browser window. The functions of this structure +// may be called on any thread unless otherwise indicated in the comments. +/// +typedef struct _cef_browser_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // 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_t* self); + + /// + // Closes this browser window. + /// + void (CEF_CALLBACK *close_browser)(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); + + /// + // 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); + + /// + // 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_t* self, int enable); + + /// + // Retrieve the window handle for this browser. + /// + cef_window_handle_t (CEF_CALLBACK *get_window_handle)( + struct _cef_browser_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_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 client for this browser. + /// + struct _cef_client_t* (CEF_CALLBACK *get_client)(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. This function should only + // be called on the UI thread. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)( + struct _cef_browser_t* self); + + /// + // Returns the frame with the specified name, or NULL if not found. This + // function should only be called on the UI thread. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self, + const cef_string_t* name); + + /// + // Returns the names of all existing frames. This function should only be + // called on the UI thread. + /// + void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self, + cef_string_list_t names); + + /// + // Search for |searchText|. |identifier| can be used to have multiple searches + // running simultaniously. |forward| indicates whether to search forward or + // backward within the page. |matchCase| indicates whether the search should + // be case-sensitive. |findNext| indicates whether this is the first request + // or a follow-up. + /// + void (CEF_CALLBACK *find)(struct _cef_browser_t* self, int identifier, + const cef_string_t* searchText, int forward, int matchCase, + int findNext); + + /// + // Cancel all searches that are currently going on. + /// + void (CEF_CALLBACK *stop_finding)(struct _cef_browser_t* self, + int clearSelection); + + /// + // Get the zoom level. + /// + double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_t* self); + + /// + // Change the zoom level to the specified value. + /// + void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_t* self, + double zoomLevel); + + /// + // Clear the back/forward browsing history. + /// + void (CEF_CALLBACK *clear_history)(struct _cef_browser_t* self); + + /// + // Open developer tools in its own window. + /// + void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_t* self); + + /// + // Explicitly close the developer tools window if one exists for this browser + // instance. + /// + void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_t* self); + + /// + // Returns true (1) if window rendering is disabled. + /// + int (CEF_CALLBACK *is_window_rendering_disabled)(struct _cef_browser_t* self); + + /// + // Get the size of the specified element. This function should only be called + // on the UI thread. + /// + int (CEF_CALLBACK *get_size)(struct _cef_browser_t* self, + enum cef_paint_element_type_t type, int* width, int* height); + + /// + // Set the size of the specified element. This function is only used when + // window rendering is disabled. + /// + void (CEF_CALLBACK *set_size)(struct _cef_browser_t* self, + enum cef_paint_element_type_t type, int width, int height); + + /// + // Returns true (1) if a popup is currently visible. This function should only + // be called on the UI thread. + /// + int (CEF_CALLBACK *is_popup_visible)(struct _cef_browser_t* self); + + /// + // Hide the currently visible popup, if any. + /// + void (CEF_CALLBACK *hide_popup)(struct _cef_browser_t* self); + + /// + // Invalidate the |dirtyRect| region of the view. This function is only used + // when window rendering is disabled and will result in a call to + // HandlePaint(). + /// + void (CEF_CALLBACK *invalidate)(struct _cef_browser_t* self, + const cef_rect_t* dirtyRect); + + /// + // Get the raw image data contained in the specified element without + // performing validation. The specified |width| and |height| dimensions must + // match the current element size. On Windows |buffer| must be width*height*4 + // bytes in size and represents a BGRA image with an upper-left origin. This + // function should only be called on the UI thread. + /// + int (CEF_CALLBACK *get_image)(struct _cef_browser_t* self, + enum cef_paint_element_type_t type, int width, int height, + void* buffer); + + /// + // Send a key event to the browser. + /// + void (CEF_CALLBACK *send_key_event)(struct _cef_browser_t* self, + enum cef_key_type_t type, int key, int modifiers, int sysChar, + int imeChar); + + /// + // Send a mouse click event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_t* self, + int x, int y, enum cef_mouse_button_type_t type, int mouseUp, + int clickCount); + + /// + // Send a mouse move event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_t* self, int x, + int y, int mouseLeave); + + /// + // Send a mouse wheel event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_t* self, + int x, int y, int delta); + + /// + // Send a focus event to the browser. + /// + void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_t* self, + int setFocus); + + /// + // Send a capture lost event to the browser. + /// + void (CEF_CALLBACK *send_capture_lost_event)(struct _cef_browser_t* self); + +} cef_browser_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 call will not block. +/// +CEF_EXPORT int cef_browser_create(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 should only be called on the UI thread. +/// +CEF_EXPORT cef_browser_t* cef_browser_create_sync(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_BROWSER_CAPI_H diff --git a/include/capi/cef_client_capi.h b/include/capi/cef_client_capi.h new file mode 100644 index 000000000..75016ed36 --- /dev/null +++ b/include/capi/cef_client_capi.h @@ -0,0 +1,142 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_CLIENT_CAPI_H +#define _CEF_CLIENT_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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 focus events. + /// + struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for keyboard events. + /// + struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for context menu events. + /// + struct _cef_menu_handler_t* (CEF_CALLBACK *get_menu_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for printing events. + /// + struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for find result events. + /// + struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for JavaScript dialog events. + /// + struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for V8 context events. + /// + struct _cef_v8context_handler_t* (CEF_CALLBACK *get_v8context_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for off-screen rendering events. + /// + struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for drag events. + /// + struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)( + struct _cef_client_t* self); + +} cef_client_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_CLIENT_CAPI_H diff --git a/include/capi/cef_command_line_capi.h b/include/capi/cef_command_line_capi.h new file mode 100644 index 000000000..65a76a5e0 --- /dev/null +++ b/include/capi/cef_command_line_capi.h @@ -0,0 +1,170 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_COMMAND_LINE_CAPI_H +#define _CEF_COMMAND_LINE_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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; + + /// + // 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); + + /// + // 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(); + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_COMMAND_LINE_CAPI_H diff --git a/include/capi/cef_content_filter_capi.h b/include/capi/cef_content_filter_capi.h new file mode 100644 index 000000000..1bdf2e6c3 --- /dev/null +++ b/include/capi/cef_content_filter_capi.h @@ -0,0 +1,81 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_CONTENT_FILTER_CAPI_H +#define _CEF_CONTENT_FILTER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Structure to implement for filtering response content. The functions of this +// structure will always be called on the UI thread. +/// +typedef struct _cef_content_filter_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Set |substitute_data| to the replacement for the data in |data| if data + // should be modified. + /// + void (CEF_CALLBACK *process_data)(struct _cef_content_filter_t* self, + const void* data, int data_size, + struct _cef_stream_reader_t** substitute_data); + + /// + // Called when there is no more data to be processed. It is expected that + // whatever data was retained in the last process_data() call, it should be + // returned now by setting |remainder| if appropriate. + /// + void (CEF_CALLBACK *drain)(struct _cef_content_filter_t* self, + struct _cef_stream_reader_t** remainder); + +} cef_content_filter_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_CONTENT_FILTER_CAPI_H diff --git a/include/capi/cef_cookie_capi.h b/include/capi/cef_cookie_capi.h new file mode 100644 index 000000000..4c7d5aaee --- /dev/null +++ b/include/capi/cef_cookie_capi.h @@ -0,0 +1,121 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_COOKIE_CAPI_H +#define _CEF_COOKIE_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Visit all cookies. The returned cookies are ordered by longest path, then by +// earliest creation date. Returns false (0) if cookies cannot be accessed. +/// +CEF_EXPORT int cef_visit_all_cookies(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. +/// +CEF_EXPORT int cef_visit_url_cookies(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. +/// +CEF_EXPORT int cef_set_cookie(const cef_string_t* url, + const struct _cef_cookie_t* cookie); + +/// +// Delete all cookies that match the specified parameters. If both |url| and +// |cookie_name| are specified all host and domain cookies matching both values +// 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. +/// +CEF_EXPORT int cef_delete_cookies(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. By default the cookie path is the +// same as the cache path. Returns false (0) if cookies cannot be accessed. +/// +CEF_EXPORT int cef_set_cookie_path(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_COOKIE_CAPI_H diff --git a/include/capi/cef_display_handler_capi.h b/include/capi/cef_display_handler_capi.h new file mode 100644 index 000000000..33c464878 --- /dev/null +++ b/include/capi/cef_display_handler_capi.h @@ -0,0 +1,118 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_DISPLAY_HANDLER_CAPI_H +#define _CEF_DISPLAY_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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 navigation state has changed. + /// + void (CEF_CALLBACK *on_nav_state_change)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, 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 size of the content area has changed. + /// + void (CEF_CALLBACK *on_contents_size_change)( + struct _cef_display_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, int width, int height); + + /// + // 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_DISPLAY_HANDLER_CAPI_H diff --git a/include/capi/cef_dom_capi.h b/include/capi/cef_dom_capi.h new file mode 100644 index 000000000..4aad95450 --- /dev/null +++ b/include/capi/cef_dom_capi.h @@ -0,0 +1,450 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_DOM_CAPI_H +#define _CEF_DOM_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Structure to implement for visiting the DOM. The functions of this structure +// will be called on the UI thread. +/// +typedef struct _cef_domvisitor_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method executed for visiting the DOM. The document object passed to this + // function represents a snapshot of the DOM at the time this function is + // executed. DOM objects are only valid for the scope of this function. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this function. + /// + void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self, + struct _cef_domdocument_t* document); + +} cef_domvisitor_t; + + +/// +// Structure used to represent a DOM document. The functions of this structure +// should only be called on the UI thread. +/// +typedef struct _cef_domdocument_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the document type. + /// + enum cef_dom_document_type_t (CEF_CALLBACK *get_type)( + struct _cef_domdocument_t* self); + + /// + // Returns the root document node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_document)( + struct _cef_domdocument_t* self); + + /// + // Returns the BODY node of an HTML document. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_body)( + struct _cef_domdocument_t* self); + + /// + // Returns the HEAD node of an HTML document. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_head)( + struct _cef_domdocument_t* self); + + /// + // Returns the title of an HTML document. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_title)( + struct _cef_domdocument_t* self); + + /// + // Returns the document element with the specified ID value. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)( + struct _cef_domdocument_t* self, const cef_string_t* id); + + /// + // Returns the node that currently has keyboard focus. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)( + struct _cef_domdocument_t* self); + + /// + // Returns true (1) if a portion of the document is selected. + /// + int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self); + + /// + // Returns the selection start node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_selection_start_node)( + struct _cef_domdocument_t* self); + + /// + // Returns the selection offset within the start node. + /// + int (CEF_CALLBACK *get_selection_start_offset)( + struct _cef_domdocument_t* self); + + /// + // Returns the selection end node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_selection_end_node)( + struct _cef_domdocument_t* self); + + /// + // Returns the selection offset within the end node. + /// + int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self); + + /// + // Returns the contents of this selection as markup. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)( + struct _cef_domdocument_t* self); + + /// + // Returns the contents of this selection as text. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)( + struct _cef_domdocument_t* self); + + /// + // Returns the base URL for the document. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_base_url)( + struct _cef_domdocument_t* self); + + /// + // Returns a complete URL based on the document base URL and the specified + // partial URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_complete_url)( + struct _cef_domdocument_t* self, const cef_string_t* partialURL); + +} cef_domdocument_t; + + +/// +// Structure used to represent a DOM node. The functions of this structure +// should only be called on the UI thread. +/// +typedef struct _cef_domnode_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the type for this node. + /// + enum cef_dom_node_type_t (CEF_CALLBACK *get_type)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is a text node. + /// + int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is an element node. + /// + int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is a form control element node. + /// + int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self); + + /// + // Returns the type of this form control element node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self, + struct _cef_domnode_t* that); + + /// + // Returns the name of this node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self); + + /// + // Returns the value of this node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self); + + /// + // Set the value of this node. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self, + const cef_string_t* value); + + /// + // Returns the contents of this node as markup. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_as_markup)( + struct _cef_domnode_t* self); + + /// + // Returns the document associated with this node. + /// + struct _cef_domdocument_t* (CEF_CALLBACK *get_document)( + struct _cef_domnode_t* self); + + /// + // Returns the parent node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_parent)( + struct _cef_domnode_t* self); + + /// + // Returns the previous sibling node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)( + struct _cef_domnode_t* self); + + /// + // Returns the next sibling node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this node has child nodes. + /// + int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self); + + /// + // Return the first child node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)( + struct _cef_domnode_t* self); + + /// + // Returns the last child node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)( + struct _cef_domnode_t* self); + + /// + // Add an event listener to this node for the specified event type. If + // |useCapture| is true (1) then this listener will be considered a capturing + // listener. Capturing listeners will recieve all events of the specified type + // before the events are dispatched to any other event targets beneath the + // current node in the tree. Events which are bubbling upwards through the + // tree will not trigger a capturing listener. Separate calls to this function + // can be used to register the same listener with and without capture. See + // WebCore/dom/EventNames.h for the list of supported event types. + /// + void (CEF_CALLBACK *add_event_listener)(struct _cef_domnode_t* self, + const cef_string_t* eventType, struct _cef_domevent_listener_t* listener, + int useCapture); + + + // The following functions are valid only for element nodes. + + /// + // Returns the tag name of this element. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this element has attributes. + /// + int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this element has an attribute named |attrName|. + /// + int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName); + + /// + // Returns the element attribute named |attrName|. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)( + struct _cef_domnode_t* self, const cef_string_t* attrName); + + /// + // Returns a map of all element attributes. + /// + void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self, + cef_string_map_t attrMap); + + /// + // Set the value for the element attribute named |attrName|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName, const cef_string_t* value); + + /// + // Returns the inner text of the element. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)( + struct _cef_domnode_t* self); + +} cef_domnode_t; + + +/// +// Structure used to represent a DOM event. The functions of this structure +// should only be called on the UI thread. +/// +typedef struct _cef_domevent_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the event type. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_type)(struct _cef_domevent_t* self); + + /// + // Returns the event category. + /// + enum cef_dom_event_category_t (CEF_CALLBACK *get_category)( + struct _cef_domevent_t* self); + + /// + // Returns the event processing phase. + /// + enum cef_dom_event_phase_t (CEF_CALLBACK *get_phase)( + struct _cef_domevent_t* self); + + /// + // Returns true (1) if the event can bubble up the tree. + /// + int (CEF_CALLBACK *can_bubble)(struct _cef_domevent_t* self); + + /// + // Returns true (1) if the event can be canceled. + /// + int (CEF_CALLBACK *can_cancel)(struct _cef_domevent_t* self); + + /// + // Returns the document associated with this event. + /// + struct _cef_domdocument_t* (CEF_CALLBACK *get_document)( + struct _cef_domevent_t* self); + + /// + // Returns the target of the event. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_target)( + struct _cef_domevent_t* self); + + /// + // Returns the current target of the event. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_current_target)( + struct _cef_domevent_t* self); + +} cef_domevent_t; + + +/// +// Structure to implement for handling DOM events. The functions of this +// structure will be called on the UI thread. +/// +typedef struct _cef_domevent_listener_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when an event is received. The event object passed to this function + // contains a snapshot of the DOM at the time this function is executed. DOM + // objects are only valid for the scope of this function. Do not keep + // references to or attempt to access any DOM objects outside the scope of + // this function. + /// + void (CEF_CALLBACK *handle_event)(struct _cef_domevent_listener_t* self, + struct _cef_domevent_t* event); + +} cef_domevent_listener_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_DOM_CAPI_H diff --git a/include/capi/cef_download_handler_capi.h b/include/capi/cef_download_handler_capi.h new file mode 100644 index 000000000..57e08cabb --- /dev/null +++ b/include/capi/cef_download_handler_capi.h @@ -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. +// +// --------------------------------------------------------------------------- +// +// 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_DOWNLOAD_HANDLER_CAPI_H +#define _CEF_DOWNLOAD_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Structure used to handle file downloads. The functions of this structure will +// always be called on the UI thread. +/// +typedef struct _cef_download_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // A portion of the file contents have been received. This function will be + // called multiple times until the download is complete. Return |true (1)| to + // continue receiving data and |false (0)| to cancel. + /// + int (CEF_CALLBACK *received_data)(struct _cef_download_handler_t* self, + void* data, int data_size); + + /// + // The download is complete. + /// + void (CEF_CALLBACK *complete)(struct _cef_download_handler_t* self); + +} cef_download_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_DOWNLOAD_HANDLER_CAPI_H diff --git a/include/capi/cef_drag_data_capi.h b/include/capi/cef_drag_data_capi.h new file mode 100644 index 000000000..e191b5227 --- /dev/null +++ b/include/capi/cef_drag_data_capi.h @@ -0,0 +1,144 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_DRAG_DATA_CAPI_H +#define _CEF_DRAG_DATA_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Structure used to represent drag data. The functions of this structure may be +// called on any thread. +/// +typedef struct _cef_drag_data_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the drag data is a link. + /// + int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a text or html fragment. + /// + int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a file. + /// + int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self); + + /// + // Return the link URL that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_url)( + struct _cef_drag_data_t* self); + + /// + // Return the title associated with the link being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_title)( + struct _cef_drag_data_t* self); + + /// + // Return the metadata, if any, associated with the link being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)( + struct _cef_drag_data_t* self); + + /// + // Return the plain text fragment that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)( + struct _cef_drag_data_t* self); + + /// + // Return the text/html fragment that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)( + struct _cef_drag_data_t* self); + + /// + // Return the base URL that the fragment came from. This value is used for + // resolving relative URLs and may be NULL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)( + struct _cef_drag_data_t* self); + + /// + // Return the extension of the file being dragged out of the browser window. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file_extension)( + struct _cef_drag_data_t* self); + + /// + // Return the name of the file being dragged out of the browser window. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file_name)( + struct _cef_drag_data_t* self); + + /// + // Retrieve the list of file names that are being dragged into the browser + // window. + /// + int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self, + cef_string_list_t names); + +} cef_drag_data_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_DRAG_DATA_CAPI_H diff --git a/include/capi/cef_drag_handler_capi.h b/include/capi/cef_drag_handler_capi.h new file mode 100644 index 000000000..34f11eded --- /dev/null +++ b/include/capi/cef_drag_handler_capi.h @@ -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. +// +// --------------------------------------------------------------------------- +// +// 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_DRAG_HANDLER_CAPI_H +#define _CEF_DRAG_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events related to dragging. The functions +// of this structure will be called on the UI thread. +/// +typedef struct _cef_drag_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when the browser window initiates a drag event. |dragData| contains + // the drag event data and |mask| represents the type of drag operation. + // Return false (0) for default drag handling behavior or true (1) to cancel + // the drag event. + /// + int (CEF_CALLBACK *on_drag_start)(struct _cef_drag_handler_t* self, + struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, + enum cef_drag_operations_mask_t mask); + + /// + // Called when an external drag event enters the browser window. |dragData| + // contains the drag event data and |mask| represents the type of drag + // operation. Return false (0) for default drag handling behavior or true (1) + // to cancel the drag event. + /// + int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self, + struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, + enum cef_drag_operations_mask_t mask); + +} cef_drag_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_DRAG_HANDLER_CAPI_H diff --git a/include/capi/cef_find_handler_capi.h b/include/capi/cef_find_handler_capi.h new file mode 100644 index 000000000..3439c5920 --- /dev/null +++ b/include/capi/cef_find_handler_capi.h @@ -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. +// +// --------------------------------------------------------------------------- +// +// 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_FIND_HANDLER_CAPI_H +#define _CEF_FIND_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events related to find results. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_find_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to report find results returned by cef_browser_t::find(). + // |identifer| is the identifier passed to cef_browser_t::find(), |count| is + // the number of matches currently identified, |selectionRect| is the location + // of where the match was found (in window coordinates), |activeMatchOrdinal| + // is the current position in the search results, and |finalUpdate| is true + // (1) if this is the last find notification. + /// + void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self, + struct _cef_browser_t* browser, int identifier, int count, + const cef_rect_t* selectionRect, int activeMatchOrdinal, + int finalUpdate); + +} cef_find_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_FIND_HANDLER_CAPI_H diff --git a/include/capi/cef_focus_handler_capi.h b/include/capi/cef_focus_handler_capi.h new file mode 100644 index 000000000..b9f869218 --- /dev/null +++ b/include/capi/cef_focus_handler_capi.h @@ -0,0 +1,94 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_FOCUS_HANDLER_CAPI_H +#define _CEF_FOCUS_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events related to focus. The functions of +// this structure will be called on the UI thread. +/// +typedef struct _cef_focus_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when the browser component is about to loose focus. For instance, if + // focus was on the last HTML element and the user pressed the TAB key. |next| + // will be true (1) if the browser is giving focus to the next component and + // false (0) if the browser is giving focus to the previous component. + /// + void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, int next); + + /// + // Called when the browser component is requesting focus. |source| indicates + // where the focus request is originating from. Return false (0) to allow the + // focus to be set or true (1) to cancel setting the focus. + /// + int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, enum cef_handler_focus_source_t source); + + /// + // Called when a new node in the the browser gets focus. The |node| value may + // be NULL if no specific node has gained focus. The node object passed to + // this function represents a snapshot of the DOM at the time this function is + // executed. DOM objects are only valid for the scope of this function. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this function. + /// + void (CEF_CALLBACK *on_focused_node_changed)( + struct _cef_focus_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_domnode_t* node); + +} cef_focus_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_FOCUS_HANDLER_CAPI_H diff --git a/include/capi/cef_frame_capi.h b/include/capi/cef_frame_capi.h new file mode 100644 index 000000000..07c18ba4e --- /dev/null +++ b/include/capi/cef_frame_capi.h @@ -0,0 +1,220 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_FRAME_CAPI_H +#define _CEF_FRAME_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Structure used to represent a frame in the browser window. The functions of +// this structure may be called on any thread unless otherwise indicated in the +// comments. +/// +typedef struct _cef_frame_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // 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); + + /// + // Execute printing in the this frame. The user will be prompted with the + // print dialog appropriate to the operating system. + /// + void (CEF_CALLBACK *print)(struct _cef_frame_t* self); + + /// + // Save this frame's HTML source to a temporary file and open it in the + // default text viewing application. + /// + void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self); + + /// + // Returns this frame's HTML source as a string. This function should only be + // called on the UI thread. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_source)(struct _cef_frame_t* self); + + /// + // Returns this frame's display text as a string. This function should only be + // called on the UI thread. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_text)(struct _cef_frame_t* self); + + /// + // 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| with the optional dummy target |url|. + /// + void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self, + const cef_string_t* string, const cef_string_t* url); + + /// + // Load the contents of |stream| with the optional dummy target |url|. + /// + void (CEF_CALLBACK *load_stream)(struct _cef_frame_t* self, + struct _cef_stream_reader_t* stream, 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. This function should only be + // called on the UI thread. + /// + 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. This function should + // only be called on the UI thread. + /// + long long (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. This function should only be called on the UI thread. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self); + + /// + // Returns the URL currently loaded in this frame. This function should only + // be called on the UI thread. + /// + // 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); + + /// + // Visit the DOM document. + /// + void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self, + struct _cef_domvisitor_t* visitor); + + /// + // Get the V8 context associated with the frame. This function should only be + // called on the UI thread. + /// + struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)( + struct _cef_frame_t* self); + +} cef_frame_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_FRAME_CAPI_H diff --git a/include/capi/cef_jsdialog_handler_capi.h b/include/capi/cef_jsdialog_handler_capi.h new file mode 100644 index 000000000..3c65e4ce7 --- /dev/null +++ b/include/capi/cef_jsdialog_handler_capi.h @@ -0,0 +1,93 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_JSDIALOG_HANDLER_CAPI_H +#define _CEF_JSDIALOG_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events related to JavaScript dialogs. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_jsdialog_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to run a JavaScript alert message. Return false (0) to display the + // default alert or true (1) if you displayed a custom alert. + /// + int (CEF_CALLBACK *on_jsalert)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* message); + + /// + // Called to run a JavaScript confirm request. Return false (0) to display the + // default alert or true (1) if you displayed a custom alert. If you handled + // the alert set |retval| to true (1) if the user accepted the confirmation. + /// + int (CEF_CALLBACK *on_jsconfirm)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* message, int* retval); + + /// + // Called to run a JavaScript prompt request. Return false (0) to display the + // default prompt or true (1) if you displayed a custom prompt. If you handled + // the prompt set |retval| to true (1) if the user accepted the prompt and + // request and |result| to the resulting value. + /// + int (CEF_CALLBACK *on_jsprompt)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* message, const cef_string_t* defaultValue, + int* retval, cef_string_t* result); + +} cef_jsdialog_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_JSDIALOG_HANDLER_CAPI_H diff --git a/include/capi/cef_keyboard_handler_capi.h b/include/capi/cef_keyboard_handler_capi.h new file mode 100644 index 000000000..52087b393 --- /dev/null +++ b/include/capi/cef_keyboard_handler_capi.h @@ -0,0 +1,83 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_KEYBOARD_HANDLER_CAPI_H +#define _CEF_KEYBOARD_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events related to keyboard input. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_keyboard_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when the browser component receives a keyboard event. This function + // is called both before the event is passed to the renderer and after + // JavaScript in the page has had a chance to handle the event. |type| is the + // type of keyboard event, |code| is the windows scan-code for the event, + // |modifiers| is a set of bit- flags describing any pressed modifier keys and + // |isSystemKey| is true (1) if Windows considers this a 'system key' message + // (see http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx). If + // |isAfterJavaScript| is true (1) then JavaScript in the page has had a + // chance to handle the event and has chosen not to. Only RAWKEYDOWN, KEYDOWN + // and CHAR events will be sent with |isAfterJavaScript| set to true (1). + // Return true (1) if the keyboard event was handled or false (0) to allow + // continued handling of the event by the renderer. + /// + int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self, + struct _cef_browser_t* browser, enum cef_handler_keyevent_type_t type, + int code, int modifiers, int isSystemKey, int isAfterJavaScript); + +} cef_keyboard_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_KEYBOARD_HANDLER_CAPI_H diff --git a/include/capi/cef_life_span_handler_capi.h b/include/capi/cef_life_span_handler_capi.h new file mode 100644 index 000000000..b3a10e231 --- /dev/null +++ b/include/capi/cef_life_span_handler_capi.h @@ -0,0 +1,115 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_LIFE_SPAN_HANDLER_CAPI_H +#define _CEF_LIFE_SPAN_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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_LIFE_SPAN_HANDLER_CAPI_H diff --git a/include/capi/cef_load_handler_capi.h b/include/capi/cef_load_handler_capi.h new file mode 100644 index 000000000..356a3b34c --- /dev/null +++ b/include/capi/cef_load_handler_capi.h @@ -0,0 +1,100 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_LOAD_HANDLER_CAPI_H +#define _CEF_LOAD_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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 and |failedUrl| is the URL that failed to load. To provide + // custom error text assign the text to |errorText| and return true (1). + // Otherwise, return false (0) for the default error text. See + // net\base\net_error_list.h for complete descriptions of the error codes. + /// + int (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* failedUrl, + cef_string_t* errorText); + +} cef_load_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_LOAD_HANDLER_CAPI_H diff --git a/include/capi/cef_menu_handler_capi.h b/include/capi/cef_menu_handler_capi.h new file mode 100644 index 000000000..41ab1ffe4 --- /dev/null +++ b/include/capi/cef_menu_handler_capi.h @@ -0,0 +1,89 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_MENU_HANDLER_CAPI_H +#define _CEF_MENU_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events related to browser context menus. +// The functions of this structure will be called on the UI thread. +/// +typedef struct _cef_menu_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called before a context menu is displayed. Return false (0) to display the + // default context menu or true (1) to cancel the display. + /// + int (CEF_CALLBACK *on_before_menu)(struct _cef_menu_handler_t* self, + struct _cef_browser_t* browser, + const struct _cef_menu_info_t* menuInfo); + + /// + // Called to optionally override the default text for a context menu item. + // |label| contains the default text and may be modified to substitute + // alternate text. + /// + void (CEF_CALLBACK *get_menu_label)(struct _cef_menu_handler_t* self, + struct _cef_browser_t* browser, enum cef_menu_id_t menuId, + cef_string_t* label); + + /// + // Called when an option is selected from the default context menu. Return + // false (0) to execute the default action or true (1) to cancel the action. + /// + int (CEF_CALLBACK *on_menu_action)(struct _cef_menu_handler_t* self, + struct _cef_browser_t* browser, enum cef_menu_id_t menuId); + +} cef_menu_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_MENU_HANDLER_CAPI_H diff --git a/include/cef_nplugin_capi.h b/include/capi/cef_nplugin_capi.h similarity index 97% rename from include/cef_nplugin_capi.h rename to include/capi/cef_nplugin_capi.h index f3f46d080..2d595a1ed 100644 --- a/include/cef_nplugin_capi.h +++ b/include/capi/cef_nplugin_capi.h @@ -35,7 +35,7 @@ extern "C" { #endif -#include "internal/cef_nplugin_types.h" +#include "../internal/cef_nplugin_types.h" /// // Register a plugin with the system. Returns true (1) on success. diff --git a/include/capi/cef_origin_whitelist_capi.h b/include/capi/cef_origin_whitelist_capi.h new file mode 100644 index 000000000..3bf69ff3a --- /dev/null +++ b/include/capi/cef_origin_whitelist_capi.h @@ -0,0 +1,101 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_ORIGIN_WHITELIST_CAPI_H +#define _CEF_ORIGIN_WHITELIST_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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_ORIGIN_WHITELIST_CAPI_H diff --git a/include/capi/cef_print_handler_capi.h b/include/capi/cef_print_handler_capi.h new file mode 100644 index 000000000..ce9eef45a --- /dev/null +++ b/include/capi/cef_print_handler_capi.h @@ -0,0 +1,97 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_PRINT_HANDLER_CAPI_H +#define _CEF_PRINT_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events related to printing. The functions +// of this structure will be called on the UI thread. +/// +typedef struct _cef_print_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to allow customization of standard print options before the print + // dialog is displayed. |printOptions| allows specification of paper size, + // orientation and margins. Note that the specified margins may be adjusted if + // they are outside the range supported by the printer. All units are in + // inches. Return false (0) to display the default print options or true (1) + // to display the modified |printOptions|. + /// + int (CEF_CALLBACK *get_print_options)(struct _cef_print_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_print_options_t* printOptions); + + /// + // Called to format print headers and footers. |printInfo| contains platform- + // specific information about the printer context. |url| is the URL if the + // currently printing page, |title| is the title of the currently printing + // page, |currentPage| is the current page number and |maxPages| is the total + // number of pages. Six default header locations are provided by the + // implementation: top left, top center, top right, bottom left, bottom center + // and bottom right. To use one of these default locations just assign a + // string to the appropriate variable. To draw the header and footer yourself + // return true (1). Otherwise, populate the approprate variables and return + // false (0). + /// + int (CEF_CALLBACK *get_print_header_footer)(struct _cef_print_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const struct _cef_print_info_t* printInfo, const cef_string_t* url, + const cef_string_t* title, int currentPage, int maxPages, + cef_string_t* topLeft, cef_string_t* topCenter, cef_string_t* topRight, + cef_string_t* bottomLeft, cef_string_t* bottomCenter, + cef_string_t* bottomRight); + +} cef_print_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_PRINT_HANDLER_CAPI_H diff --git a/include/capi/cef_proxy_handler_capi.h b/include/capi/cef_proxy_handler_capi.h new file mode 100644 index 000000000..1ae86952f --- /dev/null +++ b/include/capi/cef_proxy_handler_capi.h @@ -0,0 +1,70 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_PROXY_HANDLER_CAPI_H +#define _CEF_PROXY_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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_PROXY_HANDLER_CAPI_H diff --git a/include/capi/cef_render_handler_capi.h b/include/capi/cef_render_handler_capi.h new file mode 100644 index 000000000..65d71ca7b --- /dev/null +++ b/include/capi/cef_render_handler_capi.h @@ -0,0 +1,119 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_RENDER_HANDLER_CAPI_H +#define _CEF_RENDER_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle events when window rendering is disabled. +// The functions of this structure will be called on the UI thread. +/// +typedef struct _cef_render_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to retrieve the view rectangle which is relative to screen + // coordinates. Return true (1) if the rectangle was provided. + /// + int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_rect_t* rect); + + /// + // Called to retrieve the simulated screen rectangle. Return true (1) if the + // rectangle was provided. + /// + int (CEF_CALLBACK *get_screen_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_rect_t* rect); + + /// + // Called to retrieve the translation from view coordinates to actual screen + // coordinates. Return true (1) if the screen coordinates were provided. + /// + int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, int viewX, int viewY, int* screenX, + int* screenY); + + /// + // Called when the browser wants to show or hide the popup widget. The popup + // should be shown if |show| is true (1) and hidden if |show| is false (0). + /// + void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, int show); + + /// + // Called when the browser wants to move or resize the popup widget. |rect| + // contains the new location and size. + /// + void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, const cef_rect_t* rect); + + /// + // Called when an element should be painted. |type| indicates whether the + // element is the view or the popup widget. |buffer| contains the pixel data + // for the whole image. |dirtyRects| contains the set of rectangles that need + // to be repainted. On Windows |buffer| will be width*height*4 bytes in size + // and represents a BGRA image with an upper-left origin. + /// + void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, enum cef_paint_element_type_t type, + size_t dirtyRectsCount, cef_rect_t const* dirtyRects, + const void* buffer); + + /// + // Called when the browser window's cursor has changed. + /// + void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_cursor_handle_t cursor); + +} cef_render_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_RENDER_HANDLER_CAPI_H diff --git a/include/capi/cef_request_capi.h b/include/capi/cef_request_capi.h new file mode 100644 index 000000000..5c56418fc --- /dev/null +++ b/include/capi/cef_request_capi.h @@ -0,0 +1,266 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_REQUEST_CAPI_H +#define _CEF_REQUEST_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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 cef_web_urlrequest_t. + /// + enum cef_weburlrequest_flags_t (CEF_CALLBACK *get_flags)( + struct _cef_request_t* self); + + /// + // Set the flags used in combination with cef_web_urlrequest_t. + /// + 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 + // cef_web_urlrequest_t. + /// + // 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 + // cef_web_urlrequest_t. + /// + 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_REQUEST_CAPI_H diff --git a/include/capi/cef_request_handler_capi.h b/include/capi/cef_request_handler_capi.h new file mode 100644 index 000000000..88dcb76e7 --- /dev/null +++ b/include/capi/cef_request_handler_capi.h @@ -0,0 +1,150 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_REQUEST_HANDLER_CAPI_H +#define _CEF_REQUEST_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// 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 UI thread before browser navigation. Return true (1) to + // cancel the navigation or false (0) to allow the navigation to proceed. + /// + int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_request_t* request, enum cef_handler_navtype_t navType, + int isRedirect); + + /// + // Called on the IO thread before a resource is loaded. To allow the resource + // to load normally return false (0). To redirect the resource to a new url + // populate the |redirectUrl| value and return false (0). To specify data for + // the resource return a CefStream object in |resourceStream|, use the + // |response| object to set mime type, HTTP status code and optional header + // values, and return false (0). To cancel loading of the resource return true + // (1). Any modifications to |request| will be observed. If the URL in + // |request| is changed and |redirectUrl| is also set, the URL in |request| + // will be used. + /// + int (CEF_CALLBACK *on_before_resource_load)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + struct _cef_request_t* request, cef_string_t* redirectUrl, + struct _cef_stream_reader_t** resourceStream, + struct _cef_response_t* response, int loadFlags); + + /// + // 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, const cef_string_t* old_url, + cef_string_t* new_url); + + /// + // Called on the UI thread after a response to the resource request is + // received. Set |filter| if response content needs to be monitored and/or + // modified as it arrives. + /// + void (CEF_CALLBACK *on_resource_response)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* url, + struct _cef_response_t* response, + struct _cef_content_filter_t** filter); + + /// + // Called on the IO thread to handle requests for URLs with an unknown + // protocol component. Return true (1) to indicate that the request should + // succeed because it was handled externally. Set |allowOSExecution| to true + // (1) and return false (0) to attempt execution via the registered OS + // protocol handler, if any. If false (0) is returned and either + // |allow_os_execution| is false (0) or OS protocol handler execution fails + // then the request will fail with an error condition. SECURITY WARNING: YOU + // SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR + // OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. + /// + int (CEF_CALLBACK *on_protocol_execution)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* url, + int* allowOSExecution); + + /// + // Called on the UI thread when a server indicates via the 'Content- + // Disposition' header that a response represents a file to download. + // |mimeType| is the mime type for the download, |fileName| is the suggested + // target file name and |contentLength| is either the value of the 'Content- + // Size' header or -1 if no size was provided. Set |handler| to the + // cef_download_handler_t instance that will recieve the file contents. Return + // true (1) to download the file or false (0) to cancel the file download. + /// + int (CEF_CALLBACK *get_download_handler)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* mimeType, + const cef_string_t* fileName, int64 contentLength, + struct _cef_download_handler_t** handler); + + /// + // 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 number. Set |username| and |password| and return true (1) + // to handle the request. Return false (0) to cancel the request. + /// + int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, int isProxy, const cef_string_t* host, + int port, const cef_string_t* realm, const cef_string_t* scheme, + cef_string_t* username, cef_string_t* password); + +} cef_request_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_REQUEST_HANDLER_CAPI_H diff --git a/include/capi/cef_response_capi.h b/include/capi/cef_response_capi.h new file mode 100644 index 000000000..6881c26a3 --- /dev/null +++ b/include/capi/cef_response_capi.h @@ -0,0 +1,120 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_RESPONSE_CAPI_H +#define _CEF_RESPONSE_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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_RESPONSE_CAPI_H diff --git a/include/capi/cef_scheme_capi.h b/include/capi/cef_scheme_capi.h new file mode 100644 index 000000000..7610a48e2 --- /dev/null +++ b/include/capi/cef_scheme_capi.h @@ -0,0 +1,230 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_SCHEME_CAPI_H +#define _CEF_SCHEME_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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:
+//  [scheme]://[username]:[password]@[host]:[port]/[url-path]
+// 
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_scheme_handler_t instances. 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 scheme handler instance to handle the request. |browser| will + // be the browser window that initiated the request. If the request was + // initiated using the cef_web_urlrequest_t API |browser| will be NULL. + /// + struct _cef_scheme_handler_t* (CEF_CALLBACK *create)( + struct _cef_scheme_handler_factory_t* self, + struct _cef_browser_t* browser, const cef_string_t* scheme_name, + struct _cef_request_t* request); + +} cef_scheme_handler_factory_t; + + +/// +// Structure used to facilitate asynchronous responses to custom scheme handler +// requests. The functions of this structure may be called on any thread. +/// +typedef struct _cef_scheme_handler_callback_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Notify that header information is now available for retrieval. + /// + void (CEF_CALLBACK *headers_available)( + struct _cef_scheme_handler_callback_t* self); + + /// + // Notify that response data is now available for reading. + /// + void (CEF_CALLBACK *bytes_available)( + struct _cef_scheme_handler_callback_t* self); + + /// + // Cancel processing of the request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_callback_t* self); + +} cef_scheme_handler_callback_t; + + +/// +// Structure used to implement a custom scheme handler structure. The functions +// of this structure will always be called on the IO thread. +/// +typedef struct _cef_scheme_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Begin processing the request. To handle the request return true (1) and + // call headers_available() once the response header information is available + // (headers_available() 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_scheme_handler_t* self, + struct _cef_request_t* request, + struct _cef_scheme_handler_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_scheme_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 bytes_available() when the data + // is available. To indicate response completion return false (0). + /// + int (CEF_CALLBACK *read_response)(struct _cef_scheme_handler_t* self, + void* data_out, int bytes_to_read, int* bytes_read, + struct _cef_scheme_handler_callback_t* callback); + + /// + // Request processing has been canceled. + /// + void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_t* self); + +} cef_scheme_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_SCHEME_CAPI_H diff --git a/include/capi/cef_storage_capi.h b/include/capi/cef_storage_capi.h new file mode 100644 index 000000000..1f861d4a5 --- /dev/null +++ b/include/capi/cef_storage_capi.h @@ -0,0 +1,117 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_STORAGE_CAPI_H +#define _CEF_STORAGE_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Visit storage of the specified type. If |origin| is non-NULL only data +// matching that origin will be visited. If |key| is non-NULL only data matching +// that key will be visited. Otherwise, all data for the storage type will be +// visited. Origin should be of the form scheme://domain. If no origin is +// specified only data currently in memory will be returned. Returns false (0) +// if the storage cannot be accessed. +/// +CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type, + const cef_string_t* origin, const cef_string_t* key, + struct _cef_storage_visitor_t* visitor); + +/// +// Sets storage of the specified type, origin, key and value. Returns false (0) +// if storage cannot be accessed. This function must be called on the UI thread. +/// +CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type, + const cef_string_t* origin, const cef_string_t* key, + const cef_string_t* value); + +/// +// Deletes all storage of the specified type. If |origin| is non-NULL only data +// matching that origin will be cleared. If |key| is non-NULL only data matching +// that key will be cleared. Otherwise, all data for the storage type will be +// cleared. Returns false (0) if storage cannot be accessed. This function must +// be called on the UI thread. +/// +CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type, + const cef_string_t* origin, const cef_string_t* key); + +/// +// Sets the directory path that will be used for storing data of the specified +// type. Currently only the ST_LOCALSTORAGE type is supported by this function. +// If |path| is NULL data will be stored in memory only. By default the storage +// path is the same as the cache path. Returns false (0) if the storage cannot +// be accessed. +/// +CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, + const cef_string_t* path); + +/// +// Structure to implement for visiting storage. The functions of this structure +// will always be called on the UI thread. +/// +typedef struct _cef_storage_visitor_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called once for each key/value data pair in storage. + // |count| is the 0-based index for the current pair. |total| is the total + // number of pairs. Set |deleteData| to true (1) to delete the pair currently + // being visited. Return false (0) to stop visiting pairs. This function may + // never be called if no data is found. + /// + int (CEF_CALLBACK *visit)(struct _cef_storage_visitor_t* self, + enum cef_storage_type_t type, const cef_string_t* origin, + const cef_string_t* key, const cef_string_t* value, int count, int total, + int* deleteData); + +} cef_storage_visitor_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_STORAGE_CAPI_H diff --git a/include/capi/cef_stream_capi.h b/include/capi/cef_stream_capi.h new file mode 100644 index 000000000..8f474a3ba --- /dev/null +++ b/include/capi/cef_stream_capi.h @@ -0,0 +1,231 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_STREAM_CAPI_H +#define _CEF_STREAM_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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. + /// + int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, long offset, + int whence); + + /// + // Return the current offset position. + /// + long (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, long offset, + int whence); + + /// + // Return the current offset position. + /// + long (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. + /// + int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, long offset, + int whence); + + /// + // Return the current offset position. + /// + long (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. + /// + int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, long offset, + int whence); + + /// + // Return the current offset position. + /// + long (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_STREAM_CAPI_H diff --git a/include/capi/cef_task_capi.h b/include/capi/cef_task_capi.h new file mode 100644 index 000000000..299ab2758 --- /dev/null +++ b/include/capi/cef_task_capi.h @@ -0,0 +1,97 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_TASK_CAPI_H +#define _CEF_TASK_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// CEF maintains multiple internal threads that are used for handling different +// types of tasks. The UI thread creates the browser window and is used for all +// interaction with the WebKit rendering engine and V8 JavaScript engine (The UI +// thread will be the same as the main application thread if cef_initialize() is +// called with a CefSettings.multi_threaded_message_loop value of false (0).) +// The IO thread is used for handling schema and network requests. The FILE +// thread is used for the application cache and other miscellaneous activities. +// This function will return true (1) if called on the specified thread. +/// +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. +/// +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. +/// +CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, + struct _cef_task_t* task, long 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_TASK_CAPI_H diff --git a/include/capi/cef_url_capi.h b/include/capi/cef_url_capi.h new file mode 100644 index 000000000..47c928ab2 --- /dev/null +++ b/include/capi/cef_url_capi.h @@ -0,0 +1,66 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_URL_CAPI_H +#define _CEF_URL_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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_URL_CAPI_H diff --git a/include/capi/cef_v8_capi.h b/include/capi/cef_v8_capi.h new file mode 100644 index 000000000..840a7f5ba --- /dev/null +++ b/include/capi/cef_v8_capi.h @@ -0,0 +1,603 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_V8_CAPI_H +#define _CEF_V8_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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 +// be called on any thread. +// +// Example JavaScript extension code:
+//   // 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;
+//     };
+//   })();
+// 
Example usage in the page:
+//   // 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();
+// 
+/// +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. +/// +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. + /// + 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 or Function 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); + +} 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 UI 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 UI 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 should +// only be called on the UI 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 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. + /// + int (CEF_CALLBACK *get_int_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 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); + + /// + // Delete the value with the specified identifier. + /// + int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key); + + /// + // Delete the value with the specified identifier. + /// + int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self, + int index); + + /// + // Returns the value with the specified identifier. + /// + 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. + /// + struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)( + struct _cef_v8value_t* self, int index); + + /// + // Associate a value with the specified identifier. + /// + 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); + + /// + // Associate a value with the specified identifier. + /// + int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index, + struct _cef_v8value_t* value); + + /// + // Register an identifier whose access will be forwarded to the + // cef_v8accessor_t instance passed to + // cef_v8value_t::cef_v8value_create_object_with_accessor(). + /// + 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); + + /// + // Returns the user data, if any, specified when the object was created. + /// + struct _cef_base_t* (CEF_CALLBACK *get_user_data)( + struct _cef_v8value_t* self); + + + // 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. |arguments| is the list of arguments that + // will be passed to the function. If execution succeeds |retval| will be set + // to the function return value. If execution fails |exception| will be set to + // the exception that was thrown. If |rethrow_exception| is true (1) any + // exception will also be re- thrown. This function returns false (0) if + // called incorrectly. + /// + int (CEF_CALLBACK *execute_function)(struct _cef_v8value_t* self, + struct _cef_v8value_t* object, size_t argumentsCount, + struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, + struct _cef_v8exception_t** exception, int rethrow_exception); + + /// + // Execute the function using the specified V8 context. |object| is the + // receiver ('this' object) of the function. |arguments| is the list of + // arguments that will be passed to the function. If execution succeeds + // |retval| will be set to the function return value. If execution fails + // |exception| will be set to the exception that was thrown. If + // |rethrow_exception| is true (1) any exception will also be re-thrown. This + // function returns false (0) if called incorrectly. + /// + int (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, + struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception, + int rethrow_exception); + +} 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(int 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. +/// +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 user data and +// 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_with_accessor( + cef_base_t* user_data, cef_v8accessor_t* accessor); + +/// +// Create a new cef_v8value_t object of type array. 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(); + +/// +// 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_V8_CAPI_H diff --git a/include/capi/cef_v8context_handler_capi.h b/include/capi/cef_v8context_handler_capi.h new file mode 100644 index 000000000..43efc90fb --- /dev/null +++ b/include/capi/cef_v8context_handler_capi.h @@ -0,0 +1,82 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_V8CONTEXT_HANDLER_CAPI_H +#define _CEF_V8CONTEXT_HANDLER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Implement this structure to handle V8 context events. The functions of this +// structure will be called on the UI thread. +/// +typedef struct _cef_v8context_handler_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // 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_v8context_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_v8context_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_v8context_t* context); + +} cef_v8context_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_V8CONTEXT_HANDLER_CAPI_H diff --git a/include/capi/cef_web_urlrequest_capi.h b/include/capi/cef_web_urlrequest_capi.h new file mode 100644 index 000000000..a8033388e --- /dev/null +++ b/include/capi/cef_web_urlrequest_capi.h @@ -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. +// +// --------------------------------------------------------------------------- +// +// 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_WEB_URLREQUEST_CAPI_H +#define _CEF_WEB_URLREQUEST_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cef_base_capi.h" + + +/// +// Structure used to make a Web URL request. Web URL requests are not associated +// with a browser instance so no cef_client_t callbacks will be executed. The +// functions of this structure may be called on any thread. +/// +typedef struct _cef_web_urlrequest_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Cancels the request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_web_urlrequest_t* self); + + /// + // Returns the current ready state of the request. + /// + enum cef_weburlrequest_state_t (CEF_CALLBACK *get_state)( + struct _cef_web_urlrequest_t* self); + +} cef_web_urlrequest_t; + + +/// +// Create a new CefWebUrlRequest object. +/// +CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create( + struct _cef_request_t* request, + struct _cef_web_urlrequest_client_t* client); + + +/// +// Structure that should be implemented by the cef_web_urlrequest_t client. The +// functions of this structure will always be called on the UI thread. +/// +typedef struct _cef_web_urlrequest_client_t +{ + /// + // Base structure. + /// + cef_base_t base; + + /// + // Notifies the client that the request state has changed. State change + // notifications will always be sent before the below notification functions + // are called. + /// + void (CEF_CALLBACK *on_state_change)( + struct _cef_web_urlrequest_client_t* self, + struct _cef_web_urlrequest_t* requester, + enum cef_weburlrequest_state_t state); + + /// + // Notifies the client that the request has been redirected and provides a + // chance to change the request parameters. + /// + void (CEF_CALLBACK *on_redirect)(struct _cef_web_urlrequest_client_t* self, + struct _cef_web_urlrequest_t* requester, struct _cef_request_t* request, + struct _cef_response_t* response); + + /// + // Notifies the client of the response data. + /// + void (CEF_CALLBACK *on_headers_received)( + struct _cef_web_urlrequest_client_t* self, + struct _cef_web_urlrequest_t* requester, + struct _cef_response_t* response); + + /// + // Notifies the client of the upload progress. + /// + void (CEF_CALLBACK *on_progress)(struct _cef_web_urlrequest_client_t* self, + struct _cef_web_urlrequest_t* requester, uint64 bytesSent, + uint64 totalBytesToBeSent); + + /// + // Notifies the client that content has been received. + /// + void (CEF_CALLBACK *on_data)(struct _cef_web_urlrequest_client_t* self, + struct _cef_web_urlrequest_t* requester, const void* data, + int dataLength); + + /// + // Notifies the client that the request ended with an error. + /// + void (CEF_CALLBACK *on_error)(struct _cef_web_urlrequest_client_t* self, + struct _cef_web_urlrequest_t* requester, + enum cef_handler_errorcode_t errorCode); + +} cef_web_urlrequest_client_t; + + +#ifdef __cplusplus +} +#endif + +#endif // _CEF_WEB_URLREQUEST_CAPI_H diff --git a/include/capi/cef_xml_reader_capi.h b/include/capi/cef_xml_reader_capi.h new file mode 100644 index 000000000..b5705fd03 --- /dev/null +++ b/include/capi/cef_xml_reader_capi.h @@ -0,0 +1,279 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_XML_READER_CAPI_H +#define _CEF_XML_READER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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. is considered + // NULL but 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_XML_READER_CAPI_H diff --git a/include/capi/cef_zip_reader_capi.h b/include/capi/cef_zip_reader_capi.h new file mode 100644 index 000000000..be95c7991 --- /dev/null +++ b/include/capi/cef_zip_reader_capi.h @@ -0,0 +1,149 @@ +// 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. +// +// --------------------------------------------------------------------------- +// +// 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_ZIP_READER_CAPI_H +#define _CEF_ZIP_READER_CAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "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. + /// + long (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. + /// + long (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_ZIP_READER_CAPI_H diff --git a/include/cef.h b/include/cef.h deleted file mode 100644 index 623c0f189..000000000 --- a/include/cef.h +++ /dev/null @@ -1,3968 +0,0 @@ -// 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_H -#define _CEF_H - -#include -#include -#include -#include "internal/cef_build.h" -#include "internal/cef_ptr.h" -#include "internal/cef_types_wrappers.h" - -/// -// Bring in platform-specific definitions. -#if defined(OS_WIN) -#include "internal/cef_win.h" -#elif defined(OS_MACOSX) -#include "internal/cef_mac.h" -#elif defined(OS_LINUX) -#include "internal/cef_linux.h" -#endif - -class CefApp; -class CefBrowser; -class CefClient; -class CefContentFilter; -class CefCookieVisitor; -class CefDOMDocument; -class CefDOMEvent; -class CefDOMEventListener; -class CefDOMNode; -class CefDOMVisitor; -class CefDownloadHandler; -class CefDragData; -class CefFrame; -class CefPostData; -class CefPostDataElement; -class CefRequest; -class CefResponse; -class CefSchemeHandler; -class CefSchemeHandlerFactory; -class CefStorageVisitor; -class CefStreamReader; -class CefStreamWriter; -class CefTask; -class CefV8Context; -class CefV8Handler; -class CefV8Value; -class CefWebURLRequest; -class CefWebURLRequestClient; - -/// -// This function should be called on the main application thread to initialize -// CEF when the application is started. 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 CefSettings& settings, CefRefPtr application); - -/// -// This function should be called on the main application thread to shut down -// CEF 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(); - -/// -// 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 -// be called on any thread. -// -// Example JavaScript extension code: -//
-//   // 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;
-//     };
-//   })();
-// 
-// Example usage in the page: -//
-//   // 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();
-// 
-/// -/*--cef(optional_param=handler)--*/ -bool CefRegisterExtension(const CefString& extension_name, - const CefString& javascript_code, - CefRefPtr handler); - -/// -// 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: -//
-//  [scheme]://[username]:[password]@[host]:[port]/[url-path]
-// 
-// 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 factory); - -/// -// Clear all registered scheme handler factories. Returns false on error. This -// function may be called on any thread. -/// -/*--cef()--*/ -bool CefClearSchemeHandlerFactories(); - -/// -// 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(); - -typedef cef_thread_id_t CefThreadId; - -/// -// CEF maintains multiple internal threads that are used for handling different -// types of tasks. The UI thread creates the browser window and is used for all -// interaction with the WebKit rendering engine and V8 JavaScript engine (The -// UI thread will be the same as the main application thread if CefInitialize() -// is called with a CefSettings.multi_threaded_message_loop value of false.) The -// IO thread is used for handling schema and network requests. The FILE thread -// is used for the application cache and other miscellaneous activities. This -// function will return true if called on the specified thread. -/// -/*--cef()--*/ -bool CefCurrentlyOn(CefThreadId threadId); - -/// -// Post a task for execution on the specified thread. This function may be -// called on any thread. -/// -/*--cef()--*/ -bool CefPostTask(CefThreadId threadId, CefRefPtr task); - -/// -// Post a task for delayed execution on the specified thread. This function may -// be called on any thread. -/// -/*--cef()--*/ -bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, - long delay_ms); - -/// -// 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); - -/// -// Visit all cookies. The returned cookies are ordered by longest path, then by -// earliest creation date. Returns false if cookies cannot be accessed. -/// -/*--cef()--*/ -bool CefVisitAllCookies(CefRefPtr visitor); - -/// -// 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()--*/ -bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr 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 without setting the cookie if such -// characters are found. This method must be called on the IO thread. -/// -/*--cef()--*/ -bool CefSetCookie(const CefString& url, const CefCookie& cookie); - -/// -// Delete all cookies that match the specified parameters. If both |url| and -// |cookie_name| are specified all host and domain cookies matching both values -// 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)--*/ -bool CefDeleteCookies(const CefString& url, const CefString& cookie_name); - -/// -// Sets the directory path that will be used for storing cookie data. If |path| -// is empty data will be stored in memory only. By default the cookie path is -// the same as the cache path. Returns false if cookies cannot be accessed. -/// -/*--cef(optional_param=path)--*/ -bool CefSetCookiePath(const CefString& path); - - -typedef cef_storage_type_t CefStorageType; - -/// -// Visit storage of the specified type. If |origin| is non-empty only data -// matching that origin will be visited. If |key| is non-empty only data -// matching that key will be visited. Otherwise, all data for the storage -// type will be visited. Origin should be of the form scheme://domain. If no -// origin is specified only data currently in memory will be returned. Returns -// false if the storage cannot be accessed. -/// -/*--cef(optional_param=origin,optional_param=key)--*/ -bool CefVisitStorage(CefStorageType type, const CefString& origin, - const CefString& key, - CefRefPtr visitor); - -/// -// Sets storage of the specified type, origin, key and value. Returns false if -// storage cannot be accessed. This method must be called on the UI thread. -/// -/*--cef()--*/ -bool CefSetStorage(CefStorageType type, const CefString& origin, - const CefString& key, const CefString& value); - -/// -// Deletes all storage of the specified type. If |origin| is non-empty only data -// matching that origin will be cleared. If |key| is non-empty only data -// matching that key will be cleared. Otherwise, all data for the storage type -// will be cleared. Returns false if storage cannot be accessed. This method -// must be called on the UI thread. -/// -/*--cef(optional_param=origin,optional_param=key)--*/ -bool CefDeleteStorage(CefStorageType type, const CefString& origin, - const CefString& key); - -/// -// Sets the directory path that will be used for storing data of the specified -// type. Currently only the ST_LOCALSTORAGE type is supported by this method. -// If |path| is empty data will be stored in memory only. By default the storage -// path is the same as the cache path. Returns false if the storage cannot be -// accessed. -/// -/*--cef(optional_param=path)--*/ -bool CefSetStoragePath(CefStorageType type, const CefString& path); - - -/// -// 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_; -}; - -/// -// 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: \ - AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \ - ~AutoLock() { base_->Unlock(); } \ - private: \ - ClassName* base_; \ - }; \ - void Lock() { critsec_.Lock(); } \ - void Unlock() { critsec_.Unlock(); } \ - private: \ - CefCriticalSection critsec_; - - -/// -// 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; -}; - - -/// -// 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; -}; - - -/// -// Interface to implement for visiting storage. The methods of this class will -// always be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefStorageVisitor : public virtual CefBase -{ -public: - /// - // Method that will be called once for each key/value data pair in storage. - // |count| is the 0-based index for the current pair. |total| is the total - // number of pairs. Set |deleteData| to true to delete the pair currently - // being visited. Return false to stop visiting pairs. This method may never - // be called if no data is found. - /// - /*--cef()--*/ - virtual bool Visit(CefStorageType type, const CefString& origin, - const CefString& key, const CefString& value, int count, - int total, bool& deleteData) =0; -}; - - -/// -// Class used to represent a browser window. The methods of this class may be -// called on any thread unless otherwise indicated in the comments. -/// -/*--cef(source=library)--*/ -class CefBrowser : public virtual CefBase -{ -public: - typedef cef_key_type_t KeyType; - typedef cef_mouse_button_type_t MouseButtonType; - typedef cef_paint_element_type_t PaintElementType; - - /// - // 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 call will not block. - /// - /*--cef(optional_param=url)--*/ - static bool CreateBrowser(CefWindowInfo& windowInfo, - CefRefPtr client, - const CefString& url, - const CefBrowserSettings& settings); - - /// - // Create a new browser window using the window parameters specified by - // |windowInfo|. This method should only be called on the UI thread. - /// - /*--cef(optional_param=url)--*/ - static CefRefPtr CreateBrowserSync(CefWindowInfo& windowInfo, - CefRefPtr client, - const CefString& url, - const CefBrowserSettings& settings); - - /// - // 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; - - /// - // 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; - /// - // 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; - - /// - // 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 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 client for this browser. - /// - /*--cef()--*/ - virtual CefRefPtr GetClient() =0; - - /// - // Returns the main (top-level) frame for the browser window. - /// - /*--cef()--*/ - virtual CefRefPtr GetMainFrame() =0; - - /// - // Returns the focused frame for the browser window. This method should only - // be called on the UI thread. - /// - /*--cef()--*/ - virtual CefRefPtr GetFocusedFrame() =0; - - /// - // Returns the frame with the specified name, or NULL if not found. This - // method should only be called on the UI thread. - /// - /*--cef()--*/ - virtual CefRefPtr GetFrame(const CefString& name) =0; - - /// - // Returns the names of all existing frames. This method should only be called - // on the UI thread. - /// - /*--cef()--*/ - virtual void GetFrameNames(std::vector& names) =0; - - /// - // Search for |searchText|. |identifier| can be used to have multiple searches - // running simultaniously. |forward| indicates whether to search forward or - // backward within the page. |matchCase| indicates whether the search should - // be case-sensitive. |findNext| indicates whether this is the first request - // or a follow-up. - /// - /*--cef()--*/ - virtual void Find(int identifier, const CefString& searchText, - bool forward, bool matchCase, bool findNext) =0; - - /// - // Cancel all searches that are currently going on. - /// - /*--cef()--*/ - virtual void StopFinding(bool clearSelection) =0; - - /// - // Get the zoom level. - /// - /*--cef()--*/ - virtual double GetZoomLevel() =0; - - /// - // Change the zoom level to the specified value. - /// - /*--cef()--*/ - virtual void SetZoomLevel(double zoomLevel) =0; - - /// - // Clear the back/forward browsing history. - /// - /*--cef()--*/ - virtual void ClearHistory() =0; - - /// - // Open developer tools in its own window. - /// - /*--cef()--*/ - virtual void ShowDevTools() =0; - - /// - // Explicitly close the developer tools window if one exists for this browser - // instance. - /// - /*--cef()--*/ - virtual void CloseDevTools() =0; - - /// - // Returns true if window rendering is disabled. - /// - /*--cef()--*/ - virtual bool IsWindowRenderingDisabled() =0; - - /// - // Get the size of the specified element. This method should only be called on - // the UI thread. - /// - /*--cef()--*/ - virtual bool GetSize(PaintElementType type, int& width, int& height) =0; - - /// - // Set the size of the specified element. This method is only used when window - // rendering is disabled. - /// - /*--cef()--*/ - virtual void SetSize(PaintElementType type, int width, int height) =0; - - /// - // Returns true if a popup is currently visible. This method should only be - // called on the UI thread. - /// - /*--cef()--*/ - virtual bool IsPopupVisible() =0; - - /// - // Hide the currently visible popup, if any. - /// - /*--cef()--*/ - virtual void HidePopup() =0; - - /// - // Invalidate the |dirtyRect| region of the view. This method is only used - // when window rendering is disabled and will result in a call to - // HandlePaint(). - /// - /*--cef()--*/ - virtual void Invalidate(const CefRect& dirtyRect) =0; - - /// - // Get the raw image data contained in the specified element without - // performing validation. The specified |width| and |height| dimensions must - // match the current element size. On Windows |buffer| must be width*height*4 - // bytes in size and represents a BGRA image with an upper-left origin. This - // method should only be called on the UI thread. - /// - /*--cef()--*/ - virtual bool GetImage(PaintElementType type, int width, int height, - void* buffer) =0; - - /// - // Send a key event to the browser. - /// - /*--cef()--*/ - virtual void SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar, - bool imeChar) =0; - - /// - // Send a mouse click event to the browser. The |x| and |y| coordinates are - // relative to the upper-left corner of the view. - /// - /*--cef()--*/ - virtual void SendMouseClickEvent(int x, int y, MouseButtonType type, - bool mouseUp, int clickCount) =0; - - /// - // Send a mouse move event to the browser. The |x| and |y| coordinates are - // relative to the upper-left corner of the view. - /// - /*--cef()--*/ - virtual void SendMouseMoveEvent(int x, int y, bool mouseLeave) =0; - - /// - // Send a mouse wheel event to the browser. The |x| and |y| coordinates are - // relative to the upper-left corner of the view. - /// - /*--cef()--*/ - virtual void SendMouseWheelEvent(int x, int y, int delta) =0; - - /// - // Send a focus event to the browser. - /// - /*--cef()--*/ - virtual void SendFocusEvent(bool setFocus) =0; - - /// - // Send a capture lost event to the browser. - /// - /*--cef()--*/ - virtual void SendCaptureLostEvent() =0; -}; - - -/// -// Class used to represent a frame in the browser window. The methods of this -// class may be called on any thread unless otherwise indicated in the comments. -/// -/*--cef(source=library)--*/ -class CefFrame : public virtual CefBase -{ -public: - /// - // 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; - - /// - // Execute printing in the this frame. The user will be prompted with the - // print dialog appropriate to the operating system. - /// - /*--cef()--*/ - virtual void Print() =0; - - /// - // Save this frame's HTML source to a temporary file and open it in the - // default text viewing application. - /// - /*--cef()--*/ - virtual void ViewSource() =0; - - /// - // Returns this frame's HTML source as a string. This method should only be - // called on the UI thread. - /// - /*--cef()--*/ - virtual CefString GetSource() =0; - - /// - // Returns this frame's display text as a string. This method should only be - // called on the UI thread. - /// - /*--cef()--*/ - virtual CefString GetText() =0; - - /// - // Load the request represented by the |request| object. - /// - /*--cef()--*/ - virtual void LoadRequest(CefRefPtr request) =0; - - /// - // Load the specified |url|. - /// - /*--cef()--*/ - virtual void LoadURL(const CefString& url) =0; - - /// - // Load the contents of |string| with the optional dummy target |url|. - /// - /*--cef()--*/ - virtual void LoadString(const CefString& string, - const CefString& url) =0; - - /// - // Load the contents of |stream| with the optional dummy target |url|. - /// - /*--cef()--*/ - virtual void LoadStream(CefRefPtr stream, - 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. This method should only be - // called on the UI thread. - /// - /*--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. This method should - // only be called on the UI thread. - /// - /*--cef()--*/ - virtual long long GetIdentifier() =0; - - /// - // Returns the parent of this frame or NULL if this is the main (top-level) - // frame. This method should only be called on the UI thread. - /// - /*--cef()--*/ - virtual CefRefPtr GetParent() =0; - - /// - // Returns the URL currently loaded in this frame. This method should only be - // called on the UI thread. - /// - /*--cef()--*/ - virtual CefString GetURL() =0; - - /// - // Returns the browser that this frame belongs to. - /// - /*--cef()--*/ - virtual CefRefPtr GetBrowser() =0; - - /// - // Visit the DOM document. - /// - /*--cef()--*/ - virtual void VisitDOM(CefRefPtr visitor) =0; - - /// - // Get the V8 context associated with the frame. This method should only be - // called on the UI thread. - /// - /*--cef()--*/ - virtual CefRefPtr GetV8Context() =0; -}; - - -/// -// 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) {} -}; - - -/// -// Implement this interface to provide handler implementations. -/// -/*--cef(source=client,no_debugct_check)--*/ -class CefApp : public virtual CefBase -{ -public: - /// - // Return the handler for proxy events. If not handler is returned the default - // system handler will be used. - /// - /*--cef()--*/ - virtual CefRefPtr GetProxyHandler() { return NULL; } -}; - - -/// -// 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 parentBrowser, - const CefPopupFeatures& popupFeatures, - CefWindowInfo& windowInfo, - const CefString& url, - CefRefPtr& client, - CefBrowserSettings& settings) { return false; } - - /// - // Called after a new window is created. - /// - /*--cef()--*/ - virtual void OnAfterCreated(CefRefPtr 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 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 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 browser) {} -}; - - -/// -// 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 browser, - CefRefPtr 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 browser, - CefRefPtr frame, - int httpStatusCode) {} - - /// - // Called when the browser fails to load a resource. |errorCode| is the error - // code number and |failedUrl| is the URL that failed to load. To provide - // custom error text assign the text to |errorText| and return true. - // Otherwise, return false for the default error text. See - // net\base\net_error_list.h for complete descriptions of the error codes. - /// - /*--cef()--*/ - virtual bool OnLoadError(CefRefPtr browser, - CefRefPtr frame, - ErrorCode errorCode, - const CefString& failedUrl, - CefString& errorText) { return false; } -}; - - -/// -// 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: - typedef cef_handler_navtype_t NavType; - - /// - // Called on the UI thread before browser navigation. Return true to cancel - // the navigation or false to allow the navigation to proceed. - /// - /*--cef()--*/ - virtual bool OnBeforeBrowse(CefRefPtr browser, - CefRefPtr frame, - CefRefPtr request, - NavType navType, - bool isRedirect) { return false; } - - /// - // Called on the IO thread before a resource is loaded. To allow the resource - // to load normally return false. To redirect the resource to a new url - // populate the |redirectUrl| value and return false. To specify data for the - // resource return a CefStream object in |resourceStream|, use the |response| - // object to set mime type, HTTP status code and optional header values, and - // return false. To cancel loading of the resource return true. Any - // modifications to |request| will be observed. If the URL in |request| is - // changed and |redirectUrl| is also set, the URL in |request| will be used. - /// - /*--cef()--*/ - virtual bool OnBeforeResourceLoad(CefRefPtr browser, - CefRefPtr request, - CefString& redirectUrl, - CefRefPtr& resourceStream, - CefRefPtr response, - int loadFlags) { return false; } - - /// - // 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 browser, - const CefString& old_url, - CefString& new_url) {} - - /// - // Called on the UI thread after a response to the resource request is - // received. Set |filter| if response content needs to be monitored and/or - // modified as it arrives. - /// - /*--cef()--*/ - virtual void OnResourceResponse(CefRefPtr browser, - const CefString& url, - CefRefPtr response, - CefRefPtr& filter) {} - - /// - // Called on the IO thread to handle requests for URLs with an unknown - // protocol component. Return true to indicate that the request should - // succeed because it was handled externally. Set |allowOSExecution| to true - // and return false to attempt execution via the registered OS protocol - // handler, if any. If false is returned and either |allow_os_execution| - // is false or OS protocol handler execution fails then the request will fail - // with an error condition. - // SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED - // ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. - /// - /*--cef()--*/ - virtual bool OnProtocolExecution(CefRefPtr browser, - const CefString& url, - bool& allowOSExecution) { return false; } - - /// - // Called on the UI thread when a server indicates via the - // 'Content-Disposition' header that a response represents a file to download. - // |mimeType| is the mime type for the download, |fileName| is the suggested - // target file name and |contentLength| is either the value of the - // 'Content-Size' header or -1 if no size was provided. Set |handler| to the - // CefDownloadHandler instance that will recieve the file contents. Return - // true to download the file or false to cancel the file download. - /// - /*--cef()--*/ - virtual bool GetDownloadHandler(CefRefPtr browser, - const CefString& mimeType, - const CefString& fileName, - int64 contentLength, - CefRefPtr& handler) - { return false; } - - /// - // 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 number. Set |username| and |password| and return - // true to handle the request. Return false to cancel the request. - /// - /*--cef(optional_param=realm)--*/ - virtual bool GetAuthCredentials(CefRefPtr browser, - bool isProxy, - const CefString& host, - int port, - const CefString& realm, - const CefString& scheme, - CefString& username, - CefString& password) { return false; } -}; - - -/// -// 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 navigation state has changed. - /// - /*--cef()--*/ - virtual void OnNavStateChange(CefRefPtr browser, - bool canGoBack, - bool canGoForward) {} - - /// - // Called when a frame's address has changed. - /// - /*--cef()--*/ - virtual void OnAddressChange(CefRefPtr browser, - CefRefPtr frame, - const CefString& url) {} - - /// - // Called when the size of the content area has changed. - /// - /*--cef()--*/ - virtual void OnContentsSizeChange(CefRefPtr browser, - CefRefPtr frame, - int width, - int height) {} - - /// - // Called when the page title changes. - /// - /*--cef(optional_param=title)--*/ - virtual void OnTitleChange(CefRefPtr 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 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 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 browser, - const CefString& message, - const CefString& source, - int line) { return false; } -}; - - -/// -// Implement this interface to handle events related to focus. The methods of -// this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefFocusHandler : public virtual CefBase -{ -public: - typedef cef_handler_focus_source_t FocusSource; - - /// - // Called when the browser component is about to loose focus. For instance, if - // focus was on the last HTML element and the user pressed the TAB key. |next| - // will be true if the browser is giving focus to the next component and false - // if the browser is giving focus to the previous component. - /// - /*--cef()--*/ - virtual void OnTakeFocus(CefRefPtr browser, - bool next) {} - - /// - // Called when the browser component is requesting focus. |source| indicates - // where the focus request is originating from. Return false to allow the - // focus to be set or true to cancel setting the focus. - /// - /*--cef()--*/ - virtual bool OnSetFocus(CefRefPtr browser, - FocusSource source) { return false; } - - /// - // Called when a new node in the the browser gets focus. The |node| value may - // be empty if no specific node has gained focus. The node object passed to - // this method represents a snapshot of the DOM at the time this method is - // executed. DOM objects are only valid for the scope of this method. Do not - // keep references to or attempt to access any DOM objects outside the scope - // of this method. - /// - /*--cef(optional_param=frame,optional_param=node)--*/ - virtual void OnFocusedNodeChanged(CefRefPtr browser, - CefRefPtr frame, - CefRefPtr node) {} -}; - - -/// -// Implement this interface to handle events related to keyboard input. The -// methods of this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefKeyboardHandler : public virtual CefBase -{ -public: - typedef cef_handler_keyevent_type_t KeyEventType; - - /// - // Called when the browser component receives a keyboard event. This method - // is called both before the event is passed to the renderer and after - // JavaScript in the page has had a chance to handle the event. |type| is the - // type of keyboard event, |code| is the windows scan-code for the event, - // |modifiers| is a set of bit- flags describing any pressed modifier keys and - // |isSystemKey| is true if Windows considers this a 'system key' message (see - // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx). If - // |isAfterJavaScript| is true then JavaScript in the page has had a chance - // to handle the event and has chosen not to. Only RAWKEYDOWN, KEYDOWN and - // CHAR events will be sent with |isAfterJavaScript| set to true. Return - // true if the keyboard event was handled or false to allow continued handling - // of the event by the renderer. - /// - /*--cef()--*/ - virtual bool OnKeyEvent(CefRefPtr browser, - KeyEventType type, - int code, - int modifiers, - bool isSystemKey, - bool isAfterJavaScript) { return false; } -}; - - -/// -// Implement this interface to handle events related to browser context menus. -// The methods of this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefMenuHandler : public virtual CefBase -{ -public: - typedef cef_menu_id_t MenuId; - - /// - // Called before a context menu is displayed. Return false to display the - // default context menu or true to cancel the display. - /// - /*--cef()--*/ - virtual bool OnBeforeMenu(CefRefPtr browser, - const CefMenuInfo& menuInfo) { return false; } - - /// - // Called to optionally override the default text for a context menu item. - // |label| contains the default text and may be modified to substitute - // alternate text. - /// - /*--cef()--*/ - virtual void GetMenuLabel(CefRefPtr browser, - MenuId menuId, - CefString& label) {} - - /// - // Called when an option is selected from the default context menu. Return - // false to execute the default action or true to cancel the action. - /// - /*--cef()--*/ - virtual bool OnMenuAction(CefRefPtr browser, - MenuId menuId) { return false; } -}; - - -/// -// Implement this interface to handle events related to printing. The methods of -// this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefPrintHandler : public virtual CefBase -{ -public: - /// - // Called to allow customization of standard print options before the print - // dialog is displayed. |printOptions| allows specification of paper size, - // orientation and margins. Note that the specified margins may be adjusted if - // they are outside the range supported by the printer. All units are in - // inches. Return false to display the default print options or true to - // display the modified |printOptions|. - /// - /*--cef()--*/ - virtual bool GetPrintOptions(CefRefPtr browser, - CefPrintOptions& printOptions) { return false; } - - /// - // Called to format print headers and footers. |printInfo| contains platform- - // specific information about the printer context. |url| is the URL if the - // currently printing page, |title| is the title of the currently printing - // page, |currentPage| is the current page number and |maxPages| is the total - // number of pages. Six default header locations are provided by the - // implementation: top left, top center, top right, bottom left, bottom center - // and bottom right. To use one of these default locations just assign a - // string to the appropriate variable. To draw the header and footer yourself - // return true. Otherwise, populate the approprate variables and return false. - /// - /*--cef()--*/ - virtual bool GetPrintHeaderFooter(CefRefPtr browser, - CefRefPtr frame, - const CefPrintInfo& printInfo, - const CefString& url, - const CefString& title, - int currentPage, - int maxPages, - CefString& topLeft, - CefString& topCenter, - CefString& topRight, - CefString& bottomLeft, - CefString& bottomCenter, - CefString& bottomRight) { return false; } -}; - - -/// -// Implement this interface to handle events related to find results. The -// methods of this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefFindHandler : public virtual CefBase -{ -public: - /// - // Called to report find results returned by CefBrowser::Find(). |identifer| - // is the identifier passed to CefBrowser::Find(), |count| is the number of - // matches currently identified, |selectionRect| is the location of where the - // match was found (in window coordinates), |activeMatchOrdinal| is the - // current position in the search results, and |finalUpdate| is true if this - // is the last find notification. - /// - /*--cef()--*/ - virtual void OnFindResult(CefRefPtr browser, - int identifier, - int count, - const CefRect& selectionRect, - int activeMatchOrdinal, - bool finalUpdate) {} -}; - - -/// -// Implement this interface to handle events related to JavaScript dialogs. The -// methods of this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefJSDialogHandler : public virtual CefBase -{ -public: - /// - // Called to run a JavaScript alert message. Return false to display the - // default alert or true if you displayed a custom alert. - /// - /*--cef()--*/ - virtual bool OnJSAlert(CefRefPtr browser, - CefRefPtr frame, - const CefString& message) { return false; } - - /// - // Called to run a JavaScript confirm request. Return false to display the - // default alert or true if you displayed a custom alert. If you handled the - // alert set |retval| to true if the user accepted the confirmation. - /// - /*--cef()--*/ - virtual bool OnJSConfirm(CefRefPtr browser, - CefRefPtr frame, - const CefString& message, - bool& retval) { return false; } - - /// - // Called to run a JavaScript prompt request. Return false to display the - // default prompt or true if you displayed a custom prompt. If you handled - // the prompt set |retval| to true if the user accepted the prompt and request - // and |result| to the resulting value. - /// - /*--cef()--*/ - virtual bool OnJSPrompt(CefRefPtr browser, - CefRefPtr frame, - const CefString& message, - const CefString& defaultValue, - bool& retval, - CefString& result) { return false; } -}; - - -/// -// Implement this interface to handle V8 context events. The methods of this -// class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefV8ContextHandler : public virtual CefBase -{ -public: - /// - // 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 browser, - CefRefPtr frame, - CefRefPtr 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 browser, - CefRefPtr frame, - CefRefPtr context) {} -}; - - -/// -// Implement this interface to handle events when window rendering is disabled. -// The methods of this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefRenderHandler : public virtual CefBase -{ -public: - typedef cef_paint_element_type_t PaintElementType; - typedef std::vector RectList; - - /// - // Called to retrieve the view rectangle which is relative to screen - // coordinates. Return true if the rectangle was provided. - /// - /*--cef()--*/ - virtual bool GetViewRect(CefRefPtr browser, - CefRect& rect) { return false; } - - /// - // Called to retrieve the simulated screen rectangle. Return true if the - // rectangle was provided. - /// - /*--cef()--*/ - virtual bool GetScreenRect(CefRefPtr browser, - CefRect& rect) { return false; } - - /// - // Called to retrieve the translation from view coordinates to actual screen - // coordinates. Return true if the screen coordinates were provided. - /// - /*--cef()--*/ - virtual bool GetScreenPoint(CefRefPtr browser, - int viewX, - int viewY, - int& screenX, - int& screenY) { return false; } - - /// - // Called when the browser wants to show or hide the popup widget. The popup - // should be shown if |show| is true and hidden if |show| is false. - /// - /*--cef()--*/ - virtual void OnPopupShow(CefRefPtr browser, - bool show) {} - - /// - // Called when the browser wants to move or resize the popup widget. |rect| - // contains the new location and size. - /// - /*--cef()--*/ - virtual void OnPopupSize(CefRefPtr browser, - const CefRect& rect) {} - - /// - // Called when an element should be painted. |type| indicates whether the - // element is the view or the popup widget. |buffer| contains the pixel data - // for the whole image. |dirtyRects| contains the set of rectangles that need - // to be repainted. On Windows |buffer| will be width*height*4 bytes in size - // and represents a BGRA image with an upper-left origin. - /// - /*--cef()--*/ - virtual void OnPaint(CefRefPtr browser, - PaintElementType type, - const RectList& dirtyRects, - const void* buffer) {} - - /// - // Called when the browser window's cursor has changed. - /// - /*--cef()--*/ - virtual void OnCursorChange(CefRefPtr browser, - CefCursorHandle cursor) {} -}; - - -/// -// Implement this interface to handle events related to dragging. The methods of -// this class will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefDragHandler : public virtual CefBase -{ -public: - typedef cef_drag_operations_mask_t DragOperationsMask; - - /// - // Called when the browser window initiates a drag event. |dragData| - // contains the drag event data and |mask| represents the type of drag - // operation. Return false for default drag handling behavior or true to - // cancel the drag event. - /// - /*--cef()--*/ - virtual bool OnDragStart(CefRefPtr browser, - CefRefPtr dragData, - DragOperationsMask mask) { return false; } - - /// - // Called when an external drag event enters the browser window. |dragData| - // contains the drag event data and |mask| represents the type of drag - // operation. Return false for default drag handling behavior or true to - // cancel the drag event. - /// - /*--cef()--*/ - virtual bool OnDragEnter(CefRefPtr browser, - CefRefPtr dragData, - DragOperationsMask mask) { return false; } -}; - - -/// -// 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 GetLifeSpanHandler() { return NULL; } - - /// - // Return the handler for browser load status events. - /// - /*--cef()--*/ - virtual CefRefPtr GetLoadHandler() { return NULL; } - - /// - // Return the handler for browser request events. - /// - /*--cef()--*/ - virtual CefRefPtr GetRequestHandler() { return NULL; } - - /// - // Return the handler for browser display state events. - /// - /*--cef()--*/ - virtual CefRefPtr GetDisplayHandler() { return NULL; } - - /// - // Return the handler for focus events. - /// - /*--cef()--*/ - virtual CefRefPtr GetFocusHandler() { return NULL; } - - /// - // Return the handler for keyboard events. - /// - /*--cef()--*/ - virtual CefRefPtr GetKeyboardHandler() { return NULL; } - - /// - // Return the handler for context menu events. - /// - /*--cef()--*/ - virtual CefRefPtr GetMenuHandler() { return NULL; } - - /// - // Return the handler for printing events. - /// - /*--cef()--*/ - virtual CefRefPtr GetPrintHandler() { return NULL; } - - /// - // Return the handler for find result events. - /// - /*--cef()--*/ - virtual CefRefPtr GetFindHandler() { return NULL; } - - /// - // Return the handler for JavaScript dialog events. - /// - /*--cef()--*/ - virtual CefRefPtr GetJSDialogHandler() { return NULL; } - - /// - // Return the handler for V8 context events. - /// - /*--cef()--*/ - virtual CefRefPtr GetV8ContextHandler() { return NULL; } - - /// - // Return the handler for off-screen rendering events. - /// - /*--cef()--*/ - virtual CefRefPtr GetRenderHandler() { return NULL; } - - /// - // Return the handler for drag events. - /// - /*--cef()--*/ - virtual CefRefPtr GetDragHandler() { return NULL; } -}; - - -/// -// 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 HeaderMap; - typedef cef_weburlrequest_flags_t RequestFlags; - - /// - // Create a new CefRequest object. - /// - /*--cef()--*/ - static CefRefPtr 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 GetPostData() =0; - /// - // Set the post data. - /// - /*--cef()--*/ - virtual void SetPostData(CefRefPtr 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 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 > ElementVector; - - /// - // Create a new CefPostData object. - /// - /*--cef()--*/ - static CefRefPtr 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 element) =0; - - /// - // Add the specified post data element. Returns true if the add succeeds. - /// - /*--cef()--*/ - virtual bool AddElement(CefRefPtr 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 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; -}; - - -/// -// 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 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; -}; - - -/// -// 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. - /// - /*--cef()--*/ - virtual int Seek(long offset, int whence) =0; - - /// - // Return the current offset position. - /// - /*--cef()--*/ - virtual long 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 CreateForFile(const CefString& fileName); - /// - // Create a new CefStreamReader object from data. - /// - /*--cef()--*/ - static CefRefPtr CreateForData(void* data, size_t size); - /// - // Create a new CefStreamReader object from a custom handler. - /// - /*--cef()--*/ - static CefRefPtr CreateForHandler( - CefRefPtr 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(long offset, int whence) =0; - - /// - // Return the current offset position. - /// - /*--cef()--*/ - virtual long 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. - /// - /*--cef()--*/ - virtual int Seek(long offset, int whence) =0; - - /// - // Return the current offset position. - /// - /*--cef()--*/ - virtual long 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 CreateForFile(const CefString& fileName); - /// - // Create a new CefStreamWriter object for a custom handler. - /// - /*--cef()--*/ - static CefRefPtr CreateForHandler( - CefRefPtr 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. - /// - /*--cef()--*/ - virtual int Seek(long offset, int whence) =0; - - /// - // Return the current offset position. - /// - /*--cef()--*/ - virtual long Tell() =0; - - /// - // Flush the stream. - /// - /*--cef()--*/ - virtual int Flush() =0; -}; - - -/// -// Class that encapsulates a V8 context handle. -/// -/*--cef(source=library)--*/ -class CefV8Context : public virtual CefBase -{ -public: - /// - // Returns the current (top) context object in the V8 context stack. - /// - /*--cef()--*/ - static CefRefPtr GetCurrentContext(); - - /// - // Returns the entered (bottom) context object in the V8 context stack. - /// - /*--cef()--*/ - static CefRefPtr GetEnteredContext(); - - /// - // Returns true if V8 is currently inside a context. - /// - /*--cef()--*/ - static bool InContext(); - - /// - // Returns the browser for this context. - /// - /*--cef()--*/ - virtual CefRefPtr GetBrowser() =0; - - /// - // Returns the frame for this context. - /// - /*--cef()--*/ - virtual CefRefPtr GetFrame() =0; - - /// - // Returns the global object for this context. - /// - /*--cef()--*/ - virtual CefRefPtr GetGlobal() =0; - - /// - // Enter this context. A context must be explicitly entered before creating a - // V8 Object, Array or Function 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 that) =0; -}; - - -typedef std::vector > CefV8ValueList; - -/// -// Interface that should be implemented to handle V8 function calls. The methods -// of this class will always be called on the UI 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 object, - const CefV8ValueList& arguments, - CefRefPtr& 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 UI 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 object, - CefRefPtr& 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 object, - const CefRefPtr 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 should only be -// called on the UI 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 CreateUndefined(); - /// - // Create a new CefV8Value object of type null. - /// - /*--cef()--*/ - static CefRefPtr CreateNull(); - /// - // Create a new CefV8Value object of type bool. - /// - /*--cef()--*/ - static CefRefPtr CreateBool(bool value); - /// - // Create a new CefV8Value object of type int. - /// - /*--cef()--*/ - static CefRefPtr CreateInt(int value); - /// - // Create a new CefV8Value object of type double. - /// - /*--cef()--*/ - static CefRefPtr CreateDouble(double value); - /// - // Create a new CefV8Value object of type Date. - /// - /*--cef()--*/ - static CefRefPtr CreateDate(const CefTime& date); - /// - // Create a new CefV8Value object of type string. - /// - /*--cef(optional_param=value)--*/ - static CefRefPtr CreateString(const CefString& value); - /// - // Create a new CefV8Value object of type object with optional user data and - // 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(capi_name=cef_v8value_create_object_with_accessor, - optional_param=user_data,optional_param=accessor)--*/ - static CefRefPtr CreateObject(CefRefPtr user_data, - CefRefPtr accessor); - /// - // Create a new CefV8Value object of type array. 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 CreateArray(); - /// - // 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 CreateFunction(const CefString& name, - CefRefPtr 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 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 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 int GetIntValue() =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 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; - - /// - // Delete the value with the specified identifier. - /// - /*--cef(capi_name=delete_value_bykey)--*/ - virtual bool DeleteValue(const CefString& key) =0; - /// - // Delete the value with the specified identifier. - /// - /*--cef(capi_name=delete_value_byindex,index_param=index)--*/ - virtual bool DeleteValue(int index) =0; - - /// - // Returns the value with the specified identifier. - /// - /*--cef(capi_name=get_value_bykey)--*/ - virtual CefRefPtr GetValue(const CefString& key) =0; - /// - // Returns the value with the specified identifier. - /// - /*--cef(capi_name=get_value_byindex,index_param=index)--*/ - virtual CefRefPtr GetValue(int index) =0; - - /// - // Associate a value with the specified identifier. - /// - /*--cef(capi_name=set_value_bykey)--*/ - virtual bool SetValue(const CefString& key, CefRefPtr value, - PropertyAttribute attribute) =0; - /// - // Associate a value with the specified identifier. - /// - /*--cef(capi_name=set_value_byindex,index_param=index)--*/ - virtual bool SetValue(int index, CefRefPtr value) =0; - - /// - // Register an identifier whose access will be forwarded to the CefV8Accessor - // instance passed to CefV8Value::CreateObject(). - /// - /*--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& keys) =0; - - /// - // Returns the user data, if any, specified when the object was created. - /// - /*--cef()--*/ - virtual CefRefPtr GetUserData() =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 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. |arguments| is the list of arguments that will be passed to the - // function. If execution succeeds |retval| will be set to the function return - // value. If execution fails |exception| will be set to the exception that was - // thrown. If |rethrow_exception| is true any exception will also be re- - // thrown. This method returns false if called incorrectly. - /// - /*--cef(optional_param=object)--*/ - virtual bool ExecuteFunction(CefRefPtr object, - const CefV8ValueList& arguments, - CefRefPtr& retval, - CefRefPtr& exception, - bool rethrow_exception) =0; - - /// - // Execute the function using the specified V8 context. |object| is the - // receiver ('this' object) of the function. |arguments| is the list of - // arguments that will be passed to the function. If execution succeeds - // |retval| will be set to the function return value. If execution fails - // |exception| will be set to the exception that was thrown. If - // |rethrow_exception| is true any exception will also be re-thrown. This - // method returns false if called incorrectly. - /// - /*--cef(optional_param=object)--*/ - virtual bool ExecuteFunctionWithContext(CefRefPtr context, - CefRefPtr object, - const CefV8ValueList& arguments, - CefRefPtr& retval, - CefRefPtr& exception, - bool rethrow_exception) =0; -}; - - -/// -// Class that creates CefSchemeHandler instances. 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 scheme 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. - /// - /*--cef()--*/ - virtual CefRefPtr Create(CefRefPtr browser, - const CefString& scheme_name, - CefRefPtr request) =0; -}; - -/// -// Class used to facilitate asynchronous responses to custom scheme handler -// requests. The methods of this class may be called on any thread. -/// -/*--cef(source=library)--*/ -class CefSchemeHandlerCallback : public virtual CefBase -{ -public: - /// - // Notify that header information is now available for retrieval. - /// - /*--cef()--*/ - virtual void HeadersAvailable() =0; - - /// - // Notify that response data is now available for reading. - /// - /*--cef()--*/ - virtual void BytesAvailable() =0; - - /// - // Cancel processing of the request. - /// - /*--cef()--*/ - virtual void Cancel() =0; -}; - -/// -// Class used to implement a custom scheme handler interface. The methods of -// this class will always be called on the IO thread. -/// -/*--cef(source=client)--*/ -class CefSchemeHandler : public virtual CefBase -{ -public: - /// - // Begin processing the request. To handle the request return true and call - // HeadersAvailable() once the response header information is available - // (HeadersAvailable() 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 request, - CefRefPtr 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 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 BytesAvailable() 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 callback) =0; - - /// - // Request processing has been canceled. - /// - /*--cef()--*/ - virtual void Cancel() =0; -}; - - -/// -// Class used to handle file downloads. The methods of this class will always be -// called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefDownloadHandler : public virtual CefBase -{ -public: - /// - // A portion of the file contents have been received. This method will be - // called multiple times until the download is complete. Return |true| to - // continue receiving data and |false| to cancel. - /// - /*--cef()--*/ - virtual bool ReceivedData(void* data, int data_size) =0; - - /// - // The download is complete. - /// - /*--cef()--*/ - virtual void Complete() =0; -}; - - -/// -// Class used to make a Web URL request. Web URL requests are not associated -// with a browser instance so no CefClient callbacks will be executed. The -// methods of this class may be called on any thread. -/// -/*--cef(source=library)--*/ -class CefWebURLRequest : public virtual CefBase -{ -public: - typedef cef_weburlrequest_state_t RequestState; - - /// - // Create a new CefWebUrlRequest object. - /// - /*--cef()--*/ - static CefRefPtr CreateWebURLRequest( - CefRefPtr request, - CefRefPtr client); - - /// - // Cancels the request. - /// - /*--cef()--*/ - virtual void Cancel() =0; - - /// - // Returns the current ready state of the request. - /// - /*--cef(default_retval=WUR_STATE_UNSENT)--*/ - virtual RequestState GetState() =0; -}; - -/// -// Interface that should be implemented by the CefWebURLRequest client. The -// methods of this class will always be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefWebURLRequestClient : public virtual CefBase -{ -public: - typedef cef_weburlrequest_state_t RequestState; - typedef cef_handler_errorcode_t ErrorCode; - - /// - // Notifies the client that the request state has changed. State change - // notifications will always be sent before the below notification methods - // are called. - /// - /*--cef()--*/ - virtual void OnStateChange(CefRefPtr requester, - RequestState state) =0; - - /// - // Notifies the client that the request has been redirected and provides a - // chance to change the request parameters. - /// - /*--cef()--*/ - virtual void OnRedirect(CefRefPtr requester, - CefRefPtr request, - CefRefPtr response) =0; - - /// - // Notifies the client of the response data. - /// - /*--cef()--*/ - virtual void OnHeadersReceived(CefRefPtr requester, - CefRefPtr response) =0; - - /// - // Notifies the client of the upload progress. - /// - /*--cef()--*/ - virtual void OnProgress(CefRefPtr requester, - uint64 bytesSent, uint64 totalBytesToBeSent) =0; - - /// - // Notifies the client that content has been received. - /// - /*--cef()--*/ - virtual void OnData(CefRefPtr requester, - const void* data, int dataLength) =0; - - /// - // Notifies the client that the request ended with an error. - /// - /*--cef()--*/ - virtual void OnError(CefRefPtr requester, - ErrorCode errorCode) =0; -}; - - -/// -// 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 Create(CefRefPtr 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. is considered - // empty but 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; -}; - - -/// -// 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 Create(CefRefPtr 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 long 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 long Tell() =0; - - /// - // Returns true if at end of the file contents. - /// - /*--cef()--*/ - virtual bool Eof() =0; -}; - - -/// -// Interface to implement for visiting the DOM. The methods of this class will -// be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefDOMVisitor : public virtual CefBase -{ -public: - /// - // Method executed for visiting the DOM. The document object passed to this - // method represents a snapshot of the DOM at the time this method is - // executed. DOM objects are only valid for the scope of this method. Do not - // keep references to or attempt to access any DOM objects outside the scope - // of this method. - /// - /*--cef()--*/ - virtual void Visit(CefRefPtr document) =0; -}; - - -/// -// Class used to represent a DOM document. The methods of this class should only -// be called on the UI thread. -/// -/*--cef(source=library)--*/ -class CefDOMDocument : public virtual CefBase -{ -public: - typedef cef_dom_document_type_t Type; - - /// - // Returns the document type. - /// - /*--cef(default_retval=DOM_DOCUMENT_TYPE_UNKNOWN)--*/ - virtual Type GetType() =0; - - /// - // Returns the root document node. - /// - /*--cef()--*/ - virtual CefRefPtr GetDocument() =0; - - /// - // Returns the BODY node of an HTML document. - /// - /*--cef()--*/ - virtual CefRefPtr GetBody() =0; - - /// - // Returns the HEAD node of an HTML document. - /// - /*--cef()--*/ - virtual CefRefPtr GetHead() =0; - - /// - // Returns the title of an HTML document. - /// - /*--cef()--*/ - virtual CefString GetTitle() =0; - - /// - // Returns the document element with the specified ID value. - /// - /*--cef()--*/ - virtual CefRefPtr GetElementById(const CefString& id) =0; - - /// - // Returns the node that currently has keyboard focus. - /// - /*--cef()--*/ - virtual CefRefPtr GetFocusedNode() =0; - - /// - // Returns true if a portion of the document is selected. - /// - /*--cef()--*/ - virtual bool HasSelection() =0; - - /// - // Returns the selection start node. - /// - /*--cef()--*/ - virtual CefRefPtr GetSelectionStartNode() =0; - - /// - // Returns the selection offset within the start node. - /// - /*--cef()--*/ - virtual int GetSelectionStartOffset() =0; - - /// - // Returns the selection end node. - /// - /*--cef()--*/ - virtual CefRefPtr GetSelectionEndNode() =0; - - /// - // Returns the selection offset within the end node. - /// - /*--cef()--*/ - virtual int GetSelectionEndOffset() =0; - - /// - // Returns the contents of this selection as markup. - /// - /*--cef()--*/ - virtual CefString GetSelectionAsMarkup() =0; - - /// - // Returns the contents of this selection as text. - /// - /*--cef()--*/ - virtual CefString GetSelectionAsText() =0; - - /// - // Returns the base URL for the document. - /// - /*--cef()--*/ - virtual CefString GetBaseURL() =0; - - /// - // Returns a complete URL based on the document base URL and the specified - // partial URL. - /// - /*--cef()--*/ - virtual CefString GetCompleteURL(const CefString& partialURL) =0; -}; - - -/// -// Class used to represent a DOM node. The methods of this class should only be -// called on the UI thread. -/// -/*--cef(source=library)--*/ -class CefDOMNode : public virtual CefBase -{ -public: - typedef std::map AttributeMap; - typedef cef_dom_node_type_t Type; - - /// - // Returns the type for this node. - /// - /*--cef(default_retval=DOM_NODE_TYPE_UNSUPPORTED)--*/ - virtual Type GetType() =0; - - /// - // Returns true if this is a text node. - /// - /*--cef()--*/ - virtual bool IsText() =0; - - /// - // Returns true if this is an element node. - /// - /*--cef()--*/ - virtual bool IsElement() =0; - - /// - // Returns true if this is a form control element node. - /// - /*--cef()--*/ - virtual bool IsFormControlElement() =0; - - /// - // Returns the type of this form control element node. - /// - /*--cef()--*/ - virtual CefString GetFormControlElementType() =0; - - /// - // Returns true if this object is pointing to the same handle as |that| - // object. - /// - /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; - - /// - // Returns the name of this node. - /// - /*--cef()--*/ - virtual CefString GetName() =0; - - /// - // Returns the value of this node. - /// - /*--cef()--*/ - virtual CefString GetValue() =0; - - /// - // Set the value of this node. Returns true on success. - /// - /*--cef()--*/ - virtual bool SetValue(const CefString& value) =0; - - /// - // Returns the contents of this node as markup. - /// - /*--cef()--*/ - virtual CefString GetAsMarkup() =0; - - /// - // Returns the document associated with this node. - /// - /*--cef()--*/ - virtual CefRefPtr GetDocument() =0; - - /// - // Returns the parent node. - /// - /*--cef()--*/ - virtual CefRefPtr GetParent() =0; - - /// - // Returns the previous sibling node. - /// - /*--cef()--*/ - virtual CefRefPtr GetPreviousSibling() =0; - - /// - // Returns the next sibling node. - /// - /*--cef()--*/ - virtual CefRefPtr GetNextSibling() =0; - - /// - // Returns true if this node has child nodes. - /// - /*--cef()--*/ - virtual bool HasChildren() =0; - - /// - // Return the first child node. - /// - /*--cef()--*/ - virtual CefRefPtr GetFirstChild() =0; - - /// - // Returns the last child node. - /// - /*--cef()--*/ - virtual CefRefPtr GetLastChild() =0; - - /// - // Add an event listener to this node for the specified event type. If - // |useCapture| is true then this listener will be considered a capturing - // listener. Capturing listeners will recieve all events of the specified - // type before the events are dispatched to any other event targets beneath - // the current node in the tree. Events which are bubbling upwards through - // the tree will not trigger a capturing listener. Separate calls to this - // method can be used to register the same listener with and without capture. - // See WebCore/dom/EventNames.h for the list of supported event types. - /// - /*--cef()--*/ - virtual void AddEventListener(const CefString& eventType, - CefRefPtr listener, - bool useCapture) =0; - - - // The following methods are valid only for element nodes. - - /// - // Returns the tag name of this element. - /// - /*--cef()--*/ - virtual CefString GetElementTagName() =0; - - /// - // Returns true if this element has attributes. - /// - /*--cef()--*/ - virtual bool HasElementAttributes() =0; - - /// - // Returns true if this element has an attribute named |attrName|. - /// - /*--cef()--*/ - virtual bool HasElementAttribute(const CefString& attrName) =0; - - /// - // Returns the element attribute named |attrName|. - /// - /*--cef()--*/ - virtual CefString GetElementAttribute(const CefString& attrName) =0; - - /// - // Returns a map of all element attributes. - /// - /*--cef()--*/ - virtual void GetElementAttributes(AttributeMap& attrMap) =0; - - /// - // Set the value for the element attribute named |attrName|. Returns true on - // success. - /// - /*--cef()--*/ - virtual bool SetElementAttribute(const CefString& attrName, - const CefString& value) =0; - - /// - // Returns the inner text of the element. - /// - /*--cef()--*/ - virtual CefString GetElementInnerText() =0; -}; - - -/// -// Class used to represent a DOM event. The methods of this class should only -// be called on the UI thread. -/// -/*--cef(source=library)--*/ -class CefDOMEvent : public virtual CefBase -{ -public: - typedef cef_dom_event_category_t Category; - typedef cef_dom_event_phase_t Phase; - - /// - // Returns the event type. - /// - /*--cef()--*/ - virtual CefString GetType() =0; - - /// - // Returns the event category. - /// - /*--cef(default_retval=DOM_EVENT_CATEGORY_UNKNOWN)--*/ - virtual Category GetCategory() =0; - - /// - // Returns the event processing phase. - /// - /*--cef(default_retval=DOM_EVENT_PHASE_UNKNOWN)--*/ - virtual Phase GetPhase() =0; - - /// - // Returns true if the event can bubble up the tree. - /// - /*--cef()--*/ - virtual bool CanBubble() =0; - - /// - // Returns true if the event can be canceled. - /// - /*--cef()--*/ - virtual bool CanCancel() =0; - - /// - // Returns the document associated with this event. - /// - /*--cef()--*/ - virtual CefRefPtr GetDocument() =0; - - /// - // Returns the target of the event. - /// - /*--cef()--*/ - virtual CefRefPtr GetTarget() =0; - - /// - // Returns the current target of the event. - /// - /*--cef()--*/ - virtual CefRefPtr GetCurrentTarget() =0; -}; - - -/// -// Interface to implement for handling DOM events. The methods of this class -// will be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefDOMEventListener : public virtual CefBase -{ -public: - /// - // Called when an event is received. The event object passed to this method - // contains a snapshot of the DOM at the time this method is executed. DOM - // objects are only valid for the scope of this method. Do not keep references - // to or attempt to access any DOM objects outside the scope of this method. - /// - /*--cef()--*/ - virtual void HandleEvent(CefRefPtr event) =0; -}; - - -/// -// Interface to implement for filtering response content. The methods of this -// class will always be called on the UI thread. -/// -/*--cef(source=client)--*/ -class CefContentFilter : public virtual CefBase -{ -public: - /// - // Set |substitute_data| to the replacement for the data in |data| if data - // should be modified. - /// - /*--cef()--*/ - virtual void ProcessData(const void* data, int data_size, - CefRefPtr& substitute_data) {} - - /// - // Called when there is no more data to be processed. It is expected that - // whatever data was retained in the last ProcessData() call, it should be - // returned now by setting |remainder| if appropriate. - /// - /*--cef()--*/ - virtual void Drain(CefRefPtr& remainder) {} -}; - - -/// -// Class used to represent drag data. The methods of this class may be called -// on any thread. -/// -/*--cef(source=library)--*/ -class CefDragData : public virtual CefBase -{ -public: - /// - // Returns true if the drag data is a link. - /// - /*--cef()--*/ - virtual bool IsLink() =0; - - /// - // Returns true if the drag data is a text or html fragment. - /// - /*--cef()--*/ - virtual bool IsFragment() =0; - - /// - // Returns true if the drag data is a file. - /// - /*--cef()--*/ - virtual bool IsFile() =0; - - /// - // Return the link URL that is being dragged. - /// - /*--cef()--*/ - virtual CefString GetLinkURL() =0; - - /// - // Return the title associated with the link being dragged. - /// - /*--cef()--*/ - virtual CefString GetLinkTitle() =0; - - /// - // Return the metadata, if any, associated with the link being dragged. - /// - /*--cef()--*/ - virtual CefString GetLinkMetadata() =0; - - /// - // Return the plain text fragment that is being dragged. - /// - /*--cef()--*/ - virtual CefString GetFragmentText() =0; - - /// - // Return the text/html fragment that is being dragged. - /// - /*--cef()--*/ - virtual CefString GetFragmentHtml() =0; - - /// - // Return the base URL that the fragment came from. This value is used for - // resolving relative URLs and may be empty. - /// - /*--cef()--*/ - virtual CefString GetFragmentBaseURL() =0; - - /// - // Return the extension of the file being dragged out of the browser window. - /// - /*--cef()--*/ - virtual CefString GetFileExtension() =0; - - /// - // Return the name of the file being dragged out of the browser window. - /// - /*--cef()--*/ - virtual CefString GetFileName() =0; - - /// - // Retrieve the list of file names that are being dragged into the browser - // window. - /// - /*--cef()--*/ - virtual bool GetFileNames(std::vector& names) =0; -}; - - -/// -// 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 ArgumentList; - typedef std::map SwitchMap; - - /// - // Create a new CefCommandLine instance. - /// - /*--cef(revision_check)--*/ - static CefRefPtr CreateCommandLine(); - - /// - // 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; - - /// - // 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_H diff --git a/include/cef_app.h b/include/cef_app.h new file mode 100644 index 000000000..7db5d9fe1 --- /dev/null +++ b/include/cef_app.h @@ -0,0 +1,108 @@ +// 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_APP_H +#define _CEF_APP_H + +#include "cef_base.h" +#include "cef_proxy_handler.h" + +class CefApp; + +/// +// This function should be called on the main application thread to initialize +// CEF when the application is started. 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 CefSettings& settings, CefRefPtr application); + +/// +// This function should be called on the main application thread to shut down +// CEF 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. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefApp : public virtual CefBase +{ +public: + /// + // Return the handler for proxy events. If not handler is returned the default + // system handler will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetProxyHandler() { return NULL; } +}; + +#endif // _CEF_APP_H diff --git a/include/cef_base.h b/include/cef_base.h new file mode 100644 index 000000000..3ca429be2 --- /dev/null +++ b/include/cef_base.h @@ -0,0 +1,155 @@ +// 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_BASE_H +#define _CEF_BASE_H + +#include "internal/cef_build.h" +#include "internal/cef_ptr.h" +#include "internal/cef_types_wrappers.h" + +// Bring in platform-specific definitions. +#if defined(OS_WIN) +#include "internal/cef_win.h" +#elif defined(OS_MACOSX) +#include "internal/cef_mac.h" +#elif defined(OS_LINUX) +#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_; +}; + +/// +// 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: \ + 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_BASE_H diff --git a/include/cef_browser.h b/include/cef_browser.h new file mode 100644 index 000000000..7ce0a2413 --- /dev/null +++ b/include/cef_browser.h @@ -0,0 +1,335 @@ +// 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_BROWSER_H +#define _CEF_BROWSER_H + +#include "cef_base.h" +#include + +class CefClient; +class CefFrame; + +/// +// Class used to represent a browser window. The methods of this class may be +// called on any thread unless otherwise indicated in the comments. +/// +/*--cef(source=library)--*/ +class CefBrowser : public virtual CefBase +{ +public: + typedef cef_key_type_t KeyType; + typedef cef_mouse_button_type_t MouseButtonType; + typedef cef_paint_element_type_t PaintElementType; + + /// + // 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 call will not block. + /// + /*--cef(optional_param=url)--*/ + static bool CreateBrowser(CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, + const CefBrowserSettings& settings); + + /// + // Create a new browser window using the window parameters specified by + // |windowInfo|. This method should only be called on the UI thread. + /// + /*--cef(optional_param=url)--*/ + static CefRefPtr CreateBrowserSync(CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, + const CefBrowserSettings& settings); + + /// + // 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; + + /// + // 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; + /// + // 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; + + /// + // 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 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 client for this browser. + /// + /*--cef()--*/ + virtual CefRefPtr GetClient() =0; + + /// + // Returns the main (top-level) frame for the browser window. + /// + /*--cef()--*/ + virtual CefRefPtr GetMainFrame() =0; + + /// + // Returns the focused frame for the browser window. This method should only + // be called on the UI thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusedFrame() =0; + + /// + // Returns the frame with the specified name, or NULL if not found. This + // method should only be called on the UI thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetFrame(const CefString& name) =0; + + /// + // Returns the names of all existing frames. This method should only be called + // on the UI thread. + /// + /*--cef()--*/ + virtual void GetFrameNames(std::vector& names) =0; + + /// + // Search for |searchText|. |identifier| can be used to have multiple searches + // running simultaniously. |forward| indicates whether to search forward or + // backward within the page. |matchCase| indicates whether the search should + // be case-sensitive. |findNext| indicates whether this is the first request + // or a follow-up. + /// + /*--cef()--*/ + virtual void Find(int identifier, const CefString& searchText, + bool forward, bool matchCase, bool findNext) =0; + + /// + // Cancel all searches that are currently going on. + /// + /*--cef()--*/ + virtual void StopFinding(bool clearSelection) =0; + + /// + // Get the zoom level. + /// + /*--cef()--*/ + virtual double GetZoomLevel() =0; + + /// + // Change the zoom level to the specified value. + /// + /*--cef()--*/ + virtual void SetZoomLevel(double zoomLevel) =0; + + /// + // Clear the back/forward browsing history. + /// + /*--cef()--*/ + virtual void ClearHistory() =0; + + /// + // Open developer tools in its own window. + /// + /*--cef()--*/ + virtual void ShowDevTools() =0; + + /// + // Explicitly close the developer tools window if one exists for this browser + // instance. + /// + /*--cef()--*/ + virtual void CloseDevTools() =0; + + /// + // Returns true if window rendering is disabled. + /// + /*--cef()--*/ + virtual bool IsWindowRenderingDisabled() =0; + + /// + // Get the size of the specified element. This method should only be called on + // the UI thread. + /// + /*--cef()--*/ + virtual bool GetSize(PaintElementType type, int& width, int& height) =0; + + /// + // Set the size of the specified element. This method is only used when window + // rendering is disabled. + /// + /*--cef()--*/ + virtual void SetSize(PaintElementType type, int width, int height) =0; + + /// + // Returns true if a popup is currently visible. This method should only be + // called on the UI thread. + /// + /*--cef()--*/ + virtual bool IsPopupVisible() =0; + + /// + // Hide the currently visible popup, if any. + /// + /*--cef()--*/ + virtual void HidePopup() =0; + + /// + // Invalidate the |dirtyRect| region of the view. This method is only used + // when window rendering is disabled and will result in a call to + // HandlePaint(). + /// + /*--cef()--*/ + virtual void Invalidate(const CefRect& dirtyRect) =0; + + /// + // Get the raw image data contained in the specified element without + // performing validation. The specified |width| and |height| dimensions must + // match the current element size. On Windows |buffer| must be width*height*4 + // bytes in size and represents a BGRA image with an upper-left origin. This + // method should only be called on the UI thread. + /// + /*--cef()--*/ + virtual bool GetImage(PaintElementType type, int width, int height, + void* buffer) =0; + + /// + // Send a key event to the browser. + /// + /*--cef()--*/ + virtual void SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar, + bool imeChar) =0; + + /// + // Send a mouse click event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + /*--cef()--*/ + virtual void SendMouseClickEvent(int x, int y, MouseButtonType type, + bool mouseUp, int clickCount) =0; + + /// + // Send a mouse move event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + /*--cef()--*/ + virtual void SendMouseMoveEvent(int x, int y, bool mouseLeave) =0; + + /// + // Send a mouse wheel event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + /*--cef()--*/ + virtual void SendMouseWheelEvent(int x, int y, int delta) =0; + + /// + // Send a focus event to the browser. + /// + /*--cef()--*/ + virtual void SendFocusEvent(bool setFocus) =0; + + /// + // Send a capture lost event to the browser. + /// + /*--cef()--*/ + virtual void SendCaptureLostEvent() =0; +}; + +#endif // _CEF_BROWSER_H diff --git a/include/cef_capi.h b/include/cef_capi.h deleted file mode 100644 index ce966dced..000000000 --- a/include/cef_capi.h +++ /dev/null @@ -1,3761 +0,0 @@ -// 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. -// -// --------------------------------------------------------------------------- -// -// 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_CAPI_H -#define _CEF_CAPI_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "internal/cef_export.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_types.h" - - -/// -// This function should be called on the main application thread to initialize -// CEF when the application is started. 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_settings_t* settings, - struct _cef_app_t* application); - -/// -// This function should be called on the main application thread to shut down -// CEF 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(); - -/// -// 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 -// be called on any thread. -// -// Example JavaScript extension code:
-//   // 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;
-//     };
-//   })();
-// 
Example usage in the page:
-//   // 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();
-// 
-/// -CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, - const cef_string_t* javascript_code, struct _cef_v8handler_t* handler); - -/// -// 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:
-//  [scheme]://[username]:[password]@[host]:[port]/[url-path]
-// 
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(); - -/// -// 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(); - -/// -// CEF maintains multiple internal threads that are used for handling different -// types of tasks. The UI thread creates the browser window and is used for all -// interaction with the WebKit rendering engine and V8 JavaScript engine (The UI -// thread will be the same as the main application thread if cef_initialize() is -// called with a CefSettings.multi_threaded_message_loop value of false (0).) -// The IO thread is used for handling schema and network requests. The FILE -// thread is used for the application cache and other miscellaneous activities. -// This function will return true (1) if called on the specified thread. -/// -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. -/// -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. -/// -CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, - struct _cef_task_t* task, long delay_ms); - -/// -// 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); - -/// -// Visit all cookies. The returned cookies are ordered by longest path, then by -// earliest creation date. Returns false (0) if cookies cannot be accessed. -/// -CEF_EXPORT int cef_visit_all_cookies(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. -/// -CEF_EXPORT int cef_visit_url_cookies(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. -/// -CEF_EXPORT int cef_set_cookie(const cef_string_t* url, - const struct _cef_cookie_t* cookie); - -/// -// Delete all cookies that match the specified parameters. If both |url| and -// |cookie_name| are specified all host and domain cookies matching both values -// 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. -/// -CEF_EXPORT int cef_delete_cookies(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. By default the cookie path is the -// same as the cache path. Returns false (0) if cookies cannot be accessed. -/// -CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path); - -/// -// Visit storage of the specified type. If |origin| is non-NULL only data -// matching that origin will be visited. If |key| is non-NULL only data matching -// that key will be visited. Otherwise, all data for the storage type will be -// visited. Origin should be of the form scheme://domain. If no origin is -// specified only data currently in memory will be returned. Returns false (0) -// if the storage cannot be accessed. -/// -CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type, - const cef_string_t* origin, const cef_string_t* key, - struct _cef_storage_visitor_t* visitor); - -/// -// Sets storage of the specified type, origin, key and value. Returns false (0) -// if storage cannot be accessed. This function must be called on the UI thread. -/// -CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type, - const cef_string_t* origin, const cef_string_t* key, - const cef_string_t* value); - -/// -// Deletes all storage of the specified type. If |origin| is non-NULL only data -// matching that origin will be cleared. If |key| is non-NULL only data matching -// that key will be cleared. Otherwise, all data for the storage type will be -// cleared. Returns false (0) if storage cannot be accessed. This function must -// be called on the UI thread. -/// -CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type, - const cef_string_t* origin, const cef_string_t* key); - -/// -// Sets the directory path that will be used for storing data of the specified -// type. Currently only the ST_LOCALSTORAGE type is supported by this function. -// If |path| is NULL data will be stored in memory only. By default the storage -// path is the same as the cache path. Returns false (0) if the storage cannot -// be accessed. -/// -CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, - const cef_string_t* path); - -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)) - - -/// -// 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; - - -/// -// 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; - - -/// -// Structure to implement for visiting storage. The functions of this structure -// will always be called on the UI thread. -/// -typedef struct _cef_storage_visitor_t -{ - // Base structure. - cef_base_t base; - - /// - // Method that will be called once for each key/value data pair in storage. - // |count| is the 0-based index for the current pair. |total| is the total - // number of pairs. Set |deleteData| to true (1) to delete the pair currently - // being visited. Return false (0) to stop visiting pairs. This function may - // never be called if no data is found. - /// - int (CEF_CALLBACK *visit)(struct _cef_storage_visitor_t* self, - enum cef_storage_type_t type, const cef_string_t* origin, - const cef_string_t* key, const cef_string_t* value, int count, int total, - int* deleteData); - -} cef_storage_visitor_t; - - -/// -// Structure used to represent a browser window. The functions of this structure -// may be called on any thread unless otherwise indicated in the comments. -/// -typedef struct _cef_browser_t -{ - // Base structure. - cef_base_t base; - - /// - // 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_t* self); - - /// - // Closes this browser window. - /// - void (CEF_CALLBACK *close_browser)(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); - - /// - // 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); - - /// - // 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_t* self, int enable); - - /// - // Retrieve the window handle for this browser. - /// - cef_window_handle_t (CEF_CALLBACK *get_window_handle)( - struct _cef_browser_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_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 client for this browser. - /// - struct _cef_client_t* (CEF_CALLBACK *get_client)(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. This function should only - // be called on the UI thread. - /// - struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)( - struct _cef_browser_t* self); - - /// - // Returns the frame with the specified name, or NULL if not found. This - // function should only be called on the UI thread. - /// - struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self, - const cef_string_t* name); - - /// - // Returns the names of all existing frames. This function should only be - // called on the UI thread. - /// - void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self, - cef_string_list_t names); - - /// - // Search for |searchText|. |identifier| can be used to have multiple searches - // running simultaniously. |forward| indicates whether to search forward or - // backward within the page. |matchCase| indicates whether the search should - // be case-sensitive. |findNext| indicates whether this is the first request - // or a follow-up. - /// - void (CEF_CALLBACK *find)(struct _cef_browser_t* self, int identifier, - const cef_string_t* searchText, int forward, int matchCase, - int findNext); - - /// - // Cancel all searches that are currently going on. - /// - void (CEF_CALLBACK *stop_finding)(struct _cef_browser_t* self, - int clearSelection); - - /// - // Get the zoom level. - /// - double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_t* self); - - /// - // Change the zoom level to the specified value. - /// - void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_t* self, - double zoomLevel); - - /// - // Clear the back/forward browsing history. - /// - void (CEF_CALLBACK *clear_history)(struct _cef_browser_t* self); - - /// - // Open developer tools in its own window. - /// - void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_t* self); - - /// - // Explicitly close the developer tools window if one exists for this browser - // instance. - /// - void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_t* self); - - /// - // Returns true (1) if window rendering is disabled. - /// - int (CEF_CALLBACK *is_window_rendering_disabled)(struct _cef_browser_t* self); - - /// - // Get the size of the specified element. This function should only be called - // on the UI thread. - /// - int (CEF_CALLBACK *get_size)(struct _cef_browser_t* self, - enum cef_paint_element_type_t type, int* width, int* height); - - /// - // Set the size of the specified element. This function is only used when - // window rendering is disabled. - /// - void (CEF_CALLBACK *set_size)(struct _cef_browser_t* self, - enum cef_paint_element_type_t type, int width, int height); - - /// - // Returns true (1) if a popup is currently visible. This function should only - // be called on the UI thread. - /// - int (CEF_CALLBACK *is_popup_visible)(struct _cef_browser_t* self); - - /// - // Hide the currently visible popup, if any. - /// - void (CEF_CALLBACK *hide_popup)(struct _cef_browser_t* self); - - /// - // Invalidate the |dirtyRect| region of the view. This function is only used - // when window rendering is disabled and will result in a call to - // HandlePaint(). - /// - void (CEF_CALLBACK *invalidate)(struct _cef_browser_t* self, - const cef_rect_t* dirtyRect); - - /// - // Get the raw image data contained in the specified element without - // performing validation. The specified |width| and |height| dimensions must - // match the current element size. On Windows |buffer| must be width*height*4 - // bytes in size and represents a BGRA image with an upper-left origin. This - // function should only be called on the UI thread. - /// - int (CEF_CALLBACK *get_image)(struct _cef_browser_t* self, - enum cef_paint_element_type_t type, int width, int height, - void* buffer); - - /// - // Send a key event to the browser. - /// - void (CEF_CALLBACK *send_key_event)(struct _cef_browser_t* self, - enum cef_key_type_t type, int key, int modifiers, int sysChar, - int imeChar); - - /// - // Send a mouse click event to the browser. The |x| and |y| coordinates are - // relative to the upper-left corner of the view. - /// - void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_t* self, - int x, int y, enum cef_mouse_button_type_t type, int mouseUp, - int clickCount); - - /// - // Send a mouse move event to the browser. The |x| and |y| coordinates are - // relative to the upper-left corner of the view. - /// - void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_t* self, int x, - int y, int mouseLeave); - - /// - // Send a mouse wheel event to the browser. The |x| and |y| coordinates are - // relative to the upper-left corner of the view. - /// - void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_t* self, - int x, int y, int delta); - - /// - // Send a focus event to the browser. - /// - void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_t* self, - int setFocus); - - /// - // Send a capture lost event to the browser. - /// - void (CEF_CALLBACK *send_capture_lost_event)(struct _cef_browser_t* self); - -} cef_browser_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 call will not block. -/// -CEF_EXPORT int cef_browser_create(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 should only be called on the UI thread. -/// -CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo, - struct _cef_client_t* client, const cef_string_t* url, - const struct _cef_browser_settings_t* settings); - - -/// -// Structure used to represent a frame in the browser window. The functions of -// this structure may be called on any thread unless otherwise indicated in the -// comments. -/// -typedef struct _cef_frame_t -{ - // Base structure. - cef_base_t base; - - /// - // 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); - - /// - // Execute printing in the this frame. The user will be prompted with the - // print dialog appropriate to the operating system. - /// - void (CEF_CALLBACK *print)(struct _cef_frame_t* self); - - /// - // Save this frame's HTML source to a temporary file and open it in the - // default text viewing application. - /// - void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self); - - /// - // Returns this frame's HTML source as a string. This function should only be - // called on the UI thread. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_source)(struct _cef_frame_t* self); - - /// - // Returns this frame's display text as a string. This function should only be - // called on the UI thread. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_text)(struct _cef_frame_t* self); - - /// - // 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| with the optional dummy target |url|. - /// - void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self, - const cef_string_t* string, const cef_string_t* url); - - /// - // Load the contents of |stream| with the optional dummy target |url|. - /// - void (CEF_CALLBACK *load_stream)(struct _cef_frame_t* self, - struct _cef_stream_reader_t* stream, 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. This function should only be - // called on the UI thread. - /// - 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. This function should - // only be called on the UI thread. - /// - long long (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. This function should only be called on the UI thread. - /// - struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self); - - /// - // Returns the URL currently loaded in this frame. This function should only - // be called on the UI thread. - /// - // 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); - - /// - // Visit the DOM document. - /// - void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self, - struct _cef_domvisitor_t* visitor); - - /// - // Get the V8 context associated with the frame. This function should only be - // called on the UI thread. - /// - struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)( - struct _cef_frame_t* self); - -} cef_frame_t; - - -/// -// 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; - - -/// -// Implement this structure to provide handler implementations. -/// -typedef struct _cef_app_t -{ - // Base structure. - cef_base_t base; - - /// - // Return the handler for proxy events. If not handler is returned the default - // system handler will be used. - /// - struct _cef_proxy_handler_t* (CEF_CALLBACK *get_proxy_handler)( - struct _cef_app_t* self); - -} cef_app_t; - - -/// -// 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; - - -/// -// 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 and |failedUrl| is the URL that failed to load. To provide - // custom error text assign the text to |errorText| and return true (1). - // Otherwise, return false (0) for the default error text. See - // net\base\net_error_list.h for complete descriptions of the error codes. - /// - int (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* failedUrl, - cef_string_t* errorText); - -} cef_load_handler_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 UI thread before browser navigation. Return true (1) to - // cancel the navigation or false (0) to allow the navigation to proceed. - /// - int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - struct _cef_request_t* request, enum cef_handler_navtype_t navType, - int isRedirect); - - /// - // Called on the IO thread before a resource is loaded. To allow the resource - // to load normally return false (0). To redirect the resource to a new url - // populate the |redirectUrl| value and return false (0). To specify data for - // the resource return a CefStream object in |resourceStream|, use the - // |response| object to set mime type, HTTP status code and optional header - // values, and return false (0). To cancel loading of the resource return true - // (1). Any modifications to |request| will be observed. If the URL in - // |request| is changed and |redirectUrl| is also set, the URL in |request| - // will be used. - /// - int (CEF_CALLBACK *on_before_resource_load)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, - struct _cef_request_t* request, cef_string_t* redirectUrl, - struct _cef_stream_reader_t** resourceStream, - struct _cef_response_t* response, int loadFlags); - - /// - // 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, const cef_string_t* old_url, - cef_string_t* new_url); - - /// - // Called on the UI thread after a response to the resource request is - // received. Set |filter| if response content needs to be monitored and/or - // modified as it arrives. - /// - void (CEF_CALLBACK *on_resource_response)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* url, - struct _cef_response_t* response, - struct _cef_content_filter_t** filter); - - /// - // Called on the IO thread to handle requests for URLs with an unknown - // protocol component. Return true (1) to indicate that the request should - // succeed because it was handled externally. Set |allowOSExecution| to true - // (1) and return false (0) to attempt execution via the registered OS - // protocol handler, if any. If false (0) is returned and either - // |allow_os_execution| is false (0) or OS protocol handler execution fails - // then the request will fail with an error condition. SECURITY WARNING: YOU - // SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR - // OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. - /// - int (CEF_CALLBACK *on_protocol_execution)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* url, - int* allowOSExecution); - - /// - // Called on the UI thread when a server indicates via the 'Content- - // Disposition' header that a response represents a file to download. - // |mimeType| is the mime type for the download, |fileName| is the suggested - // target file name and |contentLength| is either the value of the 'Content- - // Size' header or -1 if no size was provided. Set |handler| to the - // cef_download_handler_t instance that will recieve the file contents. Return - // true (1) to download the file or false (0) to cancel the file download. - /// - int (CEF_CALLBACK *get_download_handler)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* mimeType, - const cef_string_t* fileName, int64 contentLength, - struct _cef_download_handler_t** handler); - - /// - // 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 number. Set |username| and |password| and return true (1) - // to handle the request. Return false (0) to cancel the request. - /// - int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, int isProxy, const cef_string_t* host, - int port, const cef_string_t* realm, const cef_string_t* scheme, - cef_string_t* username, cef_string_t* password); - -} cef_request_handler_t; - - -/// -// 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 navigation state has changed. - /// - void (CEF_CALLBACK *on_nav_state_change)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, 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 size of the content area has changed. - /// - void (CEF_CALLBACK *on_contents_size_change)( - struct _cef_display_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, int width, int height); - - /// - // 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; - - -/// -// Implement this structure to handle events related to focus. The functions of -// this structure will be called on the UI thread. -/// -typedef struct _cef_focus_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called when the browser component is about to loose focus. For instance, if - // focus was on the last HTML element and the user pressed the TAB key. |next| - // will be true (1) if the browser is giving focus to the next component and - // false (0) if the browser is giving focus to the previous component. - /// - void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self, - struct _cef_browser_t* browser, int next); - - /// - // Called when the browser component is requesting focus. |source| indicates - // where the focus request is originating from. Return false (0) to allow the - // focus to be set or true (1) to cancel setting the focus. - /// - int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self, - struct _cef_browser_t* browser, enum cef_handler_focus_source_t source); - - /// - // Called when a new node in the the browser gets focus. The |node| value may - // be NULL if no specific node has gained focus. The node object passed to - // this function represents a snapshot of the DOM at the time this function is - // executed. DOM objects are only valid for the scope of this function. Do not - // keep references to or attempt to access any DOM objects outside the scope - // of this function. - /// - void (CEF_CALLBACK *on_focused_node_changed)( - struct _cef_focus_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_domnode_t* node); - -} cef_focus_handler_t; - - -/// -// Implement this structure to handle events related to keyboard input. The -// functions of this structure will be called on the UI thread. -/// -typedef struct _cef_keyboard_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called when the browser component receives a keyboard event. This function - // is called both before the event is passed to the renderer and after - // JavaScript in the page has had a chance to handle the event. |type| is the - // type of keyboard event, |code| is the windows scan-code for the event, - // |modifiers| is a set of bit- flags describing any pressed modifier keys and - // |isSystemKey| is true (1) if Windows considers this a 'system key' message - // (see http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx). If - // |isAfterJavaScript| is true (1) then JavaScript in the page has had a - // chance to handle the event and has chosen not to. Only RAWKEYDOWN, KEYDOWN - // and CHAR events will be sent with |isAfterJavaScript| set to true (1). - // Return true (1) if the keyboard event was handled or false (0) to allow - // continued handling of the event by the renderer. - /// - int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self, - struct _cef_browser_t* browser, enum cef_handler_keyevent_type_t type, - int code, int modifiers, int isSystemKey, int isAfterJavaScript); - -} cef_keyboard_handler_t; - - -/// -// Implement this structure to handle events related to browser context menus. -// The functions of this structure will be called on the UI thread. -/// -typedef struct _cef_menu_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called before a context menu is displayed. Return false (0) to display the - // default context menu or true (1) to cancel the display. - /// - int (CEF_CALLBACK *on_before_menu)(struct _cef_menu_handler_t* self, - struct _cef_browser_t* browser, - const struct _cef_menu_info_t* menuInfo); - - /// - // Called to optionally override the default text for a context menu item. - // |label| contains the default text and may be modified to substitute - // alternate text. - /// - void (CEF_CALLBACK *get_menu_label)(struct _cef_menu_handler_t* self, - struct _cef_browser_t* browser, enum cef_menu_id_t menuId, - cef_string_t* label); - - /// - // Called when an option is selected from the default context menu. Return - // false (0) to execute the default action or true (1) to cancel the action. - /// - int (CEF_CALLBACK *on_menu_action)(struct _cef_menu_handler_t* self, - struct _cef_browser_t* browser, enum cef_menu_id_t menuId); - -} cef_menu_handler_t; - - -/// -// Implement this structure to handle events related to printing. The functions -// of this structure will be called on the UI thread. -/// -typedef struct _cef_print_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called to allow customization of standard print options before the print - // dialog is displayed. |printOptions| allows specification of paper size, - // orientation and margins. Note that the specified margins may be adjusted if - // they are outside the range supported by the printer. All units are in - // inches. Return false (0) to display the default print options or true (1) - // to display the modified |printOptions|. - /// - int (CEF_CALLBACK *get_print_options)(struct _cef_print_handler_t* self, - struct _cef_browser_t* browser, - struct _cef_print_options_t* printOptions); - - /// - // Called to format print headers and footers. |printInfo| contains platform- - // specific information about the printer context. |url| is the URL if the - // currently printing page, |title| is the title of the currently printing - // page, |currentPage| is the current page number and |maxPages| is the total - // number of pages. Six default header locations are provided by the - // implementation: top left, top center, top right, bottom left, bottom center - // and bottom right. To use one of these default locations just assign a - // string to the appropriate variable. To draw the header and footer yourself - // return true (1). Otherwise, populate the approprate variables and return - // false (0). - /// - int (CEF_CALLBACK *get_print_header_footer)(struct _cef_print_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - const struct _cef_print_info_t* printInfo, const cef_string_t* url, - const cef_string_t* title, int currentPage, int maxPages, - cef_string_t* topLeft, cef_string_t* topCenter, cef_string_t* topRight, - cef_string_t* bottomLeft, cef_string_t* bottomCenter, - cef_string_t* bottomRight); - -} cef_print_handler_t; - - -/// -// Implement this structure to handle events related to find results. The -// functions of this structure will be called on the UI thread. -/// -typedef struct _cef_find_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called to report find results returned by cef_browser_t::find(). - // |identifer| is the identifier passed to cef_browser_t::find(), |count| is - // the number of matches currently identified, |selectionRect| is the location - // of where the match was found (in window coordinates), |activeMatchOrdinal| - // is the current position in the search results, and |finalUpdate| is true - // (1) if this is the last find notification. - /// - void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self, - struct _cef_browser_t* browser, int identifier, int count, - const cef_rect_t* selectionRect, int activeMatchOrdinal, - int finalUpdate); - -} cef_find_handler_t; - - -/// -// Implement this structure to handle events related to JavaScript dialogs. The -// functions of this structure will be called on the UI thread. -/// -typedef struct _cef_jsdialog_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called to run a JavaScript alert message. Return false (0) to display the - // default alert or true (1) if you displayed a custom alert. - /// - int (CEF_CALLBACK *on_jsalert)(struct _cef_jsdialog_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - const cef_string_t* message); - - /// - // Called to run a JavaScript confirm request. Return false (0) to display the - // default alert or true (1) if you displayed a custom alert. If you handled - // the alert set |retval| to true (1) if the user accepted the confirmation. - /// - int (CEF_CALLBACK *on_jsconfirm)(struct _cef_jsdialog_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - const cef_string_t* message, int* retval); - - /// - // Called to run a JavaScript prompt request. Return false (0) to display the - // default prompt or true (1) if you displayed a custom prompt. If you handled - // the prompt set |retval| to true (1) if the user accepted the prompt and - // request and |result| to the resulting value. - /// - int (CEF_CALLBACK *on_jsprompt)(struct _cef_jsdialog_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - const cef_string_t* message, const cef_string_t* defaultValue, - int* retval, cef_string_t* result); - -} cef_jsdialog_handler_t; - - -/// -// Implement this structure to handle V8 context events. The functions of this -// structure will be called on the UI thread. -/// -typedef struct _cef_v8context_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // 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_v8context_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_v8context_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_v8context_t* context); - -} cef_v8context_handler_t; - - -/// -// Implement this structure to handle events when window rendering is disabled. -// The functions of this structure will be called on the UI thread. -/// -typedef struct _cef_render_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called to retrieve the view rectangle which is relative to screen - // coordinates. Return true (1) if the rectangle was provided. - /// - int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_rect_t* rect); - - /// - // Called to retrieve the simulated screen rectangle. Return true (1) if the - // rectangle was provided. - /// - int (CEF_CALLBACK *get_screen_rect)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_rect_t* rect); - - /// - // Called to retrieve the translation from view coordinates to actual screen - // coordinates. Return true (1) if the screen coordinates were provided. - /// - int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, int viewX, int viewY, int* screenX, - int* screenY); - - /// - // Called when the browser wants to show or hide the popup widget. The popup - // should be shown if |show| is true (1) and hidden if |show| is false (0). - /// - void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, int show); - - /// - // Called when the browser wants to move or resize the popup widget. |rect| - // contains the new location and size. - /// - void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, const cef_rect_t* rect); - - /// - // Called when an element should be painted. |type| indicates whether the - // element is the view or the popup widget. |buffer| contains the pixel data - // for the whole image. |dirtyRects| contains the set of rectangles that need - // to be repainted. On Windows |buffer| will be width*height*4 bytes in size - // and represents a BGRA image with an upper-left origin. - /// - void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, enum cef_paint_element_type_t type, - size_t dirtyRectsCount, cef_rect_t const* dirtyRects, - const void* buffer); - - /// - // Called when the browser window's cursor has changed. - /// - void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_cursor_handle_t cursor); - -} cef_render_handler_t; - - -/// -// Implement this structure to handle events related to dragging. The functions -// of this structure will be called on the UI thread. -/// -typedef struct _cef_drag_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Called when the browser window initiates a drag event. |dragData| contains - // the drag event data and |mask| represents the type of drag operation. - // Return false (0) for default drag handling behavior or true (1) to cancel - // the drag event. - /// - int (CEF_CALLBACK *on_drag_start)(struct _cef_drag_handler_t* self, - struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, - enum cef_drag_operations_mask_t mask); - - /// - // Called when an external drag event enters the browser window. |dragData| - // contains the drag event data and |mask| represents the type of drag - // operation. Return false (0) for default drag handling behavior or true (1) - // to cancel the drag event. - /// - int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self, - struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, - enum cef_drag_operations_mask_t mask); - -} cef_drag_handler_t; - - -/// -// 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 focus events. - /// - struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for keyboard events. - /// - struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for context menu events. - /// - struct _cef_menu_handler_t* (CEF_CALLBACK *get_menu_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for printing events. - /// - struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for find result events. - /// - struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for JavaScript dialog events. - /// - struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for V8 context events. - /// - struct _cef_v8context_handler_t* (CEF_CALLBACK *get_v8context_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for off-screen rendering events. - /// - struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)( - struct _cef_client_t* self); - - /// - // Return the handler for drag events. - /// - struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)( - struct _cef_client_t* self); - -} cef_client_t; - - -/// -// 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 cef_web_urlrequest_t. - /// - enum cef_weburlrequest_flags_t (CEF_CALLBACK *get_flags)( - struct _cef_request_t* self); - - /// - // Set the flags used in combination with cef_web_urlrequest_t. - /// - 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 - // cef_web_urlrequest_t. - /// - // 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 - // cef_web_urlrequest_t. - /// - 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(); - - -/// -// 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; - - -/// -// 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. - /// - int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, long offset, - int whence); - - /// - // Return the current offset position. - /// - long (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, long offset, - int whence); - - /// - // Return the current offset position. - /// - long (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. - /// - int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, long offset, - int whence); - - /// - // Return the current offset position. - /// - long (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. - /// - int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, long offset, - int whence); - - /// - // Return the current offset position. - /// - long (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); - - -/// -// Structure that encapsulates a V8 context handle. -/// -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. - /// - 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 or Function 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); - -} 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 UI 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(). The -// functions of this structure will always be called on the UI 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 should -// only be called on the UI 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 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. - /// - int (CEF_CALLBACK *get_int_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 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); - - /// - // Delete the value with the specified identifier. - /// - int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self, - const cef_string_t* key); - - /// - // Delete the value with the specified identifier. - /// - int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self, - int index); - - /// - // Returns the value with the specified identifier. - /// - 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. - /// - struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)( - struct _cef_v8value_t* self, int index); - - /// - // Associate a value with the specified identifier. - /// - 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); - - /// - // Associate a value with the specified identifier. - /// - int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index, - struct _cef_v8value_t* value); - - /// - // Register an identifier whose access will be forwarded to the - // cef_v8accessor_t instance passed to - // cef_v8value_t::cef_v8value_create_object_with_accessor(). - /// - 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); - - /// - // Returns the user data, if any, specified when the object was created. - /// - struct _cef_base_t* (CEF_CALLBACK *get_user_data)( - struct _cef_v8value_t* self); - - - // 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. |arguments| is the list of arguments that - // will be passed to the function. If execution succeeds |retval| will be set - // to the function return value. If execution fails |exception| will be set to - // the exception that was thrown. If |rethrow_exception| is true (1) any - // exception will also be re- thrown. This function returns false (0) if - // called incorrectly. - /// - int (CEF_CALLBACK *execute_function)(struct _cef_v8value_t* self, - struct _cef_v8value_t* object, size_t argumentsCount, - struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, - struct _cef_v8exception_t** exception, int rethrow_exception); - - /// - // Execute the function using the specified V8 context. |object| is the - // receiver ('this' object) of the function. |arguments| is the list of - // arguments that will be passed to the function. If execution succeeds - // |retval| will be set to the function return value. If execution fails - // |exception| will be set to the exception that was thrown. If - // |rethrow_exception| is true (1) any exception will also be re-thrown. This - // function returns false (0) if called incorrectly. - /// - int (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, - struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception, - int rethrow_exception); - -} 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(int 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. -/// -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 user data and -// 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_with_accessor( - cef_base_t* user_data, cef_v8accessor_t* accessor); - -/// -// Create a new cef_v8value_t object of type array. 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(); - -/// -// 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); - - -/// -// Structure that creates cef_scheme_handler_t instances. 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 scheme handler instance to handle the request. |browser| will - // be the browser window that initiated the request. If the request was - // initiated using the cef_web_urlrequest_t API |browser| will be NULL. - /// - struct _cef_scheme_handler_t* (CEF_CALLBACK *create)( - struct _cef_scheme_handler_factory_t* self, - struct _cef_browser_t* browser, const cef_string_t* scheme_name, - struct _cef_request_t* request); - -} cef_scheme_handler_factory_t; - - -/// -// Structure used to facilitate asynchronous responses to custom scheme handler -// requests. The functions of this structure may be called on any thread. -/// -typedef struct _cef_scheme_handler_callback_t -{ - // Base structure. - cef_base_t base; - - /// - // Notify that header information is now available for retrieval. - /// - void (CEF_CALLBACK *headers_available)( - struct _cef_scheme_handler_callback_t* self); - - /// - // Notify that response data is now available for reading. - /// - void (CEF_CALLBACK *bytes_available)( - struct _cef_scheme_handler_callback_t* self); - - /// - // Cancel processing of the request. - /// - void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_callback_t* self); - -} cef_scheme_handler_callback_t; - - -/// -// Structure used to implement a custom scheme handler structure. The functions -// of this structure will always be called on the IO thread. -/// -typedef struct _cef_scheme_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // Begin processing the request. To handle the request return true (1) and - // call headers_available() once the response header information is available - // (headers_available() 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_scheme_handler_t* self, - struct _cef_request_t* request, - struct _cef_scheme_handler_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_scheme_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 bytes_available() when the data - // is available. To indicate response completion return false (0). - /// - int (CEF_CALLBACK *read_response)(struct _cef_scheme_handler_t* self, - void* data_out, int bytes_to_read, int* bytes_read, - struct _cef_scheme_handler_callback_t* callback); - - /// - // Request processing has been canceled. - /// - void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_t* self); - -} cef_scheme_handler_t; - - -/// -// Structure used to handle file downloads. The functions of this structure will -// always be called on the UI thread. -/// -typedef struct _cef_download_handler_t -{ - // Base structure. - cef_base_t base; - - /// - // A portion of the file contents have been received. This function will be - // called multiple times until the download is complete. Return |true (1)| to - // continue receiving data and |false (0)| to cancel. - /// - int (CEF_CALLBACK *received_data)(struct _cef_download_handler_t* self, - void* data, int data_size); - - /// - // The download is complete. - /// - void (CEF_CALLBACK *complete)(struct _cef_download_handler_t* self); - -} cef_download_handler_t; - - -/// -// Structure used to make a Web URL request. Web URL requests are not associated -// with a browser instance so no cef_client_t callbacks will be executed. The -// functions of this structure may be called on any thread. -/// -typedef struct _cef_web_urlrequest_t -{ - // Base structure. - cef_base_t base; - - /// - // Cancels the request. - /// - void (CEF_CALLBACK *cancel)(struct _cef_web_urlrequest_t* self); - - /// - // Returns the current ready state of the request. - /// - enum cef_weburlrequest_state_t (CEF_CALLBACK *get_state)( - struct _cef_web_urlrequest_t* self); - -} cef_web_urlrequest_t; - - -/// -// Create a new CefWebUrlRequest object. -/// -CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create( - cef_request_t* request, struct _cef_web_urlrequest_client_t* client); - - -/// -// Structure that should be implemented by the cef_web_urlrequest_t client. The -// functions of this structure will always be called on the UI thread. -/// -typedef struct _cef_web_urlrequest_client_t -{ - // Base structure. - cef_base_t base; - - /// - // Notifies the client that the request state has changed. State change - // notifications will always be sent before the below notification functions - // are called. - /// - void (CEF_CALLBACK *on_state_change)( - struct _cef_web_urlrequest_client_t* self, - struct _cef_web_urlrequest_t* requester, - enum cef_weburlrequest_state_t state); - - /// - // Notifies the client that the request has been redirected and provides a - // chance to change the request parameters. - /// - void (CEF_CALLBACK *on_redirect)(struct _cef_web_urlrequest_client_t* self, - struct _cef_web_urlrequest_t* requester, struct _cef_request_t* request, - struct _cef_response_t* response); - - /// - // Notifies the client of the response data. - /// - void (CEF_CALLBACK *on_headers_received)( - struct _cef_web_urlrequest_client_t* self, - struct _cef_web_urlrequest_t* requester, - struct _cef_response_t* response); - - /// - // Notifies the client of the upload progress. - /// - void (CEF_CALLBACK *on_progress)(struct _cef_web_urlrequest_client_t* self, - struct _cef_web_urlrequest_t* requester, uint64 bytesSent, - uint64 totalBytesToBeSent); - - /// - // Notifies the client that content has been received. - /// - void (CEF_CALLBACK *on_data)(struct _cef_web_urlrequest_client_t* self, - struct _cef_web_urlrequest_t* requester, const void* data, - int dataLength); - - /// - // Notifies the client that the request ended with an error. - /// - void (CEF_CALLBACK *on_error)(struct _cef_web_urlrequest_client_t* self, - struct _cef_web_urlrequest_t* requester, - enum cef_handler_errorcode_t errorCode); - -} cef_web_urlrequest_client_t; - - -/// -// 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. is considered - // NULL but 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(cef_stream_reader_t* stream, - enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI); - - -/// -// 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. - /// - long (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. - /// - long (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(cef_stream_reader_t* stream); - - -/// -// Structure to implement for visiting the DOM. The functions of this structure -// will be called on the UI thread. -/// -typedef struct _cef_domvisitor_t -{ - // Base structure. - cef_base_t base; - - /// - // Method executed for visiting the DOM. The document object passed to this - // function represents a snapshot of the DOM at the time this function is - // executed. DOM objects are only valid for the scope of this function. Do not - // keep references to or attempt to access any DOM objects outside the scope - // of this function. - /// - void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self, - struct _cef_domdocument_t* document); - -} cef_domvisitor_t; - - -/// -// Structure used to represent a DOM document. The functions of this structure -// should only be called on the UI thread. -/// -typedef struct _cef_domdocument_t -{ - // Base structure. - cef_base_t base; - - /// - // Returns the document type. - /// - enum cef_dom_document_type_t (CEF_CALLBACK *get_type)( - struct _cef_domdocument_t* self); - - /// - // Returns the root document node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_document)( - struct _cef_domdocument_t* self); - - /// - // Returns the BODY node of an HTML document. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_body)( - struct _cef_domdocument_t* self); - - /// - // Returns the HEAD node of an HTML document. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_head)( - struct _cef_domdocument_t* self); - - /// - // Returns the title of an HTML document. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_title)( - struct _cef_domdocument_t* self); - - /// - // Returns the document element with the specified ID value. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)( - struct _cef_domdocument_t* self, const cef_string_t* id); - - /// - // Returns the node that currently has keyboard focus. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)( - struct _cef_domdocument_t* self); - - /// - // Returns true (1) if a portion of the document is selected. - /// - int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self); - - /// - // Returns the selection start node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_selection_start_node)( - struct _cef_domdocument_t* self); - - /// - // Returns the selection offset within the start node. - /// - int (CEF_CALLBACK *get_selection_start_offset)( - struct _cef_domdocument_t* self); - - /// - // Returns the selection end node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_selection_end_node)( - struct _cef_domdocument_t* self); - - /// - // Returns the selection offset within the end node. - /// - int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self); - - /// - // Returns the contents of this selection as markup. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)( - struct _cef_domdocument_t* self); - - /// - // Returns the contents of this selection as text. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)( - struct _cef_domdocument_t* self); - - /// - // Returns the base URL for the document. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_base_url)( - struct _cef_domdocument_t* self); - - /// - // Returns a complete URL based on the document base URL and the specified - // partial URL. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_complete_url)( - struct _cef_domdocument_t* self, const cef_string_t* partialURL); - -} cef_domdocument_t; - - -/// -// Structure used to represent a DOM node. The functions of this structure -// should only be called on the UI thread. -/// -typedef struct _cef_domnode_t -{ - // Base structure. - cef_base_t base; - - /// - // Returns the type for this node. - /// - enum cef_dom_node_type_t (CEF_CALLBACK *get_type)( - struct _cef_domnode_t* self); - - /// - // Returns true (1) if this is a text node. - /// - int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self); - - /// - // Returns true (1) if this is an element node. - /// - int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self); - - /// - // Returns true (1) if this is a form control element node. - /// - int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self); - - /// - // Returns the type of this form control element node. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)( - struct _cef_domnode_t* self); - - /// - // Returns true (1) if this object is pointing to the same handle as |that| - // object. - /// - int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self, - struct _cef_domnode_t* that); - - /// - // Returns the name of this node. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self); - - /// - // Returns the value of this node. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self); - - /// - // Set the value of this node. Returns true (1) on success. - /// - int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self, - const cef_string_t* value); - - /// - // Returns the contents of this node as markup. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_as_markup)( - struct _cef_domnode_t* self); - - /// - // Returns the document associated with this node. - /// - struct _cef_domdocument_t* (CEF_CALLBACK *get_document)( - struct _cef_domnode_t* self); - - /// - // Returns the parent node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_parent)( - struct _cef_domnode_t* self); - - /// - // Returns the previous sibling node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)( - struct _cef_domnode_t* self); - - /// - // Returns the next sibling node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)( - struct _cef_domnode_t* self); - - /// - // Returns true (1) if this node has child nodes. - /// - int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self); - - /// - // Return the first child node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)( - struct _cef_domnode_t* self); - - /// - // Returns the last child node. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)( - struct _cef_domnode_t* self); - - /// - // Add an event listener to this node for the specified event type. If - // |useCapture| is true (1) then this listener will be considered a capturing - // listener. Capturing listeners will recieve all events of the specified type - // before the events are dispatched to any other event targets beneath the - // current node in the tree. Events which are bubbling upwards through the - // tree will not trigger a capturing listener. Separate calls to this function - // can be used to register the same listener with and without capture. See - // WebCore/dom/EventNames.h for the list of supported event types. - /// - void (CEF_CALLBACK *add_event_listener)(struct _cef_domnode_t* self, - const cef_string_t* eventType, struct _cef_domevent_listener_t* listener, - int useCapture); - - - // The following functions are valid only for element nodes. - - /// - // Returns the tag name of this element. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)( - struct _cef_domnode_t* self); - - /// - // Returns true (1) if this element has attributes. - /// - int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self); - - /// - // Returns true (1) if this element has an attribute named |attrName|. - /// - int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self, - const cef_string_t* attrName); - - /// - // Returns the element attribute named |attrName|. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)( - struct _cef_domnode_t* self, const cef_string_t* attrName); - - /// - // Returns a map of all element attributes. - /// - void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self, - cef_string_map_t attrMap); - - /// - // Set the value for the element attribute named |attrName|. Returns true (1) - // on success. - /// - int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self, - const cef_string_t* attrName, const cef_string_t* value); - - /// - // Returns the inner text of the element. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)( - struct _cef_domnode_t* self); - -} cef_domnode_t; - - -/// -// Structure used to represent a DOM event. The functions of this structure -// should only be called on the UI thread. -/// -typedef struct _cef_domevent_t -{ - // Base structure. - cef_base_t base; - - /// - // Returns the event type. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_type)(struct _cef_domevent_t* self); - - /// - // Returns the event category. - /// - enum cef_dom_event_category_t (CEF_CALLBACK *get_category)( - struct _cef_domevent_t* self); - - /// - // Returns the event processing phase. - /// - enum cef_dom_event_phase_t (CEF_CALLBACK *get_phase)( - struct _cef_domevent_t* self); - - /// - // Returns true (1) if the event can bubble up the tree. - /// - int (CEF_CALLBACK *can_bubble)(struct _cef_domevent_t* self); - - /// - // Returns true (1) if the event can be canceled. - /// - int (CEF_CALLBACK *can_cancel)(struct _cef_domevent_t* self); - - /// - // Returns the document associated with this event. - /// - struct _cef_domdocument_t* (CEF_CALLBACK *get_document)( - struct _cef_domevent_t* self); - - /// - // Returns the target of the event. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_target)( - struct _cef_domevent_t* self); - - /// - // Returns the current target of the event. - /// - struct _cef_domnode_t* (CEF_CALLBACK *get_current_target)( - struct _cef_domevent_t* self); - -} cef_domevent_t; - - -/// -// Structure to implement for handling DOM events. The functions of this -// structure will be called on the UI thread. -/// -typedef struct _cef_domevent_listener_t -{ - // Base structure. - cef_base_t base; - - /// - // Called when an event is received. The event object passed to this function - // contains a snapshot of the DOM at the time this function is executed. DOM - // objects are only valid for the scope of this function. Do not keep - // references to or attempt to access any DOM objects outside the scope of - // this function. - /// - void (CEF_CALLBACK *handle_event)(struct _cef_domevent_listener_t* self, - struct _cef_domevent_t* event); - -} cef_domevent_listener_t; - - -/// -// Structure to implement for filtering response content. The functions of this -// structure will always be called on the UI thread. -/// -typedef struct _cef_content_filter_t -{ - // Base structure. - cef_base_t base; - - /// - // Set |substitute_data| to the replacement for the data in |data| if data - // should be modified. - /// - void (CEF_CALLBACK *process_data)(struct _cef_content_filter_t* self, - const void* data, int data_size, - struct _cef_stream_reader_t** substitute_data); - - /// - // Called when there is no more data to be processed. It is expected that - // whatever data was retained in the last process_data() call, it should be - // returned now by setting |remainder| if appropriate. - /// - void (CEF_CALLBACK *drain)(struct _cef_content_filter_t* self, - struct _cef_stream_reader_t** remainder); - -} cef_content_filter_t; - - -/// -// Structure used to represent drag data. The functions of this structure may be -// called on any thread. -/// -typedef struct _cef_drag_data_t -{ - // Base structure. - cef_base_t base; - - /// - // Returns true (1) if the drag data is a link. - /// - int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self); - - /// - // Returns true (1) if the drag data is a text or html fragment. - /// - int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self); - - /// - // Returns true (1) if the drag data is a file. - /// - int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self); - - /// - // Return the link URL that is being dragged. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_link_url)( - struct _cef_drag_data_t* self); - - /// - // Return the title associated with the link being dragged. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_link_title)( - struct _cef_drag_data_t* self); - - /// - // Return the metadata, if any, associated with the link being dragged. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)( - struct _cef_drag_data_t* self); - - /// - // Return the plain text fragment that is being dragged. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)( - struct _cef_drag_data_t* self); - - /// - // Return the text/html fragment that is being dragged. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)( - struct _cef_drag_data_t* self); - - /// - // Return the base URL that the fragment came from. This value is used for - // resolving relative URLs and may be NULL. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)( - struct _cef_drag_data_t* self); - - /// - // Return the extension of the file being dragged out of the browser window. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_file_extension)( - struct _cef_drag_data_t* self); - - /// - // Return the name of the file being dragged out of the browser window. - /// - // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_file_name)( - struct _cef_drag_data_t* self); - - /// - // Retrieve the list of file names that are being dragged into the browser - // window. - /// - int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self, - cef_string_list_t names); - -} cef_drag_data_t; - - -/// -// 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; - - /// - // 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); - - /// - // 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(); - - -#ifdef __cplusplus -} -#endif - -#endif // _CEF_CAPI_H diff --git a/include/cef_client.h b/include/cef_client.h new file mode 100644 index 000000000..230d46953 --- /dev/null +++ b/include/cef_client.h @@ -0,0 +1,141 @@ +// 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_CLIENT_H +#define _CEF_CLIENT_H + +#include "cef_base.h" +#include "cef_display_handler.h" +#include "cef_drag_handler.h" +#include "cef_find_handler.h" +#include "cef_focus_handler.h" +#include "cef_jsdialog_handler.h" +#include "cef_keyboard_handler.h" +#include "cef_life_span_handler.h" +#include "cef_load_handler.h" +#include "cef_menu_handler.h" +#include "cef_print_handler.h" +#include "cef_render_handler.h" +#include "cef_request_handler.h" +#include "cef_v8context_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 GetLifeSpanHandler() { return NULL; } + + /// + // Return the handler for browser load status events. + /// + /*--cef()--*/ + virtual CefRefPtr GetLoadHandler() { return NULL; } + + /// + // Return the handler for browser request events. + /// + /*--cef()--*/ + virtual CefRefPtr GetRequestHandler() { return NULL; } + + /// + // Return the handler for browser display state events. + /// + /*--cef()--*/ + virtual CefRefPtr GetDisplayHandler() { return NULL; } + + /// + // Return the handler for focus events. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusHandler() { return NULL; } + + /// + // Return the handler for keyboard events. + /// + /*--cef()--*/ + virtual CefRefPtr GetKeyboardHandler() { return NULL; } + + /// + // Return the handler for context menu events. + /// + /*--cef()--*/ + virtual CefRefPtr GetMenuHandler() { return NULL; } + + /// + // Return the handler for printing events. + /// + /*--cef()--*/ + virtual CefRefPtr GetPrintHandler() { return NULL; } + + /// + // Return the handler for find result events. + /// + /*--cef()--*/ + virtual CefRefPtr GetFindHandler() { return NULL; } + + /// + // Return the handler for JavaScript dialog events. + /// + /*--cef()--*/ + virtual CefRefPtr GetJSDialogHandler() { return NULL; } + + /// + // Return the handler for V8 context events. + /// + /*--cef()--*/ + virtual CefRefPtr GetV8ContextHandler() { return NULL; } + + /// + // Return the handler for off-screen rendering events. + /// + /*--cef()--*/ + virtual CefRefPtr GetRenderHandler() { return NULL; } + + /// + // Return the handler for drag events. + /// + /*--cef()--*/ + virtual CefRefPtr GetDragHandler() { return NULL; } +}; + +#endif // _CEF_CLIENT_H diff --git a/include/cef_command_line.h b/include/cef_command_line.h new file mode 100644 index 000000000..4d8335a57 --- /dev/null +++ b/include/cef_command_line.h @@ -0,0 +1,160 @@ +// 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_COMMAND_LINE_H +#define _CEF_COMMAND_LINE_H + +#include "cef_base.h" +#include +#include + +/// +// 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 ArgumentList; + typedef std::map SwitchMap; + + /// + // Create a new CefCommandLine instance. + /// + /*--cef(revision_check)--*/ + static CefRefPtr CreateCommandLine(); + + /// + // 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; + + /// + // 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_COMMAND_LINE_H diff --git a/include/cef_content_filter.h b/include/cef_content_filter.h new file mode 100644 index 000000000..fd3619879 --- /dev/null +++ b/include/cef_content_filter.h @@ -0,0 +1,69 @@ +// 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_CONTENT_FILTER_H +#define _CEF_CONTENT_FILTER_H + +#include "cef_base.h" + +class CefStreamReader; + +/// +// Interface to implement for filtering response content. The methods of this +// class will always be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefContentFilter : public virtual CefBase +{ +public: + /// + // Set |substitute_data| to the replacement for the data in |data| if data + // should be modified. + /// + /*--cef()--*/ + virtual void ProcessData(const void* data, int data_size, + CefRefPtr& substitute_data) {} + + /// + // Called when there is no more data to be processed. It is expected that + // whatever data was retained in the last ProcessData() call, it should be + // returned now by setting |remainder| if appropriate. + /// + /*--cef()--*/ + virtual void Drain(CefRefPtr& remainder) {} +}; + +#endif // _CEF_CONTENT_FILTER_H diff --git a/include/cef_cookie.h b/include/cef_cookie.h new file mode 100644 index 000000000..4a344e58d --- /dev/null +++ b/include/cef_cookie.h @@ -0,0 +1,113 @@ +// 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_COOKIE_H +#define _CEF_COOKIE_H + +#include "cef_base.h" + +class CefCookieVisitor; + +/// +// Visit all cookies. The returned cookies are ordered by longest path, then by +// earliest creation date. Returns false if cookies cannot be accessed. +/// +/*--cef()--*/ +bool CefVisitAllCookies(CefRefPtr visitor); + +/// +// 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()--*/ +bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, + CefRefPtr 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 without setting the cookie if such +// characters are found. This method must be called on the IO thread. +/// +/*--cef()--*/ +bool CefSetCookie(const CefString& url, const CefCookie& cookie); + +/// +// Delete all cookies that match the specified parameters. If both |url| and +// |cookie_name| are specified all host and domain cookies matching both values +// 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)--*/ +bool CefDeleteCookies(const CefString& url, const CefString& cookie_name); + +/// +// Sets the directory path that will be used for storing cookie data. If |path| +// is empty data will be stored in memory only. By default the cookie path is +// the same as the cache path. Returns false if cookies cannot be accessed. +/// +/*--cef(optional_param=path)--*/ +bool CefSetCookiePath(const CefString& path); + + +/// +// 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_COOKIE_H diff --git a/include/cef_display_handler.h b/include/cef_display_handler.h new file mode 100644 index 000000000..c68694bd9 --- /dev/null +++ b/include/cef_display_handler.h @@ -0,0 +1,118 @@ +// 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_DISPLAY_HANDLER_H +#define _CEF_DISPLAY_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; +class CefFrame; + +/// +// 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 navigation state has changed. + /// + /*--cef()--*/ + virtual void OnNavStateChange(CefRefPtr browser, + bool canGoBack, + bool canGoForward) {} + + /// + // Called when a frame's address has changed. + /// + /*--cef()--*/ + virtual void OnAddressChange(CefRefPtr browser, + CefRefPtr frame, + const CefString& url) {} + + /// + // Called when the size of the content area has changed. + /// + /*--cef()--*/ + virtual void OnContentsSizeChange(CefRefPtr browser, + CefRefPtr frame, + int width, + int height) {} + + /// + // Called when the page title changes. + /// + /*--cef(optional_param=title)--*/ + virtual void OnTitleChange(CefRefPtr 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 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 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 browser, + const CefString& message, + const CefString& source, + int line) { return false; } +}; + +#endif // _CEF_DISPLAY_HANDLER_H diff --git a/include/cef_dom.h b/include/cef_dom.h new file mode 100644 index 000000000..d40f41675 --- /dev/null +++ b/include/cef_dom.h @@ -0,0 +1,433 @@ +// 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_DOM_H +#define _CEF_DOM_H + +#include "cef_base.h" +#include + +class CefDOMDocument; +class CefDOMEventListener; +class CefDOMNode; + +/// +// Interface to implement for visiting the DOM. The methods of this class will +// be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDOMVisitor : public virtual CefBase +{ +public: + /// + // Method executed for visiting the DOM. The document object passed to this + // method represents a snapshot of the DOM at the time this method is + // executed. DOM objects are only valid for the scope of this method. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this method. + /// + /*--cef()--*/ + virtual void Visit(CefRefPtr document) =0; +}; + + +/// +// Class used to represent a DOM document. The methods of this class should only +// be called on the UI thread. +/// +/*--cef(source=library)--*/ +class CefDOMDocument : public virtual CefBase +{ +public: + typedef cef_dom_document_type_t Type; + + /// + // Returns the document type. + /// + /*--cef(default_retval=DOM_DOCUMENT_TYPE_UNKNOWN)--*/ + virtual Type GetType() =0; + + /// + // Returns the root document node. + /// + /*--cef()--*/ + virtual CefRefPtr GetDocument() =0; + + /// + // Returns the BODY node of an HTML document. + /// + /*--cef()--*/ + virtual CefRefPtr GetBody() =0; + + /// + // Returns the HEAD node of an HTML document. + /// + /*--cef()--*/ + virtual CefRefPtr GetHead() =0; + + /// + // Returns the title of an HTML document. + /// + /*--cef()--*/ + virtual CefString GetTitle() =0; + + /// + // Returns the document element with the specified ID value. + /// + /*--cef()--*/ + virtual CefRefPtr GetElementById(const CefString& id) =0; + + /// + // Returns the node that currently has keyboard focus. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusedNode() =0; + + /// + // Returns true if a portion of the document is selected. + /// + /*--cef()--*/ + virtual bool HasSelection() =0; + + /// + // Returns the selection start node. + /// + /*--cef()--*/ + virtual CefRefPtr GetSelectionStartNode() =0; + + /// + // Returns the selection offset within the start node. + /// + /*--cef()--*/ + virtual int GetSelectionStartOffset() =0; + + /// + // Returns the selection end node. + /// + /*--cef()--*/ + virtual CefRefPtr GetSelectionEndNode() =0; + + /// + // Returns the selection offset within the end node. + /// + /*--cef()--*/ + virtual int GetSelectionEndOffset() =0; + + /// + // Returns the contents of this selection as markup. + /// + /*--cef()--*/ + virtual CefString GetSelectionAsMarkup() =0; + + /// + // Returns the contents of this selection as text. + /// + /*--cef()--*/ + virtual CefString GetSelectionAsText() =0; + + /// + // Returns the base URL for the document. + /// + /*--cef()--*/ + virtual CefString GetBaseURL() =0; + + /// + // Returns a complete URL based on the document base URL and the specified + // partial URL. + /// + /*--cef()--*/ + virtual CefString GetCompleteURL(const CefString& partialURL) =0; +}; + + +/// +// Class used to represent a DOM node. The methods of this class should only be +// called on the UI thread. +/// +/*--cef(source=library)--*/ +class CefDOMNode : public virtual CefBase +{ +public: + typedef std::map AttributeMap; + typedef cef_dom_node_type_t Type; + + /// + // Returns the type for this node. + /// + /*--cef(default_retval=DOM_NODE_TYPE_UNSUPPORTED)--*/ + virtual Type GetType() =0; + + /// + // Returns true if this is a text node. + /// + /*--cef()--*/ + virtual bool IsText() =0; + + /// + // Returns true if this is an element node. + /// + /*--cef()--*/ + virtual bool IsElement() =0; + + /// + // Returns true if this is a form control element node. + /// + /*--cef()--*/ + virtual bool IsFormControlElement() =0; + + /// + // Returns the type of this form control element node. + /// + /*--cef()--*/ + virtual CefString GetFormControlElementType() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns the name of this node. + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the value of this node. + /// + /*--cef()--*/ + virtual CefString GetValue() =0; + + /// + // Set the value of this node. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetValue(const CefString& value) =0; + + /// + // Returns the contents of this node as markup. + /// + /*--cef()--*/ + virtual CefString GetAsMarkup() =0; + + /// + // Returns the document associated with this node. + /// + /*--cef()--*/ + virtual CefRefPtr GetDocument() =0; + + /// + // Returns the parent node. + /// + /*--cef()--*/ + virtual CefRefPtr GetParent() =0; + + /// + // Returns the previous sibling node. + /// + /*--cef()--*/ + virtual CefRefPtr GetPreviousSibling() =0; + + /// + // Returns the next sibling node. + /// + /*--cef()--*/ + virtual CefRefPtr GetNextSibling() =0; + + /// + // Returns true if this node has child nodes. + /// + /*--cef()--*/ + virtual bool HasChildren() =0; + + /// + // Return the first child node. + /// + /*--cef()--*/ + virtual CefRefPtr GetFirstChild() =0; + + /// + // Returns the last child node. + /// + /*--cef()--*/ + virtual CefRefPtr GetLastChild() =0; + + /// + // Add an event listener to this node for the specified event type. If + // |useCapture| is true then this listener will be considered a capturing + // listener. Capturing listeners will recieve all events of the specified + // type before the events are dispatched to any other event targets beneath + // the current node in the tree. Events which are bubbling upwards through + // the tree will not trigger a capturing listener. Separate calls to this + // method can be used to register the same listener with and without capture. + // See WebCore/dom/EventNames.h for the list of supported event types. + /// + /*--cef()--*/ + virtual void AddEventListener(const CefString& eventType, + CefRefPtr listener, + bool useCapture) =0; + + + // The following methods are valid only for element nodes. + + /// + // Returns the tag name of this element. + /// + /*--cef()--*/ + virtual CefString GetElementTagName() =0; + + /// + // Returns true if this element has attributes. + /// + /*--cef()--*/ + virtual bool HasElementAttributes() =0; + + /// + // Returns true if this element has an attribute named |attrName|. + /// + /*--cef()--*/ + virtual bool HasElementAttribute(const CefString& attrName) =0; + + /// + // Returns the element attribute named |attrName|. + /// + /*--cef()--*/ + virtual CefString GetElementAttribute(const CefString& attrName) =0; + + /// + // Returns a map of all element attributes. + /// + /*--cef()--*/ + virtual void GetElementAttributes(AttributeMap& attrMap) =0; + + /// + // Set the value for the element attribute named |attrName|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetElementAttribute(const CefString& attrName, + const CefString& value) =0; + + /// + // Returns the inner text of the element. + /// + /*--cef()--*/ + virtual CefString GetElementInnerText() =0; +}; + + +/// +// Class used to represent a DOM event. The methods of this class should only +// be called on the UI thread. +/// +/*--cef(source=library)--*/ +class CefDOMEvent : public virtual CefBase +{ +public: + typedef cef_dom_event_category_t Category; + typedef cef_dom_event_phase_t Phase; + + /// + // Returns the event type. + /// + /*--cef()--*/ + virtual CefString GetType() =0; + + /// + // Returns the event category. + /// + /*--cef(default_retval=DOM_EVENT_CATEGORY_UNKNOWN)--*/ + virtual Category GetCategory() =0; + + /// + // Returns the event processing phase. + /// + /*--cef(default_retval=DOM_EVENT_PHASE_UNKNOWN)--*/ + virtual Phase GetPhase() =0; + + /// + // Returns true if the event can bubble up the tree. + /// + /*--cef()--*/ + virtual bool CanBubble() =0; + + /// + // Returns true if the event can be canceled. + /// + /*--cef()--*/ + virtual bool CanCancel() =0; + + /// + // Returns the document associated with this event. + /// + /*--cef()--*/ + virtual CefRefPtr GetDocument() =0; + + /// + // Returns the target of the event. + /// + /*--cef()--*/ + virtual CefRefPtr GetTarget() =0; + + /// + // Returns the current target of the event. + /// + /*--cef()--*/ + virtual CefRefPtr GetCurrentTarget() =0; +}; + + +/// +// Interface to implement for handling DOM events. The methods of this class +// will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDOMEventListener : public virtual CefBase +{ +public: + /// + // Called when an event is received. The event object passed to this method + // contains a snapshot of the DOM at the time this method is executed. DOM + // objects are only valid for the scope of this method. Do not keep references + // to or attempt to access any DOM objects outside the scope of this method. + /// + /*--cef()--*/ + virtual void HandleEvent(CefRefPtr event) =0; +}; + +#endif // _CEF_DOM_H diff --git a/include/cef_download_handler.h b/include/cef_download_handler.h new file mode 100644 index 000000000..3fb704052 --- /dev/null +++ b/include/cef_download_handler.h @@ -0,0 +1,65 @@ +// 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_DOWNLOAD_HANDLER_H +#define _CEF_DOWNLOAD_HANDLER_H + +#include "cef_base.h" + +/// +// Class used to handle file downloads. The methods of this class will always be +// called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDownloadHandler : public virtual CefBase +{ +public: + /// + // A portion of the file contents have been received. This method will be + // called multiple times until the download is complete. Return |true| to + // continue receiving data and |false| to cancel. + /// + /*--cef()--*/ + virtual bool ReceivedData(void* data, int data_size) =0; + + /// + // The download is complete. + /// + /*--cef()--*/ + virtual void Complete() =0; +}; + +#endif // _CEF_DOWNLOAD_HANDLER_H diff --git a/include/cef_drag_data.h b/include/cef_drag_data.h new file mode 100644 index 000000000..8e63bc1f6 --- /dev/null +++ b/include/cef_drag_data.h @@ -0,0 +1,126 @@ +// 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_DRAG_DATA_H +#define _CEF_DRAG_DATA_H + +#include "cef_base.h" +#include + +/// +// Class used to represent drag data. The methods of this class may be called +// on any thread. +/// +/*--cef(source=library)--*/ +class CefDragData : public virtual CefBase +{ +public: + /// + // Returns true if the drag data is a link. + /// + /*--cef()--*/ + virtual bool IsLink() =0; + + /// + // Returns true if the drag data is a text or html fragment. + /// + /*--cef()--*/ + virtual bool IsFragment() =0; + + /// + // Returns true if the drag data is a file. + /// + /*--cef()--*/ + virtual bool IsFile() =0; + + /// + // Return the link URL that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkURL() =0; + + /// + // Return the title associated with the link being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkTitle() =0; + + /// + // Return the metadata, if any, associated with the link being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkMetadata() =0; + + /// + // Return the plain text fragment that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetFragmentText() =0; + + /// + // Return the text/html fragment that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetFragmentHtml() =0; + + /// + // Return the base URL that the fragment came from. This value is used for + // resolving relative URLs and may be empty. + /// + /*--cef()--*/ + virtual CefString GetFragmentBaseURL() =0; + + /// + // Return the extension of the file being dragged out of the browser window. + /// + /*--cef()--*/ + virtual CefString GetFileExtension() =0; + + /// + // Return the name of the file being dragged out of the browser window. + /// + /*--cef()--*/ + virtual CefString GetFileName() =0; + + /// + // Retrieve the list of file names that are being dragged into the browser + // window. + /// + /*--cef()--*/ + virtual bool GetFileNames(std::vector& names) =0; +}; + +#endif // _CEF_DRAG_DATA_H diff --git a/include/cef_drag_handler.h b/include/cef_drag_handler.h new file mode 100644 index 000000000..0e0f5a88a --- /dev/null +++ b/include/cef_drag_handler.h @@ -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. +// +// --------------------------------------------------------------------------- +// +// 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_DRAG_HANDLER_H +#define _CEF_DRAG_HANDLER_H + +#include "cef_base.h" +#include "cef_drag_data.h" + +class CefBrowser; + +/// +// Implement this interface to handle events related to dragging. The methods of +// this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDragHandler : public virtual CefBase +{ +public: + typedef cef_drag_operations_mask_t DragOperationsMask; + + /// + // Called when the browser window initiates a drag event. |dragData| + // contains the drag event data and |mask| represents the type of drag + // operation. Return false for default drag handling behavior or true to + // cancel the drag event. + /// + /*--cef()--*/ + virtual bool OnDragStart(CefRefPtr browser, + CefRefPtr dragData, + DragOperationsMask mask) { return false; } + + /// + // Called when an external drag event enters the browser window. |dragData| + // contains the drag event data and |mask| represents the type of drag + // operation. Return false for default drag handling behavior or true to + // cancel the drag event. + /// + /*--cef()--*/ + virtual bool OnDragEnter(CefRefPtr browser, + CefRefPtr dragData, + DragOperationsMask mask) { return false; } +}; + +#endif // _CEF_DRAG_HANDLER_H diff --git a/include/cef_find_handler.h b/include/cef_find_handler.h new file mode 100644 index 000000000..1310e55bd --- /dev/null +++ b/include/cef_find_handler.h @@ -0,0 +1,69 @@ +// 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_FIND_HANDLER_H +#define _CEF_FIND_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; + +/// +// Implement this interface to handle events related to find results. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefFindHandler : public virtual CefBase +{ +public: + /// + // Called to report find results returned by CefBrowser::Find(). |identifer| + // is the identifier passed to CefBrowser::Find(), |count| is the number of + // matches currently identified, |selectionRect| is the location of where the + // match was found (in window coordinates), |activeMatchOrdinal| is the + // current position in the search results, and |finalUpdate| is true if this + // is the last find notification. + /// + /*--cef()--*/ + virtual void OnFindResult(CefRefPtr browser, + int identifier, + int count, + const CefRect& selectionRect, + int activeMatchOrdinal, + bool finalUpdate) {} +}; + +#endif // _CEF_FIND_HANDLER_H diff --git a/include/cef_focus_handler.h b/include/cef_focus_handler.h new file mode 100644 index 000000000..4a882e7b2 --- /dev/null +++ b/include/cef_focus_handler.h @@ -0,0 +1,89 @@ +// 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_FOCUS_HANDLER_H +#define _CEF_FOCUS_HANDLER_H + +#include "cef_base.h" +#include "cef_dom.h" + +class CefBrowser; +class CefFrame; + +/// +// Implement this interface to handle events related to focus. The methods of +// this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefFocusHandler : public virtual CefBase +{ +public: + typedef cef_handler_focus_source_t FocusSource; + + /// + // Called when the browser component is about to loose focus. For instance, if + // focus was on the last HTML element and the user pressed the TAB key. |next| + // will be true if the browser is giving focus to the next component and false + // if the browser is giving focus to the previous component. + /// + /*--cef()--*/ + virtual void OnTakeFocus(CefRefPtr browser, + bool next) {} + + /// + // Called when the browser component is requesting focus. |source| indicates + // where the focus request is originating from. Return false to allow the + // focus to be set or true to cancel setting the focus. + /// + /*--cef()--*/ + virtual bool OnSetFocus(CefRefPtr browser, + FocusSource source) { return false; } + + /// + // Called when a new node in the the browser gets focus. The |node| value may + // be empty if no specific node has gained focus. The node object passed to + // this method represents a snapshot of the DOM at the time this method is + // executed. DOM objects are only valid for the scope of this method. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this method. + /// + /*--cef(optional_param=frame,optional_param=node)--*/ + virtual void OnFocusedNodeChanged(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr node) {} +}; + +#endif // _CEF_FOCUS_HANDLER_H diff --git a/include/cef_frame.h b/include/cef_frame.h new file mode 100644 index 000000000..ce29cc071 --- /dev/null +++ b/include/cef_frame.h @@ -0,0 +1,222 @@ +// 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_FRAME_H +#define _CEF_FRAME_H + +#include "cef_base.h" + +class CefBrowser; +class CefDOMVisitor; +class CefRequest; +class CefStreamReader; +class CefV8Context; + +/// +// Class used to represent a frame in the browser window. The methods of this +// class may be called on any thread unless otherwise indicated in the comments. +/// +/*--cef(source=library)--*/ +class CefFrame : public virtual CefBase +{ +public: + /// + // 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; + + /// + // Execute printing in the this frame. The user will be prompted with the + // print dialog appropriate to the operating system. + /// + /*--cef()--*/ + virtual void Print() =0; + + /// + // Save this frame's HTML source to a temporary file and open it in the + // default text viewing application. + /// + /*--cef()--*/ + virtual void ViewSource() =0; + + /// + // Returns this frame's HTML source as a string. This method should only be + // called on the UI thread. + /// + /*--cef()--*/ + virtual CefString GetSource() =0; + + /// + // Returns this frame's display text as a string. This method should only be + // called on the UI thread. + /// + /*--cef()--*/ + virtual CefString GetText() =0; + + /// + // Load the request represented by the |request| object. + /// + /*--cef()--*/ + virtual void LoadRequest(CefRefPtr request) =0; + + /// + // Load the specified |url|. + /// + /*--cef()--*/ + virtual void LoadURL(const CefString& url) =0; + + /// + // Load the contents of |string| with the optional dummy target |url|. + /// + /*--cef()--*/ + virtual void LoadString(const CefString& string, + const CefString& url) =0; + + /// + // Load the contents of |stream| with the optional dummy target |url|. + /// + /*--cef()--*/ + virtual void LoadStream(CefRefPtr stream, + 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. This method should only be + // called on the UI thread. + /// + /*--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. This method should + // only be called on the UI thread. + /// + /*--cef()--*/ + virtual long long GetIdentifier() =0; + + /// + // Returns the parent of this frame or NULL if this is the main (top-level) + // frame. This method should only be called on the UI thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetParent() =0; + + /// + // Returns the URL currently loaded in this frame. This method should only be + // called on the UI thread. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Returns the browser that this frame belongs to. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Visit the DOM document. + /// + /*--cef()--*/ + virtual void VisitDOM(CefRefPtr visitor) =0; + + /// + // Get the V8 context associated with the frame. This method should only be + // called on the UI thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetV8Context() =0; +}; + +#endif // _CEF_FRAME_H diff --git a/include/cef_jsdialog_handler.h b/include/cef_jsdialog_handler.h new file mode 100644 index 000000000..f252538c1 --- /dev/null +++ b/include/cef_jsdialog_handler.h @@ -0,0 +1,88 @@ +// 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_JSDIALOG_HANDLER_H +#define _CEF_JSDIALOG_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; +class CefFrame; + +/// +// Implement this interface to handle events related to JavaScript dialogs. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefJSDialogHandler : public virtual CefBase +{ +public: + /// + // Called to run a JavaScript alert message. Return false to display the + // default alert or true if you displayed a custom alert. + /// + /*--cef()--*/ + virtual bool OnJSAlert(CefRefPtr browser, + CefRefPtr frame, + const CefString& message) { return false; } + + /// + // Called to run a JavaScript confirm request. Return false to display the + // default alert or true if you displayed a custom alert. If you handled the + // alert set |retval| to true if the user accepted the confirmation. + /// + /*--cef()--*/ + virtual bool OnJSConfirm(CefRefPtr browser, + CefRefPtr frame, + const CefString& message, + bool& retval) { return false; } + + /// + // Called to run a JavaScript prompt request. Return false to display the + // default prompt or true if you displayed a custom prompt. If you handled + // the prompt set |retval| to true if the user accepted the prompt and request + // and |result| to the resulting value. + /// + /*--cef()--*/ + virtual bool OnJSPrompt(CefRefPtr browser, + CefRefPtr frame, + const CefString& message, + const CefString& defaultValue, + bool& retval, + CefString& result) { return false; } +}; + +#endif // _CEF_JSDIALOG_HANDLER_H diff --git a/include/cef_keyboard_handler.h b/include/cef_keyboard_handler.h new file mode 100644 index 000000000..6daca769d --- /dev/null +++ b/include/cef_keyboard_handler.h @@ -0,0 +1,77 @@ +// 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_KEYBOARD_HANDLER_H +#define _CEF_KEYBOARD_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; + +/// +// Implement this interface to handle events related to keyboard input. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefKeyboardHandler : public virtual CefBase +{ +public: + typedef cef_handler_keyevent_type_t KeyEventType; + + /// + // Called when the browser component receives a keyboard event. This method + // is called both before the event is passed to the renderer and after + // JavaScript in the page has had a chance to handle the event. |type| is the + // type of keyboard event, |code| is the windows scan-code for the event, + // |modifiers| is a set of bit- flags describing any pressed modifier keys and + // |isSystemKey| is true if Windows considers this a 'system key' message (see + // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx). If + // |isAfterJavaScript| is true then JavaScript in the page has had a chance + // to handle the event and has chosen not to. Only RAWKEYDOWN, KEYDOWN and + // CHAR events will be sent with |isAfterJavaScript| set to true. Return + // true if the keyboard event was handled or false to allow continued handling + // of the event by the renderer. + /// + /*--cef()--*/ + virtual bool OnKeyEvent(CefRefPtr browser, + KeyEventType type, + int code, + int modifiers, + bool isSystemKey, + bool isAfterJavaScript) { return false; } +}; + +#endif // _CEF_KEYBOARD_HANDLER_H diff --git a/include/cef_life_span_handler.h b/include/cef_life_span_handler.h new file mode 100644 index 000000000..a4222a8b9 --- /dev/null +++ b/include/cef_life_span_handler.h @@ -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. +// +// --------------------------------------------------------------------------- +// +// 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_LIFE_SPAN_HANDLER_H +#define _CEF_LIFE_SPAN_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; +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 parentBrowser, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + const CefString& url, + CefRefPtr& client, + CefBrowserSettings& settings) { return false; } + + /// + // Called after a new window is created. + /// + /*--cef()--*/ + virtual void OnAfterCreated(CefRefPtr 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 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 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 browser) {} +}; + +#endif // _CEF_LIFE_SPAN_HANDLER_H diff --git a/include/cef_load_handler.h b/include/cef_load_handler.h new file mode 100644 index 000000000..73b8e9e29 --- /dev/null +++ b/include/cef_load_handler.h @@ -0,0 +1,95 @@ +// 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_LOAD_HANDLER_H +#define _CEF_LOAD_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; +class CefFrame; + +/// +// 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 browser, + CefRefPtr 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 browser, + CefRefPtr frame, + int httpStatusCode) {} + + /// + // Called when the browser fails to load a resource. |errorCode| is the error + // code number and |failedUrl| is the URL that failed to load. To provide + // custom error text assign the text to |errorText| and return true. + // Otherwise, return false for the default error text. See + // net\base\net_error_list.h for complete descriptions of the error codes. + /// + /*--cef()--*/ + virtual bool OnLoadError(CefRefPtr browser, + CefRefPtr frame, + ErrorCode errorCode, + const CefString& failedUrl, + CefString& errorText) { return false; } +}; + +#endif // _CEF_LOAD_HANDLER_H diff --git a/include/cef_menu_handler.h b/include/cef_menu_handler.h new file mode 100644 index 000000000..509cfad28 --- /dev/null +++ b/include/cef_menu_handler.h @@ -0,0 +1,81 @@ +// 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_MENU_HANDLER_H +#define _CEF_MENU_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; + +/// +// Implement this interface to handle events related to browser context menus. +// The methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefMenuHandler : public virtual CefBase +{ +public: + typedef cef_menu_id_t MenuId; + + /// + // Called before a context menu is displayed. Return false to display the + // default context menu or true to cancel the display. + /// + /*--cef()--*/ + virtual bool OnBeforeMenu(CefRefPtr browser, + const CefMenuInfo& menuInfo) { return false; } + + /// + // Called to optionally override the default text for a context menu item. + // |label| contains the default text and may be modified to substitute + // alternate text. + /// + /*--cef()--*/ + virtual void GetMenuLabel(CefRefPtr browser, + MenuId menuId, + CefString& label) {} + + /// + // Called when an option is selected from the default context menu. Return + // false to execute the default action or true to cancel the action. + /// + /*--cef()--*/ + virtual bool OnMenuAction(CefRefPtr browser, + MenuId menuId) { return false; } +}; + +#endif // _CEF_MENU_HANDLER_H diff --git a/include/cef_origin_whitelist.h b/include/cef_origin_whitelist.h new file mode 100644 index 000000000..e71550182 --- /dev/null +++ b/include/cef_origin_whitelist.h @@ -0,0 +1,98 @@ +// 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_ORIGIN_WHITELIST_H +#define _CEF_ORIGIN_WHITELIST_H + +#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_ORIGIN_WHITELIST_H diff --git a/include/cef_print_handler.h b/include/cef_print_handler.h new file mode 100644 index 000000000..a4e91fb60 --- /dev/null +++ b/include/cef_print_handler.h @@ -0,0 +1,92 @@ +// 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_PRINT_HANDLER_H +#define _CEF_PRINT_HANDLER_H + +#include "cef_base.h" + +class CefBrowser; +class CefFrame; + +/// +// Implement this interface to handle events related to printing. The methods of +// this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefPrintHandler : public virtual CefBase +{ +public: + /// + // Called to allow customization of standard print options before the print + // dialog is displayed. |printOptions| allows specification of paper size, + // orientation and margins. Note that the specified margins may be adjusted if + // they are outside the range supported by the printer. All units are in + // inches. Return false to display the default print options or true to + // display the modified |printOptions|. + /// + /*--cef()--*/ + virtual bool GetPrintOptions(CefRefPtr browser, + CefPrintOptions& printOptions) { return false; } + + /// + // Called to format print headers and footers. |printInfo| contains platform- + // specific information about the printer context. |url| is the URL if the + // currently printing page, |title| is the title of the currently printing + // page, |currentPage| is the current page number and |maxPages| is the total + // number of pages. Six default header locations are provided by the + // implementation: top left, top center, top right, bottom left, bottom center + // and bottom right. To use one of these default locations just assign a + // string to the appropriate variable. To draw the header and footer yourself + // return true. Otherwise, populate the approprate variables and return false. + /// + /*--cef()--*/ + virtual bool GetPrintHeaderFooter(CefRefPtr browser, + CefRefPtr frame, + const CefPrintInfo& printInfo, + const CefString& url, + const CefString& title, + int currentPage, + int maxPages, + CefString& topLeft, + CefString& topCenter, + CefString& topRight, + CefString& bottomLeft, + CefString& bottomCenter, + CefString& bottomRight) { return false; } +}; + +#endif // _CEF_PRINT_HANDLER_H diff --git a/include/cef_proxy_handler.h b/include/cef_proxy_handler.h new file mode 100644 index 000000000..024ebd553 --- /dev/null +++ b/include/cef_proxy_handler.h @@ -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_PROXY_HANDLER_H +#define _CEF_PROXY_HANDLER_H + +#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_PROXY_HANDLER_H diff --git a/include/cef_render_handler.h b/include/cef_render_handler.h new file mode 100644 index 000000000..bfe92b0c4 --- /dev/null +++ b/include/cef_render_handler.h @@ -0,0 +1,120 @@ +// 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_RENDER_HANDLER_H +#define _CEF_RENDER_HANDLER_H + +#include "cef_base.h" +#include + +class CefBrowser; + +/// +// Implement this interface to handle events when window rendering is disabled. +// The methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefRenderHandler : public virtual CefBase +{ +public: + typedef cef_paint_element_type_t PaintElementType; + typedef std::vector RectList; + + /// + // Called to retrieve the view rectangle which is relative to screen + // coordinates. Return true if the rectangle was provided. + /// + /*--cef()--*/ + virtual bool GetViewRect(CefRefPtr browser, + CefRect& rect) { return false; } + + /// + // Called to retrieve the simulated screen rectangle. Return true if the + // rectangle was provided. + /// + /*--cef()--*/ + virtual bool GetScreenRect(CefRefPtr browser, + CefRect& rect) { return false; } + + /// + // Called to retrieve the translation from view coordinates to actual screen + // coordinates. Return true if the screen coordinates were provided. + /// + /*--cef()--*/ + virtual bool GetScreenPoint(CefRefPtr browser, + int viewX, + int viewY, + int& screenX, + int& screenY) { return false; } + + /// + // Called when the browser wants to show or hide the popup widget. The popup + // should be shown if |show| is true and hidden if |show| is false. + /// + /*--cef()--*/ + virtual void OnPopupShow(CefRefPtr browser, + bool show) {} + + /// + // Called when the browser wants to move or resize the popup widget. |rect| + // contains the new location and size. + /// + /*--cef()--*/ + virtual void OnPopupSize(CefRefPtr browser, + const CefRect& rect) {} + + /// + // Called when an element should be painted. |type| indicates whether the + // element is the view or the popup widget. |buffer| contains the pixel data + // for the whole image. |dirtyRects| contains the set of rectangles that need + // to be repainted. On Windows |buffer| will be width*height*4 bytes in size + // and represents a BGRA image with an upper-left origin. + /// + /*--cef()--*/ + virtual void OnPaint(CefRefPtr browser, + PaintElementType type, + const RectList& dirtyRects, + const void* buffer) {} + + /// + // Called when the browser window's cursor has changed. + /// + /*--cef()--*/ + virtual void OnCursorChange(CefRefPtr browser, + CefCursorHandle cursor) {} +}; + +#endif // _CEF_RENDER_HANDLER_H diff --git a/include/cef_request.h b/include/cef_request.h new file mode 100644 index 000000000..6b092a1ce --- /dev/null +++ b/include/cef_request.h @@ -0,0 +1,257 @@ +// 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_REQUEST_H +#define _CEF_REQUEST_H + +#include "cef_base.h" +#include +#include + +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 HeaderMap; + typedef cef_weburlrequest_flags_t RequestFlags; + + /// + // Create a new CefRequest object. + /// + /*--cef()--*/ + static CefRefPtr 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 GetPostData() =0; + /// + // Set the post data. + /// + /*--cef()--*/ + virtual void SetPostData(CefRefPtr 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 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 > ElementVector; + + /// + // Create a new CefPostData object. + /// + /*--cef()--*/ + static CefRefPtr 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 element) =0; + + /// + // Add the specified post data element. Returns true if the add succeeds. + /// + /*--cef()--*/ + virtual bool AddElement(CefRefPtr 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 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_REQUEST_H diff --git a/include/cef_request_handler.h b/include/cef_request_handler.h new file mode 100644 index 000000000..4f3d1ef14 --- /dev/null +++ b/include/cef_request_handler.h @@ -0,0 +1,160 @@ +// 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_REQUEST_HANDLER_H +#define _CEF_REQUEST_HANDLER_H + +#include "cef_base.h" +#include "cef_download_handler.h" +#include "cef_content_filter.h" +#include "cef_response.h" +#include "cef_request.h" +#include "cef_stream.h" + +class CefBrowser; +class CefFrame; + +/// +// 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: + typedef cef_handler_navtype_t NavType; + + /// + // Called on the UI thread before browser navigation. Return true to cancel + // the navigation or false to allow the navigation to proceed. + /// + /*--cef()--*/ + virtual bool OnBeforeBrowse(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + NavType navType, + bool isRedirect) { return false; } + + /// + // Called on the IO thread before a resource is loaded. To allow the resource + // to load normally return false. To redirect the resource to a new url + // populate the |redirectUrl| value and return false. To specify data for the + // resource return a CefStream object in |resourceStream|, use the |response| + // object to set mime type, HTTP status code and optional header values, and + // return false. To cancel loading of the resource return true. Any + // modifications to |request| will be observed. If the URL in |request| is + // changed and |redirectUrl| is also set, the URL in |request| will be used. + /// + /*--cef()--*/ + virtual bool OnBeforeResourceLoad(CefRefPtr browser, + CefRefPtr request, + CefString& redirectUrl, + CefRefPtr& resourceStream, + CefRefPtr response, + int loadFlags) { return false; } + + /// + // 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 browser, + const CefString& old_url, + CefString& new_url) {} + + /// + // Called on the UI thread after a response to the resource request is + // received. Set |filter| if response content needs to be monitored and/or + // modified as it arrives. + /// + /*--cef()--*/ + virtual void OnResourceResponse(CefRefPtr browser, + const CefString& url, + CefRefPtr response, + CefRefPtr& filter) {} + + /// + // Called on the IO thread to handle requests for URLs with an unknown + // protocol component. Return true to indicate that the request should + // succeed because it was handled externally. Set |allowOSExecution| to true + // and return false to attempt execution via the registered OS protocol + // handler, if any. If false is returned and either |allow_os_execution| + // is false or OS protocol handler execution fails then the request will fail + // with an error condition. + // SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED + // ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. + /// + /*--cef()--*/ + virtual bool OnProtocolExecution(CefRefPtr browser, + const CefString& url, + bool& allowOSExecution) { return false; } + + /// + // Called on the UI thread when a server indicates via the + // 'Content-Disposition' header that a response represents a file to download. + // |mimeType| is the mime type for the download, |fileName| is the suggested + // target file name and |contentLength| is either the value of the + // 'Content-Size' header or -1 if no size was provided. Set |handler| to the + // CefDownloadHandler instance that will recieve the file contents. Return + // true to download the file or false to cancel the file download. + /// + /*--cef()--*/ + virtual bool GetDownloadHandler(CefRefPtr browser, + const CefString& mimeType, + const CefString& fileName, + int64 contentLength, + CefRefPtr& handler) + { return false; } + + /// + // 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 number. Set |username| and |password| and return + // true to handle the request. Return false to cancel the request. + /// + /*--cef(optional_param=realm)--*/ + virtual bool GetAuthCredentials(CefRefPtr browser, + bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefString& username, + CefString& password) { return false; } +}; + +#endif // _CEF_REQUEST_HANDLER_H diff --git a/include/cef_response.h b/include/cef_response.h new file mode 100644 index 000000000..08862dd4d --- /dev/null +++ b/include/cef_response.h @@ -0,0 +1,104 @@ +// 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_RESPONSE_H +#define _CEF_RESPONSE_H + +#include "cef_base.h" +#include + +/// +// 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 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_RESPONSE_H diff --git a/include/cef_runnable.h b/include/cef_runnable.h index a311f2cc1..81d630d54 100644 --- a/include/cef_runnable.h +++ b/include/cef_runnable.h @@ -34,7 +34,8 @@ #define _CEF_RUNNABLE_H #pragma once -#include "cef.h" +#include "cef_base.h" +#include "cef_task.h" #ifdef BUILDING_CEF_SHARED #include "base/tuple.h" #else diff --git a/include/cef_scheme.h b/include/cef_scheme.h new file mode 100644 index 000000000..c4d3093c1 --- /dev/null +++ b/include/cef_scheme.h @@ -0,0 +1,223 @@ +// 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_SCHEME_H +#define _CEF_SCHEME_H + +#include "cef_base.h" + +class CefBrowser; +class CefRequest; +class CefResponse; +class CefSchemeHandler; +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: +//
+//  [scheme]://[username]:[password]@[host]:[port]/[url-path]
+// 
+// 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 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 CefSchemeHandler instances. 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 scheme 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. + /// + /*--cef()--*/ + virtual CefRefPtr Create(CefRefPtr browser, + const CefString& scheme_name, + CefRefPtr request) =0; +}; + +/// +// Class used to facilitate asynchronous responses to custom scheme handler +// requests. The methods of this class may be called on any thread. +/// +/*--cef(source=library)--*/ +class CefSchemeHandlerCallback : public virtual CefBase +{ +public: + /// + // Notify that header information is now available for retrieval. + /// + /*--cef()--*/ + virtual void HeadersAvailable() =0; + + /// + // Notify that response data is now available for reading. + /// + /*--cef()--*/ + virtual void BytesAvailable() =0; + + /// + // Cancel processing of the request. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +/// +// Class used to implement a custom scheme handler interface. The methods of +// this class will always be called on the IO thread. +/// +/*--cef(source=client)--*/ +class CefSchemeHandler : public virtual CefBase +{ +public: + /// + // Begin processing the request. To handle the request return true and call + // HeadersAvailable() once the response header information is available + // (HeadersAvailable() 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 request, + CefRefPtr 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 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 BytesAvailable() 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 callback) =0; + + /// + // Request processing has been canceled. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +#endif // _CEF_SCHEME_H diff --git a/include/cef_storage.h b/include/cef_storage.h new file mode 100644 index 000000000..928b6f9cd --- /dev/null +++ b/include/cef_storage.h @@ -0,0 +1,110 @@ +// 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_STORAGE_H +#define _CEF_STORAGE_H + +#include "cef_base.h" + +class CefStorageVisitor; + +typedef cef_storage_type_t CefStorageType; + +/// +// Visit storage of the specified type. If |origin| is non-empty only data +// matching that origin will be visited. If |key| is non-empty only data +// matching that key will be visited. Otherwise, all data for the storage +// type will be visited. Origin should be of the form scheme://domain. If no +// origin is specified only data currently in memory will be returned. Returns +// false if the storage cannot be accessed. +/// +/*--cef(optional_param=origin,optional_param=key)--*/ +bool CefVisitStorage(CefStorageType type, const CefString& origin, + const CefString& key, + CefRefPtr visitor); + +/// +// Sets storage of the specified type, origin, key and value. Returns false if +// storage cannot be accessed. This method must be called on the UI thread. +/// +/*--cef()--*/ +bool CefSetStorage(CefStorageType type, const CefString& origin, + const CefString& key, const CefString& value); + +/// +// Deletes all storage of the specified type. If |origin| is non-empty only data +// matching that origin will be cleared. If |key| is non-empty only data +// matching that key will be cleared. Otherwise, all data for the storage type +// will be cleared. Returns false if storage cannot be accessed. This method +// must be called on the UI thread. +/// +/*--cef(optional_param=origin,optional_param=key)--*/ +bool CefDeleteStorage(CefStorageType type, const CefString& origin, + const CefString& key); + +/// +// Sets the directory path that will be used for storing data of the specified +// type. Currently only the ST_LOCALSTORAGE type is supported by this method. +// If |path| is empty data will be stored in memory only. By default the storage +// path is the same as the cache path. Returns false if the storage cannot be +// accessed. +/// +/*--cef(optional_param=path)--*/ +bool CefSetStoragePath(CefStorageType type, const CefString& path); + + +/// +// Interface to implement for visiting storage. The methods of this class will +// always be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefStorageVisitor : public virtual CefBase +{ +public: + /// + // Method that will be called once for each key/value data pair in storage. + // |count| is the 0-based index for the current pair. |total| is the total + // number of pairs. Set |deleteData| to true to delete the pair currently + // being visited. Return false to stop visiting pairs. This method may never + // be called if no data is found. + /// + /*--cef()--*/ + virtual bool Visit(CefStorageType type, const CefString& origin, + const CefString& key, const CefString& value, int count, + int total, bool& deleteData) =0; +}; + +#endif // _CEF_STORAGE_H diff --git a/include/cef_stream.h b/include/cef_stream.h new file mode 100644 index 000000000..e6b18b7f4 --- /dev/null +++ b/include/cef_stream.h @@ -0,0 +1,211 @@ +// 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_STREAM_H +#define _CEF_STREAM_H + +#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. + /// + /*--cef()--*/ + virtual int Seek(long offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual long 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 CreateForFile(const CefString& fileName); + /// + // Create a new CefStreamReader object from data. + /// + /*--cef()--*/ + static CefRefPtr CreateForData(void* data, size_t size); + /// + // Create a new CefStreamReader object from a custom handler. + /// + /*--cef()--*/ + static CefRefPtr CreateForHandler( + CefRefPtr 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(long offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual long 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. + /// + /*--cef()--*/ + virtual int Seek(long offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual long 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 CreateForFile(const CefString& fileName); + /// + // Create a new CefStreamWriter object for a custom handler. + /// + /*--cef()--*/ + static CefRefPtr CreateForHandler( + CefRefPtr 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. + /// + /*--cef()--*/ + virtual int Seek(long offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual long Tell() =0; + + /// + // Flush the stream. + /// + /*--cef()--*/ + virtual int Flush() =0; +}; + +#endif // _CEF_STREAM_H diff --git a/include/cef_task.h b/include/cef_task.h new file mode 100644 index 000000000..e3a9ecc87 --- /dev/null +++ b/include/cef_task.h @@ -0,0 +1,90 @@ +// 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_TASK_H +#define _CEF_TASK_H + +#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. The UI thread creates the browser window and is used for all +// interaction with the WebKit rendering engine and V8 JavaScript engine (The +// UI thread will be the same as the main application thread if CefInitialize() +// is called with a CefSettings.multi_threaded_message_loop value of false.) The +// IO thread is used for handling schema and network requests. The FILE thread +// is used for the application cache and other miscellaneous activities. This +// function will return true if called on the specified thread. +/// +/*--cef()--*/ +bool CefCurrentlyOn(CefThreadId threadId); + +/// +// Post a task for execution on the specified thread. This function may be +// called on any thread. +/// +/*--cef()--*/ +bool CefPostTask(CefThreadId threadId, CefRefPtr task); + +/// +// Post a task for delayed execution on the specified thread. This function may +// be called on any thread. +/// +/*--cef()--*/ +bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, + long 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_TASK_H diff --git a/include/cef_url.h b/include/cef_url.h new file mode 100644 index 000000000..bf7109ab4 --- /dev/null +++ b/include/cef_url.h @@ -0,0 +1,59 @@ +// 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_URL_H +#define _CEF_URL_H + +#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_URL_H diff --git a/include/cef_v8.h b/include/cef_v8.h new file mode 100644 index 000000000..0862de481 --- /dev/null +++ b/include/cef_v8.h @@ -0,0 +1,602 @@ +// 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_V8_H +#define _CEF_V8_H + +#include "cef_base.h" +#include + +class CefBrowser; +class CefFrame; +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 +// be called on any thread. +// +// Example JavaScript extension code: +//
+//   // 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;
+//     };
+//   })();
+// 
+// Example usage in the page: +//
+//   // 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();
+// 
+/// +/*--cef(optional_param=handler)--*/ +bool CefRegisterExtension(const CefString& extension_name, + const CefString& javascript_code, + CefRefPtr handler); + + +/// +// Class that encapsulates a V8 context handle. +/// +/*--cef(source=library)--*/ +class CefV8Context : public virtual CefBase +{ +public: + /// + // Returns the current (top) context object in the V8 context stack. + /// + /*--cef()--*/ + static CefRefPtr GetCurrentContext(); + + /// + // Returns the entered (bottom) context object in the V8 context stack. + /// + /*--cef()--*/ + static CefRefPtr GetEnteredContext(); + + /// + // Returns true if V8 is currently inside a context. + /// + /*--cef()--*/ + static bool InContext(); + + /// + // Returns the browser for this context. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Returns the frame for this context. + /// + /*--cef()--*/ + virtual CefRefPtr GetFrame() =0; + + /// + // Returns the global object for this context. + /// + /*--cef()--*/ + virtual CefRefPtr GetGlobal() =0; + + /// + // Enter this context. A context must be explicitly entered before creating a + // V8 Object, Array or Function 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 that) =0; +}; + + +typedef std::vector > CefV8ValueList; + +/// +// Interface that should be implemented to handle V8 function calls. The methods +// of this class will always be called on the UI 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 object, + const CefV8ValueList& arguments, + CefRefPtr& 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 UI 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 object, + CefRefPtr& 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 object, + const CefRefPtr 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 should only be +// called on the UI 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 CreateUndefined(); + /// + // Create a new CefV8Value object of type null. + /// + /*--cef()--*/ + static CefRefPtr CreateNull(); + /// + // Create a new CefV8Value object of type bool. + /// + /*--cef()--*/ + static CefRefPtr CreateBool(bool value); + /// + // Create a new CefV8Value object of type int. + /// + /*--cef()--*/ + static CefRefPtr CreateInt(int value); + /// + // Create a new CefV8Value object of type double. + /// + /*--cef()--*/ + static CefRefPtr CreateDouble(double value); + /// + // Create a new CefV8Value object of type Date. + /// + /*--cef()--*/ + static CefRefPtr CreateDate(const CefTime& date); + /// + // Create a new CefV8Value object of type string. + /// + /*--cef(optional_param=value)--*/ + static CefRefPtr CreateString(const CefString& value); + /// + // Create a new CefV8Value object of type object with optional user data and + // 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(capi_name=cef_v8value_create_object_with_accessor, + optional_param=user_data,optional_param=accessor)--*/ + static CefRefPtr CreateObject(CefRefPtr user_data, + CefRefPtr accessor); + /// + // Create a new CefV8Value object of type array. 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 CreateArray(); + /// + // 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 CreateFunction(const CefString& name, + CefRefPtr 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 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 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 int GetIntValue() =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 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; + + /// + // Delete the value with the specified identifier. + /// + /*--cef(capi_name=delete_value_bykey)--*/ + virtual bool DeleteValue(const CefString& key) =0; + /// + // Delete the value with the specified identifier. + /// + /*--cef(capi_name=delete_value_byindex,index_param=index)--*/ + virtual bool DeleteValue(int index) =0; + + /// + // Returns the value with the specified identifier. + /// + /*--cef(capi_name=get_value_bykey)--*/ + virtual CefRefPtr GetValue(const CefString& key) =0; + /// + // Returns the value with the specified identifier. + /// + /*--cef(capi_name=get_value_byindex,index_param=index)--*/ + virtual CefRefPtr GetValue(int index) =0; + + /// + // Associate a value with the specified identifier. + /// + /*--cef(capi_name=set_value_bykey)--*/ + virtual bool SetValue(const CefString& key, CefRefPtr value, + PropertyAttribute attribute) =0; + /// + // Associate a value with the specified identifier. + /// + /*--cef(capi_name=set_value_byindex,index_param=index)--*/ + virtual bool SetValue(int index, CefRefPtr value) =0; + + /// + // Register an identifier whose access will be forwarded to the CefV8Accessor + // instance passed to CefV8Value::CreateObject(). + /// + /*--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& keys) =0; + + /// + // Returns the user data, if any, specified when the object was created. + /// + /*--cef()--*/ + virtual CefRefPtr GetUserData() =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 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. |arguments| is the list of arguments that will be passed to the + // function. If execution succeeds |retval| will be set to the function return + // value. If execution fails |exception| will be set to the exception that was + // thrown. If |rethrow_exception| is true any exception will also be re- + // thrown. This method returns false if called incorrectly. + /// + /*--cef(optional_param=object)--*/ + virtual bool ExecuteFunction(CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefRefPtr& exception, + bool rethrow_exception) =0; + + /// + // Execute the function using the specified V8 context. |object| is the + // receiver ('this' object) of the function. |arguments| is the list of + // arguments that will be passed to the function. If execution succeeds + // |retval| will be set to the function return value. If execution fails + // |exception| will be set to the exception that was thrown. If + // |rethrow_exception| is true any exception will also be re-thrown. This + // method returns false if called incorrectly. + /// + /*--cef(optional_param=object)--*/ + virtual bool ExecuteFunctionWithContext(CefRefPtr context, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefRefPtr& exception, + bool rethrow_exception) =0; +}; + +#endif // _CEF_V8_H diff --git a/include/cef_v8context_handler.h b/include/cef_v8context_handler.h new file mode 100644 index 000000000..e46cefc4d --- /dev/null +++ b/include/cef_v8context_handler.h @@ -0,0 +1,74 @@ +// 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_V8CONTEXT_HANDLER_H +#define _CEF_V8CONTEXT_HANDLER_H + +#include "cef_base.h" +#include "cef_v8.h" + +class CefBrowser; +class CefFrame; + +/// +// Implement this interface to handle V8 context events. The methods of this +// class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefV8ContextHandler : public virtual CefBase +{ +public: + /// + // 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 browser, + CefRefPtr frame, + CefRefPtr 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 browser, + CefRefPtr frame, + CefRefPtr context) {} +}; + +#endif // _CEF_V8CONTEXT_HANDLER_H diff --git a/include/cef_web_urlrequest.h b/include/cef_web_urlrequest.h new file mode 100644 index 000000000..46a92d651 --- /dev/null +++ b/include/cef_web_urlrequest.h @@ -0,0 +1,136 @@ +// 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_WEB_URLREQUEST_H +#define _CEF_WEB_URLREQUEST_H + +#include "cef_base.h" + +class CefRequest; +class CefResponse; +class CefWebURLRequestClient; + +/// +// Class used to make a Web URL request. Web URL requests are not associated +// with a browser instance so no CefClient callbacks will be executed. The +// methods of this class may be called on any thread. +/// +/*--cef(source=library)--*/ +class CefWebURLRequest : public virtual CefBase +{ +public: + typedef cef_weburlrequest_state_t RequestState; + + /// + // Create a new CefWebUrlRequest object. + /// + /*--cef()--*/ + static CefRefPtr CreateWebURLRequest( + CefRefPtr request, + CefRefPtr client); + + /// + // Cancels the request. + /// + /*--cef()--*/ + virtual void Cancel() =0; + + /// + // Returns the current ready state of the request. + /// + /*--cef(default_retval=WUR_STATE_UNSENT)--*/ + virtual RequestState GetState() =0; +}; + +/// +// Interface that should be implemented by the CefWebURLRequest client. The +// methods of this class will always be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefWebURLRequestClient : public virtual CefBase +{ +public: + typedef cef_weburlrequest_state_t RequestState; + typedef cef_handler_errorcode_t ErrorCode; + + /// + // Notifies the client that the request state has changed. State change + // notifications will always be sent before the below notification methods + // are called. + /// + /*--cef()--*/ + virtual void OnStateChange(CefRefPtr requester, + RequestState state) =0; + + /// + // Notifies the client that the request has been redirected and provides a + // chance to change the request parameters. + /// + /*--cef()--*/ + virtual void OnRedirect(CefRefPtr requester, + CefRefPtr request, + CefRefPtr response) =0; + + /// + // Notifies the client of the response data. + /// + /*--cef()--*/ + virtual void OnHeadersReceived(CefRefPtr requester, + CefRefPtr response) =0; + + /// + // Notifies the client of the upload progress. + /// + /*--cef()--*/ + virtual void OnProgress(CefRefPtr requester, + uint64 bytesSent, uint64 totalBytesToBeSent) =0; + + /// + // Notifies the client that content has been received. + /// + /*--cef()--*/ + virtual void OnData(CefRefPtr requester, + const void* data, int dataLength) =0; + + /// + // Notifies the client that the request ended with an error. + /// + /*--cef()--*/ + virtual void OnError(CefRefPtr requester, + ErrorCode errorCode) =0; +}; + +#endif // _CEF_WEB_URLREQUEST_H diff --git a/include/cef_xml_reader.h b/include/cef_xml_reader.h new file mode 100644 index 000000000..5791883e0 --- /dev/null +++ b/include/cef_xml_reader.h @@ -0,0 +1,269 @@ +// 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_XML_READER_H +#define _CEF_XML_READER_H + +#include "cef_base.h" + +class CefStreamReader; + +/// +// 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 Create(CefRefPtr 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. is considered + // empty but 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_XML_READER_H diff --git a/include/cef_zip_reader.h b/include/cef_zip_reader.h new file mode 100644 index 000000000..79a72c28d --- /dev/null +++ b/include/cef_zip_reader.h @@ -0,0 +1,143 @@ +// 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_ZIP_READER_H +#define _CEF_ZIP_READER_H + +#include "cef_base.h" + +class CefStreamReader; + +/// +// 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 Create(CefRefPtr 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 long 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 long Tell() =0; + + /// + // Returns true if at end of the file contents. + /// + /*--cef()--*/ + virtual bool Eof() =0; +}; + +#endif // _CEF_ZIP_READER_H diff --git a/include/internal/cef_ptr.h b/include/internal/cef_ptr.h index 0aec0075f..472e02012 100644 --- a/include/internal/cef_ptr.h +++ b/include/internal/cef_ptr.h @@ -32,6 +32,8 @@ #ifndef _CEF_PTR_H #define _CEF_PTR_H +#include + /// // Smart pointer implementation borrowed from base/ref_counted.h //

diff --git a/include/wrapper/cef_byte_read_handler.h b/include/wrapper/cef_byte_read_handler.h new file mode 100644 index 000000000..d43ef8182 --- /dev/null +++ b/include/wrapper/cef_byte_read_handler.h @@ -0,0 +1,88 @@ +// 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_BYTE_READ_HANDLER_H +#define _CEF_BYTE_READ_HANDLER_H + +#include "../cef_base.h" +#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 source); + + /// + // Read raw binary data. + /// + virtual size_t Read(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. + /// + virtual int Seek(long offset, int whence); + + /// + // Return the current offset position. + /// + virtual long Tell(); + + /// + // Return non-zero if at end of file. + /// + virtual int Eof(); + +private: + const unsigned char* bytes_; + size_t size_; + size_t offset_; + CefRefPtr source_; + + IMPLEMENT_REFCOUNTING(CefByteReadHandler); + IMPLEMENT_LOCKING(CefByteReadHandler); +}; + +#endif // _CEF_BYTE_READ_HANDLER_H diff --git a/include/cef_wrapper.h b/include/wrapper/cef_xml_object.h similarity index 64% rename from include/cef_wrapper.h rename to include/wrapper/cef_xml_object.h index e455ce812..7a8307009 100644 --- a/include/cef_wrapper.h +++ b/include/wrapper/cef_xml_object.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. +// 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 @@ -33,13 +33,16 @@ // against the libcef_dll_wrapper target. // -#ifndef _CEF_WRAPPER_H -#define _CEF_WRAPPER_H +#ifndef _CEF_XML_OBJECT_H +#define _CEF_XML_OBJECT_H -#include "cef.h" +#include "../cef_base.h" +#include "../cef_xml_reader.h" #include #include +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 @@ -182,141 +185,4 @@ private: IMPLEMENT_LOCKING(CefXmlObject); }; - -/// -// 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 source); - - /// - // Read raw binary data. - /// - virtual size_t Read(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. - /// - virtual int Seek(long offset, int whence); - - /// - // Return the current offset position. - /// - virtual long Tell(); - - /// - // Return non-zero if at end of file. - /// - virtual int Eof(); - -private: - const unsigned char* bytes_; - size_t size_; - size_t offset_; - CefRefPtr source_; - - IMPLEMENT_REFCOUNTING(CefByteReadHandler); - IMPLEMENT_LOCKING(CefByteReadHandler); -}; - - -/// -// 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 GetStreamReader() =0; - }; - typedef std::map > 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 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 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_WRAPPER_H +#endif // _CEF_XML_OBJECT_H diff --git a/include/wrapper/cef_zip_archive.h b/include/wrapper/cef_zip_archive.h new file mode 100644 index 000000000..c9ae4097e --- /dev/null +++ b/include/wrapper/cef_zip_archive.h @@ -0,0 +1,133 @@ +// 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_ZIP_ARCHIVE_H +#define _CEF_ZIP_ARCHIVE_H + +#include "../cef_base.h" +#include + +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 GetStreamReader() =0; + }; + typedef std::map > 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 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 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_ZIP_ARCHIVE_H diff --git a/libcef/browser_devtools_scheme_handler.cc b/libcef/browser_devtools_scheme_handler.cc index f7c27aedd..bf92c8b6f 100644 --- a/libcef/browser_devtools_scheme_handler.cc +++ b/libcef/browser_devtools_scheme_handler.cc @@ -3,7 +3,12 @@ // be found in the LICENSE file. #include "browser_devtools_scheme_handler.h" -#include "include/cef.h" +#include "include/cef_browser.h" +#include "include/cef_request.h" +#include "include/cef_response.h" +#include "include/cef_scheme.h" +#include "include/cef_stream.h" +#include "include/cef_url.h" #include "browser_webkit_glue.h" #include diff --git a/libcef/browser_drag_delegate_win.cc b/libcef/browser_drag_delegate_win.cc index 93a1142c7..a51002050 100644 --- a/libcef/browser_drag_delegate_win.cc +++ b/libcef/browser_drag_delegate_win.cc @@ -3,7 +3,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "include/cef.h" #include "browser_drag_delegate_win.h" #include "browser_impl.h" #include "browser_webview_delegate.h" diff --git a/libcef/browser_impl.cc b/libcef/browser_impl.cc index 5839d162d..f99ba30a5 100644 --- a/libcef/browser_impl.cc +++ b/libcef/browser_impl.cc @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_devtools_scheme_handler.h" #include "browser_impl.h" +#include "browser_devtools_scheme_handler.h" #include "browser_webkit_glue.h" #include "browser_zoom_map.h" #include "cef_context.h" diff --git a/libcef/browser_impl.h b/libcef/browser_impl.h index a3718a187..7517675ca 100644 --- a/libcef/browser_impl.h +++ b/libcef/browser_impl.h @@ -6,7 +6,9 @@ #ifndef _BROWSER_IMPL_H #define _BROWSER_IMPL_H -#include "include/cef.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" +#include "include/cef_frame.h" #include "webview_host.h" #include "browser_devtools_agent.h" diff --git a/libcef/browser_navigation_controller.h b/libcef/browser_navigation_controller.h index ba6f86478..fa3e876be 100644 --- a/libcef/browser_navigation_controller.h +++ b/libcef/browser_navigation_controller.h @@ -16,7 +16,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPBody.h" -#include "include/cef.h" +#include "include/cef_request.h" class GURL; class CefBrowserImpl; diff --git a/libcef/browser_resource_loader_bridge.h b/libcef/browser_resource_loader_bridge.h index 250ac68ed..6f6790f13 100644 --- a/libcef/browser_resource_loader_bridge.h +++ b/libcef/browser_resource_loader_bridge.h @@ -6,12 +6,13 @@ #ifndef _BROWSER_RESOURCE_LOADER_BRIDGE_H #define _BROWSER_RESOURCE_LOADER_BRIDGE_H -#include "include/cef.h" +#include "include/cef_base.h" #include "base/message_loop_proxy.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_loader_bridge.h" #include +class CefBrowser; class GURL; class BrowserResourceLoaderBridge { diff --git a/libcef/browser_settings.cc b/libcef/browser_settings.cc index b97d712c0..f8516a970 100644 --- a/libcef/browser_settings.cc +++ b/libcef/browser_settings.cc @@ -2,7 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "../include/cef.h" +#include "browser_settings.h" +#include "include/internal/cef_types_wrappers.h" #include "base/utf_string_conversions.h" #include "webkit/glue/webpreferences.h" diff --git a/libcef/browser_webkit_glue.h b/libcef/browser_webkit_glue.h index 776e8aafb..506eafa5e 100644 --- a/libcef/browser_webkit_glue.h +++ b/libcef/browser_webkit_glue.h @@ -2,8 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" - #if defined(OS_WIN) #include #endif diff --git a/libcef/cef_context.cc b/libcef/cef_context.cc index e6488748f..9b859dd1d 100644 --- a/libcef/cef_context.cc +++ b/libcef/cef_context.cc @@ -1,25 +1,15 @@ -// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights +// 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. -#include "include/cef_nplugin.h" +#include "cef_context.h" #include "browser_devtools_scheme_handler.h" #include "browser_impl.h" #include "browser_webkit_glue.h" -#include "cef_context.h" -#include "cef_time_util.h" -#include "dom_storage_common.h" -#include "dom_storage_namespace.h" -#include "dom_storage_area.h" #include "base/bind.h" #include "base/file_util.h" -#include "base/stringprintf.h" -#include "base/string_split.h" #include "base/synchronization/waitable_event.h" -#include "base/utf_string_conversions.h" -#include "net/base/cookie_monster.h" -#include "webkit/plugins/npapi/plugin_list.h" #if defined(OS_MACOSX) || defined(OS_WIN) #include "crypto/nss_util.h" @@ -34,167 +24,6 @@ CefRefPtr _Context; namespace { -void UIT_RegisterPlugin(CefPluginInfo* plugin_info) -{ - REQUIRE_UIT(); - - webkit::WebPluginInfo info; - - info.path = FilePath(CefString(&plugin_info->unique_name)); - info.name = CefString(&plugin_info->display_name); - info.version = CefString(&plugin_info->version); - info.desc = CefString(&plugin_info->description); - - typedef std::vector VectorType; - VectorType mime_types, file_extensions, descriptions, file_extensions_parts; - base::SplitString(CefString(&plugin_info->mime_types), '|', &mime_types); - base::SplitString(CefString(&plugin_info->file_extensions), '|', - &file_extensions); - base::SplitString(CefString(&plugin_info->type_descriptions), '|', - &descriptions); - - for (size_t i = 0; i < mime_types.size(); ++i) { - webkit::WebPluginMimeType mimeType; - - mimeType.mime_type = mime_types[i]; - - if (file_extensions.size() > i) { - base::SplitString(file_extensions[i], ',', &file_extensions_parts); - VectorType::const_iterator it = file_extensions_parts.begin(); - for(; it != file_extensions_parts.end(); ++it) - mimeType.file_extensions.push_back(*(it)); - file_extensions_parts.clear(); - } - - if (descriptions.size() > i) - mimeType.description = UTF8ToUTF16(descriptions[i]); - - info.mime_types.push_back(mimeType); - } - - webkit::npapi::PluginEntryPoints entry_points; -#if !defined(OS_POSIX) || defined(OS_MACOSX) - entry_points.np_getentrypoints = plugin_info->np_getentrypoints; -#endif - entry_points.np_initialize = plugin_info->np_initialize; - entry_points.np_shutdown = plugin_info->np_shutdown; - - webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( - info, entry_points, true); - - delete plugin_info; -} - -int GetThreadId(CefThreadId threadId) -{ - switch(threadId) { - case TID_UI: return CefThread::UI; - case TID_IO: return CefThread::IO; - case TID_FILE: return CefThread::FILE; - }; - NOTREACHED(); - return -1; -} - -// Callback class for visiting cookies. -class VisitCookiesCallback : public base::RefCounted { -public: - VisitCookiesCallback(CefRefPtr visitor) - : visitor_(visitor) - { - } - - void Run(const net::CookieList& list) - { - REQUIRE_IOT(); - - net::CookieMonster* cookie_monster = static_cast( - _Context->request_context()->cookie_store()); - if (!cookie_monster) - return; - - int total = list.size(), count = 0; - - net::CookieList::const_iterator it = list.begin(); - for (; it != list.end(); ++it, ++count) { - CefCookie cookie; - const net::CookieMonster::CanonicalCookie& cc = *(it); - - CefString(&cookie.name).FromString(cc.Name()); - CefString(&cookie.value).FromString(cc.Value()); - CefString(&cookie.domain).FromString(cc.Domain()); - CefString(&cookie.path).FromString(cc.Path()); - cookie.secure = cc.IsSecure(); - cookie.httponly = cc.IsHttpOnly(); - cef_time_from_basetime(cc.CreationDate(), cookie.creation); - cef_time_from_basetime(cc.LastAccessDate(), cookie.last_access); - cookie.has_expires = cc.DoesExpire(); - if (cookie.has_expires) - cef_time_from_basetime(cc.ExpiryDate(), cookie.expires); - - bool deleteCookie = false; - bool keepLooping = visitor_->Visit(cookie, count, total, deleteCookie); - if (deleteCookie) { - cookie_monster->DeleteCanonicalCookieAsync(cc, - net::CookieMonster::DeleteCookieCallback()); - } - if (!keepLooping) - break; - } - } - -private: - CefRefPtr visitor_; -}; - -void IOT_VisitAllCookies(CefRefPtr visitor) -{ - REQUIRE_IOT(); - - net::CookieMonster* cookie_monster = static_cast( - _Context->request_context()->cookie_store()); - if (!cookie_monster) - return; - - scoped_refptr callback( - new VisitCookiesCallback(visitor)); - - cookie_monster->GetAllCookiesAsync( - base::Bind(&VisitCookiesCallback::Run, callback.get())); -} - -void IOT_VisitUrlCookies(const GURL& url, bool includeHttpOnly, - CefRefPtr visitor) -{ - REQUIRE_IOT(); - - net::CookieMonster* cookie_monster = static_cast( - _Context->request_context()->cookie_store()); - if (!cookie_monster) - return; - - net::CookieOptions options; - if (includeHttpOnly) - options.set_include_httponly(); - - scoped_refptr callback( - new VisitCookiesCallback(visitor)); - - cookie_monster->GetAllCookiesForURLWithOptionsAsync(url, options, - base::Bind(&VisitCookiesCallback::Run, callback.get())); -} - -void IOT_SetCookiePath(const CefString& path) -{ - REQUIRE_IOT(); - - FilePath cookie_path; - if (!path.empty()) - cookie_path = FilePath(path); - - _Context->request_context()->SetCookieStoragePath(cookie_path); -} - // Used in multi-threaded message loop mode to observe shutdown of the UI // thread. class DestructionObserver : public MessageLoop::DestructionObserver @@ -210,145 +39,6 @@ private: base::WaitableEvent *event_; }; -void UIT_VisitStorage(int64 namespace_id, const CefString& origin, - const CefString& key, - CefRefPtr visitor) -{ - REQUIRE_UIT(); - - DOMStorageContext* context = _Context->storage_context(); - - // Allow storage to be allocated for localStorage so that on-disk data, if - // any, will be available. - bool allocation_allowed = (namespace_id == kLocalStorageNamespaceId); - - DOMStorageNamespace* ns = - context->GetStorageNamespace(namespace_id, allocation_allowed); - if (!ns) - return; - - typedef std::vector AreaList; - AreaList areas; - - if (!origin.empty()) { - // Visit only the area with the specified origin. - DOMStorageArea* area = ns->GetStorageArea(origin, allocation_allowed); - if (area) - areas.push_back(area); - } else { - // Visit all areas. - ns->GetStorageAreas(areas, true); - } - - if (areas.empty()) - return; - - // Count the total number of matching keys. - unsigned int total = 0; - { - NullableString16 value; - AreaList::iterator it = areas.begin(); - for (; it != areas.end(); ) { - DOMStorageArea* area = (*it); - if (!key.empty()) { - value = area->GetItem(key); - if (value.is_null()) { - it = areas.erase(it); - // Don't increment the iterator. - continue; - } else { - total++; - } - } else { - total += area->Length(); - } - ++it; - } - } - - if (total == 0) - return; - - DOMStorageArea* area; - bool stop = false, deleteData; - unsigned int count = 0, i, len; - NullableString16 keyVal, valueVal; - string16 keyStr, valueStr; - typedef std::vector String16List; - String16List delete_keys; - - // Visit all matching pairs. - AreaList::iterator it = areas.begin(); - for (; it != areas.end() && !stop; ++it) { - // Each area. - area = *(it); - if (!key.empty()) { - // Visit only the matching key. - valueVal = area->GetItem(key); - if (valueVal.is_null()) - valueStr.clear(); - else - valueStr = valueVal.string(); - - deleteData = false; - stop = !visitor->Visit(static_cast(namespace_id), - area->origin(), key, valueStr, count, total, deleteData); - if (deleteData) - area->RemoveItem(key); - count++; - } else { - // Visit all keys. - len = area->Length(); - for(i = 0; i < len && !stop; ++i) { - keyVal = area->Key(i); - if (keyVal.is_null()) { - keyStr.clear(); - valueStr.clear(); - } else { - keyStr = keyVal.string(); - valueVal = area->GetItem(keyStr); - if (valueVal.is_null()) - valueStr.clear(); - else - valueStr = valueVal.string(); - } - - deleteData = false; - stop = !visitor->Visit(static_cast(namespace_id), - area->origin(), keyStr, valueStr, count, total, deleteData); - if (deleteData) - delete_keys.push_back(keyStr); - count++; - } - - // Delete the requested keys. - if (!delete_keys.empty()) { - String16List::const_iterator it = delete_keys.begin(); - for (; it != delete_keys.end(); ++it) - area->RemoveItem(*it); - delete_keys.clear(); - } - } - } -} - -void UIT_SetStoragePath(int64 namespace_id, const CefString& path) -{ - REQUIRE_UIT(); - - if (namespace_id != kLocalStorageNamespaceId) - return; - - FilePath file_path; - if (!path.empty()) - file_path = FilePath(path); - - DOMStorageContext* context = _Context->storage_context(); - DCHECK(context); - if (context) - context->SetLocalStoragePath(file_path); -} - } // anonymous bool CefInitialize(const CefSettings& settings, CefRefPtr application) @@ -441,410 +131,6 @@ void CefQuitMessageLoop() _Context->process()->QuitMessageLoop(); } -bool CefRegisterPlugin(const CefPluginInfo& plugin_info) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - CefThread::PostTask(CefThread::UI, FROM_HERE, - NewRunnableFunction(UIT_RegisterPlugin, new CefPluginInfo(plugin_info))); - - return true; -} - -bool CefCurrentlyOn(CefThreadId threadId) -{ - int id = GetThreadId(threadId); - if(id < 0) - return false; - - return CefThread::CurrentlyOn(static_cast(id)); -} - -class CefTaskHelper : public Task -{ -public: - CefTaskHelper(CefRefPtr task, CefThreadId threadId) - : task_(task), thread_id_(threadId) {} - virtual void Run() { task_->Execute(thread_id_); } -private: - CefRefPtr task_; - CefThreadId thread_id_; - DISALLOW_COPY_AND_ASSIGN(CefTaskHelper); -}; - -bool CefPostTask(CefThreadId threadId, CefRefPtr task) -{ - int id = GetThreadId(threadId); - if(id < 0) - return false; - - return CefThread::PostTask(static_cast(id), FROM_HERE, - new CefTaskHelper(task, threadId)); -} - -bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, - long delay_ms) -{ - int id = GetThreadId(threadId); - if(id < 0) - return false; - - return CefThread::PostDelayedTask(static_cast(id), FROM_HERE, - new CefTaskHelper(task, threadId), delay_ms); -} - -bool CefParseURL(const CefString& url, - CefURLParts& parts) -{ - GURL gurl(url.ToString()); - if (!gurl.is_valid()) - return false; - - CefString(&parts.spec).FromString(gurl.spec()); - CefString(&parts.scheme).FromString(gurl.scheme()); - CefString(&parts.username).FromString(gurl.username()); - CefString(&parts.password).FromString(gurl.password()); - CefString(&parts.host).FromString(gurl.host()); - CefString(&parts.port).FromString(gurl.port()); - CefString(&parts.path).FromString(gurl.path()); - CefString(&parts.query).FromString(gurl.query()); - - return true; -} - -bool CefCreateURL(const CefURLParts& parts, - CefString& url) -{ - std::string spec = CefString(parts.spec.str, parts.spec.length, false); - std::string scheme = CefString(parts.scheme.str, parts.scheme.length, false); - std::string username = - CefString(parts.username.str, parts.username.length, false); - std::string password = - CefString(parts.password.str, parts.password.length, false); - std::string host = CefString(parts.host.str, parts.host.length, false); - std::string port = CefString(parts.port.str, parts.port.length, false); - std::string path = CefString(parts.path.str, parts.path.length, false); - std::string query = CefString(parts.query.str, parts.query.length, false); - - GURL gurl; - if (!spec.empty()) { - gurl = GURL(spec); - } else if (!scheme.empty() && !host.empty()) { - std::stringstream ss; - ss << scheme << "://"; - if (!username.empty()) { - ss << username; - if (!password.empty()) - ss << ":" << password; - ss << "@"; - } - ss << host; - if (!port.empty()) - ss << ":" << port; - if (!path.empty()) - ss << path; - if (!query.empty()) - ss << "?" << query; - gurl = GURL(ss.str()); - } - - if (gurl.is_valid()) { - url = gurl.spec(); - return true; - } - - return false; -} - -bool CefVisitAllCookies(CefRefPtr visitor) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - return CefThread::PostTask(CefThread::IO, FROM_HERE, - NewRunnableFunction(IOT_VisitAllCookies, visitor)); -} - -bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr visitor) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - std::string urlStr = url; - GURL gurl = GURL(urlStr); - if (!gurl.is_valid()) - return false; - - return CefThread::PostTask(CefThread::IO, FROM_HERE, - NewRunnableFunction(IOT_VisitUrlCookies, gurl, includeHttpOnly, visitor)); -} - -bool CefSetCookie(const CefString& url, const CefCookie& cookie) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - // Verify that this function is being called on the IO thread. - if (!CefThread::CurrentlyOn(CefThread::IO)) { - NOTREACHED() << "called on invalid thread"; - return false; - } - - net::CookieMonster* cookie_monster = static_cast( - _Context->request_context()->cookie_store()); - if (!cookie_monster) - return false; - - std::string urlStr = url; - GURL gurl = GURL(urlStr); - if (!gurl.is_valid()) - return false; - - std::string name = CefString(&cookie.name).ToString(); - std::string value = CefString(&cookie.value).ToString(); - std::string domain = CefString(&cookie.domain).ToString(); - std::string path = CefString(&cookie.path).ToString(); - - base::Time expiration_time; - if (cookie.has_expires) - cef_time_to_basetime(cookie.expires, expiration_time); - - cookie_monster->SetCookieWithDetailsAsync(gurl, name, value, domain, path, - expiration_time, cookie.secure, cookie.httponly, - net::CookieStore::SetCookiesCallback()); - return true; -} - -bool CefDeleteCookies(const CefString& url, const CefString& cookie_name) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - // Verify that this function is being called on the IO thread. - if (!CefThread::CurrentlyOn(CefThread::IO)) { - NOTREACHED() << "called on invalid thread"; - return false; - } - - net::CookieMonster* cookie_monster = static_cast( - _Context->request_context()->cookie_store()); - if (!cookie_monster) - return false; - - if (url.empty()) { - // Delete all cookies. - cookie_monster->DeleteAllAsync(net::CookieMonster::DeleteCallback()); - return true; - } - - std::string urlStr = url; - GURL gurl = GURL(urlStr); - if (!gurl.is_valid()) - return false; - - if (cookie_name.empty()) { - // Delete all matching host cookies. - cookie_monster->DeleteAllForHostAsync(gurl, - net::CookieMonster::DeleteCallback()); - } else { - // Delete all matching host and domain cookies. - cookie_monster->DeleteCookieAsync(gurl, cookie_name, base::Closure()); - } - return true; -} - -bool CefSetCookiePath(const CefString& path) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - if (CefThread::CurrentlyOn(CefThread::IO)) { - IOT_SetCookiePath(path); - } else { - CefThread::PostTask(CefThread::IO, FROM_HERE, - base::Bind(&IOT_SetCookiePath, path)); - } - - return true; -} - -bool CefVisitStorage(CefStorageType type, const CefString& origin, - const CefString& key, - CefRefPtr visitor) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - int64 namespace_id; - if (type == ST_LOCALSTORAGE) { - namespace_id = kLocalStorageNamespaceId; - } else if(type == ST_SESSIONSTORAGE) { - namespace_id = kLocalStorageNamespaceId + 1; - } else { - NOTREACHED() << "invalid type"; - return false; - } - - if (CefThread::CurrentlyOn(CefThread::UI)) { - UIT_VisitStorage(namespace_id, origin, key, visitor); - } else { - CefThread::PostTask(CefThread::UI, FROM_HERE, - base::Bind(&UIT_VisitStorage, namespace_id, origin, key, visitor)); - } - - return true; -} - -bool CefSetStorage(CefStorageType type, const CefString& origin, - const CefString& key, const CefString& value) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - // Verify that this function is being called on the UI thread. - if (!CefThread::CurrentlyOn(CefThread::UI)) { - NOTREACHED() << "called on invalid thread"; - return false; - } - - int64 namespace_id; - if (type == ST_LOCALSTORAGE) { - namespace_id = kLocalStorageNamespaceId; - } else if(type == ST_SESSIONSTORAGE) { - namespace_id = kLocalStorageNamespaceId + 1; - } else { - NOTREACHED() << "invalid type"; - return false; - } - - if (origin.empty()) { - NOTREACHED() << "invalid origin"; - return false; - } - - DOMStorageArea* area = - _Context->storage_context()->GetStorageArea(namespace_id, origin, true); - if (!area) - return false; - - WebKit::WebStorageArea::Result result; - area->SetItem(key, value, &result); - return (result == WebKit::WebStorageArea::ResultOK); -} - -bool CefDeleteStorage(CefStorageType type, const CefString& origin, - const CefString& key) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - // Verify that this function is being called on the UI thread. - if (!CefThread::CurrentlyOn(CefThread::UI)) { - NOTREACHED() << "called on invalid thread"; - return false; - } - - int64 namespace_id; - if (type == ST_LOCALSTORAGE) { - namespace_id = kLocalStorageNamespaceId; - } else if(type == ST_SESSIONSTORAGE) { - namespace_id = kLocalStorageNamespaceId + 1; - } else { - NOTREACHED() << "invalid type"; - return false; - } - - DOMStorageContext* context = _Context->storage_context(); - - // Allow storage to be allocated for localStorage so that on-disk data, if - // any, will be available. - bool allocation_allowed = (namespace_id == kLocalStorageNamespaceId); - - if (origin.empty()) { - // Delete all storage for the namespace. - if (namespace_id == kLocalStorageNamespaceId) - context->DeleteAllLocalStorageFiles(); - else - context->PurgeMemory(namespace_id); - } else if(key.empty()) { - // Clear the storage area for the specified origin. - if (namespace_id == kLocalStorageNamespaceId) { - context->DeleteLocalStorageForOrigin(origin); - } else { - DOMStorageArea* area = - context->GetStorageArea(namespace_id, origin, allocation_allowed); - if (area) { - // Calling Clear() is necessary to remove the data from the namespace. - area->Clear(); - area->PurgeMemory(); - } - } - } else { - // Delete the specified key. - DOMStorageArea* area = - context->GetStorageArea(namespace_id, origin, allocation_allowed); - if (area) - area->RemoveItem(key); - } - - return true; -} - -bool CefSetStoragePath(CefStorageType type, const CefString& path) -{ - // Verify that the context is in a valid state. - if (!CONTEXT_STATE_VALID()) { - NOTREACHED() << "context not valid"; - return false; - } - - int64 namespace_id; - if (type == ST_LOCALSTORAGE) { - namespace_id = kLocalStorageNamespaceId; - } else { - NOTREACHED() << "invalid type"; - return false; - } - - if (CefThread::CurrentlyOn(CefThread::UI)) { - UIT_SetStoragePath(namespace_id, path); - } else { - CefThread::PostTask(CefThread::UI, FROM_HERE, - base::Bind(&UIT_SetStoragePath, namespace_id, path)); - } - - return true; -} - // CefContext diff --git a/libcef/cef_context.h b/libcef/cef_context.h index 1f01356c7..ec9c19251 100644 --- a/libcef/cef_context.h +++ b/libcef/cef_context.h @@ -5,7 +5,8 @@ #ifndef _CEF_CONTEXT_H #define _CEF_CONTEXT_H -#include "include/cef.h" +#include "include/cef_app.h" +#include "include/cef_base.h" #include "browser_file_system.h" #include "browser_request_context.h" #include "cef_process.h" diff --git a/libcef/cef_process_ui_thread_mac.mm b/libcef/cef_process_ui_thread_mac.mm index bafa43937..4be9efb3d 100644 --- a/libcef/cef_process_ui_thread_mac.mm +++ b/libcef/cef_process_ui_thread_mac.mm @@ -5,7 +5,6 @@ #import -#include "include/cef.h" #import "include/cef_application_mac.h" #include "cef_process_ui_thread.h" #include "browser_webkit_glue.h" diff --git a/libcef/command_line_impl.cc b/libcef/command_line_impl.cc index 3520c6c7d..ddaafabdc 100644 --- a/libcef/command_line_impl.cc +++ b/libcef/command_line_impl.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_command_line.h" #include "base/command_line.h" #include "base/file_path.h" #include "base/logging.h" diff --git a/libcef/cookie_impl.cc b/libcef/cookie_impl.cc new file mode 100644 index 000000000..6d3ed4fda --- /dev/null +++ b/libcef/cookie_impl.cc @@ -0,0 +1,241 @@ +// 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. + +#include "include/cef_cookie.h" +#include "cef_context.h" +#include "cef_thread.h" +#include "cef_time_util.h" + +#include "net/base/cookie_monster.h" + +namespace { + +// Callback class for visiting cookies. +class VisitCookiesCallback : public base::RefCounted { +public: + VisitCookiesCallback(CefRefPtr visitor) + : visitor_(visitor) + { + } + + void Run(const net::CookieList& list) + { + REQUIRE_IOT(); + + net::CookieMonster* cookie_monster = static_cast( + _Context->request_context()->cookie_store()); + if (!cookie_monster) + return; + + int total = list.size(), count = 0; + + net::CookieList::const_iterator it = list.begin(); + for (; it != list.end(); ++it, ++count) { + CefCookie cookie; + const net::CookieMonster::CanonicalCookie& cc = *(it); + + CefString(&cookie.name).FromString(cc.Name()); + CefString(&cookie.value).FromString(cc.Value()); + CefString(&cookie.domain).FromString(cc.Domain()); + CefString(&cookie.path).FromString(cc.Path()); + cookie.secure = cc.IsSecure(); + cookie.httponly = cc.IsHttpOnly(); + cef_time_from_basetime(cc.CreationDate(), cookie.creation); + cef_time_from_basetime(cc.LastAccessDate(), cookie.last_access); + cookie.has_expires = cc.DoesExpire(); + if (cookie.has_expires) + cef_time_from_basetime(cc.ExpiryDate(), cookie.expires); + + bool deleteCookie = false; + bool keepLooping = visitor_->Visit(cookie, count, total, deleteCookie); + if (deleteCookie) { + cookie_monster->DeleteCanonicalCookieAsync(cc, + net::CookieMonster::DeleteCookieCallback()); + } + if (!keepLooping) + break; + } + } + +private: + CefRefPtr visitor_; +}; + +void IOT_VisitAllCookies(CefRefPtr visitor) +{ + REQUIRE_IOT(); + + net::CookieMonster* cookie_monster = static_cast( + _Context->request_context()->cookie_store()); + if (!cookie_monster) + return; + + scoped_refptr callback( + new VisitCookiesCallback(visitor)); + + cookie_monster->GetAllCookiesAsync( + base::Bind(&VisitCookiesCallback::Run, callback.get())); +} + +void IOT_VisitUrlCookies(const GURL& url, bool includeHttpOnly, + CefRefPtr visitor) +{ + REQUIRE_IOT(); + + net::CookieMonster* cookie_monster = static_cast( + _Context->request_context()->cookie_store()); + if (!cookie_monster) + return; + + net::CookieOptions options; + if (includeHttpOnly) + options.set_include_httponly(); + + scoped_refptr callback( + new VisitCookiesCallback(visitor)); + + cookie_monster->GetAllCookiesForURLWithOptionsAsync(url, options, + base::Bind(&VisitCookiesCallback::Run, callback.get())); +} + +void IOT_SetCookiePath(const CefString& path) +{ + REQUIRE_IOT(); + + FilePath cookie_path; + if (!path.empty()) + cookie_path = FilePath(path); + + _Context->request_context()->SetCookieStoragePath(cookie_path); +} + +} // anonymous + +bool CefVisitAllCookies(CefRefPtr visitor) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + return CefThread::PostTask(CefThread::IO, FROM_HERE, + NewRunnableFunction(IOT_VisitAllCookies, visitor)); +} + +bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, + CefRefPtr visitor) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + std::string urlStr = url; + GURL gurl = GURL(urlStr); + if (!gurl.is_valid()) + return false; + + return CefThread::PostTask(CefThread::IO, FROM_HERE, + NewRunnableFunction(IOT_VisitUrlCookies, gurl, includeHttpOnly, visitor)); +} + +bool CefSetCookie(const CefString& url, const CefCookie& cookie) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + // Verify that this function is being called on the IO thread. + if (!CefThread::CurrentlyOn(CefThread::IO)) { + NOTREACHED() << "called on invalid thread"; + return false; + } + + net::CookieMonster* cookie_monster = static_cast( + _Context->request_context()->cookie_store()); + if (!cookie_monster) + return false; + + std::string urlStr = url; + GURL gurl = GURL(urlStr); + if (!gurl.is_valid()) + return false; + + std::string name = CefString(&cookie.name).ToString(); + std::string value = CefString(&cookie.value).ToString(); + std::string domain = CefString(&cookie.domain).ToString(); + std::string path = CefString(&cookie.path).ToString(); + + base::Time expiration_time; + if (cookie.has_expires) + cef_time_to_basetime(cookie.expires, expiration_time); + + cookie_monster->SetCookieWithDetailsAsync(gurl, name, value, domain, path, + expiration_time, cookie.secure, cookie.httponly, + net::CookieStore::SetCookiesCallback()); + return true; +} + +bool CefDeleteCookies(const CefString& url, const CefString& cookie_name) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + // Verify that this function is being called on the IO thread. + if (!CefThread::CurrentlyOn(CefThread::IO)) { + NOTREACHED() << "called on invalid thread"; + return false; + } + + net::CookieMonster* cookie_monster = static_cast( + _Context->request_context()->cookie_store()); + if (!cookie_monster) + return false; + + if (url.empty()) { + // Delete all cookies. + cookie_monster->DeleteAllAsync(net::CookieMonster::DeleteCallback()); + return true; + } + + std::string urlStr = url; + GURL gurl = GURL(urlStr); + if (!gurl.is_valid()) + return false; + + if (cookie_name.empty()) { + // Delete all matching host cookies. + cookie_monster->DeleteAllForHostAsync(gurl, + net::CookieMonster::DeleteCallback()); + } else { + // Delete all matching host and domain cookies. + cookie_monster->DeleteCookieAsync(gurl, cookie_name, base::Closure()); + } + return true; +} + +bool CefSetCookiePath(const CefString& path) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + if (CefThread::CurrentlyOn(CefThread::IO)) { + IOT_SetCookiePath(path); + } else { + CefThread::PostTask(CefThread::IO, FROM_HERE, + base::Bind(&IOT_SetCookiePath, path)); + } + + return true; +} diff --git a/libcef/dom_document_impl.h b/libcef/dom_document_impl.h index b70f8c8fb..dadedd26e 100644 --- a/libcef/dom_document_impl.h +++ b/libcef/dom_document_impl.h @@ -5,7 +5,7 @@ #ifndef _DOM_DOCUMENT_IMPL_H #define _DOM_DOCUMENT_IMPL_H -#include "include/cef.h" +#include "include/cef_dom.h" #include namespace WebKit { diff --git a/libcef/dom_event_impl.h b/libcef/dom_event_impl.h index 377ad15ad..870523af4 100644 --- a/libcef/dom_event_impl.h +++ b/libcef/dom_event_impl.h @@ -5,7 +5,7 @@ #ifndef _DOM_EVENT_IMPL_H #define _DOM_EVENT_IMPL_H -#include "include/cef.h" +#include "include/cef_dom.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" class CefDOMDocumentImpl; diff --git a/libcef/dom_node_impl.h b/libcef/dom_node_impl.h index a430c9a6a..c936f3039 100644 --- a/libcef/dom_node_impl.h +++ b/libcef/dom_node_impl.h @@ -5,7 +5,7 @@ #ifndef _DOM_NODE_IMPL_H #define _DOM_NODE_IMPL_H -#include "include/cef.h" +#include "include/cef_dom.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" class CefDOMDocumentImpl; diff --git a/libcef/drag_data_impl.h b/libcef/drag_data_impl.h index 4f878a445..438b7a313 100644 --- a/libcef/drag_data_impl.h +++ b/libcef/drag_data_impl.h @@ -5,7 +5,7 @@ #ifndef _DRAG_DATA_IMPL_H #define _DRAG_DATA_IMPL_H -#include "../include/cef.h" +#include "include/cef_drag_data.h" #include "webkit/glue/webdropdata.h" // Implementation of CefDragData. diff --git a/libcef/http_header_utils.cc b/libcef/http_header_utils.cc index 89841d86d..bcf8e7e50 100644 --- a/libcef/http_header_utils.cc +++ b/libcef/http_header_utils.cc @@ -2,7 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" #include "http_header_utils.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" diff --git a/libcef/http_header_utils.h b/libcef/http_header_utils.h index 10f64e558..7a3179766 100644 --- a/libcef/http_header_utils.h +++ b/libcef/http_header_utils.h @@ -5,6 +5,7 @@ #ifndef _HTTP_HEADER_UTILS_H #define _HTTP_HEADER_UTILS_H +#include "include/cef_request.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPHeaderVisitor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" diff --git a/libcef/nplugin_impl.cc b/libcef/nplugin_impl.cc new file mode 100644 index 000000000..9ab58a1d1 --- /dev/null +++ b/libcef/nplugin_impl.cc @@ -0,0 +1,80 @@ +// 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. + +#include "include/cef_nplugin.h" +#include "cef_context.h" +#include "cef_thread.h" + +#include "base/string_split.h" +#include "base/utf_string_conversions.h" +#include "webkit/plugins/npapi/plugin_list.h" + +namespace { + +void UIT_RegisterPlugin(CefPluginInfo* plugin_info) +{ + REQUIRE_UIT(); + + webkit::WebPluginInfo info; + + info.path = FilePath(CefString(&plugin_info->unique_name)); + info.name = CefString(&plugin_info->display_name); + info.version = CefString(&plugin_info->version); + info.desc = CefString(&plugin_info->description); + + typedef std::vector VectorType; + VectorType mime_types, file_extensions, descriptions, file_extensions_parts; + base::SplitString(CefString(&plugin_info->mime_types), '|', &mime_types); + base::SplitString(CefString(&plugin_info->file_extensions), '|', + &file_extensions); + base::SplitString(CefString(&plugin_info->type_descriptions), '|', + &descriptions); + + for (size_t i = 0; i < mime_types.size(); ++i) { + webkit::WebPluginMimeType mimeType; + + mimeType.mime_type = mime_types[i]; + + if (file_extensions.size() > i) { + base::SplitString(file_extensions[i], ',', &file_extensions_parts); + VectorType::const_iterator it = file_extensions_parts.begin(); + for(; it != file_extensions_parts.end(); ++it) + mimeType.file_extensions.push_back(*(it)); + file_extensions_parts.clear(); + } + + if (descriptions.size() > i) + mimeType.description = UTF8ToUTF16(descriptions[i]); + + info.mime_types.push_back(mimeType); + } + + webkit::npapi::PluginEntryPoints entry_points; +#if !defined(OS_POSIX) || defined(OS_MACOSX) + entry_points.np_getentrypoints = plugin_info->np_getentrypoints; +#endif + entry_points.np_initialize = plugin_info->np_initialize; + entry_points.np_shutdown = plugin_info->np_shutdown; + + webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( + info, entry_points, true); + + delete plugin_info; +} + +} // anonymous + +bool CefRegisterPlugin(const CefPluginInfo& plugin_info) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + CefThread::PostTask(CefThread::UI, FROM_HERE, + NewRunnableFunction(UIT_RegisterPlugin, new CefPluginInfo(plugin_info))); + + return true; +} diff --git a/libcef/origin_whitelist_impl.cc b/libcef/origin_whitelist_impl.cc index 2d5355e85..5c32d096b 100644 --- a/libcef/origin_whitelist_impl.cc +++ b/libcef/origin_whitelist_impl.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_origin_whitelist.h" #include "cef_context.h" #include "cef_thread.h" diff --git a/libcef/request_impl.h b/libcef/request_impl.h index 410d41723..36ddeedec 100644 --- a/libcef/request_impl.h +++ b/libcef/request_impl.h @@ -5,7 +5,7 @@ #ifndef _REQUEST_IMPL_H #define _REQUEST_IMPL_H -#include "include/cef.h" +#include "include/cef_request.h" #include "net/base/upload_data.h" #include "net/http/http_request_headers.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPBody.h" diff --git a/libcef/response_impl.cc b/libcef/response_impl.cc index dd8909c5c..300062e03 100644 --- a/libcef/response_impl.cc +++ b/libcef/response_impl.cc @@ -2,7 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" #include "response_impl.h" #include "http_header_utils.h" diff --git a/libcef/response_impl.h b/libcef/response_impl.h index 8f83d7b9a..bd16e91b2 100644 --- a/libcef/response_impl.h +++ b/libcef/response_impl.h @@ -5,7 +5,7 @@ #ifndef _RESPONSE_IMPL_H #define _RESPONSE_IMPL_H -#include "include/cef.h" +#include "include/cef_response.h" namespace net { class HttpResponseHeaders; diff --git a/libcef/scheme_impl.cc b/libcef/scheme_impl.cc index 66aadbd13..019cefd87 100644 --- a/libcef/scheme_impl.cc +++ b/libcef/scheme_impl.cc @@ -3,7 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_browser.h" +#include "include/cef_scheme.h" #include "browser_devtools_scheme_handler.h" #include "browser_resource_loader_bridge.h" #include "cef_context.h" diff --git a/libcef/storage_impl.cc b/libcef/storage_impl.cc new file mode 100644 index 000000000..95345d5e2 --- /dev/null +++ b/libcef/storage_impl.cc @@ -0,0 +1,310 @@ +// 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. + +#include "include/cef_storage.h" +#include "cef_context.h" +#include "cef_thread.h" +#include "dom_storage_common.h" +#include "dom_storage_namespace.h" +#include "dom_storage_area.h" + +namespace { + +void UIT_VisitStorage(int64 namespace_id, const CefString& origin, + const CefString& key, + CefRefPtr visitor) +{ + REQUIRE_UIT(); + + DOMStorageContext* context = _Context->storage_context(); + + // Allow storage to be allocated for localStorage so that on-disk data, if + // any, will be available. + bool allocation_allowed = (namespace_id == kLocalStorageNamespaceId); + + DOMStorageNamespace* ns = + context->GetStorageNamespace(namespace_id, allocation_allowed); + if (!ns) + return; + + typedef std::vector AreaList; + AreaList areas; + + if (!origin.empty()) { + // Visit only the area with the specified origin. + DOMStorageArea* area = ns->GetStorageArea(origin, allocation_allowed); + if (area) + areas.push_back(area); + } else { + // Visit all areas. + ns->GetStorageAreas(areas, true); + } + + if (areas.empty()) + return; + + // Count the total number of matching keys. + unsigned int total = 0; + { + NullableString16 value; + AreaList::iterator it = areas.begin(); + for (; it != areas.end(); ) { + DOMStorageArea* area = (*it); + if (!key.empty()) { + value = area->GetItem(key); + if (value.is_null()) { + it = areas.erase(it); + // Don't increment the iterator. + continue; + } else { + total++; + } + } else { + total += area->Length(); + } + ++it; + } + } + + if (total == 0) + return; + + DOMStorageArea* area; + bool stop = false, deleteData; + unsigned int count = 0, i, len; + NullableString16 keyVal, valueVal; + string16 keyStr, valueStr; + typedef std::vector String16List; + String16List delete_keys; + + // Visit all matching pairs. + AreaList::iterator it = areas.begin(); + for (; it != areas.end() && !stop; ++it) { + // Each area. + area = *(it); + if (!key.empty()) { + // Visit only the matching key. + valueVal = area->GetItem(key); + if (valueVal.is_null()) + valueStr.clear(); + else + valueStr = valueVal.string(); + + deleteData = false; + stop = !visitor->Visit(static_cast(namespace_id), + area->origin(), key, valueStr, count, total, deleteData); + if (deleteData) + area->RemoveItem(key); + count++; + } else { + // Visit all keys. + len = area->Length(); + for(i = 0; i < len && !stop; ++i) { + keyVal = area->Key(i); + if (keyVal.is_null()) { + keyStr.clear(); + valueStr.clear(); + } else { + keyStr = keyVal.string(); + valueVal = area->GetItem(keyStr); + if (valueVal.is_null()) + valueStr.clear(); + else + valueStr = valueVal.string(); + } + + deleteData = false; + stop = !visitor->Visit(static_cast(namespace_id), + area->origin(), keyStr, valueStr, count, total, deleteData); + if (deleteData) + delete_keys.push_back(keyStr); + count++; + } + + // Delete the requested keys. + if (!delete_keys.empty()) { + String16List::const_iterator it = delete_keys.begin(); + for (; it != delete_keys.end(); ++it) + area->RemoveItem(*it); + delete_keys.clear(); + } + } + } +} + +void UIT_SetStoragePath(int64 namespace_id, const CefString& path) +{ + REQUIRE_UIT(); + + if (namespace_id != kLocalStorageNamespaceId) + return; + + FilePath file_path; + if (!path.empty()) + file_path = FilePath(path); + + DOMStorageContext* context = _Context->storage_context(); + DCHECK(context); + if (context) + context->SetLocalStoragePath(file_path); +} + +} // anonymous + +bool CefVisitStorage(CefStorageType type, const CefString& origin, + const CefString& key, + CefRefPtr visitor) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + int64 namespace_id; + if (type == ST_LOCALSTORAGE) { + namespace_id = kLocalStorageNamespaceId; + } else if(type == ST_SESSIONSTORAGE) { + namespace_id = kLocalStorageNamespaceId + 1; + } else { + NOTREACHED() << "invalid type"; + return false; + } + + if (CefThread::CurrentlyOn(CefThread::UI)) { + UIT_VisitStorage(namespace_id, origin, key, visitor); + } else { + CefThread::PostTask(CefThread::UI, FROM_HERE, + base::Bind(&UIT_VisitStorage, namespace_id, origin, key, visitor)); + } + + return true; +} + +bool CefSetStorage(CefStorageType type, const CefString& origin, + const CefString& key, const CefString& value) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + // Verify that this function is being called on the UI thread. + if (!CefThread::CurrentlyOn(CefThread::UI)) { + NOTREACHED() << "called on invalid thread"; + return false; + } + + int64 namespace_id; + if (type == ST_LOCALSTORAGE) { + namespace_id = kLocalStorageNamespaceId; + } else if(type == ST_SESSIONSTORAGE) { + namespace_id = kLocalStorageNamespaceId + 1; + } else { + NOTREACHED() << "invalid type"; + return false; + } + + if (origin.empty()) { + NOTREACHED() << "invalid origin"; + return false; + } + + DOMStorageArea* area = + _Context->storage_context()->GetStorageArea(namespace_id, origin, true); + if (!area) + return false; + + WebKit::WebStorageArea::Result result; + area->SetItem(key, value, &result); + return (result == WebKit::WebStorageArea::ResultOK); +} + +bool CefDeleteStorage(CefStorageType type, const CefString& origin, + const CefString& key) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + // Verify that this function is being called on the UI thread. + if (!CefThread::CurrentlyOn(CefThread::UI)) { + NOTREACHED() << "called on invalid thread"; + return false; + } + + int64 namespace_id; + if (type == ST_LOCALSTORAGE) { + namespace_id = kLocalStorageNamespaceId; + } else if(type == ST_SESSIONSTORAGE) { + namespace_id = kLocalStorageNamespaceId + 1; + } else { + NOTREACHED() << "invalid type"; + return false; + } + + DOMStorageContext* context = _Context->storage_context(); + + // Allow storage to be allocated for localStorage so that on-disk data, if + // any, will be available. + bool allocation_allowed = (namespace_id == kLocalStorageNamespaceId); + + if (origin.empty()) { + // Delete all storage for the namespace. + if (namespace_id == kLocalStorageNamespaceId) + context->DeleteAllLocalStorageFiles(); + else + context->PurgeMemory(namespace_id); + } else if(key.empty()) { + // Clear the storage area for the specified origin. + if (namespace_id == kLocalStorageNamespaceId) { + context->DeleteLocalStorageForOrigin(origin); + } else { + DOMStorageArea* area = + context->GetStorageArea(namespace_id, origin, allocation_allowed); + if (area) { + // Calling Clear() is necessary to remove the data from the namespace. + area->Clear(); + area->PurgeMemory(); + } + } + } else { + // Delete the specified key. + DOMStorageArea* area = + context->GetStorageArea(namespace_id, origin, allocation_allowed); + if (area) + area->RemoveItem(key); + } + + return true; +} + +bool CefSetStoragePath(CefStorageType type, const CefString& path) +{ + // Verify that the context is in a valid state. + if (!CONTEXT_STATE_VALID()) { + NOTREACHED() << "context not valid"; + return false; + } + + int64 namespace_id; + if (type == ST_LOCALSTORAGE) { + namespace_id = kLocalStorageNamespaceId; + } else { + NOTREACHED() << "invalid type"; + return false; + } + + if (CefThread::CurrentlyOn(CefThread::UI)) { + UIT_SetStoragePath(namespace_id, path); + } else { + CefThread::PostTask(CefThread::UI, FROM_HERE, + base::Bind(&UIT_SetStoragePath, namespace_id, path)); + } + + return true; +} diff --git a/libcef/stream_impl.h b/libcef/stream_impl.h index 90d310b60..daa9b8c64 100644 --- a/libcef/stream_impl.h +++ b/libcef/stream_impl.h @@ -5,7 +5,7 @@ #ifndef _STREAM_IMPL_H #define _STREAM_IMPL_H -#include "../include/cef.h" +#include "include/cef_stream.h" #include // Implementation of CefStreamReader for files. diff --git a/libcef/task_impl.cc b/libcef/task_impl.cc new file mode 100644 index 000000000..aed9f8040 --- /dev/null +++ b/libcef/task_impl.cc @@ -0,0 +1,63 @@ +// 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. + +#include "include/cef_task.h" +#include "cef_thread.h" + +namespace { + +int GetThreadId(CefThreadId threadId) +{ + switch(threadId) { + case TID_UI: return CefThread::UI; + case TID_IO: return CefThread::IO; + case TID_FILE: return CefThread::FILE; + }; + NOTREACHED(); + return -1; +} + +} // anonymous + +bool CefCurrentlyOn(CefThreadId threadId) +{ + int id = GetThreadId(threadId); + if(id < 0) + return false; + + return CefThread::CurrentlyOn(static_cast(id)); +} + +class CefTaskHelper : public Task +{ +public: + CefTaskHelper(CefRefPtr task, CefThreadId threadId) + : task_(task), thread_id_(threadId) {} + virtual void Run() { task_->Execute(thread_id_); } +private: + CefRefPtr task_; + CefThreadId thread_id_; + DISALLOW_COPY_AND_ASSIGN(CefTaskHelper); +}; + +bool CefPostTask(CefThreadId threadId, CefRefPtr task) +{ + int id = GetThreadId(threadId); + if(id < 0) + return false; + + return CefThread::PostTask(static_cast(id), FROM_HERE, + new CefTaskHelper(task, threadId)); +} + +bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, + long delay_ms) +{ + int id = GetThreadId(threadId); + if(id < 0) + return false; + + return CefThread::PostDelayedTask(static_cast(id), FROM_HERE, + new CefTaskHelper(task, threadId), delay_ms); +} diff --git a/libcef/tracker.h b/libcef/tracker.h index 61467b15e..ad52b9f18 100644 --- a/libcef/tracker.h +++ b/libcef/tracker.h @@ -5,7 +5,7 @@ #ifndef _TRACKER_H #define _TRACKER_H -#include "include/cef.h" +#include "include/cef_base.h" // Class extended by objects that must be tracked. After creating a tracked // object you should add it to the appropriate track manager. diff --git a/libcef/url_impl.cc b/libcef/url_impl.cc new file mode 100644 index 000000000..d1a8af10a --- /dev/null +++ b/libcef/url_impl.cc @@ -0,0 +1,71 @@ +// 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. + +#include "include/cef_url.h" + +#include "googleurl/src/gurl.h" +#include + +bool CefParseURL(const CefString& url, + CefURLParts& parts) +{ + GURL gurl(url.ToString()); + if (!gurl.is_valid()) + return false; + + CefString(&parts.spec).FromString(gurl.spec()); + CefString(&parts.scheme).FromString(gurl.scheme()); + CefString(&parts.username).FromString(gurl.username()); + CefString(&parts.password).FromString(gurl.password()); + CefString(&parts.host).FromString(gurl.host()); + CefString(&parts.port).FromString(gurl.port()); + CefString(&parts.path).FromString(gurl.path()); + CefString(&parts.query).FromString(gurl.query()); + + return true; +} + +bool CefCreateURL(const CefURLParts& parts, + CefString& url) +{ + std::string spec = CefString(parts.spec.str, parts.spec.length, false); + std::string scheme = CefString(parts.scheme.str, parts.scheme.length, false); + std::string username = + CefString(parts.username.str, parts.username.length, false); + std::string password = + CefString(parts.password.str, parts.password.length, false); + std::string host = CefString(parts.host.str, parts.host.length, false); + std::string port = CefString(parts.port.str, parts.port.length, false); + std::string path = CefString(parts.path.str, parts.path.length, false); + std::string query = CefString(parts.query.str, parts.query.length, false); + + GURL gurl; + if (!spec.empty()) { + gurl = GURL(spec); + } else if (!scheme.empty() && !host.empty()) { + std::stringstream ss; + ss << scheme << "://"; + if (!username.empty()) { + ss << username; + if (!password.empty()) + ss << ":" << password; + ss << "@"; + } + ss << host; + if (!port.empty()) + ss << ":" << port; + if (!path.empty()) + ss << path; + if (!query.empty()) + ss << "?" << query; + gurl = GURL(ss.str()); + } + + if (gurl.is_valid()) { + url = gurl.spec(); + return true; + } + + return false; +} diff --git a/libcef/v8_impl.h b/libcef/v8_impl.h index 4eec22753..b28535698 100644 --- a/libcef/v8_impl.h +++ b/libcef/v8_impl.h @@ -5,7 +5,7 @@ #ifndef _V8_IMPL_H #define _V8_IMPL_H -#include "include/cef.h" +#include "include/cef_v8.h" #include "v8/include/v8.h" class CefTrackObject; diff --git a/libcef/web_urlrequest_impl.cc b/libcef/web_urlrequest_impl.cc index fec660a7c..ede5c7013 100644 --- a/libcef/web_urlrequest_impl.cc +++ b/libcef/web_urlrequest_impl.cc @@ -2,7 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" #include "web_urlrequest_impl.h" #include "browser_webkit_init.h" #include "cef_thread.h" diff --git a/libcef/web_urlrequest_impl.h b/libcef/web_urlrequest_impl.h index bcf5a857a..747340d79 100644 --- a/libcef/web_urlrequest_impl.h +++ b/libcef/web_urlrequest_impl.h @@ -5,7 +5,7 @@ #ifndef _WEB_URL_REQUEST_CLIENT_IMPL_H #define _WEB_URL_REQUEST_CLIENT_IMPL_H -#include "include/cef.h" +#include "include/cef_web_urlrequest.h" #include "base/memory/ref_counted.h" class CefWebURLRequestImpl : public CefWebURLRequest diff --git a/libcef/xml_reader_impl.cc b/libcef/xml_reader_impl.cc index 0215b58d8..f0fecc418 100644 --- a/libcef/xml_reader_impl.cc +++ b/libcef/xml_reader_impl.cc @@ -3,6 +3,7 @@ // can be found in the LICENSE file. #include "xml_reader_impl.h" +#include "include/cef_stream.h" #include "base/logging.h" // Static functions diff --git a/libcef/xml_reader_impl.h b/libcef/xml_reader_impl.h index 1de73375a..a0523a922 100644 --- a/libcef/xml_reader_impl.h +++ b/libcef/xml_reader_impl.h @@ -5,7 +5,7 @@ #ifndef _XML_READER_IMPL_H #define _XML_READER_IMPL_H -#include "../include/cef.h" +#include "include/cef_xml_reader.h" #include "base/threading/platform_thread.h" #include #include diff --git a/libcef/zip_reader_impl.cc b/libcef/zip_reader_impl.cc index 872de891e..423ae52e3 100644 --- a/libcef/zip_reader_impl.cc +++ b/libcef/zip_reader_impl.cc @@ -3,6 +3,7 @@ // can be found in the LICENSE file. #include "zip_reader_impl.h" +#include "include/cef_stream.h" #include "base/logging.h" #include diff --git a/libcef/zip_reader_impl.h b/libcef/zip_reader_impl.h index 4e022ad65..a48fb5d2b 100644 --- a/libcef/zip_reader_impl.h +++ b/libcef/zip_reader_impl.h @@ -5,7 +5,7 @@ #ifndef _ZIP_READER_IMPL_H #define _ZIP_READER_IMPL_H -#include "../include/cef.h" +#include "include/cef_zip_reader.h" #include "base/threading/platform_thread.h" #include "third_party/zlib/contrib/minizip/unzip.h" #include diff --git a/libcef_dll/cpptoc/app_cpptoc.cc b/libcef_dll/cpptoc/app_cpptoc.cc index d9ba6e693..b7c58ef63 100644 --- a/libcef_dll/cpptoc/app_cpptoc.cc +++ b/libcef_dll/cpptoc/app_cpptoc.cc @@ -16,7 +16,8 @@ // MEMBER FUNCTIONS - Body may be edited by hand. -cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler(struct _cef_app_t* self) +struct _cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler( + struct _cef_app_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -33,7 +34,6 @@ cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler(struct _cef_app_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefAppCppToC::CefAppCppToC(CefApp* cls) diff --git a/libcef_dll/cpptoc/app_cpptoc.h b/libcef_dll/cpptoc/app_cpptoc.h index 3d24fb955..b39acacf1 100644 --- a/libcef_dll/cpptoc/app_cpptoc.h +++ b/libcef_dll/cpptoc/app_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_app.h" +#include "include/capi/cef_app_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/base_cpptoc.h b/libcef_dll/cpptoc/base_cpptoc.h index 2206eeeaa..7de6140f9 100644 --- a/libcef_dll/cpptoc/base_cpptoc.h +++ b/libcef_dll/cpptoc/base_cpptoc.h @@ -5,8 +5,8 @@ #ifndef _BASE_CPPTOC_H #define _BASE_CPPTOC_H -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" #include "libcef_dll/cef_logging.h" diff --git a/libcef_dll/cpptoc/browser_cpptoc.cc b/libcef_dll/cpptoc/browser_cpptoc.cc index ab3b748db..6b32f95da 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_cpptoc.cc @@ -62,7 +62,6 @@ CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo, return _retval; } - CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo, struct _cef_client_t* client, const cef_string_t* url, const struct _cef_browser_settings_t* settings) @@ -108,7 +107,6 @@ CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo, } - // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK browser_parent_window_will_close(struct _cef_browser_t* self) @@ -123,7 +121,6 @@ void CEF_CALLBACK browser_parent_window_will_close(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ParentWindowWillClose(); } - void CEF_CALLBACK browser_close_browser(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -136,7 +133,6 @@ void CEF_CALLBACK browser_close_browser(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->CloseBrowser(); } - int CEF_CALLBACK browser_can_go_back(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -152,7 +148,6 @@ int CEF_CALLBACK browser_can_go_back(struct _cef_browser_t* self) return _retval; } - void CEF_CALLBACK browser_go_back(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -165,7 +160,6 @@ void CEF_CALLBACK browser_go_back(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->GoBack(); } - int CEF_CALLBACK browser_can_go_forward(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -181,7 +175,6 @@ int CEF_CALLBACK browser_can_go_forward(struct _cef_browser_t* self) return _retval; } - void CEF_CALLBACK browser_go_forward(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -194,7 +187,6 @@ void CEF_CALLBACK browser_go_forward(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->GoForward(); } - void CEF_CALLBACK browser_reload(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -207,7 +199,6 @@ void CEF_CALLBACK browser_reload(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->Reload(); } - void CEF_CALLBACK browser_reload_ignore_cache(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -220,7 +211,6 @@ void CEF_CALLBACK browser_reload_ignore_cache(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ReloadIgnoreCache(); } - void CEF_CALLBACK browser_stop_load(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -233,7 +223,6 @@ void CEF_CALLBACK browser_stop_load(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->StopLoad(); } - void CEF_CALLBACK browser_set_focus(struct _cef_browser_t* self, int enable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -247,7 +236,6 @@ void CEF_CALLBACK browser_set_focus(struct _cef_browser_t* self, int enable) enable?true:false); } - cef_window_handle_t CEF_CALLBACK browser_get_window_handle( struct _cef_browser_t* self) { @@ -264,7 +252,6 @@ cef_window_handle_t CEF_CALLBACK browser_get_window_handle( return _retval; } - cef_window_handle_t CEF_CALLBACK browser_get_opener_window_handle( struct _cef_browser_t* self) { @@ -282,7 +269,6 @@ cef_window_handle_t CEF_CALLBACK browser_get_opener_window_handle( return _retval; } - int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -298,7 +284,6 @@ int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) return _retval; } - int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -314,7 +299,6 @@ int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) return _retval; } - struct _cef_client_t* CEF_CALLBACK browser_get_client( struct _cef_browser_t* self) { @@ -331,7 +315,6 @@ struct _cef_client_t* CEF_CALLBACK browser_get_client( return CefClientCToCpp::Unwrap(_retval); } - struct _cef_frame_t* CEF_CALLBACK browser_get_main_frame( struct _cef_browser_t* self) { @@ -348,7 +331,6 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_main_frame( return CefFrameCppToC::Wrap(_retval); } - struct _cef_frame_t* CEF_CALLBACK browser_get_focused_frame( struct _cef_browser_t* self) { @@ -365,7 +347,6 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_focused_frame( return CefFrameCppToC::Wrap(_retval); } - struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, const cef_string_t* name) { @@ -387,7 +368,6 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, return CefFrameCppToC::Wrap(_retval); } - void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, cef_string_list_t names) { @@ -414,7 +394,6 @@ void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, transfer_string_list_contents(namesList, names); } - void CEF_CALLBACK browser_find(struct _cef_browser_t* self, int identifier, const cef_string_t* searchText, int forward, int matchCase, int findNext) { @@ -437,7 +416,6 @@ void CEF_CALLBACK browser_find(struct _cef_browser_t* self, int identifier, findNext?true:false); } - void CEF_CALLBACK browser_stop_finding(struct _cef_browser_t* self, int clearSelection) { @@ -452,7 +430,6 @@ void CEF_CALLBACK browser_stop_finding(struct _cef_browser_t* self, clearSelection?true:false); } - double CEF_CALLBACK browser_get_zoom_level(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -468,7 +445,6 @@ double CEF_CALLBACK browser_get_zoom_level(struct _cef_browser_t* self) return _retval; } - void CEF_CALLBACK browser_set_zoom_level(struct _cef_browser_t* self, double zoomLevel) { @@ -483,7 +459,6 @@ void CEF_CALLBACK browser_set_zoom_level(struct _cef_browser_t* self, zoomLevel); } - void CEF_CALLBACK browser_clear_history(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -496,7 +471,6 @@ void CEF_CALLBACK browser_clear_history(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ClearHistory(); } - void CEF_CALLBACK browser_show_dev_tools(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -509,7 +483,6 @@ void CEF_CALLBACK browser_show_dev_tools(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ShowDevTools(); } - void CEF_CALLBACK browser_close_dev_tools(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -522,7 +495,6 @@ void CEF_CALLBACK browser_close_dev_tools(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->CloseDevTools(); } - int CEF_CALLBACK browser_is_window_rendering_disabled( struct _cef_browser_t* self) { @@ -539,7 +511,6 @@ int CEF_CALLBACK browser_is_window_rendering_disabled( return _retval; } - int CEF_CALLBACK browser_get_size(struct _cef_browser_t* self, enum cef_paint_element_type_t type, int* width, int* height) { @@ -579,7 +550,6 @@ int CEF_CALLBACK browser_get_size(struct _cef_browser_t* self, return _retval; } - void CEF_CALLBACK browser_set_size(struct _cef_browser_t* self, enum cef_paint_element_type_t type, int width, int height) { @@ -596,7 +566,6 @@ void CEF_CALLBACK browser_set_size(struct _cef_browser_t* self, height); } - int CEF_CALLBACK browser_is_popup_visible(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -612,7 +581,6 @@ int CEF_CALLBACK browser_is_popup_visible(struct _cef_browser_t* self) return _retval; } - void CEF_CALLBACK browser_hide_popup(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -625,7 +593,6 @@ void CEF_CALLBACK browser_hide_popup(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->HidePopup(); } - void CEF_CALLBACK browser_invalidate(struct _cef_browser_t* self, const cef_rect_t* dirtyRect) { @@ -647,7 +614,6 @@ void CEF_CALLBACK browser_invalidate(struct _cef_browser_t* self, dirtyRectVal); } - int CEF_CALLBACK browser_get_image(struct _cef_browser_t* self, enum cef_paint_element_type_t type, int width, int height, void* buffer) { @@ -672,7 +638,6 @@ int CEF_CALLBACK browser_get_image(struct _cef_browser_t* self, return _retval; } - void CEF_CALLBACK browser_send_key_event(struct _cef_browser_t* self, enum cef_key_type_t type, int key, int modifiers, int sysChar, int imeChar) @@ -692,7 +657,6 @@ void CEF_CALLBACK browser_send_key_event(struct _cef_browser_t* self, imeChar?true:false); } - void CEF_CALLBACK browser_send_mouse_click_event(struct _cef_browser_t* self, int x, int y, enum cef_mouse_button_type_t type, int mouseUp, int clickCount) @@ -712,7 +676,6 @@ void CEF_CALLBACK browser_send_mouse_click_event(struct _cef_browser_t* self, clickCount); } - void CEF_CALLBACK browser_send_mouse_move_event(struct _cef_browser_t* self, int x, int y, int mouseLeave) { @@ -729,7 +692,6 @@ void CEF_CALLBACK browser_send_mouse_move_event(struct _cef_browser_t* self, mouseLeave?true:false); } - void CEF_CALLBACK browser_send_mouse_wheel_event(struct _cef_browser_t* self, int x, int y, int delta) { @@ -746,7 +708,6 @@ void CEF_CALLBACK browser_send_mouse_wheel_event(struct _cef_browser_t* self, delta); } - void CEF_CALLBACK browser_send_focus_event(struct _cef_browser_t* self, int setFocus) { @@ -761,7 +722,6 @@ void CEF_CALLBACK browser_send_focus_event(struct _cef_browser_t* self, setFocus?true:false); } - void CEF_CALLBACK browser_send_capture_lost_event(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -775,7 +735,6 @@ void CEF_CALLBACK browser_send_capture_lost_event(struct _cef_browser_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefBrowserCppToC::CefBrowserCppToC(CefBrowser* cls) diff --git a/libcef_dll/cpptoc/browser_cpptoc.h b/libcef_dll/cpptoc/browser_cpptoc.h index 2c226d16a..ec058581d 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.h +++ b/libcef_dll/cpptoc/browser_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/client_cpptoc.cc b/libcef_dll/cpptoc/client_cpptoc.cc index e1f217a44..b7560bd05 100644 --- a/libcef_dll/cpptoc/client_cpptoc.cc +++ b/libcef_dll/cpptoc/client_cpptoc.cc @@ -28,7 +28,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. -cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( +struct _cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,8 +45,7 @@ cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( return CefLifeSpanHandlerCppToC::Wrap(_retval); } - -cef_load_handler_t* CEF_CALLBACK client_get_load_handler( +struct _cef_load_handler_t* CEF_CALLBACK client_get_load_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -63,8 +62,7 @@ cef_load_handler_t* CEF_CALLBACK client_get_load_handler( return CefLoadHandlerCppToC::Wrap(_retval); } - -cef_request_handler_t* CEF_CALLBACK client_get_request_handler( +struct _cef_request_handler_t* CEF_CALLBACK client_get_request_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -81,8 +79,7 @@ cef_request_handler_t* CEF_CALLBACK client_get_request_handler( return CefRequestHandlerCppToC::Wrap(_retval); } - -cef_display_handler_t* CEF_CALLBACK client_get_display_handler( +struct _cef_display_handler_t* CEF_CALLBACK client_get_display_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -99,8 +96,7 @@ cef_display_handler_t* CEF_CALLBACK client_get_display_handler( return CefDisplayHandlerCppToC::Wrap(_retval); } - -cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( +struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -117,8 +113,7 @@ cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( return CefFocusHandlerCppToC::Wrap(_retval); } - -cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( +struct _cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -135,8 +130,7 @@ cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( return CefKeyboardHandlerCppToC::Wrap(_retval); } - -cef_menu_handler_t* CEF_CALLBACK client_get_menu_handler( +struct _cef_menu_handler_t* CEF_CALLBACK client_get_menu_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -153,8 +147,7 @@ cef_menu_handler_t* CEF_CALLBACK client_get_menu_handler( return CefMenuHandlerCppToC::Wrap(_retval); } - -cef_print_handler_t* CEF_CALLBACK client_get_print_handler( +struct _cef_print_handler_t* CEF_CALLBACK client_get_print_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -171,8 +164,7 @@ cef_print_handler_t* CEF_CALLBACK client_get_print_handler( return CefPrintHandlerCppToC::Wrap(_retval); } - -cef_find_handler_t* CEF_CALLBACK client_get_find_handler( +struct _cef_find_handler_t* CEF_CALLBACK client_get_find_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -189,8 +181,7 @@ cef_find_handler_t* CEF_CALLBACK client_get_find_handler( return CefFindHandlerCppToC::Wrap(_retval); } - -cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( +struct _cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -207,8 +198,7 @@ cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( return CefJSDialogHandlerCppToC::Wrap(_retval); } - -cef_v8context_handler_t* CEF_CALLBACK client_get_v8context_handler( +struct _cef_v8context_handler_t* CEF_CALLBACK client_get_v8context_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -225,8 +215,7 @@ cef_v8context_handler_t* CEF_CALLBACK client_get_v8context_handler( return CefV8ContextHandlerCppToC::Wrap(_retval); } - -cef_render_handler_t* CEF_CALLBACK client_get_render_handler( +struct _cef_render_handler_t* CEF_CALLBACK client_get_render_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -243,8 +232,7 @@ cef_render_handler_t* CEF_CALLBACK client_get_render_handler( return CefRenderHandlerCppToC::Wrap(_retval); } - -cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( +struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -262,7 +250,6 @@ cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( } - // CONSTRUCTOR - Do not edit by hand. CefClientCppToC::CefClientCppToC(CefClient* cls) diff --git a/libcef_dll/cpptoc/client_cpptoc.h b/libcef_dll/cpptoc/client_cpptoc.h index c04d5d5b7..4067b24c4 100644 --- a/libcef_dll/cpptoc/client_cpptoc.h +++ b/libcef_dll/cpptoc/client_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/command_line_cpptoc.cc b/libcef_dll/cpptoc/command_line_cpptoc.cc index b27ff6385..2056b0def 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.cc +++ b/libcef_dll/cpptoc/command_line_cpptoc.cc @@ -28,7 +28,6 @@ CEF_EXPORT cef_command_line_t* cef_command_line_create() } - // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK command_line_init_from_argv(struct _cef_command_line_t* self, @@ -50,7 +49,6 @@ void CEF_CALLBACK command_line_init_from_argv(struct _cef_command_line_t* self, argv); } - void CEF_CALLBACK command_line_init_from_string( struct _cef_command_line_t* self, const cef_string_t* command_line) { @@ -69,7 +67,6 @@ void CEF_CALLBACK command_line_init_from_string( CefString(command_line)); } - cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string( struct _cef_command_line_t* self) { @@ -86,7 +83,6 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK command_line_get_program( struct _cef_command_line_t* self) { @@ -103,7 +99,6 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_program( return _retval.DetachToUserFree(); } - void CEF_CALLBACK command_line_set_program(struct _cef_command_line_t* self, const cef_string_t* program) { @@ -122,7 +117,6 @@ void CEF_CALLBACK command_line_set_program(struct _cef_command_line_t* self, CefString(program)); } - int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -138,7 +132,6 @@ int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) return _retval; } - int CEF_CALLBACK command_line_has_switch(struct _cef_command_line_t* self, const cef_string_t* name) { @@ -160,7 +153,6 @@ int CEF_CALLBACK command_line_has_switch(struct _cef_command_line_t* self, return _retval; } - cef_string_userfree_t CEF_CALLBACK command_line_get_switch_value( struct _cef_command_line_t* self, const cef_string_t* name) { @@ -182,7 +174,6 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_switch_value( return _retval.DetachToUserFree(); } - void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, cef_string_map_t switches) { @@ -209,7 +200,6 @@ void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, transfer_string_map_contents(switchesMap, switches); } - void CEF_CALLBACK command_line_append_switch(struct _cef_command_line_t* self, const cef_string_t* name) { @@ -228,7 +218,6 @@ void CEF_CALLBACK command_line_append_switch(struct _cef_command_line_t* self, CefString(name)); } - void CEF_CALLBACK command_line_append_switch_with_value( struct _cef_command_line_t* self, const cef_string_t* name, const cef_string_t* value) @@ -253,7 +242,6 @@ void CEF_CALLBACK command_line_append_switch_with_value( CefString(value)); } - int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -269,7 +257,6 @@ int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) return _retval; } - void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, cef_string_list_t arguments) { @@ -296,7 +283,6 @@ void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, transfer_string_list_contents(argumentsList, arguments); } - void CEF_CALLBACK command_line_append_argument(struct _cef_command_line_t* self, const cef_string_t* argument) { @@ -316,7 +302,6 @@ void CEF_CALLBACK command_line_append_argument(struct _cef_command_line_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefCommandLineCppToC::CefCommandLineCppToC(CefCommandLine* cls) diff --git a/libcef_dll/cpptoc/command_line_cpptoc.h b/libcef_dll/cpptoc/command_line_cpptoc.h index 38b863303..6d8088595 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.h +++ b/libcef_dll/cpptoc/command_line_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_command_line.h" +#include "include/capi/cef_command_line_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/content_filter_cpptoc.cc b/libcef_dll/cpptoc/content_filter_cpptoc.cc index 5fd8db816..da2b03d86 100644 --- a/libcef_dll/cpptoc/content_filter_cpptoc.cc +++ b/libcef_dll/cpptoc/content_filter_cpptoc.cc @@ -18,7 +18,7 @@ void CEF_CALLBACK content_filter_process_data( struct _cef_content_filter_t* self, const void* data, int data_size, - cef_stream_reader_t** substitute_data) + struct _cef_stream_reader_t** substitute_data) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -58,9 +58,8 @@ void CEF_CALLBACK content_filter_process_data( } } - void CEF_CALLBACK content_filter_drain(struct _cef_content_filter_t* self, - cef_stream_reader_t** remainder) + struct _cef_stream_reader_t** remainder) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -95,7 +94,6 @@ void CEF_CALLBACK content_filter_drain(struct _cef_content_filter_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefContentFilterCppToC::CefContentFilterCppToC(CefContentFilter* cls) diff --git a/libcef_dll/cpptoc/content_filter_cpptoc.h b/libcef_dll/cpptoc/content_filter_cpptoc.h index 6f4582a34..91c391b67 100644 --- a/libcef_dll/cpptoc/content_filter_cpptoc.h +++ b/libcef_dll/cpptoc/content_filter_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_content_filter.h" +#include "include/capi/cef_content_filter_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc index 3de5d482c..8e4c52890 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc @@ -56,7 +56,6 @@ int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefCookieVisitorCppToC::CefCookieVisitorCppToC(CefCookieVisitor* cls) diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h index e92f7b513..99e60154b 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_cookie.h" +#include "include/capi/cef_cookie_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/cpptoc.h b/libcef_dll/cpptoc/cpptoc.h index ce7f8876a..6e4065607 100644 --- a/libcef_dll/cpptoc/cpptoc.h +++ b/libcef_dll/cpptoc/cpptoc.h @@ -5,8 +5,8 @@ #ifndef _CPPTOC_H #define _CPPTOC_H -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" #include "libcef_dll/cef_logging.h" diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.cc b/libcef_dll/cpptoc/display_handler_cpptoc.cc index b385419c3..7847e6227 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/display_handler_cpptoc.cc @@ -38,10 +38,9 @@ void CEF_CALLBACK display_handler_on_nav_state_change( canGoForward?true:false); } - void CEF_CALLBACK display_handler_on_address_change( struct _cef_display_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, const cef_string_t* url) + struct _cef_frame_t* frame, const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -68,10 +67,9 @@ void CEF_CALLBACK display_handler_on_address_change( CefString(url)); } - void CEF_CALLBACK display_handler_on_contents_size_change( struct _cef_display_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, int width, int height) + struct _cef_frame_t* frame, int width, int height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -95,7 +93,6 @@ void CEF_CALLBACK display_handler_on_contents_size_change( height); } - void CEF_CALLBACK display_handler_on_title_change( struct _cef_display_handler_t* self, cef_browser_t* browser, const cef_string_t* title) @@ -117,7 +114,6 @@ void CEF_CALLBACK display_handler_on_title_change( CefString(title)); } - int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, cef_browser_t* browser, cef_string_t* text) { @@ -144,7 +140,6 @@ int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, return _retval; } - void CEF_CALLBACK display_handler_on_status_message( struct _cef_display_handler_t* self, cef_browser_t* browser, const cef_string_t* value, enum cef_handler_statustype_t type) @@ -167,7 +162,6 @@ void CEF_CALLBACK display_handler_on_status_message( type); } - int CEF_CALLBACK display_handler_on_console_message( struct _cef_display_handler_t* self, cef_browser_t* browser, const cef_string_t* message, const cef_string_t* source, int line) @@ -195,7 +189,6 @@ int CEF_CALLBACK display_handler_on_console_message( } - // CONSTRUCTOR - Do not edit by hand. CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls) diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.h b/libcef_dll/cpptoc/display_handler_cpptoc.h index 1dc36ea81..e4b033af9 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.h +++ b/libcef_dll/cpptoc/display_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_display_handler.h" +#include "include/capi/cef_display_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.cc b/libcef_dll/cpptoc/domdocument_cpptoc.cc index 44cf25275..0ed630812 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.cc +++ b/libcef_dll/cpptoc/domdocument_cpptoc.cc @@ -32,7 +32,6 @@ enum cef_dom_document_type_t CEF_CALLBACK domdocument_get_type( return _retval; } - struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document( struct _cef_domdocument_t* self) { @@ -50,7 +49,6 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document( return CefDOMNodeCppToC::Wrap(_retval); } - struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body( struct _cef_domdocument_t* self) { @@ -67,7 +65,6 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body( return CefDOMNodeCppToC::Wrap(_retval); } - struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head( struct _cef_domdocument_t* self) { @@ -84,7 +81,6 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head( return CefDOMNodeCppToC::Wrap(_retval); } - cef_string_userfree_t CEF_CALLBACK domdocument_get_title( struct _cef_domdocument_t* self) { @@ -101,7 +97,6 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_title( return _retval.DetachToUserFree(); } - struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id( struct _cef_domdocument_t* self, const cef_string_t* id) { @@ -124,7 +119,6 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id( return CefDOMNodeCppToC::Wrap(_retval); } - struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node( struct _cef_domdocument_t* self) { @@ -142,7 +136,6 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node( return CefDOMNodeCppToC::Wrap(_retval); } - int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -158,7 +151,6 @@ int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) return _retval; } - struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_start_node( struct _cef_domdocument_t* self) { @@ -176,7 +168,6 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_start_node( return CefDOMNodeCppToC::Wrap(_retval); } - int CEF_CALLBACK domdocument_get_selection_start_offset( struct _cef_domdocument_t* self) { @@ -193,7 +184,6 @@ int CEF_CALLBACK domdocument_get_selection_start_offset( return _retval; } - struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_end_node( struct _cef_domdocument_t* self) { @@ -211,7 +201,6 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_end_node( return CefDOMNodeCppToC::Wrap(_retval); } - int CEF_CALLBACK domdocument_get_selection_end_offset( struct _cef_domdocument_t* self) { @@ -228,7 +217,6 @@ int CEF_CALLBACK domdocument_get_selection_end_offset( return _retval; } - cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup( struct _cef_domdocument_t* self) { @@ -245,7 +233,6 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text( struct _cef_domdocument_t* self) { @@ -262,7 +249,6 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url( struct _cef_domdocument_t* self) { @@ -279,7 +265,6 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( struct _cef_domdocument_t* self, const cef_string_t* partialURL) { @@ -302,7 +287,6 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( } - // CONSTRUCTOR - Do not edit by hand. CefDOMDocumentCppToC::CefDOMDocumentCppToC(CefDOMDocument* cls) diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.h b/libcef_dll/cpptoc/domdocument_cpptoc.h index f2afd490a..ccef3dd5a 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.h +++ b/libcef_dll/cpptoc/domdocument_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/domevent_cpptoc.cc b/libcef_dll/cpptoc/domevent_cpptoc.cc index 237b6e795..90c00d965 100644 --- a/libcef_dll/cpptoc/domevent_cpptoc.cc +++ b/libcef_dll/cpptoc/domevent_cpptoc.cc @@ -33,7 +33,6 @@ cef_string_userfree_t CEF_CALLBACK domevent_get_type( return _retval.DetachToUserFree(); } - enum cef_dom_event_category_t CEF_CALLBACK domevent_get_category( struct _cef_domevent_t* self) { @@ -51,7 +50,6 @@ enum cef_dom_event_category_t CEF_CALLBACK domevent_get_category( return _retval; } - enum cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase( struct _cef_domevent_t* self) { @@ -68,7 +66,6 @@ enum cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase( return _retval; } - int CEF_CALLBACK domevent_can_bubble(struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -84,7 +81,6 @@ int CEF_CALLBACK domevent_can_bubble(struct _cef_domevent_t* self) return _retval; } - int CEF_CALLBACK domevent_can_cancel(struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -100,7 +96,6 @@ int CEF_CALLBACK domevent_can_cancel(struct _cef_domevent_t* self) return _retval; } - cef_domdocument_t* CEF_CALLBACK domevent_get_document( struct _cef_domevent_t* self) { @@ -118,7 +113,6 @@ cef_domdocument_t* CEF_CALLBACK domevent_get_document( return CefDOMDocumentCppToC::Wrap(_retval); } - cef_domnode_t* CEF_CALLBACK domevent_get_target(struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -134,7 +128,6 @@ cef_domnode_t* CEF_CALLBACK domevent_get_target(struct _cef_domevent_t* self) return CefDOMNodeCppToC::Wrap(_retval); } - cef_domnode_t* CEF_CALLBACK domevent_get_current_target( struct _cef_domevent_t* self) { @@ -153,7 +146,6 @@ cef_domnode_t* CEF_CALLBACK domevent_get_current_target( } - // CONSTRUCTOR - Do not edit by hand. CefDOMEventCppToC::CefDOMEventCppToC(CefDOMEvent* cls) diff --git a/libcef_dll/cpptoc/domevent_cpptoc.h b/libcef_dll/cpptoc/domevent_cpptoc.h index 603fc9fa7..65b148427 100644 --- a/libcef_dll/cpptoc/domevent_cpptoc.h +++ b/libcef_dll/cpptoc/domevent_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/domevent_listener_cpptoc.cc b/libcef_dll/cpptoc/domevent_listener_cpptoc.cc index 688f93f6b..887e32f7f 100644 --- a/libcef_dll/cpptoc/domevent_listener_cpptoc.cc +++ b/libcef_dll/cpptoc/domevent_listener_cpptoc.cc @@ -35,7 +35,6 @@ void CEF_CALLBACK domevent_listener_handle_event( } - // CONSTRUCTOR - Do not edit by hand. CefDOMEventListenerCppToC::CefDOMEventListenerCppToC(CefDOMEventListener* cls) diff --git a/libcef_dll/cpptoc/domevent_listener_cpptoc.h b/libcef_dll/cpptoc/domevent_listener_cpptoc.h index 8b6ee09f6..742130a87 100644 --- a/libcef_dll/cpptoc/domevent_listener_cpptoc.h +++ b/libcef_dll/cpptoc/domevent_listener_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/domnode_cpptoc.cc b/libcef_dll/cpptoc/domnode_cpptoc.cc index 3f9771feb..d09e6639c 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.cc +++ b/libcef_dll/cpptoc/domnode_cpptoc.cc @@ -34,7 +34,6 @@ enum cef_dom_node_type_t CEF_CALLBACK domnode_get_type( return _retval; } - int CEF_CALLBACK domnode_is_text(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -50,7 +49,6 @@ int CEF_CALLBACK domnode_is_text(struct _cef_domnode_t* self) return _retval; } - int CEF_CALLBACK domnode_is_element(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -66,7 +64,6 @@ int CEF_CALLBACK domnode_is_element(struct _cef_domnode_t* self) return _retval; } - int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -82,7 +79,6 @@ int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK domnode_get_form_control_element_type( struct _cef_domnode_t* self) { @@ -99,7 +95,6 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_form_control_element_type( return _retval.DetachToUserFree(); } - int CEF_CALLBACK domnode_is_same(struct _cef_domnode_t* self, struct _cef_domnode_t* that) { @@ -121,7 +116,6 @@ int CEF_CALLBACK domnode_is_same(struct _cef_domnode_t* self, return _retval; } - cef_string_userfree_t CEF_CALLBACK domnode_get_name(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -137,7 +131,6 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_name(struct _cef_domnode_t* self) return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK domnode_get_value( struct _cef_domnode_t* self) { @@ -154,7 +147,6 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_value( return _retval.DetachToUserFree(); } - int CEF_CALLBACK domnode_set_value(struct _cef_domnode_t* self, const cef_string_t* value) { @@ -176,7 +168,6 @@ int CEF_CALLBACK domnode_set_value(struct _cef_domnode_t* self, return _retval; } - cef_string_userfree_t CEF_CALLBACK domnode_get_as_markup( struct _cef_domnode_t* self) { @@ -193,7 +184,6 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_as_markup( return _retval.DetachToUserFree(); } - cef_domdocument_t* CEF_CALLBACK domnode_get_document( struct _cef_domnode_t* self) { @@ -211,7 +201,6 @@ cef_domdocument_t* CEF_CALLBACK domnode_get_document( return CefDOMDocumentCppToC::Wrap(_retval); } - struct _cef_domnode_t* CEF_CALLBACK domnode_get_parent( struct _cef_domnode_t* self) { @@ -228,7 +217,6 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_parent( return CefDOMNodeCppToC::Wrap(_retval); } - struct _cef_domnode_t* CEF_CALLBACK domnode_get_previous_sibling( struct _cef_domnode_t* self) { @@ -246,7 +234,6 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_previous_sibling( return CefDOMNodeCppToC::Wrap(_retval); } - struct _cef_domnode_t* CEF_CALLBACK domnode_get_next_sibling( struct _cef_domnode_t* self) { @@ -263,7 +250,6 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_next_sibling( return CefDOMNodeCppToC::Wrap(_retval); } - int CEF_CALLBACK domnode_has_children(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -279,7 +265,6 @@ int CEF_CALLBACK domnode_has_children(struct _cef_domnode_t* self) return _retval; } - struct _cef_domnode_t* CEF_CALLBACK domnode_get_first_child( struct _cef_domnode_t* self) { @@ -296,7 +281,6 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_first_child( return CefDOMNodeCppToC::Wrap(_retval); } - struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child( struct _cef_domnode_t* self) { @@ -313,7 +297,6 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child( return CefDOMNodeCppToC::Wrap(_retval); } - void CEF_CALLBACK domnode_add_event_listener(struct _cef_domnode_t* self, const cef_string_t* eventType, struct _cef_domevent_listener_t* listener, int useCapture) @@ -339,7 +322,6 @@ void CEF_CALLBACK domnode_add_event_listener(struct _cef_domnode_t* self, useCapture?true:false); } - cef_string_userfree_t CEF_CALLBACK domnode_get_element_tag_name( struct _cef_domnode_t* self) { @@ -356,7 +338,6 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_tag_name( return _retval.DetachToUserFree(); } - int CEF_CALLBACK domnode_has_element_attributes(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -372,7 +353,6 @@ int CEF_CALLBACK domnode_has_element_attributes(struct _cef_domnode_t* self) return _retval; } - int CEF_CALLBACK domnode_has_element_attribute(struct _cef_domnode_t* self, const cef_string_t* attrName) { @@ -394,7 +374,6 @@ int CEF_CALLBACK domnode_has_element_attribute(struct _cef_domnode_t* self, return _retval; } - cef_string_userfree_t CEF_CALLBACK domnode_get_element_attribute( struct _cef_domnode_t* self, const cef_string_t* attrName) { @@ -416,7 +395,6 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_attribute( return _retval.DetachToUserFree(); } - void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, cef_string_map_t attrMap) { @@ -443,7 +421,6 @@ void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, transfer_string_map_contents(attrMapMap, attrMap); } - int CEF_CALLBACK domnode_set_element_attribute(struct _cef_domnode_t* self, const cef_string_t* attrName, const cef_string_t* value) { @@ -470,7 +447,6 @@ int CEF_CALLBACK domnode_set_element_attribute(struct _cef_domnode_t* self, return _retval; } - cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( struct _cef_domnode_t* self) { @@ -488,7 +464,6 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( } - // CONSTRUCTOR - Do not edit by hand. CefDOMNodeCppToC::CefDOMNodeCppToC(CefDOMNode* cls) diff --git a/libcef_dll/cpptoc/domnode_cpptoc.h b/libcef_dll/cpptoc/domnode_cpptoc.h index 707f26fa1..8690791fc 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.h +++ b/libcef_dll/cpptoc/domnode_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/libcef_dll/cpptoc/domvisitor_cpptoc.cc index 4133665a0..f1342f795 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.cc +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.cc @@ -35,7 +35,6 @@ void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefDOMVisitorCppToC::CefDOMVisitorCppToC(CefDOMVisitor* cls) diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.h b/libcef_dll/cpptoc/domvisitor_cpptoc.h index 86c937ec0..398826d7c 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.h +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.cc b/libcef_dll/cpptoc/download_handler_cpptoc.cc index 61152dddc..023e508d2 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/download_handler_cpptoc.cc @@ -37,7 +37,6 @@ int CEF_CALLBACK download_handler_received_data( return _retval; } - void CEF_CALLBACK download_handler_complete( struct _cef_download_handler_t* self) { @@ -52,7 +51,6 @@ void CEF_CALLBACK download_handler_complete( } - // CONSTRUCTOR - Do not edit by hand. CefDownloadHandlerCppToC::CefDownloadHandlerCppToC(CefDownloadHandler* cls) diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.h b/libcef_dll/cpptoc/download_handler_cpptoc.h index afb0cde81..c837750e9 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.h +++ b/libcef_dll/cpptoc/download_handler_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_download_handler.h" +#include "include/capi/cef_download_handler_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.cc b/libcef_dll/cpptoc/drag_data_cpptoc.cc index 0db410f3f..107536ea3 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_data_cpptoc.cc @@ -31,7 +31,6 @@ int CEF_CALLBACK drag_data_is_link(struct _cef_drag_data_t* self) return _retval; } - int CEF_CALLBACK drag_data_is_fragment(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -47,7 +46,6 @@ int CEF_CALLBACK drag_data_is_fragment(struct _cef_drag_data_t* self) return _retval; } - int CEF_CALLBACK drag_data_is_file(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -63,7 +61,6 @@ int CEF_CALLBACK drag_data_is_file(struct _cef_drag_data_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK drag_data_get_link_url( struct _cef_drag_data_t* self) { @@ -80,7 +77,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_url( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK drag_data_get_link_title( struct _cef_drag_data_t* self) { @@ -97,7 +93,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_title( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK drag_data_get_link_metadata( struct _cef_drag_data_t* self) { @@ -114,7 +109,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_metadata( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_text( struct _cef_drag_data_t* self) { @@ -131,7 +125,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_text( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_html( struct _cef_drag_data_t* self) { @@ -148,7 +141,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_html( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_base_url( struct _cef_drag_data_t* self) { @@ -165,7 +157,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_base_url( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK drag_data_get_file_extension( struct _cef_drag_data_t* self) { @@ -182,7 +173,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_file_extension( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK drag_data_get_file_name( struct _cef_drag_data_t* self) { @@ -199,7 +189,6 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_file_name( return _retval.DetachToUserFree(); } - int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, cef_string_list_t names) { @@ -230,7 +219,6 @@ int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefDragDataCppToC::CefDragDataCppToC(CefDragData* cls) diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.h b/libcef_dll/cpptoc/drag_data_cpptoc.h index b053eac51..dc9aa5d86 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.h +++ b/libcef_dll/cpptoc/drag_data_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_drag_data.h" +#include "include/capi/cef_drag_data_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/libcef_dll/cpptoc/drag_handler_cpptoc.cc index e36e94ada..af7ce893f 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.cc @@ -18,7 +18,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK drag_handler_on_drag_start(struct _cef_drag_handler_t* self, - cef_browser_t* browser, struct _cef_drag_data_t* dragData, + cef_browser_t* browser, cef_drag_data_t* dragData, enum cef_drag_operations_mask_t mask) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,9 +45,8 @@ int CEF_CALLBACK drag_handler_on_drag_start(struct _cef_drag_handler_t* self, return _retval; } - int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, - cef_browser_t* browser, struct _cef_drag_data_t* dragData, + cef_browser_t* browser, cef_drag_data_t* dragData, enum cef_drag_operations_mask_t mask) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -75,7 +74,6 @@ int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefDragHandlerCppToC::CefDragHandlerCppToC(CefDragHandler* cls) diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.h b/libcef_dll/cpptoc/drag_handler_cpptoc.h index cb42b2439..6a4ef4770 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.h +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_drag_handler.h" +#include "include/capi/cef_drag_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.cc b/libcef_dll/cpptoc/find_handler_cpptoc.cc index 1b562a62a..76c885106 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/find_handler_cpptoc.cc @@ -48,7 +48,6 @@ void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefFindHandlerCppToC::CefFindHandlerCppToC(CefFindHandler* cls) diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.h b/libcef_dll/cpptoc/find_handler_cpptoc.h index 0d5f90601..33f39925c 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.h +++ b/libcef_dll/cpptoc/find_handler_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_find_handler.h" +#include "include/capi/cef_find_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/libcef_dll/cpptoc/focus_handler_cpptoc.cc index 4358486eb..3c7e5517b 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.cc @@ -37,7 +37,6 @@ void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, next?true:false); } - int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, cef_browser_t* browser, enum cef_handler_focus_source_t source) { @@ -60,10 +59,9 @@ int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, return _retval; } - void CEF_CALLBACK focus_handler_on_focused_node_changed( struct _cef_focus_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_domnode_t* node) + struct _cef_frame_t* frame, cef_domnode_t* node) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -84,7 +82,6 @@ void CEF_CALLBACK focus_handler_on_focused_node_changed( } - // CONSTRUCTOR - Do not edit by hand. CefFocusHandlerCppToC::CefFocusHandlerCppToC(CefFocusHandler* cls) diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.h b/libcef_dll/cpptoc/focus_handler_cpptoc.h index 377b3ad6e..e429099ba 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.h +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_focus_handler.h" +#include "include/capi/cef_focus_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/frame_cpptoc.cc b/libcef_dll/cpptoc/frame_cpptoc.cc index 2ddef669e..bd117440e 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.cc +++ b/libcef_dll/cpptoc/frame_cpptoc.cc @@ -32,7 +32,6 @@ void CEF_CALLBACK frame_undo(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Undo(); } - void CEF_CALLBACK frame_redo(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,7 +44,6 @@ void CEF_CALLBACK frame_redo(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Redo(); } - void CEF_CALLBACK frame_cut(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -58,7 +56,6 @@ void CEF_CALLBACK frame_cut(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Cut(); } - void CEF_CALLBACK frame_copy(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -71,7 +68,6 @@ void CEF_CALLBACK frame_copy(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Copy(); } - void CEF_CALLBACK frame_paste(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -84,7 +80,6 @@ void CEF_CALLBACK frame_paste(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Paste(); } - void CEF_CALLBACK frame_del(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -97,7 +92,6 @@ void CEF_CALLBACK frame_del(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Delete(); } - void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -110,7 +104,6 @@ void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->SelectAll(); } - void CEF_CALLBACK frame_print(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -123,7 +116,6 @@ void CEF_CALLBACK frame_print(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Print(); } - void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -136,7 +128,6 @@ void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->ViewSource(); } - cef_string_userfree_t CEF_CALLBACK frame_get_source(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -152,7 +143,6 @@ cef_string_userfree_t CEF_CALLBACK frame_get_source(struct _cef_frame_t* self) return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -168,7 +158,6 @@ cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self) return _retval.DetachToUserFree(); } - void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, struct _cef_request_t* request) { @@ -187,7 +176,6 @@ void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, CefRequestCppToC::Unwrap(request)); } - void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, const cef_string_t* url) { @@ -206,7 +194,6 @@ void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, CefString(url)); } - void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, const cef_string_t* string, const cef_string_t* url) { @@ -230,7 +217,6 @@ void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, CefString(url)); } - void CEF_CALLBACK frame_load_stream(struct _cef_frame_t* self, struct _cef_stream_reader_t* stream, const cef_string_t* url) { @@ -254,7 +240,6 @@ void CEF_CALLBACK frame_load_stream(struct _cef_frame_t* self, CefString(url)); } - void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, const cef_string_t* jsCode, const cef_string_t* scriptUrl, int startLine) { @@ -276,7 +261,6 @@ void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, startLine); } - int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -292,7 +276,6 @@ int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) return _retval; } - int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -308,7 +291,6 @@ int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -324,7 +306,6 @@ cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) return _retval.DetachToUserFree(); } - long long CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -340,7 +321,6 @@ long long CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) return _retval; } - struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -356,7 +336,6 @@ struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) return CefFrameCppToC::Wrap(_retval); } - cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -372,7 +351,6 @@ cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) return _retval.DetachToUserFree(); } - cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -388,9 +366,8 @@ cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) return CefBrowserCppToC::Wrap(_retval); } - void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, - struct _cef_domvisitor_t* visitor) + cef_domvisitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -407,7 +384,6 @@ void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, CefDOMVisitorCToCpp::Wrap(visitor)); } - struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( struct _cef_frame_t* self) { @@ -425,7 +401,6 @@ struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( } - // CONSTRUCTOR - Do not edit by hand. CefFrameCppToC::CefFrameCppToC(CefFrame* cls) diff --git a/libcef_dll/cpptoc/frame_cpptoc.h b/libcef_dll/cpptoc/frame_cpptoc.h index 1992f5e7a..dabc35e91 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.h +++ b/libcef_dll/cpptoc/frame_cpptoc.h @@ -17,8 +17,18 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc index cce925780..3f5b120b5 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc @@ -49,7 +49,6 @@ int CEF_CALLBACK jsdialog_handler_on_jsalert( return _retval; } - int CEF_CALLBACK jsdialog_handler_on_jsconfirm( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_string_t* message, int* retval) @@ -94,7 +93,6 @@ int CEF_CALLBACK jsdialog_handler_on_jsconfirm( return _retval; } - int CEF_CALLBACK jsdialog_handler_on_jsprompt( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_string_t* message, @@ -153,7 +151,6 @@ int CEF_CALLBACK jsdialog_handler_on_jsprompt( } - // CONSTRUCTOR - Do not edit by hand. CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC(CefJSDialogHandler* cls) diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h index a1fdb66f3..424e0e9c1 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_jsdialog_handler.h" +#include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc index ad2e6f340..6cb3a2b19 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc @@ -45,7 +45,6 @@ int CEF_CALLBACK keyboard_handler_on_key_event( } - // CONSTRUCTOR - Do not edit by hand. CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC(CefKeyboardHandler* cls) diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h index 0d1dbc3b4..82e7f7608 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_keyboard_handler.h" +#include "include/capi/cef_keyboard_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc index ea2a6a8b0..b161f2693 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc @@ -21,7 +21,7 @@ int CEF_CALLBACK life_span_handler_on_before_popup( struct _cef_life_span_handler_t* self, cef_browser_t* parentBrowser, const struct _cef_popup_features_t* popupFeatures, cef_window_info_t* windowInfo, const cef_string_t* url, - struct _cef_client_t** client, struct _cef_browser_settings_t* settings) + cef_client_t** client, struct _cef_browser_settings_t* settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -98,7 +98,6 @@ int CEF_CALLBACK life_span_handler_on_before_popup( return _retval; } - void CEF_CALLBACK life_span_handler_on_after_created( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { @@ -117,7 +116,6 @@ void CEF_CALLBACK life_span_handler_on_after_created( CefBrowserCToCpp::Wrap(browser)); } - int CEF_CALLBACK life_span_handler_run_modal( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { @@ -139,7 +137,6 @@ int CEF_CALLBACK life_span_handler_run_modal( return _retval; } - int CEF_CALLBACK life_span_handler_do_close( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { @@ -161,7 +158,6 @@ int CEF_CALLBACK life_span_handler_do_close( return _retval; } - void CEF_CALLBACK life_span_handler_on_before_close( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { @@ -181,7 +177,6 @@ void CEF_CALLBACK life_span_handler_on_before_close( } - // CONSTRUCTOR - Do not edit by hand. CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls) diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/libcef_dll/cpptoc/life_span_handler_cpptoc.h index 722bf967b..082fd1f38 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.h +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_life_span_handler.h" +#include "include/capi/cef_life_span_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.cc b/libcef_dll/cpptoc/load_handler_cpptoc.cc index 2f7ca596c..dd7046903 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/load_handler_cpptoc.cc @@ -40,7 +40,6 @@ void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self, CefFrameCToCpp::Wrap(frame)); } - void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode) { @@ -65,7 +64,6 @@ void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, httpStatusCode); } - int CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl, @@ -109,7 +107,6 @@ int CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefLoadHandlerCppToC::CefLoadHandlerCppToC(CefLoadHandler* cls) diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.h b/libcef_dll/cpptoc/load_handler_cpptoc.h index c4f56c92d..883c07cd5 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.h +++ b/libcef_dll/cpptoc/load_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_load_handler.h" +#include "include/capi/cef_load_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/menu_handler_cpptoc.cc b/libcef_dll/cpptoc/menu_handler_cpptoc.cc index 491b77e3a..18871494a 100644 --- a/libcef_dll/cpptoc/menu_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/menu_handler_cpptoc.cc @@ -47,7 +47,6 @@ int CEF_CALLBACK menu_handler_on_before_menu(struct _cef_menu_handler_t* self, return _retval; } - void CEF_CALLBACK menu_handler_get_menu_label(struct _cef_menu_handler_t* self, cef_browser_t* browser, enum cef_menu_id_t menuId, cef_string_t* label) { @@ -75,7 +74,6 @@ void CEF_CALLBACK menu_handler_get_menu_label(struct _cef_menu_handler_t* self, labelStr); } - int CEF_CALLBACK menu_handler_on_menu_action(struct _cef_menu_handler_t* self, cef_browser_t* browser, enum cef_menu_id_t menuId) { @@ -99,7 +97,6 @@ int CEF_CALLBACK menu_handler_on_menu_action(struct _cef_menu_handler_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefMenuHandlerCppToC::CefMenuHandlerCppToC(CefMenuHandler* cls) diff --git a/libcef_dll/cpptoc/menu_handler_cpptoc.h b/libcef_dll/cpptoc/menu_handler_cpptoc.h index e50f11d54..1a0e7aa9c 100644 --- a/libcef_dll/cpptoc/menu_handler_cpptoc.h +++ b/libcef_dll/cpptoc/menu_handler_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_menu_handler.h" +#include "include/capi/cef_menu_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/post_data_cpptoc.cc b/libcef_dll/cpptoc/post_data_cpptoc.cc index 2cda6bd50..b6bb74eca 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_cpptoc.cc @@ -28,7 +28,6 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create() } - // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) @@ -46,7 +45,6 @@ size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) return _retval; } - void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, size_t* elementsCount, struct _cef_post_data_element_t** elements) { @@ -83,7 +81,6 @@ void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, } } - int CEF_CALLBACK post_data_remove_element(struct _cef_post_data_t* self, struct _cef_post_data_element_t* element) { @@ -105,7 +102,6 @@ int CEF_CALLBACK post_data_remove_element(struct _cef_post_data_t* self, return _retval; } - int CEF_CALLBACK post_data_add_element(struct _cef_post_data_t* self, struct _cef_post_data_element_t* element) { @@ -127,7 +123,6 @@ int CEF_CALLBACK post_data_add_element(struct _cef_post_data_t* self, return _retval; } - void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -141,7 +136,6 @@ void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefPostDataCppToC::CefPostDataCppToC(CefPostData* cls) diff --git a/libcef_dll/cpptoc/post_data_cpptoc.h b/libcef_dll/cpptoc/post_data_cpptoc.h index a7ba2f2a7..f174557c1 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.cc b/libcef_dll/cpptoc/post_data_element_cpptoc.cc index bc53c0bb1..7e54052e2 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.cc @@ -28,7 +28,6 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() } - // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK post_data_element_set_to_empty( @@ -44,7 +43,6 @@ void CEF_CALLBACK post_data_element_set_to_empty( CefPostDataElementCppToC::Get(self)->SetToEmpty(); } - void CEF_CALLBACK post_data_element_set_to_file( struct _cef_post_data_element_t* self, const cef_string_t* fileName) { @@ -63,7 +61,6 @@ void CEF_CALLBACK post_data_element_set_to_file( CefString(fileName)); } - void CEF_CALLBACK post_data_element_set_to_bytes( struct _cef_post_data_element_t* self, size_t size, const void* bytes) { @@ -83,7 +80,6 @@ void CEF_CALLBACK post_data_element_set_to_bytes( bytes); } - enum cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type( struct _cef_post_data_element_t* self) { @@ -101,7 +97,6 @@ enum cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type( return _retval; } - cef_string_userfree_t CEF_CALLBACK post_data_element_get_file( struct _cef_post_data_element_t* self) { @@ -118,7 +113,6 @@ cef_string_userfree_t CEF_CALLBACK post_data_element_get_file( return _retval.DetachToUserFree(); } - size_t CEF_CALLBACK post_data_element_get_bytes_count( struct _cef_post_data_element_t* self) { @@ -135,7 +129,6 @@ size_t CEF_CALLBACK post_data_element_get_bytes_count( return _retval; } - size_t CEF_CALLBACK post_data_element_get_bytes( struct _cef_post_data_element_t* self, size_t size, void* bytes) { @@ -159,7 +152,6 @@ size_t CEF_CALLBACK post_data_element_get_bytes( } - // CONSTRUCTOR - Do not edit by hand. CefPostDataElementCppToC::CefPostDataElementCppToC(CefPostDataElement* cls) diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.h b/libcef_dll/cpptoc/post_data_element_cpptoc.h index 3b03d1555..cdbd97835 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.cc b/libcef_dll/cpptoc/print_handler_cpptoc.cc index 60b4417ef..8a0c2acbc 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/print_handler_cpptoc.cc @@ -53,7 +53,6 @@ int CEF_CALLBACK print_handler_get_print_options( return _retval; } - int CEF_CALLBACK print_handler_get_print_header_footer( struct _cef_print_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_print_info_t* printInfo, @@ -150,7 +149,6 @@ int CEF_CALLBACK print_handler_get_print_header_footer( } - // CONSTRUCTOR - Do not edit by hand. CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls) diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.h b/libcef_dll/cpptoc/print_handler_cpptoc.h index 35717bf65..941a9839b 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.h +++ b/libcef_dll/cpptoc/print_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_print_handler.h" +#include "include/capi/cef_print_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/proxy_handler_cpptoc.cc b/libcef_dll/cpptoc/proxy_handler_cpptoc.cc index 6cec9f11c..47364193d 100644 --- a/libcef_dll/cpptoc/proxy_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/proxy_handler_cpptoc.cc @@ -49,7 +49,6 @@ void CEF_CALLBACK proxy_handler_get_proxy_for_url( } - // CONSTRUCTOR - Do not edit by hand. CefProxyHandlerCppToC::CefProxyHandlerCppToC(CefProxyHandler* cls) diff --git a/libcef_dll/cpptoc/proxy_handler_cpptoc.h b/libcef_dll/cpptoc/proxy_handler_cpptoc.h index edeb12440..ca698dca0 100644 --- a/libcef_dll/cpptoc/proxy_handler_cpptoc.h +++ b/libcef_dll/cpptoc/proxy_handler_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_proxy_handler.h" +#include "include/capi/cef_proxy_handler_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.cc b/libcef_dll/cpptoc/read_handler_cpptoc.cc index 80ac42639..0d073e88d 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/read_handler_cpptoc.cc @@ -38,7 +38,6 @@ size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, return _retval; } - int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, long offset, int whence) { @@ -57,7 +56,6 @@ int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, return _retval; } - long CEF_CALLBACK read_handler_tell(struct _cef_read_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -73,7 +71,6 @@ long CEF_CALLBACK read_handler_tell(struct _cef_read_handler_t* self) return _retval; } - int CEF_CALLBACK read_handler_eof(struct _cef_read_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -90,7 +87,6 @@ int CEF_CALLBACK read_handler_eof(struct _cef_read_handler_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefReadHandlerCppToC::CefReadHandlerCppToC(CefReadHandler* cls) diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.h b/libcef_dll/cpptoc/read_handler_cpptoc.h index f45ca0db7..d6acba5d9 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.h +++ b/libcef_dll/cpptoc/read_handler_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.cc b/libcef_dll/cpptoc/render_handler_cpptoc.cc index 01d53d346..13f1b4d11 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_handler_cpptoc.cc @@ -50,7 +50,6 @@ int CEF_CALLBACK render_handler_get_view_rect( return _retval; } - int CEF_CALLBACK render_handler_get_screen_rect( struct _cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect) @@ -85,7 +84,6 @@ int CEF_CALLBACK render_handler_get_screen_rect( return _retval; } - int CEF_CALLBACK render_handler_get_screen_point( struct _cef_render_handler_t* self, cef_browser_t* browser, int viewX, int viewY, int* screenX, int* screenY) @@ -132,7 +130,6 @@ int CEF_CALLBACK render_handler_get_screen_point( return _retval; } - void CEF_CALLBACK render_handler_on_popup_show( struct _cef_render_handler_t* self, cef_browser_t* browser, int show) { @@ -152,7 +149,6 @@ void CEF_CALLBACK render_handler_on_popup_show( show?true:false); } - void CEF_CALLBACK render_handler_on_popup_size( struct _cef_render_handler_t* self, cef_browser_t* browser, const cef_rect_t* rect) @@ -180,7 +176,6 @@ void CEF_CALLBACK render_handler_on_popup_size( rectVal); } - void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, cef_browser_t* browser, enum cef_paint_element_type_t type, size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer) @@ -219,7 +214,6 @@ void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, buffer); } - void CEF_CALLBACK render_handler_on_cursor_change( struct _cef_render_handler_t* self, cef_browser_t* browser, cef_cursor_handle_t cursor) @@ -241,7 +235,6 @@ void CEF_CALLBACK render_handler_on_cursor_change( } - // CONSTRUCTOR - Do not edit by hand. CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls) diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.h b/libcef_dll/cpptoc/render_handler_cpptoc.h index 1304e1198..0d8496aff 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.h +++ b/libcef_dll/cpptoc/render_handler_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_render_handler.h" +#include "include/capi/cef_render_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/request_cpptoc.cc b/libcef_dll/cpptoc/request_cpptoc.cc index 5e89d234c..2fb86d5a8 100644 --- a/libcef_dll/cpptoc/request_cpptoc.cc +++ b/libcef_dll/cpptoc/request_cpptoc.cc @@ -29,7 +29,6 @@ CEF_EXPORT cef_request_t* cef_request_create() } - // MEMBER FUNCTIONS - Body may be edited by hand. cef_string_userfree_t CEF_CALLBACK request_get_url(struct _cef_request_t* self) @@ -47,7 +46,6 @@ cef_string_userfree_t CEF_CALLBACK request_get_url(struct _cef_request_t* self) return _retval.DetachToUserFree(); } - void CEF_CALLBACK request_set_url(struct _cef_request_t* self, const cef_string_t* url) { @@ -66,7 +64,6 @@ void CEF_CALLBACK request_set_url(struct _cef_request_t* self, CefString(url)); } - cef_string_userfree_t CEF_CALLBACK request_get_method( struct _cef_request_t* self) { @@ -83,7 +80,6 @@ cef_string_userfree_t CEF_CALLBACK request_get_method( return _retval.DetachToUserFree(); } - void CEF_CALLBACK request_set_method(struct _cef_request_t* self, const cef_string_t* method) { @@ -102,7 +98,6 @@ void CEF_CALLBACK request_set_method(struct _cef_request_t* self, CefString(method)); } - struct _cef_post_data_t* CEF_CALLBACK request_get_post_data( struct _cef_request_t* self) { @@ -119,7 +114,6 @@ struct _cef_post_data_t* CEF_CALLBACK request_get_post_data( return CefPostDataCppToC::Wrap(_retval); } - void CEF_CALLBACK request_set_post_data(struct _cef_request_t* self, struct _cef_post_data_t* postData) { @@ -138,7 +132,6 @@ void CEF_CALLBACK request_set_post_data(struct _cef_request_t* self, CefPostDataCppToC::Unwrap(postData)); } - void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, cef_string_multimap_t headerMap) { @@ -165,7 +158,6 @@ void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, transfer_string_multimap_contents(headerMapMultimap, headerMap); } - void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, cef_string_multimap_t headerMap) { @@ -188,7 +180,6 @@ void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, headerMapMultimap); } - void CEF_CALLBACK request_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) @@ -224,7 +215,6 @@ void CEF_CALLBACK request_set(struct _cef_request_t* self, headerMapMultimap); } - enum cef_weburlrequest_flags_t CEF_CALLBACK request_get_flags( struct _cef_request_t* self) { @@ -241,7 +231,6 @@ enum cef_weburlrequest_flags_t CEF_CALLBACK request_get_flags( return _retval; } - void CEF_CALLBACK request_set_flags(struct _cef_request_t* self, enum cef_weburlrequest_flags_t flags) { @@ -256,7 +245,6 @@ void CEF_CALLBACK request_set_flags(struct _cef_request_t* self, flags); } - cef_string_userfree_t CEF_CALLBACK request_get_first_party_for_cookies( struct _cef_request_t* self) { @@ -273,7 +261,6 @@ cef_string_userfree_t CEF_CALLBACK request_get_first_party_for_cookies( return _retval.DetachToUserFree(); } - void CEF_CALLBACK request_set_first_party_for_cookies( struct _cef_request_t* self, const cef_string_t* url) { @@ -293,7 +280,6 @@ void CEF_CALLBACK request_set_first_party_for_cookies( } - // CONSTRUCTOR - Do not edit by hand. CefRequestCppToC::CefRequestCppToC(CefRequest* cls) diff --git a/libcef_dll/cpptoc/request_cpptoc.h b/libcef_dll/cpptoc/request_cpptoc.h index ce0383d5a..1d725eae4 100644 --- a/libcef_dll/cpptoc/request_cpptoc.h +++ b/libcef_dll/cpptoc/request_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.cc b/libcef_dll/cpptoc/request_handler_cpptoc.cc index 4fe94fe21..6426b3124 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/request_handler_cpptoc.cc @@ -24,7 +24,7 @@ int CEF_CALLBACK request_handler_on_before_browse( struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_request_t* request, + cef_frame_t* frame, cef_request_t* request, enum cef_handler_navtype_t navType, int isRedirect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -57,10 +57,9 @@ int CEF_CALLBACK request_handler_on_before_browse( return _retval; } - int CEF_CALLBACK request_handler_on_before_resource_load( struct _cef_request_handler_t* self, cef_browser_t* browser, - struct _cef_request_t* request, cef_string_t* redirectUrl, + cef_request_t* request, cef_string_t* redirectUrl, struct _cef_stream_reader_t** resourceStream, struct _cef_response_t* response, int loadFlags) { @@ -122,7 +121,6 @@ int CEF_CALLBACK request_handler_on_before_resource_load( return _retval; } - void CEF_CALLBACK request_handler_on_resource_redirect( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* old_url, cef_string_t* new_url) @@ -155,11 +153,10 @@ void CEF_CALLBACK request_handler_on_resource_redirect( new_urlStr); } - void CEF_CALLBACK request_handler_on_resource_response( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* url, struct _cef_response_t* response, - struct _cef_content_filter_t** filter) + cef_content_filter_t** filter) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -208,7 +205,6 @@ void CEF_CALLBACK request_handler_on_resource_response( } } - int CEF_CALLBACK request_handler_on_protocol_execution( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* url, int* allowOSExecution) @@ -249,11 +245,10 @@ int CEF_CALLBACK request_handler_on_protocol_execution( return _retval; } - int CEF_CALLBACK request_handler_get_download_handler( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* mimeType, const cef_string_t* fileName, - int64 contentLength, struct _cef_download_handler_t** handler) + int64 contentLength, cef_download_handler_t** handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -306,7 +301,6 @@ int CEF_CALLBACK request_handler_get_download_handler( return _retval; } - int CEF_CALLBACK request_handler_get_auth_credentials( struct _cef_request_handler_t* self, cef_browser_t* browser, int isProxy, const cef_string_t* host, int port, const cef_string_t* realm, @@ -361,7 +355,6 @@ int CEF_CALLBACK request_handler_get_auth_credentials( } - // CONSTRUCTOR - Do not edit by hand. CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls) diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.h b/libcef_dll/cpptoc/request_handler_cpptoc.h index d61d80a53..61b343b19 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.h +++ b/libcef_dll/cpptoc/request_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request_handler.h" +#include "include/capi/cef_request_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/response_cpptoc.cc b/libcef_dll/cpptoc/response_cpptoc.cc index afc33e0d5..b1dc7b02d 100644 --- a/libcef_dll/cpptoc/response_cpptoc.cc +++ b/libcef_dll/cpptoc/response_cpptoc.cc @@ -31,7 +31,6 @@ int CEF_CALLBACK response_get_status(struct _cef_response_t* self) return _retval; } - void CEF_CALLBACK response_set_status(struct _cef_response_t* self, int status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,7 +44,6 @@ void CEF_CALLBACK response_set_status(struct _cef_response_t* self, int status) status); } - cef_string_userfree_t CEF_CALLBACK response_get_status_text( struct _cef_response_t* self) { @@ -62,7 +60,6 @@ cef_string_userfree_t CEF_CALLBACK response_get_status_text( return _retval.DetachToUserFree(); } - void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self, const cef_string_t* statusText) { @@ -81,7 +78,6 @@ void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self, CefString(statusText)); } - cef_string_userfree_t CEF_CALLBACK response_get_mime_type( struct _cef_response_t* self) { @@ -98,7 +94,6 @@ cef_string_userfree_t CEF_CALLBACK response_get_mime_type( return _retval.DetachToUserFree(); } - void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self, const cef_string_t* mimeType) { @@ -117,7 +112,6 @@ void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self, CefString(mimeType)); } - cef_string_userfree_t CEF_CALLBACK response_get_header( struct _cef_response_t* self, const cef_string_t* name) { @@ -139,7 +133,6 @@ cef_string_userfree_t CEF_CALLBACK response_get_header( return _retval.DetachToUserFree(); } - void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, cef_string_multimap_t headerMap) { @@ -166,7 +159,6 @@ void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, transfer_string_multimap_contents(headerMapMultimap, headerMap); } - void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, cef_string_multimap_t headerMap) { @@ -190,7 +182,6 @@ void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefResponseCppToC::CefResponseCppToC(CefResponse* cls) diff --git a/libcef_dll/cpptoc/response_cpptoc.h b/libcef_dll/cpptoc/response_cpptoc.h index fba22da5c..c58f535a9 100644 --- a/libcef_dll/cpptoc/response_cpptoc.h +++ b/libcef_dll/cpptoc/response_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc index 7080be6d2..be886632c 100644 --- a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc @@ -28,7 +28,6 @@ void CEF_CALLBACK scheme_handler_callback_headers_available( CefSchemeHandlerCallbackCppToC::Get(self)->HeadersAvailable(); } - void CEF_CALLBACK scheme_handler_callback_bytes_available( struct _cef_scheme_handler_callback_t* self) { @@ -42,7 +41,6 @@ void CEF_CALLBACK scheme_handler_callback_bytes_available( CefSchemeHandlerCallbackCppToC::Get(self)->BytesAvailable(); } - void CEF_CALLBACK scheme_handler_callback_cancel( struct _cef_scheme_handler_callback_t* self) { @@ -57,7 +55,6 @@ void CEF_CALLBACK scheme_handler_callback_cancel( } - // CONSTRUCTOR - Do not edit by hand. CefSchemeHandlerCallbackCppToC::CefSchemeHandlerCallbackCppToC( diff --git a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h index 6c83f46bd..72ed86bea 100644 --- a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h @@ -17,8 +17,14 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/scheme_handler_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_cpptoc.cc index 9746185c3..bee349f8d 100644 --- a/libcef_dll/cpptoc/scheme_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_cpptoc.cc @@ -45,7 +45,6 @@ int CEF_CALLBACK scheme_handler_process_request( return _retval; } - void CEF_CALLBACK scheme_handler_get_response_headers( struct _cef_scheme_handler_t* self, cef_response_t* response, int64* response_length, cef_string_t* redirectUrl) @@ -84,7 +83,6 @@ void CEF_CALLBACK scheme_handler_get_response_headers( *response_length = response_lengthVal; } - int CEF_CALLBACK scheme_handler_read_response( struct _cef_scheme_handler_t* self, void* data_out, int bytes_to_read, int* bytes_read, cef_scheme_handler_callback_t* callback) @@ -125,7 +123,6 @@ int CEF_CALLBACK scheme_handler_read_response( return _retval; } - void CEF_CALLBACK scheme_handler_cancel(struct _cef_scheme_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -139,7 +136,6 @@ void CEF_CALLBACK scheme_handler_cancel(struct _cef_scheme_handler_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefSchemeHandlerCppToC::CefSchemeHandlerCppToC(CefSchemeHandler* cls) diff --git a/libcef_dll/cpptoc/scheme_handler_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_cpptoc.h index 3dc7f55e4..6513f0a21 100644 --- a/libcef_dll/cpptoc/scheme_handler_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_cpptoc.h @@ -17,8 +17,14 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc index cb18538e7..174770b19 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc @@ -52,7 +52,6 @@ struct _cef_scheme_handler_t* CEF_CALLBACK scheme_handler_factory_create( } - // CONSTRUCTOR - Do not edit by hand. CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC( diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h index f2d8fcc5d..527ef0344 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h @@ -17,8 +17,14 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/storage_visitor_cpptoc.cc b/libcef_dll/cpptoc/storage_visitor_cpptoc.cc index ca2f5b4d2..7dea2cb31 100644 --- a/libcef_dll/cpptoc/storage_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/storage_visitor_cpptoc.cc @@ -64,7 +64,6 @@ int CEF_CALLBACK storage_visitor_visit(struct _cef_storage_visitor_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefStorageVisitorCppToC::CefStorageVisitorCppToC(CefStorageVisitor* cls) diff --git a/libcef_dll/cpptoc/storage_visitor_cpptoc.h b/libcef_dll/cpptoc/storage_visitor_cpptoc.h index a90b23830..4f2c567d4 100644 --- a/libcef_dll/cpptoc/storage_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/storage_visitor_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_storage.h" +#include "include/capi/cef_storage_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.cc b/libcef_dll/cpptoc/stream_reader_cpptoc.cc index e4ea58327..ddf1d9be7 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.cc @@ -34,7 +34,6 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( return CefStreamReaderCppToC::Wrap(_retval); } - CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, size_t size) { @@ -54,7 +53,6 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, return CefStreamReaderCppToC::Wrap(_retval); } - CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( cef_read_handler_t* handler) { @@ -74,7 +72,6 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( } - // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, @@ -100,7 +97,6 @@ size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, return _retval; } - int CEF_CALLBACK stream_reader_seek(struct _cef_stream_reader_t* self, long offset, int whence) { @@ -119,7 +115,6 @@ int CEF_CALLBACK stream_reader_seek(struct _cef_stream_reader_t* self, return _retval; } - long CEF_CALLBACK stream_reader_tell(struct _cef_stream_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -135,7 +130,6 @@ long CEF_CALLBACK stream_reader_tell(struct _cef_stream_reader_t* self) return _retval; } - int CEF_CALLBACK stream_reader_eof(struct _cef_stream_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -152,7 +146,6 @@ int CEF_CALLBACK stream_reader_eof(struct _cef_stream_reader_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefStreamReaderCppToC::CefStreamReaderCppToC(CefStreamReader* cls) diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.h b/libcef_dll/cpptoc/stream_reader_cpptoc.h index 88395a2da..58ec7fa2f 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.h +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.cc b/libcef_dll/cpptoc/stream_writer_cpptoc.cc index 83751f0a9..61b92d26f 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.cc @@ -34,7 +34,6 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( return CefStreamWriterCppToC::Wrap(_retval); } - CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( cef_write_handler_t* handler) { @@ -54,7 +53,6 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( } - // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, @@ -80,7 +78,6 @@ size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, return _retval; } - int CEF_CALLBACK stream_writer_seek(struct _cef_stream_writer_t* self, long offset, int whence) { @@ -99,7 +96,6 @@ int CEF_CALLBACK stream_writer_seek(struct _cef_stream_writer_t* self, return _retval; } - long CEF_CALLBACK stream_writer_tell(struct _cef_stream_writer_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -115,7 +111,6 @@ long CEF_CALLBACK stream_writer_tell(struct _cef_stream_writer_t* self) return _retval; } - int CEF_CALLBACK stream_writer_flush(struct _cef_stream_writer_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -132,7 +127,6 @@ int CEF_CALLBACK stream_writer_flush(struct _cef_stream_writer_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefStreamWriterCppToC::CefStreamWriterCppToC(CefStreamWriter* cls) diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.h b/libcef_dll/cpptoc/stream_writer_cpptoc.h index 1958a4f66..619e4d114 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.h +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/task_cpptoc.cc b/libcef_dll/cpptoc/task_cpptoc.cc index 3b6c6051d..7e9139713 100644 --- a/libcef_dll/cpptoc/task_cpptoc.cc +++ b/libcef_dll/cpptoc/task_cpptoc.cc @@ -30,7 +30,6 @@ void CEF_CALLBACK task_execute(struct _cef_task_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefTaskCppToC::CefTaskCppToC(CefTask* cls) diff --git a/libcef_dll/cpptoc/task_cpptoc.h b/libcef_dll/cpptoc/task_cpptoc.h index d29d8ec9e..1241955e4 100644 --- a/libcef_dll/cpptoc/task_cpptoc.h +++ b/libcef_dll/cpptoc/task_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_task.h" +#include "include/capi/cef_task_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/libcef_dll/cpptoc/v8accessor_cpptoc.cc index 4186ecd66..336f6593e 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.cc +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.cc @@ -72,7 +72,6 @@ int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, return _retval; } - int CEF_CALLBACK v8accessor_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) @@ -114,7 +113,6 @@ int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefV8AccessorCppToC::CefV8AccessorCppToC(CefV8Accessor* cls) diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.h b/libcef_dll/cpptoc/v8accessor_cpptoc.h index fe8a09422..eefaed3d6 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.h +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/v8context_cpptoc.cc b/libcef_dll/cpptoc/v8context_cpptoc.cc index ebb32017d..fb0d6e4de 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_cpptoc.cc @@ -29,7 +29,6 @@ CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context() return CefV8ContextCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -41,7 +40,6 @@ CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context() return CefV8ContextCppToC::Wrap(_retval); } - CEF_EXPORT int cef_v8context_in_context() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -54,7 +52,6 @@ CEF_EXPORT int cef_v8context_in_context() } - // MEMBER FUNCTIONS - Body may be edited by hand. cef_browser_t* CEF_CALLBACK v8context_get_browser(struct _cef_v8context_t* self) @@ -72,7 +69,6 @@ cef_browser_t* CEF_CALLBACK v8context_get_browser(struct _cef_v8context_t* self) return CefBrowserCppToC::Wrap(_retval); } - cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -88,7 +84,6 @@ cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) return CefFrameCppToC::Wrap(_retval); } - struct _cef_v8value_t* CEF_CALLBACK v8context_get_global( struct _cef_v8context_t* self) { @@ -105,7 +100,6 @@ struct _cef_v8value_t* CEF_CALLBACK v8context_get_global( return CefV8ValueCppToC::Wrap(_retval); } - int CEF_CALLBACK v8context_enter(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -121,7 +115,6 @@ int CEF_CALLBACK v8context_enter(struct _cef_v8context_t* self) return _retval; } - int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -137,7 +130,6 @@ int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) return _retval; } - int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self, struct _cef_v8context_t* that) { @@ -160,7 +152,6 @@ int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefV8ContextCppToC::CefV8ContextCppToC(CefV8Context* cls) diff --git a/libcef_dll/cpptoc/v8context_cpptoc.h b/libcef_dll/cpptoc/v8context_cpptoc.h index df20c6b86..b6049d63f 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/v8context_handler_cpptoc.cc b/libcef_dll/cpptoc/v8context_handler_cpptoc.cc index 6b5a3617e..a4616a15f 100644 --- a/libcef_dll/cpptoc/v8context_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_handler_cpptoc.cc @@ -20,7 +20,7 @@ void CEF_CALLBACK v8context_handler_on_context_created( struct _cef_v8context_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_v8context_t* context) + cef_frame_t* frame, cef_v8context_t* context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -47,10 +47,9 @@ void CEF_CALLBACK v8context_handler_on_context_created( CefV8ContextCToCpp::Wrap(context)); } - void CEF_CALLBACK v8context_handler_on_context_released( struct _cef_v8context_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_v8context_t* context) + cef_frame_t* frame, cef_v8context_t* context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -78,7 +77,6 @@ void CEF_CALLBACK v8context_handler_on_context_released( } - // CONSTRUCTOR - Do not edit by hand. CefV8ContextHandlerCppToC::CefV8ContextHandlerCppToC(CefV8ContextHandler* cls) diff --git a/libcef_dll/cpptoc/v8context_handler_cpptoc.h b/libcef_dll/cpptoc/v8context_handler_cpptoc.h index e5c862890..59618229e 100644 --- a/libcef_dll/cpptoc/v8context_handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8context_handler.h" +#include "include/capi/cef_v8context_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.cc b/libcef_dll/cpptoc/v8exception_cpptoc.cc index 55f0098e9..1d6f9045a 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.cc +++ b/libcef_dll/cpptoc/v8exception_cpptoc.cc @@ -31,7 +31,6 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_message( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK v8exception_get_source_line( struct _cef_v8exception_t* self) { @@ -48,7 +47,6 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_source_line( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK v8exception_get_script_resource_name( struct _cef_v8exception_t* self) { @@ -65,7 +63,6 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_script_resource_name( return _retval.DetachToUserFree(); } - int CEF_CALLBACK v8exception_get_line_number(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -81,7 +78,6 @@ int CEF_CALLBACK v8exception_get_line_number(struct _cef_v8exception_t* self) return _retval; } - int CEF_CALLBACK v8exception_get_start_position(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -97,7 +93,6 @@ int CEF_CALLBACK v8exception_get_start_position(struct _cef_v8exception_t* self) return _retval; } - int CEF_CALLBACK v8exception_get_end_position(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -113,7 +108,6 @@ int CEF_CALLBACK v8exception_get_end_position(struct _cef_v8exception_t* self) return _retval; } - int CEF_CALLBACK v8exception_get_start_column(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -129,7 +123,6 @@ int CEF_CALLBACK v8exception_get_start_column(struct _cef_v8exception_t* self) return _retval; } - int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -146,7 +139,6 @@ int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefV8ExceptionCppToC::CefV8ExceptionCppToC(CefV8Exception* cls) diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.h b/libcef_dll/cpptoc/v8exception_cpptoc.h index b03143fb7..de8f67149 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.h +++ b/libcef_dll/cpptoc/v8exception_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.cc b/libcef_dll/cpptoc/v8handler_cpptoc.cc index d19a271de..6af008547 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8handler_cpptoc.cc @@ -86,7 +86,6 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, } - // CONSTRUCTOR - Do not edit by hand. CefV8HandlerCppToC::CefV8HandlerCppToC(CefV8Handler* cls) diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.h b/libcef_dll/cpptoc/v8handler_cpptoc.h index 995232229..46cb22fb5 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8handler_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/v8value_cpptoc.cc b/libcef_dll/cpptoc/v8value_cpptoc.cc index 5f81f636d..ce42534eb 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.cc +++ b/libcef_dll/cpptoc/v8value_cpptoc.cc @@ -32,7 +32,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined() return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_null() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -44,7 +43,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_null() return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -57,7 +55,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value) return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -70,7 +67,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value) return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -83,7 +79,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value) return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -104,7 +99,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date) return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -119,7 +113,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_object_with_accessor( cef_base_t* user_data, cef_v8accessor_t* accessor) { @@ -136,7 +129,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_object_with_accessor( return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_array() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -148,7 +140,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_array() return CefV8ValueCppToC::Wrap(_retval); } - CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, cef_v8handler_t* handler) { @@ -173,7 +164,6 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, } - // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8value_is_undefined(struct _cef_v8value_t* self) @@ -191,7 +181,6 @@ int CEF_CALLBACK v8value_is_undefined(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_null(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -207,7 +196,6 @@ int CEF_CALLBACK v8value_is_null(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_bool(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -223,7 +211,6 @@ int CEF_CALLBACK v8value_is_bool(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_int(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -239,7 +226,6 @@ int CEF_CALLBACK v8value_is_int(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_double(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -255,7 +241,6 @@ int CEF_CALLBACK v8value_is_double(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_date(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -271,7 +256,6 @@ int CEF_CALLBACK v8value_is_date(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_string(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -287,7 +271,6 @@ int CEF_CALLBACK v8value_is_string(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_object(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -303,7 +286,6 @@ int CEF_CALLBACK v8value_is_object(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_array(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -319,7 +301,6 @@ int CEF_CALLBACK v8value_is_array(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -335,7 +316,6 @@ int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_is_same(struct _cef_v8value_t* self, struct _cef_v8value_t* that) { @@ -357,7 +337,6 @@ int CEF_CALLBACK v8value_is_same(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_get_bool_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -373,7 +352,6 @@ int CEF_CALLBACK v8value_get_bool_value(struct _cef_v8value_t* self) return _retval; } - int CEF_CALLBACK v8value_get_int_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -389,7 +367,6 @@ int CEF_CALLBACK v8value_get_int_value(struct _cef_v8value_t* self) return _retval; } - double CEF_CALLBACK v8value_get_double_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -405,7 +382,6 @@ double CEF_CALLBACK v8value_get_double_value(struct _cef_v8value_t* self) return _retval; } - cef_time_t CEF_CALLBACK v8value_get_date_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -421,7 +397,6 @@ cef_time_t CEF_CALLBACK v8value_get_date_value(struct _cef_v8value_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK v8value_get_string_value( struct _cef_v8value_t* self) { @@ -438,7 +413,6 @@ cef_string_userfree_t CEF_CALLBACK v8value_get_string_value( return _retval.DetachToUserFree(); } - int CEF_CALLBACK v8value_has_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key) { @@ -460,7 +434,6 @@ int CEF_CALLBACK v8value_has_value_bykey(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_has_value_byindex(struct _cef_v8value_t* self, int index) { @@ -482,7 +455,6 @@ int CEF_CALLBACK v8value_has_value_byindex(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_delete_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key) { @@ -504,7 +476,6 @@ int CEF_CALLBACK v8value_delete_value_bykey(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_delete_value_byindex(struct _cef_v8value_t* self, int index) { @@ -526,7 +497,6 @@ int CEF_CALLBACK v8value_delete_value_byindex(struct _cef_v8value_t* self, return _retval; } - struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_bykey( struct _cef_v8value_t* self, const cef_string_t* key) { @@ -548,7 +518,6 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_bykey( return CefV8ValueCppToC::Wrap(_retval); } - struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex( struct _cef_v8value_t* self, int index) { @@ -570,7 +539,6 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex( return CefV8ValueCppToC::Wrap(_retval); } - int CEF_CALLBACK v8value_set_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key, struct _cef_v8value_t* value, enum cef_v8_propertyattribute_t attribute) @@ -599,7 +567,6 @@ int CEF_CALLBACK v8value_set_value_bykey(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self, int index, struct _cef_v8value_t* value) { @@ -626,7 +593,6 @@ int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_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) @@ -651,7 +617,6 @@ int CEF_CALLBACK v8value_set_value_byaccessor(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, cef_string_list_t keys) { @@ -681,7 +646,6 @@ int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, return _retval; } - cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -697,7 +661,6 @@ cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) return CefBaseCToCpp::Unwrap(_retval); } - int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -713,7 +676,6 @@ int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK v8value_get_function_name( struct _cef_v8value_t* self) { @@ -730,7 +692,6 @@ cef_string_userfree_t CEF_CALLBACK v8value_get_function_name( return _retval.DetachToUserFree(); } - cef_v8handler_t* CEF_CALLBACK v8value_get_function_handler( struct _cef_v8value_t* self) { @@ -748,7 +709,6 @@ cef_v8handler_t* CEF_CALLBACK v8value_get_function_handler( return CefV8HandlerCToCpp::Unwrap(_retval); } - int CEF_CALLBACK v8value_execute_function(struct _cef_v8value_t* self, struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, @@ -824,7 +784,6 @@ int CEF_CALLBACK v8value_execute_function(struct _cef_v8value_t* self, return _retval; } - int CEF_CALLBACK v8value_execute_function_with_context( struct _cef_v8value_t* self, cef_v8context_t* context, struct _cef_v8value_t* object, size_t argumentsCount, @@ -907,7 +866,6 @@ int CEF_CALLBACK v8value_execute_function_with_context( } - // CONSTRUCTOR - Do not edit by hand. CefV8ValueCppToC::CefV8ValueCppToC(CefV8Value* cls) diff --git a/libcef_dll/cpptoc/v8value_cpptoc.h b/libcef_dll/cpptoc/v8value_cpptoc.h index 930f7efc3..75e4c1aa6 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.h +++ b/libcef_dll/cpptoc/v8value_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc index 377d1a194..7acc8b50d 100644 --- a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc +++ b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc @@ -38,7 +38,6 @@ void CEF_CALLBACK web_urlrequest_client_on_state_change( state); } - void CEF_CALLBACK web_urlrequest_client_on_redirect( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, cef_request_t* request, cef_response_t* response) @@ -68,7 +67,6 @@ void CEF_CALLBACK web_urlrequest_client_on_redirect( CefResponseCToCpp::Wrap(response)); } - void CEF_CALLBACK web_urlrequest_client_on_headers_received( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, cef_response_t* response) @@ -93,7 +91,6 @@ void CEF_CALLBACK web_urlrequest_client_on_headers_received( CefResponseCToCpp::Wrap(response)); } - void CEF_CALLBACK web_urlrequest_client_on_progress( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, uint64 bytesSent, uint64 totalBytesToBeSent) @@ -115,7 +112,6 @@ void CEF_CALLBACK web_urlrequest_client_on_progress( totalBytesToBeSent); } - void CEF_CALLBACK web_urlrequest_client_on_data( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, const void* data, int dataLength) @@ -141,7 +137,6 @@ void CEF_CALLBACK web_urlrequest_client_on_data( dataLength); } - void CEF_CALLBACK web_urlrequest_client_on_error( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, enum cef_handler_errorcode_t errorCode) @@ -163,7 +158,6 @@ void CEF_CALLBACK web_urlrequest_client_on_error( } - // CONSTRUCTOR - Do not edit by hand. CefWebURLRequestClientCppToC::CefWebURLRequestClientCppToC( diff --git a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h index 7d891b0d8..9a2f2c315 100644 --- a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h +++ b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_web_urlrequest.h" +#include "include/capi/cef_web_urlrequest_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc b/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc index b08795ddd..3be67c3e3 100644 --- a/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc +++ b/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc @@ -41,7 +41,6 @@ CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create( } - // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK web_urlrequest_cancel(struct _cef_web_urlrequest_t* self) @@ -56,7 +55,6 @@ void CEF_CALLBACK web_urlrequest_cancel(struct _cef_web_urlrequest_t* self) CefWebURLRequestCppToC::Get(self)->Cancel(); } - enum cef_weburlrequest_state_t CEF_CALLBACK web_urlrequest_get_state( struct _cef_web_urlrequest_t* self) { @@ -75,7 +73,6 @@ enum cef_weburlrequest_state_t CEF_CALLBACK web_urlrequest_get_state( } - // CONSTRUCTOR - Do not edit by hand. CefWebURLRequestCppToC::CefWebURLRequestCppToC(CefWebURLRequest* cls) diff --git a/libcef_dll/cpptoc/web_urlrequest_cpptoc.h b/libcef_dll/cpptoc/web_urlrequest_cpptoc.h index 8601c2197..d515175d6 100644 --- a/libcef_dll/cpptoc/web_urlrequest_cpptoc.h +++ b/libcef_dll/cpptoc/web_urlrequest_cpptoc.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_web_urlrequest.h" +#include "include/capi/cef_web_urlrequest_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.cc b/libcef_dll/cpptoc/write_handler_cpptoc.cc index 901db462b..6fc3ee9cb 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/write_handler_cpptoc.cc @@ -38,7 +38,6 @@ size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, return _retval; } - int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, long offset, int whence) { @@ -57,7 +56,6 @@ int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, return _retval; } - long CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -73,7 +71,6 @@ long CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) return _retval; } - int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -90,7 +87,6 @@ int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefWriteHandlerCppToC::CefWriteHandlerCppToC(CefWriteHandler* cls) diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.h b/libcef_dll/cpptoc/write_handler_cpptoc.h index 30e032e8b..29dd108a5 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.h +++ b/libcef_dll/cpptoc/write_handler_cpptoc.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.cc b/libcef_dll/cpptoc/xml_reader_cpptoc.cc index e79344d3b..a6cb6a15a 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.cc @@ -41,7 +41,6 @@ CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream, } - // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self) @@ -59,7 +58,6 @@ int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self) return _retval; } - int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -75,7 +73,6 @@ int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self) return _retval; } - int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -91,7 +88,6 @@ int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_error( struct _cef_xml_reader_t* self) { @@ -108,7 +104,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_error( return _retval.DetachToUserFree(); } - enum cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type( struct _cef_xml_reader_t* self) { @@ -125,7 +120,6 @@ enum cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type( return _retval; } - int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -141,7 +135,6 @@ int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name( struct _cef_xml_reader_t* self) { @@ -158,7 +151,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix( struct _cef_xml_reader_t* self) { @@ -175,7 +167,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name( struct _cef_xml_reader_t* self) { @@ -192,7 +183,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri( struct _cef_xml_reader_t* self) { @@ -209,7 +199,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri( struct _cef_xml_reader_t* self) { @@ -226,7 +215,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang( struct _cef_xml_reader_t* self) { @@ -243,7 +231,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang( return _retval.DetachToUserFree(); } - int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -259,7 +246,6 @@ int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self) return _retval; } - int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -275,7 +261,6 @@ int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_value( struct _cef_xml_reader_t* self) { @@ -292,7 +277,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_value( return _retval.DetachToUserFree(); } - int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -308,7 +292,6 @@ int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self) return _retval; } - size_t CEF_CALLBACK xml_reader_get_attribute_count( struct _cef_xml_reader_t* self) { @@ -325,7 +308,6 @@ size_t CEF_CALLBACK xml_reader_get_attribute_count( return _retval; } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex( struct _cef_xml_reader_t* self, int index) { @@ -347,7 +329,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname( struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { @@ -369,7 +350,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname( struct _cef_xml_reader_t* self, const cef_string_t* localName, const cef_string_t* namespaceURI) @@ -397,7 +377,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml( struct _cef_xml_reader_t* self) { @@ -414,7 +393,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml( return _retval.DetachToUserFree(); } - cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml( struct _cef_xml_reader_t* self) { @@ -431,7 +409,6 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml( return _retval.DetachToUserFree(); } - int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -447,7 +424,6 @@ int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self) return _retval; } - int CEF_CALLBACK xml_reader_move_to_attribute_byindex( struct _cef_xml_reader_t* self, int index) { @@ -469,7 +445,6 @@ int CEF_CALLBACK xml_reader_move_to_attribute_byindex( return _retval; } - int CEF_CALLBACK xml_reader_move_to_attribute_byqname( struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { @@ -491,7 +466,6 @@ int CEF_CALLBACK xml_reader_move_to_attribute_byqname( return _retval; } - int CEF_CALLBACK xml_reader_move_to_attribute_bylname( struct _cef_xml_reader_t* self, const cef_string_t* localName, const cef_string_t* namespaceURI) @@ -519,7 +493,6 @@ int CEF_CALLBACK xml_reader_move_to_attribute_bylname( return _retval; } - int CEF_CALLBACK xml_reader_move_to_first_attribute( struct _cef_xml_reader_t* self) { @@ -536,7 +509,6 @@ int CEF_CALLBACK xml_reader_move_to_first_attribute( return _retval; } - int CEF_CALLBACK xml_reader_move_to_next_attribute( struct _cef_xml_reader_t* self) { @@ -553,7 +525,6 @@ int CEF_CALLBACK xml_reader_move_to_next_attribute( return _retval; } - int CEF_CALLBACK xml_reader_move_to_carrying_element( struct _cef_xml_reader_t* self) { @@ -571,7 +542,6 @@ int CEF_CALLBACK xml_reader_move_to_carrying_element( } - // CONSTRUCTOR - Do not edit by hand. CefXmlReaderCppToC::CefXmlReaderCppToC(CefXmlReader* cls) diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.h b/libcef_dll/cpptoc/xml_reader_cpptoc.h index 679670ecb..86b2e06e8 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.h +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_xml_reader.h" +#include "include/capi/cef_xml_reader_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.cc b/libcef_dll/cpptoc/zip_reader_cpptoc.cc index 69cc5019e..286560093 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.cc @@ -34,7 +34,6 @@ CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create(cef_stream_reader_t* stream) } - // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK zip_reader_move_to_first_file(struct _cef_zip_reader_t* self) @@ -52,7 +51,6 @@ int CEF_CALLBACK zip_reader_move_to_first_file(struct _cef_zip_reader_t* self) return _retval; } - int CEF_CALLBACK zip_reader_move_to_next_file(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -68,7 +66,6 @@ int CEF_CALLBACK zip_reader_move_to_next_file(struct _cef_zip_reader_t* self) return _retval; } - int CEF_CALLBACK zip_reader_move_to_file(struct _cef_zip_reader_t* self, const cef_string_t* fileName, int caseSensitive) { @@ -91,7 +88,6 @@ int CEF_CALLBACK zip_reader_move_to_file(struct _cef_zip_reader_t* self, return _retval; } - int CEF_CALLBACK zip_reader_close(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -107,7 +103,6 @@ int CEF_CALLBACK zip_reader_close(struct _cef_zip_reader_t* self) return _retval; } - cef_string_userfree_t CEF_CALLBACK zip_reader_get_file_name( struct _cef_zip_reader_t* self) { @@ -124,7 +119,6 @@ cef_string_userfree_t CEF_CALLBACK zip_reader_get_file_name( return _retval.DetachToUserFree(); } - long CEF_CALLBACK zip_reader_get_file_size(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -140,7 +134,6 @@ long CEF_CALLBACK zip_reader_get_file_size(struct _cef_zip_reader_t* self) return _retval; } - time_t CEF_CALLBACK zip_reader_get_file_last_modified( struct _cef_zip_reader_t* self) { @@ -157,7 +150,6 @@ time_t CEF_CALLBACK zip_reader_get_file_last_modified( return _retval; } - int CEF_CALLBACK zip_reader_open_file(struct _cef_zip_reader_t* self, const cef_string_t* password) { @@ -176,7 +168,6 @@ int CEF_CALLBACK zip_reader_open_file(struct _cef_zip_reader_t* self, return _retval; } - int CEF_CALLBACK zip_reader_close_file(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -192,7 +183,6 @@ int CEF_CALLBACK zip_reader_close_file(struct _cef_zip_reader_t* self) return _retval; } - int CEF_CALLBACK zip_reader_read_file(struct _cef_zip_reader_t* self, void* buffer, size_t bufferSize) { @@ -215,7 +205,6 @@ int CEF_CALLBACK zip_reader_read_file(struct _cef_zip_reader_t* self, return _retval; } - long CEF_CALLBACK zip_reader_tell(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -231,7 +220,6 @@ long CEF_CALLBACK zip_reader_tell(struct _cef_zip_reader_t* self) return _retval; } - int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -248,7 +236,6 @@ int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) } - // CONSTRUCTOR - Do not edit by hand. CefZipReaderCppToC::CefZipReaderCppToC(CefZipReader* cls) diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.h b/libcef_dll/cpptoc/zip_reader_cpptoc.h index fdc3757fd..ec9148473 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.h +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_zip_reader.h" +#include "include/capi/cef_zip_reader_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/ctocpp/app_ctocpp.cc b/libcef_dll/ctocpp/app_ctocpp.cc index ee5503b5f..b5e5d9c49 100644 --- a/libcef_dll/ctocpp/app_ctocpp.cc +++ b/libcef_dll/ctocpp/app_ctocpp.cc @@ -31,7 +31,6 @@ CefRefPtr CefAppCToCpp::GetProxyHandler() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; #endif diff --git a/libcef_dll/ctocpp/app_ctocpp.h b/libcef_dll/ctocpp/app_ctocpp.h index b221e8562..618da37a6 100644 --- a/libcef_dll/ctocpp/app_ctocpp.h +++ b/libcef_dll/ctocpp/app_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_app.h" +#include "include/capi/cef_app_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/base_ctocpp.h b/libcef_dll/ctocpp/base_ctocpp.h index 8a7de871e..69df2a867 100644 --- a/libcef_dll/ctocpp/base_ctocpp.h +++ b/libcef_dll/ctocpp/base_ctocpp.h @@ -5,8 +5,8 @@ #ifndef _BASE_CTOCPP_H #define _BASE_CTOCPP_H -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" #include "libcef_dll/cef_logging.h" diff --git a/libcef_dll/ctocpp/browser_ctocpp.cc b/libcef_dll/ctocpp/browser_ctocpp.cc index aad112c7d..1a04a6cdb 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_ctocpp.cc @@ -41,7 +41,6 @@ bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, return _retval?true:false; } - CefRefPtr CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, const CefBrowserSettings& settings) @@ -66,7 +65,6 @@ CefRefPtr CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo, } - // VIRTUAL METHODS - Body may be edited by hand. void CefBrowserCToCpp::ParentWindowWillClose() @@ -80,7 +78,6 @@ void CefBrowserCToCpp::ParentWindowWillClose() struct_->parent_window_will_close(struct_); } - void CefBrowserCToCpp::CloseBrowser() { if (CEF_MEMBER_MISSING(struct_, close_browser)) @@ -92,7 +89,6 @@ void CefBrowserCToCpp::CloseBrowser() struct_->close_browser(struct_); } - bool CefBrowserCToCpp::CanGoBack() { if (CEF_MEMBER_MISSING(struct_, can_go_back)) @@ -107,7 +103,6 @@ bool CefBrowserCToCpp::CanGoBack() return _retval?true:false; } - void CefBrowserCToCpp::GoBack() { if (CEF_MEMBER_MISSING(struct_, go_back)) @@ -119,7 +114,6 @@ void CefBrowserCToCpp::GoBack() struct_->go_back(struct_); } - bool CefBrowserCToCpp::CanGoForward() { if (CEF_MEMBER_MISSING(struct_, can_go_forward)) @@ -134,7 +128,6 @@ bool CefBrowserCToCpp::CanGoForward() return _retval?true:false; } - void CefBrowserCToCpp::GoForward() { if (CEF_MEMBER_MISSING(struct_, go_forward)) @@ -146,7 +139,6 @@ void CefBrowserCToCpp::GoForward() struct_->go_forward(struct_); } - void CefBrowserCToCpp::Reload() { if (CEF_MEMBER_MISSING(struct_, reload)) @@ -158,7 +150,6 @@ void CefBrowserCToCpp::Reload() struct_->reload(struct_); } - void CefBrowserCToCpp::ReloadIgnoreCache() { if (CEF_MEMBER_MISSING(struct_, reload_ignore_cache)) @@ -170,7 +161,6 @@ void CefBrowserCToCpp::ReloadIgnoreCache() struct_->reload_ignore_cache(struct_); } - void CefBrowserCToCpp::StopLoad() { if (CEF_MEMBER_MISSING(struct_, stop_load)) @@ -182,7 +172,6 @@ void CefBrowserCToCpp::StopLoad() struct_->stop_load(struct_); } - void CefBrowserCToCpp::SetFocus(bool enable) { if (CEF_MEMBER_MISSING(struct_, set_focus)) @@ -195,7 +184,6 @@ void CefBrowserCToCpp::SetFocus(bool enable) enable); } - CefWindowHandle CefBrowserCToCpp::GetWindowHandle() { if (CEF_MEMBER_MISSING(struct_, get_window_handle)) @@ -210,7 +198,6 @@ CefWindowHandle CefBrowserCToCpp::GetWindowHandle() return _retval; } - CefWindowHandle CefBrowserCToCpp::GetOpenerWindowHandle() { if (CEF_MEMBER_MISSING(struct_, get_opener_window_handle)) @@ -225,7 +212,6 @@ CefWindowHandle CefBrowserCToCpp::GetOpenerWindowHandle() return _retval; } - bool CefBrowserCToCpp::IsPopup() { if (CEF_MEMBER_MISSING(struct_, is_popup)) @@ -240,7 +226,6 @@ bool CefBrowserCToCpp::IsPopup() return _retval?true:false; } - bool CefBrowserCToCpp::HasDocument() { if (CEF_MEMBER_MISSING(struct_, has_document)) @@ -255,7 +240,6 @@ bool CefBrowserCToCpp::HasDocument() return _retval?true:false; } - CefRefPtr CefBrowserCToCpp::GetClient() { if (CEF_MEMBER_MISSING(struct_, get_client)) @@ -270,7 +254,6 @@ CefRefPtr CefBrowserCToCpp::GetClient() return CefClientCppToC::Unwrap(_retval); } - CefRefPtr CefBrowserCToCpp::GetMainFrame() { if (CEF_MEMBER_MISSING(struct_, get_main_frame)) @@ -285,7 +268,6 @@ CefRefPtr CefBrowserCToCpp::GetMainFrame() return CefFrameCToCpp::Wrap(_retval); } - CefRefPtr CefBrowserCToCpp::GetFocusedFrame() { if (CEF_MEMBER_MISSING(struct_, get_focused_frame)) @@ -300,7 +282,6 @@ CefRefPtr CefBrowserCToCpp::GetFocusedFrame() return CefFrameCToCpp::Wrap(_retval); } - CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, get_frame)) @@ -321,7 +302,6 @@ CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) return CefFrameCToCpp::Wrap(_retval); } - void CefBrowserCToCpp::GetFrameNames(std::vector& names) { if (CEF_MEMBER_MISSING(struct_, get_frame_names)) @@ -347,7 +327,6 @@ void CefBrowserCToCpp::GetFrameNames(std::vector& names) } } - void CefBrowserCToCpp::Find(int identifier, const CefString& searchText, bool forward, bool matchCase, bool findNext) { @@ -370,7 +349,6 @@ void CefBrowserCToCpp::Find(int identifier, const CefString& searchText, findNext); } - void CefBrowserCToCpp::StopFinding(bool clearSelection) { if (CEF_MEMBER_MISSING(struct_, stop_finding)) @@ -383,7 +361,6 @@ void CefBrowserCToCpp::StopFinding(bool clearSelection) clearSelection); } - double CefBrowserCToCpp::GetZoomLevel() { if (CEF_MEMBER_MISSING(struct_, get_zoom_level)) @@ -398,7 +375,6 @@ double CefBrowserCToCpp::GetZoomLevel() return _retval; } - void CefBrowserCToCpp::SetZoomLevel(double zoomLevel) { if (CEF_MEMBER_MISSING(struct_, set_zoom_level)) @@ -411,7 +387,6 @@ void CefBrowserCToCpp::SetZoomLevel(double zoomLevel) zoomLevel); } - void CefBrowserCToCpp::ClearHistory() { if (CEF_MEMBER_MISSING(struct_, clear_history)) @@ -423,7 +398,6 @@ void CefBrowserCToCpp::ClearHistory() struct_->clear_history(struct_); } - void CefBrowserCToCpp::ShowDevTools() { if (CEF_MEMBER_MISSING(struct_, show_dev_tools)) @@ -435,7 +409,6 @@ void CefBrowserCToCpp::ShowDevTools() struct_->show_dev_tools(struct_); } - void CefBrowserCToCpp::CloseDevTools() { if (CEF_MEMBER_MISSING(struct_, close_dev_tools)) @@ -447,7 +420,6 @@ void CefBrowserCToCpp::CloseDevTools() struct_->close_dev_tools(struct_); } - bool CefBrowserCToCpp::IsWindowRenderingDisabled() { if (CEF_MEMBER_MISSING(struct_, is_window_rendering_disabled)) @@ -462,7 +434,6 @@ bool CefBrowserCToCpp::IsWindowRenderingDisabled() return _retval?true:false; } - bool CefBrowserCToCpp::GetSize(PaintElementType type, int& width, int& height) { if (CEF_MEMBER_MISSING(struct_, get_size)) @@ -480,7 +451,6 @@ bool CefBrowserCToCpp::GetSize(PaintElementType type, int& width, int& height) return _retval?true:false; } - void CefBrowserCToCpp::SetSize(PaintElementType type, int width, int height) { if (CEF_MEMBER_MISSING(struct_, set_size)) @@ -495,7 +465,6 @@ void CefBrowserCToCpp::SetSize(PaintElementType type, int width, int height) height); } - bool CefBrowserCToCpp::IsPopupVisible() { if (CEF_MEMBER_MISSING(struct_, is_popup_visible)) @@ -510,7 +479,6 @@ bool CefBrowserCToCpp::IsPopupVisible() return _retval?true:false; } - void CefBrowserCToCpp::HidePopup() { if (CEF_MEMBER_MISSING(struct_, hide_popup)) @@ -522,7 +490,6 @@ void CefBrowserCToCpp::HidePopup() struct_->hide_popup(struct_); } - void CefBrowserCToCpp::Invalidate(const CefRect& dirtyRect) { if (CEF_MEMBER_MISSING(struct_, invalidate)) @@ -535,7 +502,6 @@ void CefBrowserCToCpp::Invalidate(const CefRect& dirtyRect) &dirtyRect); } - bool CefBrowserCToCpp::GetImage(PaintElementType type, int width, int height, void* buffer) { @@ -560,7 +526,6 @@ bool CefBrowserCToCpp::GetImage(PaintElementType type, int width, int height, return _retval?true:false; } - void CefBrowserCToCpp::SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar, bool imeChar) { @@ -578,7 +543,6 @@ void CefBrowserCToCpp::SendKeyEvent(KeyType type, int key, int modifiers, imeChar); } - void CefBrowserCToCpp::SendMouseClickEvent(int x, int y, MouseButtonType type, bool mouseUp, int clickCount) { @@ -596,7 +560,6 @@ void CefBrowserCToCpp::SendMouseClickEvent(int x, int y, MouseButtonType type, clickCount); } - void CefBrowserCToCpp::SendMouseMoveEvent(int x, int y, bool mouseLeave) { if (CEF_MEMBER_MISSING(struct_, send_mouse_move_event)) @@ -611,7 +574,6 @@ void CefBrowserCToCpp::SendMouseMoveEvent(int x, int y, bool mouseLeave) mouseLeave); } - void CefBrowserCToCpp::SendMouseWheelEvent(int x, int y, int delta) { if (CEF_MEMBER_MISSING(struct_, send_mouse_wheel_event)) @@ -626,7 +588,6 @@ void CefBrowserCToCpp::SendMouseWheelEvent(int x, int y, int delta) delta); } - void CefBrowserCToCpp::SendFocusEvent(bool setFocus) { if (CEF_MEMBER_MISSING(struct_, send_focus_event)) @@ -639,7 +600,6 @@ void CefBrowserCToCpp::SendFocusEvent(bool setFocus) setFocus); } - void CefBrowserCToCpp::SendCaptureLostEvent() { if (CEF_MEMBER_MISSING(struct_, send_capture_lost_event)) @@ -652,7 +612,6 @@ void CefBrowserCToCpp::SendCaptureLostEvent() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/browser_ctocpp.h b/libcef_dll/ctocpp/browser_ctocpp.h index de9739b20..2daf610fd 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.h +++ b/libcef_dll/ctocpp/browser_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/client_ctocpp.cc b/libcef_dll/ctocpp/client_ctocpp.cc index 9190b9edf..ce0b6329e 100644 --- a/libcef_dll/ctocpp/client_ctocpp.cc +++ b/libcef_dll/ctocpp/client_ctocpp.cc @@ -42,7 +42,6 @@ CefRefPtr CefClientCToCpp::GetLifeSpanHandler() return CefLifeSpanHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetLoadHandler() { if (CEF_MEMBER_MISSING(struct_, get_load_handler)) @@ -57,7 +56,6 @@ CefRefPtr CefClientCToCpp::GetLoadHandler() return CefLoadHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetRequestHandler() { if (CEF_MEMBER_MISSING(struct_, get_request_handler)) @@ -72,7 +70,6 @@ CefRefPtr CefClientCToCpp::GetRequestHandler() return CefRequestHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetDisplayHandler() { if (CEF_MEMBER_MISSING(struct_, get_display_handler)) @@ -87,7 +84,6 @@ CefRefPtr CefClientCToCpp::GetDisplayHandler() return CefDisplayHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetFocusHandler() { if (CEF_MEMBER_MISSING(struct_, get_focus_handler)) @@ -102,7 +98,6 @@ CefRefPtr CefClientCToCpp::GetFocusHandler() return CefFocusHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetKeyboardHandler() { if (CEF_MEMBER_MISSING(struct_, get_keyboard_handler)) @@ -117,7 +112,6 @@ CefRefPtr CefClientCToCpp::GetKeyboardHandler() return CefKeyboardHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetMenuHandler() { if (CEF_MEMBER_MISSING(struct_, get_menu_handler)) @@ -132,7 +126,6 @@ CefRefPtr CefClientCToCpp::GetMenuHandler() return CefMenuHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetPrintHandler() { if (CEF_MEMBER_MISSING(struct_, get_print_handler)) @@ -147,7 +140,6 @@ CefRefPtr CefClientCToCpp::GetPrintHandler() return CefPrintHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetFindHandler() { if (CEF_MEMBER_MISSING(struct_, get_find_handler)) @@ -162,7 +154,6 @@ CefRefPtr CefClientCToCpp::GetFindHandler() return CefFindHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetJSDialogHandler() { if (CEF_MEMBER_MISSING(struct_, get_jsdialog_handler)) @@ -177,7 +168,6 @@ CefRefPtr CefClientCToCpp::GetJSDialogHandler() return CefJSDialogHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetV8ContextHandler() { if (CEF_MEMBER_MISSING(struct_, get_v8context_handler)) @@ -192,7 +182,6 @@ CefRefPtr CefClientCToCpp::GetV8ContextHandler() return CefV8ContextHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetRenderHandler() { if (CEF_MEMBER_MISSING(struct_, get_render_handler)) @@ -207,7 +196,6 @@ CefRefPtr CefClientCToCpp::GetRenderHandler() return CefRenderHandlerCToCpp::Wrap(_retval); } - CefRefPtr CefClientCToCpp::GetDragHandler() { if (CEF_MEMBER_MISSING(struct_, get_drag_handler)) @@ -223,7 +211,6 @@ CefRefPtr CefClientCToCpp::GetDragHandler() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/client_ctocpp.h b/libcef_dll/ctocpp/client_ctocpp.h index aa0ee9d7c..4f613d83a 100644 --- a/libcef_dll/ctocpp/client_ctocpp.h +++ b/libcef_dll/ctocpp/client_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/command_line_ctocpp.cc b/libcef_dll/ctocpp/command_line_ctocpp.cc index c66e8542c..0e154d993 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.cc +++ b/libcef_dll/ctocpp/command_line_ctocpp.cc @@ -36,7 +36,6 @@ CefRefPtr CefCommandLine::CreateCommandLine() } - // VIRTUAL METHODS - Body may be edited by hand. void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) @@ -57,7 +56,6 @@ void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) argv); } - void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { if (CEF_MEMBER_MISSING(struct_, init_from_string)) @@ -75,7 +73,6 @@ void CefCommandLineCToCpp::InitFromString(const CefString& command_line) command_line.GetStruct()); } - CefString CefCommandLineCToCpp::GetCommandLineString() { if (CEF_MEMBER_MISSING(struct_, get_command_line_string)) @@ -92,7 +89,6 @@ CefString CefCommandLineCToCpp::GetCommandLineString() return _retvalStr; } - CefString CefCommandLineCToCpp::GetProgram() { if (CEF_MEMBER_MISSING(struct_, get_program)) @@ -109,7 +105,6 @@ CefString CefCommandLineCToCpp::GetProgram() return _retvalStr; } - void CefCommandLineCToCpp::SetProgram(const CefString& program) { if (CEF_MEMBER_MISSING(struct_, set_program)) @@ -127,7 +122,6 @@ void CefCommandLineCToCpp::SetProgram(const CefString& program) program.GetStruct()); } - bool CefCommandLineCToCpp::HasSwitches() { if (CEF_MEMBER_MISSING(struct_, has_switches)) @@ -142,7 +136,6 @@ bool CefCommandLineCToCpp::HasSwitches() return _retval?true:false; } - bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, has_switch)) @@ -163,7 +156,6 @@ bool CefCommandLineCToCpp::HasSwitch(const CefString& name) return _retval?true:false; } - CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, get_switch_value)) @@ -186,7 +178,6 @@ CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) return _retvalStr; } - void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { if (CEF_MEMBER_MISSING(struct_, get_switches)) @@ -212,7 +203,6 @@ void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) } } - void CefCommandLineCToCpp::AppendSwitch(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, append_switch)) @@ -230,7 +220,6 @@ void CefCommandLineCToCpp::AppendSwitch(const CefString& name) name.GetStruct()); } - void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, const CefString& value) { @@ -254,7 +243,6 @@ void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, value.GetStruct()); } - bool CefCommandLineCToCpp::HasArguments() { if (CEF_MEMBER_MISSING(struct_, has_arguments)) @@ -269,7 +257,6 @@ bool CefCommandLineCToCpp::HasArguments() return _retval?true:false; } - void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { if (CEF_MEMBER_MISSING(struct_, get_arguments)) @@ -295,7 +282,6 @@ void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) } } - void CefCommandLineCToCpp::AppendArgument(const CefString& argument) { if (CEF_MEMBER_MISSING(struct_, append_argument)) @@ -314,7 +300,6 @@ void CefCommandLineCToCpp::AppendArgument(const CefString& argument) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/command_line_ctocpp.h b/libcef_dll/ctocpp/command_line_ctocpp.h index cc8b6778c..c32c5d747 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.h +++ b/libcef_dll/ctocpp/command_line_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_command_line.h" +#include "include/capi/cef_command_line_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/content_filter_ctocpp.cc b/libcef_dll/ctocpp/content_filter_ctocpp.cc index 64fbc52ed..0c68f05d6 100644 --- a/libcef_dll/ctocpp/content_filter_ctocpp.cc +++ b/libcef_dll/ctocpp/content_filter_ctocpp.cc @@ -51,7 +51,6 @@ void CefContentFilterCToCpp::ProcessData(const void* data, int data_size, } } - void CefContentFilterCToCpp::Drain(CefRefPtr& remainder) { if (CEF_MEMBER_MISSING(struct_, drain)) @@ -80,7 +79,6 @@ void CefContentFilterCToCpp::Drain(CefRefPtr& remainder) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/content_filter_ctocpp.h b/libcef_dll/ctocpp/content_filter_ctocpp.h index a9b8e75ce..b37174d46 100644 --- a/libcef_dll/ctocpp/content_filter_ctocpp.h +++ b/libcef_dll/ctocpp/content_filter_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_content_filter.h" +#include "include/capi/cef_content_filter_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc index 0a36ca4f0..5039e759d 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc @@ -41,7 +41,6 @@ bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h index 7a89a697e..ee50b92b5 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_cookie.h" +#include "include/capi/cef_cookie_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/ctocpp.h b/libcef_dll/ctocpp/ctocpp.h index ba2e01c2a..9f937c58b 100644 --- a/libcef_dll/ctocpp/ctocpp.h +++ b/libcef_dll/ctocpp/ctocpp.h @@ -5,8 +5,8 @@ #ifndef _CTOCPP_H #define _CTOCPP_H -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" #include "libcef_dll/cef_logging.h" diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.cc b/libcef_dll/ctocpp/display_handler_ctocpp.cc index 0769369fa..eccc34d79 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/display_handler_ctocpp.cc @@ -37,7 +37,6 @@ void CefDisplayHandlerCToCpp::OnNavStateChange(CefRefPtr browser, canGoForward); } - void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, CefRefPtr frame, const CefString& url) { @@ -66,7 +65,6 @@ void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, url.GetStruct()); } - void CefDisplayHandlerCToCpp::OnContentsSizeChange( CefRefPtr browser, CefRefPtr frame, int width, int height) @@ -93,7 +91,6 @@ void CefDisplayHandlerCToCpp::OnContentsSizeChange( height); } - void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, const CefString& title) { @@ -114,7 +111,6 @@ void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, title.GetStruct()); } - bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, CefString& text) { @@ -138,7 +134,6 @@ bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, return _retval?true:false; } - void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, const CefString& value, StatusType type) { @@ -160,7 +155,6 @@ void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, type); } - bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, const CefString& message, const CefString& source, int line) { @@ -187,7 +181,6 @@ bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.h b/libcef_dll/ctocpp/display_handler_ctocpp.h index 7b6df4425..76dc09736 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.h +++ b/libcef_dll/ctocpp/display_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_display_handler.h" +#include "include/capi/cef_display_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.cc b/libcef_dll/ctocpp/domdocument_ctocpp.cc index e784f572e..cd5d07522 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.cc +++ b/libcef_dll/ctocpp/domdocument_ctocpp.cc @@ -30,7 +30,6 @@ CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() return _retval; } - CefRefPtr CefDOMDocumentCToCpp::GetDocument() { if (CEF_MEMBER_MISSING(struct_, get_document)) @@ -45,7 +44,6 @@ CefRefPtr CefDOMDocumentCToCpp::GetDocument() return CefDOMNodeCToCpp::Wrap(_retval); } - CefRefPtr CefDOMDocumentCToCpp::GetBody() { if (CEF_MEMBER_MISSING(struct_, get_body)) @@ -60,7 +58,6 @@ CefRefPtr CefDOMDocumentCToCpp::GetBody() return CefDOMNodeCToCpp::Wrap(_retval); } - CefRefPtr CefDOMDocumentCToCpp::GetHead() { if (CEF_MEMBER_MISSING(struct_, get_head)) @@ -75,7 +72,6 @@ CefRefPtr CefDOMDocumentCToCpp::GetHead() return CefDOMNodeCToCpp::Wrap(_retval); } - CefString CefDOMDocumentCToCpp::GetTitle() { if (CEF_MEMBER_MISSING(struct_, get_title)) @@ -92,7 +88,6 @@ CefString CefDOMDocumentCToCpp::GetTitle() return _retvalStr; } - CefRefPtr CefDOMDocumentCToCpp::GetElementById(const CefString& id) { if (CEF_MEMBER_MISSING(struct_, get_element_by_id)) @@ -113,7 +108,6 @@ CefRefPtr CefDOMDocumentCToCpp::GetElementById(const CefString& id) return CefDOMNodeCToCpp::Wrap(_retval); } - CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() { if (CEF_MEMBER_MISSING(struct_, get_focused_node)) @@ -128,7 +122,6 @@ CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() return CefDOMNodeCToCpp::Wrap(_retval); } - bool CefDOMDocumentCToCpp::HasSelection() { if (CEF_MEMBER_MISSING(struct_, has_selection)) @@ -143,7 +136,6 @@ bool CefDOMDocumentCToCpp::HasSelection() return _retval?true:false; } - CefRefPtr CefDOMDocumentCToCpp::GetSelectionStartNode() { if (CEF_MEMBER_MISSING(struct_, get_selection_start_node)) @@ -158,7 +150,6 @@ CefRefPtr CefDOMDocumentCToCpp::GetSelectionStartNode() return CefDOMNodeCToCpp::Wrap(_retval); } - int CefDOMDocumentCToCpp::GetSelectionStartOffset() { if (CEF_MEMBER_MISSING(struct_, get_selection_start_offset)) @@ -173,7 +164,6 @@ int CefDOMDocumentCToCpp::GetSelectionStartOffset() return _retval; } - CefRefPtr CefDOMDocumentCToCpp::GetSelectionEndNode() { if (CEF_MEMBER_MISSING(struct_, get_selection_end_node)) @@ -188,7 +178,6 @@ CefRefPtr CefDOMDocumentCToCpp::GetSelectionEndNode() return CefDOMNodeCToCpp::Wrap(_retval); } - int CefDOMDocumentCToCpp::GetSelectionEndOffset() { if (CEF_MEMBER_MISSING(struct_, get_selection_end_offset)) @@ -203,7 +192,6 @@ int CefDOMDocumentCToCpp::GetSelectionEndOffset() return _retval; } - CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() { if (CEF_MEMBER_MISSING(struct_, get_selection_as_markup)) @@ -220,7 +208,6 @@ CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() return _retvalStr; } - CefString CefDOMDocumentCToCpp::GetSelectionAsText() { if (CEF_MEMBER_MISSING(struct_, get_selection_as_text)) @@ -237,7 +224,6 @@ CefString CefDOMDocumentCToCpp::GetSelectionAsText() return _retvalStr; } - CefString CefDOMDocumentCToCpp::GetBaseURL() { if (CEF_MEMBER_MISSING(struct_, get_base_url)) @@ -254,7 +240,6 @@ CefString CefDOMDocumentCToCpp::GetBaseURL() return _retvalStr; } - CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { if (CEF_MEMBER_MISSING(struct_, get_complete_url)) @@ -278,7 +263,6 @@ CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.h b/libcef_dll/ctocpp/domdocument_ctocpp.h index c448a83a4..e203cd375 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.h +++ b/libcef_dll/ctocpp/domdocument_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/domevent_ctocpp.cc b/libcef_dll/ctocpp/domevent_ctocpp.cc index a02cdb946..1611b0ff1 100644 --- a/libcef_dll/ctocpp/domevent_ctocpp.cc +++ b/libcef_dll/ctocpp/domevent_ctocpp.cc @@ -33,7 +33,6 @@ CefString CefDOMEventCToCpp::GetType() return _retvalStr; } - CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() { if (CEF_MEMBER_MISSING(struct_, get_category)) @@ -48,7 +47,6 @@ CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() return _retval; } - CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() { if (CEF_MEMBER_MISSING(struct_, get_phase)) @@ -63,7 +61,6 @@ CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() return _retval; } - bool CefDOMEventCToCpp::CanBubble() { if (CEF_MEMBER_MISSING(struct_, can_bubble)) @@ -78,7 +75,6 @@ bool CefDOMEventCToCpp::CanBubble() return _retval?true:false; } - bool CefDOMEventCToCpp::CanCancel() { if (CEF_MEMBER_MISSING(struct_, can_cancel)) @@ -93,7 +89,6 @@ bool CefDOMEventCToCpp::CanCancel() return _retval?true:false; } - CefRefPtr CefDOMEventCToCpp::GetDocument() { if (CEF_MEMBER_MISSING(struct_, get_document)) @@ -108,7 +103,6 @@ CefRefPtr CefDOMEventCToCpp::GetDocument() return CefDOMDocumentCToCpp::Wrap(_retval); } - CefRefPtr CefDOMEventCToCpp::GetTarget() { if (CEF_MEMBER_MISSING(struct_, get_target)) @@ -123,7 +117,6 @@ CefRefPtr CefDOMEventCToCpp::GetTarget() return CefDOMNodeCToCpp::Wrap(_retval); } - CefRefPtr CefDOMEventCToCpp::GetCurrentTarget() { if (CEF_MEMBER_MISSING(struct_, get_current_target)) @@ -139,7 +132,6 @@ CefRefPtr CefDOMEventCToCpp::GetCurrentTarget() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domevent_ctocpp.h b/libcef_dll/ctocpp/domevent_ctocpp.h index 75136b753..c19fa09d5 100644 --- a/libcef_dll/ctocpp/domevent_ctocpp.h +++ b/libcef_dll/ctocpp/domevent_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/domevent_listener_ctocpp.cc b/libcef_dll/ctocpp/domevent_listener_ctocpp.cc index dcb06a821..56bae320d 100644 --- a/libcef_dll/ctocpp/domevent_listener_ctocpp.cc +++ b/libcef_dll/ctocpp/domevent_listener_ctocpp.cc @@ -34,7 +34,6 @@ void CefDOMEventListenerCToCpp::HandleEvent(CefRefPtr event) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domevent_listener_ctocpp.h b/libcef_dll/ctocpp/domevent_listener_ctocpp.h index c8435fb1d..d6dbf3dbc 100644 --- a/libcef_dll/ctocpp/domevent_listener_ctocpp.h +++ b/libcef_dll/ctocpp/domevent_listener_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/domnode_ctocpp.cc b/libcef_dll/ctocpp/domnode_ctocpp.cc index 783818660..a262174b1 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.cc +++ b/libcef_dll/ctocpp/domnode_ctocpp.cc @@ -32,7 +32,6 @@ CefDOMNode::Type CefDOMNodeCToCpp::GetType() return _retval; } - bool CefDOMNodeCToCpp::IsText() { if (CEF_MEMBER_MISSING(struct_, is_text)) @@ -47,7 +46,6 @@ bool CefDOMNodeCToCpp::IsText() return _retval?true:false; } - bool CefDOMNodeCToCpp::IsElement() { if (CEF_MEMBER_MISSING(struct_, is_element)) @@ -62,7 +60,6 @@ bool CefDOMNodeCToCpp::IsElement() return _retval?true:false; } - bool CefDOMNodeCToCpp::IsFormControlElement() { if (CEF_MEMBER_MISSING(struct_, is_form_control_element)) @@ -77,7 +74,6 @@ bool CefDOMNodeCToCpp::IsFormControlElement() return _retval?true:false; } - CefString CefDOMNodeCToCpp::GetFormControlElementType() { if (CEF_MEMBER_MISSING(struct_, get_form_control_element_type)) @@ -95,7 +91,6 @@ CefString CefDOMNodeCToCpp::GetFormControlElementType() return _retvalStr; } - bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) @@ -116,7 +111,6 @@ bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) return _retval?true:false; } - CefString CefDOMNodeCToCpp::GetName() { if (CEF_MEMBER_MISSING(struct_, get_name)) @@ -133,7 +127,6 @@ CefString CefDOMNodeCToCpp::GetName() return _retvalStr; } - CefString CefDOMNodeCToCpp::GetValue() { if (CEF_MEMBER_MISSING(struct_, get_value)) @@ -150,7 +143,6 @@ CefString CefDOMNodeCToCpp::GetValue() return _retvalStr; } - bool CefDOMNodeCToCpp::SetValue(const CefString& value) { if (CEF_MEMBER_MISSING(struct_, set_value)) @@ -171,7 +163,6 @@ bool CefDOMNodeCToCpp::SetValue(const CefString& value) return _retval?true:false; } - CefString CefDOMNodeCToCpp::GetAsMarkup() { if (CEF_MEMBER_MISSING(struct_, get_as_markup)) @@ -188,7 +179,6 @@ CefString CefDOMNodeCToCpp::GetAsMarkup() return _retvalStr; } - CefRefPtr CefDOMNodeCToCpp::GetDocument() { if (CEF_MEMBER_MISSING(struct_, get_document)) @@ -203,7 +193,6 @@ CefRefPtr CefDOMNodeCToCpp::GetDocument() return CefDOMDocumentCToCpp::Wrap(_retval); } - CefRefPtr CefDOMNodeCToCpp::GetParent() { if (CEF_MEMBER_MISSING(struct_, get_parent)) @@ -218,7 +207,6 @@ CefRefPtr CefDOMNodeCToCpp::GetParent() return CefDOMNodeCToCpp::Wrap(_retval); } - CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() { if (CEF_MEMBER_MISSING(struct_, get_previous_sibling)) @@ -233,7 +221,6 @@ CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() return CefDOMNodeCToCpp::Wrap(_retval); } - CefRefPtr CefDOMNodeCToCpp::GetNextSibling() { if (CEF_MEMBER_MISSING(struct_, get_next_sibling)) @@ -248,7 +235,6 @@ CefRefPtr CefDOMNodeCToCpp::GetNextSibling() return CefDOMNodeCToCpp::Wrap(_retval); } - bool CefDOMNodeCToCpp::HasChildren() { if (CEF_MEMBER_MISSING(struct_, has_children)) @@ -263,7 +249,6 @@ bool CefDOMNodeCToCpp::HasChildren() return _retval?true:false; } - CefRefPtr CefDOMNodeCToCpp::GetFirstChild() { if (CEF_MEMBER_MISSING(struct_, get_first_child)) @@ -278,7 +263,6 @@ CefRefPtr CefDOMNodeCToCpp::GetFirstChild() return CefDOMNodeCToCpp::Wrap(_retval); } - CefRefPtr CefDOMNodeCToCpp::GetLastChild() { if (CEF_MEMBER_MISSING(struct_, get_last_child)) @@ -293,7 +277,6 @@ CefRefPtr CefDOMNodeCToCpp::GetLastChild() return CefDOMNodeCToCpp::Wrap(_retval); } - void CefDOMNodeCToCpp::AddEventListener(const CefString& eventType, CefRefPtr listener, bool useCapture) { @@ -318,7 +301,6 @@ void CefDOMNodeCToCpp::AddEventListener(const CefString& eventType, useCapture); } - CefString CefDOMNodeCToCpp::GetElementTagName() { if (CEF_MEMBER_MISSING(struct_, get_element_tag_name)) @@ -335,7 +317,6 @@ CefString CefDOMNodeCToCpp::GetElementTagName() return _retvalStr; } - bool CefDOMNodeCToCpp::HasElementAttributes() { if (CEF_MEMBER_MISSING(struct_, has_element_attributes)) @@ -350,7 +331,6 @@ bool CefDOMNodeCToCpp::HasElementAttributes() return _retval?true:false; } - bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { if (CEF_MEMBER_MISSING(struct_, has_element_attribute)) @@ -371,7 +351,6 @@ bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) return _retval?true:false; } - CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { if (CEF_MEMBER_MISSING(struct_, get_element_attribute)) @@ -394,7 +373,6 @@ CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) return _retvalStr; } - void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { if (CEF_MEMBER_MISSING(struct_, get_element_attributes)) @@ -420,7 +398,6 @@ void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) } } - bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, const CefString& value) { @@ -447,7 +424,6 @@ bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, return _retval?true:false; } - CefString CefDOMNodeCToCpp::GetElementInnerText() { if (CEF_MEMBER_MISSING(struct_, get_element_inner_text)) @@ -465,7 +441,6 @@ CefString CefDOMNodeCToCpp::GetElementInnerText() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domnode_ctocpp.h b/libcef_dll/ctocpp/domnode_ctocpp.h index 5c8d50c12..8ecc9fdbe 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.h +++ b/libcef_dll/ctocpp/domnode_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.cc b/libcef_dll/ctocpp/domvisitor_ctocpp.cc index 4b84d05de..5bbdefd5e 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.cc +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.cc @@ -34,7 +34,6 @@ void CefDOMVisitorCToCpp::Visit(CefRefPtr document) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.h b/libcef_dll/ctocpp/domvisitor_ctocpp.h index a86362562..d68b4050d 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.h +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.cc b/libcef_dll/ctocpp/download_handler_ctocpp.cc index affab7abf..d99b90c89 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/download_handler_ctocpp.cc @@ -36,7 +36,6 @@ bool CefDownloadHandlerCToCpp::ReceivedData(void* data, int data_size) return _retval?true:false; } - void CefDownloadHandlerCToCpp::Complete() { if (CEF_MEMBER_MISSING(struct_, complete)) @@ -49,7 +48,6 @@ void CefDownloadHandlerCToCpp::Complete() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.h b/libcef_dll/ctocpp/download_handler_ctocpp.h index d398f1ede..08c6d108a 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.h +++ b/libcef_dll/ctocpp/download_handler_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_download_handler.h" +#include "include/capi/cef_download_handler_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.cc b/libcef_dll/ctocpp/drag_data_ctocpp.cc index b6179b24d..e702bfb33 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_data_ctocpp.cc @@ -30,7 +30,6 @@ bool CefDragDataCToCpp::IsLink() return _retval?true:false; } - bool CefDragDataCToCpp::IsFragment() { if (CEF_MEMBER_MISSING(struct_, is_fragment)) @@ -45,7 +44,6 @@ bool CefDragDataCToCpp::IsFragment() return _retval?true:false; } - bool CefDragDataCToCpp::IsFile() { if (CEF_MEMBER_MISSING(struct_, is_file)) @@ -60,7 +58,6 @@ bool CefDragDataCToCpp::IsFile() return _retval?true:false; } - CefString CefDragDataCToCpp::GetLinkURL() { if (CEF_MEMBER_MISSING(struct_, get_link_url)) @@ -77,7 +74,6 @@ CefString CefDragDataCToCpp::GetLinkURL() return _retvalStr; } - CefString CefDragDataCToCpp::GetLinkTitle() { if (CEF_MEMBER_MISSING(struct_, get_link_title)) @@ -94,7 +90,6 @@ CefString CefDragDataCToCpp::GetLinkTitle() return _retvalStr; } - CefString CefDragDataCToCpp::GetLinkMetadata() { if (CEF_MEMBER_MISSING(struct_, get_link_metadata)) @@ -111,7 +106,6 @@ CefString CefDragDataCToCpp::GetLinkMetadata() return _retvalStr; } - CefString CefDragDataCToCpp::GetFragmentText() { if (CEF_MEMBER_MISSING(struct_, get_fragment_text)) @@ -128,7 +122,6 @@ CefString CefDragDataCToCpp::GetFragmentText() return _retvalStr; } - CefString CefDragDataCToCpp::GetFragmentHtml() { if (CEF_MEMBER_MISSING(struct_, get_fragment_html)) @@ -145,7 +138,6 @@ CefString CefDragDataCToCpp::GetFragmentHtml() return _retvalStr; } - CefString CefDragDataCToCpp::GetFragmentBaseURL() { if (CEF_MEMBER_MISSING(struct_, get_fragment_base_url)) @@ -162,7 +154,6 @@ CefString CefDragDataCToCpp::GetFragmentBaseURL() return _retvalStr; } - CefString CefDragDataCToCpp::GetFileExtension() { if (CEF_MEMBER_MISSING(struct_, get_file_extension)) @@ -179,7 +170,6 @@ CefString CefDragDataCToCpp::GetFileExtension() return _retvalStr; } - CefString CefDragDataCToCpp::GetFileName() { if (CEF_MEMBER_MISSING(struct_, get_file_name)) @@ -196,7 +186,6 @@ CefString CefDragDataCToCpp::GetFileName() return _retvalStr; } - bool CefDragDataCToCpp::GetFileNames(std::vector& names) { if (CEF_MEMBER_MISSING(struct_, get_file_names)) @@ -226,7 +215,6 @@ bool CefDragDataCToCpp::GetFileNames(std::vector& names) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.h b/libcef_dll/ctocpp/drag_data_ctocpp.h index 9b867d967..b29dfb872 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.h +++ b/libcef_dll/ctocpp/drag_data_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_drag_data.h" +#include "include/capi/cef_drag_data_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.cc b/libcef_dll/ctocpp/drag_handler_ctocpp.cc index d961d5073..fdfd98f36 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.cc @@ -44,7 +44,6 @@ bool CefDragHandlerCToCpp::OnDragStart(CefRefPtr browser, return _retval?true:false; } - bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, CefRefPtr dragData, DragOperationsMask mask) { @@ -73,7 +72,6 @@ bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.h b/libcef_dll/ctocpp/drag_handler_ctocpp.h index 381c9c482..69553d6a6 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.h +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_drag_handler.h" +#include "include/capi/cef_drag_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.cc b/libcef_dll/ctocpp/find_handler_ctocpp.cc index ff3240c45..dec425c4e 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/find_handler_ctocpp.cc @@ -41,7 +41,6 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.h b/libcef_dll/ctocpp/find_handler_ctocpp.h index 6e9693c01..af46d3a69 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.h +++ b/libcef_dll/ctocpp/find_handler_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_find_handler.h" +#include "include/capi/cef_find_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.cc b/libcef_dll/ctocpp/focus_handler_ctocpp.cc index 8ea09d40f..e805348d3 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.cc @@ -37,7 +37,6 @@ void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, next); } - bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, FocusSource source) { @@ -60,7 +59,6 @@ bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, return _retval?true:false; } - void CefFocusHandlerCToCpp::OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) { @@ -83,7 +81,6 @@ void CefFocusHandlerCToCpp::OnFocusedNodeChanged(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.h b/libcef_dll/ctocpp/focus_handler_ctocpp.h index 0a56aa23d..ec73a142e 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.h +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_focus_handler.h" +#include "include/capi/cef_focus_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/frame_ctocpp.cc b/libcef_dll/ctocpp/frame_ctocpp.cc index 8836b9876..d110a5da9 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.cc +++ b/libcef_dll/ctocpp/frame_ctocpp.cc @@ -31,7 +31,6 @@ void CefFrameCToCpp::Undo() struct_->undo(struct_); } - void CefFrameCToCpp::Redo() { if (CEF_MEMBER_MISSING(struct_, redo)) @@ -43,7 +42,6 @@ void CefFrameCToCpp::Redo() struct_->redo(struct_); } - void CefFrameCToCpp::Cut() { if (CEF_MEMBER_MISSING(struct_, cut)) @@ -55,7 +53,6 @@ void CefFrameCToCpp::Cut() struct_->cut(struct_); } - void CefFrameCToCpp::Copy() { if (CEF_MEMBER_MISSING(struct_, copy)) @@ -67,7 +64,6 @@ void CefFrameCToCpp::Copy() struct_->copy(struct_); } - void CefFrameCToCpp::Paste() { if (CEF_MEMBER_MISSING(struct_, paste)) @@ -79,7 +75,6 @@ void CefFrameCToCpp::Paste() struct_->paste(struct_); } - void CefFrameCToCpp::Delete() { if (CEF_MEMBER_MISSING(struct_, del)) @@ -91,7 +86,6 @@ void CefFrameCToCpp::Delete() struct_->del(struct_); } - void CefFrameCToCpp::SelectAll() { if (CEF_MEMBER_MISSING(struct_, select_all)) @@ -103,7 +97,6 @@ void CefFrameCToCpp::SelectAll() struct_->select_all(struct_); } - void CefFrameCToCpp::Print() { if (CEF_MEMBER_MISSING(struct_, print)) @@ -115,7 +108,6 @@ void CefFrameCToCpp::Print() struct_->print(struct_); } - void CefFrameCToCpp::ViewSource() { if (CEF_MEMBER_MISSING(struct_, view_source)) @@ -127,7 +119,6 @@ void CefFrameCToCpp::ViewSource() struct_->view_source(struct_); } - CefString CefFrameCToCpp::GetSource() { if (CEF_MEMBER_MISSING(struct_, get_source)) @@ -144,7 +135,6 @@ CefString CefFrameCToCpp::GetSource() return _retvalStr; } - CefString CefFrameCToCpp::GetText() { if (CEF_MEMBER_MISSING(struct_, get_text)) @@ -161,7 +151,6 @@ CefString CefFrameCToCpp::GetText() return _retvalStr; } - void CefFrameCToCpp::LoadRequest(CefRefPtr request) { if (CEF_MEMBER_MISSING(struct_, load_request)) @@ -179,7 +168,6 @@ void CefFrameCToCpp::LoadRequest(CefRefPtr request) CefRequestCToCpp::Unwrap(request)); } - void CefFrameCToCpp::LoadURL(const CefString& url) { if (CEF_MEMBER_MISSING(struct_, load_url)) @@ -197,7 +185,6 @@ void CefFrameCToCpp::LoadURL(const CefString& url) url.GetStruct()); } - void CefFrameCToCpp::LoadString(const CefString& string, const CefString& url) { if (CEF_MEMBER_MISSING(struct_, load_string)) @@ -220,7 +207,6 @@ void CefFrameCToCpp::LoadString(const CefString& string, const CefString& url) url.GetStruct()); } - void CefFrameCToCpp::LoadStream(CefRefPtr stream, const CefString& url) { @@ -244,7 +230,6 @@ void CefFrameCToCpp::LoadStream(CefRefPtr stream, url.GetStruct()); } - void CefFrameCToCpp::ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl, int startLine) { @@ -266,7 +251,6 @@ void CefFrameCToCpp::ExecuteJavaScript(const CefString& jsCode, startLine); } - bool CefFrameCToCpp::IsMain() { if (CEF_MEMBER_MISSING(struct_, is_main)) @@ -281,7 +265,6 @@ bool CefFrameCToCpp::IsMain() return _retval?true:false; } - bool CefFrameCToCpp::IsFocused() { if (CEF_MEMBER_MISSING(struct_, is_focused)) @@ -296,7 +279,6 @@ bool CefFrameCToCpp::IsFocused() return _retval?true:false; } - CefString CefFrameCToCpp::GetName() { if (CEF_MEMBER_MISSING(struct_, get_name)) @@ -313,7 +295,6 @@ CefString CefFrameCToCpp::GetName() return _retvalStr; } - long long CefFrameCToCpp::GetIdentifier() { if (CEF_MEMBER_MISSING(struct_, get_identifier)) @@ -328,7 +309,6 @@ long long CefFrameCToCpp::GetIdentifier() return _retval; } - CefRefPtr CefFrameCToCpp::GetParent() { if (CEF_MEMBER_MISSING(struct_, get_parent)) @@ -343,7 +323,6 @@ CefRefPtr CefFrameCToCpp::GetParent() return CefFrameCToCpp::Wrap(_retval); } - CefString CefFrameCToCpp::GetURL() { if (CEF_MEMBER_MISSING(struct_, get_url)) @@ -360,7 +339,6 @@ CefString CefFrameCToCpp::GetURL() return _retvalStr; } - CefRefPtr CefFrameCToCpp::GetBrowser() { if (CEF_MEMBER_MISSING(struct_, get_browser)) @@ -375,7 +353,6 @@ CefRefPtr CefFrameCToCpp::GetBrowser() return CefBrowserCToCpp::Wrap(_retval); } - void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) { if (CEF_MEMBER_MISSING(struct_, visit_dom)) @@ -393,7 +370,6 @@ void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) CefDOMVisitorCppToC::Wrap(visitor)); } - CefRefPtr CefFrameCToCpp::GetV8Context() { if (CEF_MEMBER_MISSING(struct_, get_v8context)) @@ -409,7 +385,6 @@ CefRefPtr CefFrameCToCpp::GetV8Context() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/frame_ctocpp.h b/libcef_dll/ctocpp/frame_ctocpp.h index 87310be79..e0267af23 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.h +++ b/libcef_dll/ctocpp/frame_ctocpp.h @@ -17,8 +17,18 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc index 884013997..c7446aec8 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc @@ -48,7 +48,6 @@ bool CefJSDialogHandlerCToCpp::OnJSAlert(CefRefPtr browser, return _retval?true:false; } - bool CefJSDialogHandlerCToCpp::OnJSConfirm(CefRefPtr browser, CefRefPtr frame, const CefString& message, bool& retval) { @@ -87,7 +86,6 @@ bool CefJSDialogHandlerCToCpp::OnJSConfirm(CefRefPtr browser, return _retval?true:false; } - bool CefJSDialogHandlerCToCpp::OnJSPrompt(CefRefPtr browser, CefRefPtr frame, const CefString& message, const CefString& defaultValue, bool& retval, CefString& result) @@ -134,7 +132,6 @@ bool CefJSDialogHandlerCToCpp::OnJSPrompt(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h index 3b89b2a65..96d8f8c9c 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_jsdialog_handler.h" +#include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc index dfbc41f64..0ab25a3fb 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc @@ -44,7 +44,6 @@ bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h index 99a2c9df8..7db185105 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_keyboard_handler.h" +#include "include/capi/cef_keyboard_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc index 7c2812dec..09a04d587 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc @@ -61,7 +61,6 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup( return _retval?true:false; } - void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, on_after_created)) @@ -79,7 +78,6 @@ void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) CefBrowserCppToC::Wrap(browser)); } - bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, run_modal)) @@ -100,7 +98,6 @@ bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) return _retval?true:false; } - bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, do_close)) @@ -121,7 +118,6 @@ bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) return _retval?true:false; } - void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, on_before_close)) @@ -140,7 +136,6 @@ void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.h b/libcef_dll/ctocpp/life_span_handler_ctocpp.h index 1394ec55d..def3a2af5 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.h +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_life_span_handler.h" +#include "include/capi/cef_life_span_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.cc b/libcef_dll/ctocpp/load_handler_ctocpp.cc index 46b64f9b1..dbfcd8c74 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/load_handler_ctocpp.cc @@ -40,7 +40,6 @@ void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, CefFrameCppToC::Wrap(frame)); } - void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) { @@ -65,7 +64,6 @@ void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, httpStatusCode); } - bool CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& failedUrl, CefString& errorText) @@ -101,7 +99,6 @@ bool CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.h b/libcef_dll/ctocpp/load_handler_ctocpp.h index 93c2e288f..48c021a9a 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.h +++ b/libcef_dll/ctocpp/load_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_load_handler.h" +#include "include/capi/cef_load_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/menu_handler_ctocpp.cc b/libcef_dll/ctocpp/menu_handler_ctocpp.cc index e61c7cdd1..62ae9db09 100644 --- a/libcef_dll/ctocpp/menu_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/menu_handler_ctocpp.cc @@ -38,7 +38,6 @@ bool CefMenuHandlerCToCpp::OnBeforeMenu(CefRefPtr browser, return _retval?true:false; } - void CefMenuHandlerCToCpp::GetMenuLabel(CefRefPtr browser, MenuId menuId, CefString& label) { @@ -59,7 +58,6 @@ void CefMenuHandlerCToCpp::GetMenuLabel(CefRefPtr browser, label.GetWritableStruct()); } - bool CefMenuHandlerCToCpp::OnMenuAction(CefRefPtr browser, MenuId menuId) { @@ -83,7 +81,6 @@ bool CefMenuHandlerCToCpp::OnMenuAction(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/menu_handler_ctocpp.h b/libcef_dll/ctocpp/menu_handler_ctocpp.h index e9c1287fe..5dcf50d5d 100644 --- a/libcef_dll/ctocpp/menu_handler_ctocpp.h +++ b/libcef_dll/ctocpp/menu_handler_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_menu_handler.h" +#include "include/capi/cef_menu_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/post_data_ctocpp.cc b/libcef_dll/ctocpp/post_data_ctocpp.cc index 7c6fe1dde..fdfaadc78 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_ctocpp.cc @@ -28,7 +28,6 @@ CefRefPtr CefPostData::CreatePostData() } - // VIRTUAL METHODS - Body may be edited by hand. size_t CefPostDataCToCpp::GetElementCount() @@ -45,7 +44,6 @@ size_t CefPostDataCToCpp::GetElementCount() return _retval; } - void CefPostDataCToCpp::GetElements(ElementVector& elements) { if (CEF_MEMBER_MISSING(struct_, get_elements)) @@ -85,7 +83,6 @@ void CefPostDataCToCpp::GetElements(ElementVector& elements) } } - bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { if (CEF_MEMBER_MISSING(struct_, remove_element)) @@ -106,7 +103,6 @@ bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) return _retval?true:false; } - bool CefPostDataCToCpp::AddElement(CefRefPtr element) { if (CEF_MEMBER_MISSING(struct_, add_element)) @@ -127,7 +123,6 @@ bool CefPostDataCToCpp::AddElement(CefRefPtr element) return _retval?true:false; } - void CefPostDataCToCpp::RemoveElements() { if (CEF_MEMBER_MISSING(struct_, remove_elements)) @@ -140,7 +135,6 @@ void CefPostDataCToCpp::RemoveElements() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/post_data_ctocpp.h b/libcef_dll/ctocpp/post_data_ctocpp.h index 1cc115158..722f94252 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/libcef_dll/ctocpp/post_data_element_ctocpp.cc index 848c6067f..43701816f 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.cc @@ -27,7 +27,6 @@ CefRefPtr CefPostDataElement::CreatePostDataElement() } - // VIRTUAL METHODS - Body may be edited by hand. void CefPostDataElementCToCpp::SetToEmpty() @@ -41,7 +40,6 @@ void CefPostDataElementCToCpp::SetToEmpty() struct_->set_to_empty(struct_); } - void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) { if (CEF_MEMBER_MISSING(struct_, set_to_file)) @@ -59,7 +57,6 @@ void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) fileName.GetStruct()); } - void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { if (CEF_MEMBER_MISSING(struct_, set_to_bytes)) @@ -78,7 +75,6 @@ void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) bytes); } - CefPostDataElement::Type CefPostDataElementCToCpp::GetType() { if (CEF_MEMBER_MISSING(struct_, get_type)) @@ -93,7 +89,6 @@ CefPostDataElement::Type CefPostDataElementCToCpp::GetType() return _retval; } - CefString CefPostDataElementCToCpp::GetFile() { if (CEF_MEMBER_MISSING(struct_, get_file)) @@ -110,7 +105,6 @@ CefString CefPostDataElementCToCpp::GetFile() return _retvalStr; } - size_t CefPostDataElementCToCpp::GetBytesCount() { if (CEF_MEMBER_MISSING(struct_, get_bytes_count)) @@ -125,7 +119,6 @@ size_t CefPostDataElementCToCpp::GetBytesCount() return _retval; } - size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { if (CEF_MEMBER_MISSING(struct_, get_bytes)) @@ -148,7 +141,6 @@ size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.h b/libcef_dll/ctocpp/post_data_element_ctocpp.h index 13186689a..95754d7d2 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.cc b/libcef_dll/ctocpp/print_handler_ctocpp.cc index c634cc777..f34e653d2 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/print_handler_ctocpp.cc @@ -39,7 +39,6 @@ bool CefPrintHandlerCToCpp::GetPrintOptions(CefRefPtr browser, return _retval?true:false; } - bool CefPrintHandlerCToCpp::GetPrintHeaderFooter(CefRefPtr browser, CefRefPtr frame, const CefPrintInfo& printInfo, const CefString& url, const CefString& title, int currentPage, @@ -90,7 +89,6 @@ bool CefPrintHandlerCToCpp::GetPrintHeaderFooter(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.h b/libcef_dll/ctocpp/print_handler_ctocpp.h index a392c04b8..a78bf9632 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.h +++ b/libcef_dll/ctocpp/print_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_print_handler.h" +#include "include/capi/cef_print_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/proxy_handler_ctocpp.cc b/libcef_dll/ctocpp/proxy_handler_ctocpp.cc index 06a7d6efc..eadc974e5 100644 --- a/libcef_dll/ctocpp/proxy_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/proxy_handler_ctocpp.cc @@ -35,7 +35,6 @@ void CefProxyHandlerCToCpp::GetProxyForUrl(const CefString& url, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/proxy_handler_ctocpp.h b/libcef_dll/ctocpp/proxy_handler_ctocpp.h index 86bc62b7c..d01c0f73c 100644 --- a/libcef_dll/ctocpp/proxy_handler_ctocpp.h +++ b/libcef_dll/ctocpp/proxy_handler_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_proxy_handler.h" +#include "include/capi/cef_proxy_handler_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.cc b/libcef_dll/ctocpp/read_handler_ctocpp.cc index 6a1cd501b..7ec7adff4 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/read_handler_ctocpp.cc @@ -37,7 +37,6 @@ size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) return _retval; } - int CefReadHandlerCToCpp::Seek(long offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) @@ -54,7 +53,6 @@ int CefReadHandlerCToCpp::Seek(long offset, int whence) return _retval; } - long CefReadHandlerCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) @@ -69,7 +67,6 @@ long CefReadHandlerCToCpp::Tell() return _retval; } - int CefReadHandlerCToCpp::Eof() { if (CEF_MEMBER_MISSING(struct_, eof)) @@ -85,7 +82,6 @@ int CefReadHandlerCToCpp::Eof() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.h b/libcef_dll/ctocpp/read_handler_ctocpp.h index 39b20bf09..349a86078 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.h +++ b/libcef_dll/ctocpp/read_handler_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.cc b/libcef_dll/ctocpp/render_handler_ctocpp.cc index 6be7d5aba..73d82f5ef 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_handler_ctocpp.cc @@ -38,7 +38,6 @@ bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, return _retval?true:false; } - bool CefRenderHandlerCToCpp::GetScreenRect(CefRefPtr browser, CefRect& rect) { @@ -61,7 +60,6 @@ bool CefRenderHandlerCToCpp::GetScreenRect(CefRefPtr browser, return _retval?true:false; } - bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, int viewX, int viewY, int& screenX, int& screenY) { @@ -87,7 +85,6 @@ bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, return _retval?true:false; } - void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, bool show) { @@ -107,7 +104,6 @@ void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, show); } - void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, const CefRect& rect) { @@ -127,7 +123,6 @@ void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, &rect); } - void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, const void* buffer) { @@ -167,7 +162,6 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, buffer); } - void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, CefCursorHandle cursor) { @@ -188,7 +182,6 @@ void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.h b/libcef_dll/ctocpp/render_handler_ctocpp.h index da7e9d86d..d15fa0c9c 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_handler_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_render_handler.h" +#include "include/capi/cef_render_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/request_ctocpp.cc b/libcef_dll/ctocpp/request_ctocpp.cc index b307f4e3f..73e61f3f9 100644 --- a/libcef_dll/ctocpp/request_ctocpp.cc +++ b/libcef_dll/ctocpp/request_ctocpp.cc @@ -29,7 +29,6 @@ CefRefPtr CefRequest::CreateRequest() } - // VIRTUAL METHODS - Body may be edited by hand. CefString CefRequestCToCpp::GetURL() @@ -48,7 +47,6 @@ CefString CefRequestCToCpp::GetURL() return _retvalStr; } - void CefRequestCToCpp::SetURL(const CefString& url) { if (CEF_MEMBER_MISSING(struct_, set_url)) @@ -66,7 +64,6 @@ void CefRequestCToCpp::SetURL(const CefString& url) url.GetStruct()); } - CefString CefRequestCToCpp::GetMethod() { if (CEF_MEMBER_MISSING(struct_, get_method)) @@ -83,7 +80,6 @@ CefString CefRequestCToCpp::GetMethod() return _retvalStr; } - void CefRequestCToCpp::SetMethod(const CefString& method) { if (CEF_MEMBER_MISSING(struct_, set_method)) @@ -101,7 +97,6 @@ void CefRequestCToCpp::SetMethod(const CefString& method) method.GetStruct()); } - CefRefPtr CefRequestCToCpp::GetPostData() { if (CEF_MEMBER_MISSING(struct_, get_post_data)) @@ -116,7 +111,6 @@ CefRefPtr CefRequestCToCpp::GetPostData() return CefPostDataCToCpp::Wrap(_retval); } - void CefRequestCToCpp::SetPostData(CefRefPtr postData) { if (CEF_MEMBER_MISSING(struct_, set_post_data)) @@ -134,7 +128,6 @@ void CefRequestCToCpp::SetPostData(CefRefPtr postData) CefPostDataCToCpp::Unwrap(postData)); } - void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, get_header_map)) @@ -160,7 +153,6 @@ void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) } } - void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, set_header_map)) @@ -183,7 +175,6 @@ void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) cef_string_multimap_free(headerMapMultimap); } - void CefRequestCToCpp::Set(const CefString& url, const CefString& method, CefRefPtr postData, const HeaderMap& headerMap) { @@ -220,7 +211,6 @@ void CefRequestCToCpp::Set(const CefString& url, const CefString& method, cef_string_multimap_free(headerMapMultimap); } - CefRequest::RequestFlags CefRequestCToCpp::GetFlags() { if (CEF_MEMBER_MISSING(struct_, get_flags)) @@ -235,7 +225,6 @@ CefRequest::RequestFlags CefRequestCToCpp::GetFlags() return _retval; } - void CefRequestCToCpp::SetFlags(RequestFlags flags) { if (CEF_MEMBER_MISSING(struct_, set_flags)) @@ -248,7 +237,6 @@ void CefRequestCToCpp::SetFlags(RequestFlags flags) flags); } - CefString CefRequestCToCpp::GetFirstPartyForCookies() { if (CEF_MEMBER_MISSING(struct_, get_first_party_for_cookies)) @@ -265,7 +253,6 @@ CefString CefRequestCToCpp::GetFirstPartyForCookies() return _retvalStr; } - void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) { if (CEF_MEMBER_MISSING(struct_, set_first_party_for_cookies)) @@ -284,7 +271,6 @@ void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/request_ctocpp.h b/libcef_dll/ctocpp/request_ctocpp.h index c156c2e35..0cf02eae1 100644 --- a/libcef_dll/ctocpp/request_ctocpp.h +++ b/libcef_dll/ctocpp/request_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.cc b/libcef_dll/ctocpp/request_handler_ctocpp.cc index d6b2799f2..b8b6e5c0b 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/request_handler_ctocpp.cc @@ -56,7 +56,6 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, return _retval?true:false; } - bool CefRequestHandlerCToCpp::OnBeforeResourceLoad( CefRefPtr browser, CefRefPtr request, CefString& redirectUrl, CefRefPtr& resourceStream, @@ -108,7 +107,6 @@ bool CefRequestHandlerCToCpp::OnBeforeResourceLoad( return _retval?true:false; } - void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, const CefString& old_url, CefString& new_url) { @@ -133,7 +131,6 @@ void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, new_url.GetWritableStruct()); } - void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, const CefString& url, CefRefPtr response, CefRefPtr& filter) @@ -179,7 +176,6 @@ void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, } } - bool CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, const CefString& url, bool& allowOSExecution) { @@ -213,7 +209,6 @@ bool CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, return _retval?true:false; } - bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, const CefString& mimeType, const CefString& fileName, int64 contentLength, CefRefPtr& handler) @@ -263,7 +258,6 @@ bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, return _retval?true:false; } - bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, bool isProxy, const CefString& host, int port, const CefString& realm, const CefString& scheme, CefString& username, CefString& password) @@ -303,7 +297,6 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.h b/libcef_dll/ctocpp/request_handler_ctocpp.h index f96128436..973d82809 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.h +++ b/libcef_dll/ctocpp/request_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_request_handler.h" +#include "include/capi/cef_request_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/response_ctocpp.cc b/libcef_dll/ctocpp/response_ctocpp.cc index 500abc12e..165f5daa8 100644 --- a/libcef_dll/ctocpp/response_ctocpp.cc +++ b/libcef_dll/ctocpp/response_ctocpp.cc @@ -30,7 +30,6 @@ int CefResponseCToCpp::GetStatus() return _retval; } - void CefResponseCToCpp::SetStatus(int status) { if (CEF_MEMBER_MISSING(struct_, set_status)) @@ -43,7 +42,6 @@ void CefResponseCToCpp::SetStatus(int status) status); } - CefString CefResponseCToCpp::GetStatusText() { if (CEF_MEMBER_MISSING(struct_, get_status_text)) @@ -60,7 +58,6 @@ CefString CefResponseCToCpp::GetStatusText() return _retvalStr; } - void CefResponseCToCpp::SetStatusText(const CefString& statusText) { if (CEF_MEMBER_MISSING(struct_, set_status_text)) @@ -78,7 +75,6 @@ void CefResponseCToCpp::SetStatusText(const CefString& statusText) statusText.GetStruct()); } - CefString CefResponseCToCpp::GetMimeType() { if (CEF_MEMBER_MISSING(struct_, get_mime_type)) @@ -95,7 +91,6 @@ CefString CefResponseCToCpp::GetMimeType() return _retvalStr; } - void CefResponseCToCpp::SetMimeType(const CefString& mimeType) { if (CEF_MEMBER_MISSING(struct_, set_mime_type)) @@ -113,7 +108,6 @@ void CefResponseCToCpp::SetMimeType(const CefString& mimeType) mimeType.GetStruct()); } - CefString CefResponseCToCpp::GetHeader(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, get_header)) @@ -136,7 +130,6 @@ CefString CefResponseCToCpp::GetHeader(const CefString& name) return _retvalStr; } - void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, get_header_map)) @@ -162,7 +155,6 @@ void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) } } - void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, set_header_map)) @@ -186,7 +178,6 @@ void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/response_ctocpp.h b/libcef_dll/ctocpp/response_ctocpp.h index cd1225616..52ceeb440 100644 --- a/libcef_dll/ctocpp/response_ctocpp.h +++ b/libcef_dll/ctocpp/response_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc index 9c1e7fd6d..306cdd617 100644 --- a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc @@ -26,7 +26,6 @@ void CefSchemeHandlerCallbackCToCpp::HeadersAvailable() struct_->headers_available(struct_); } - void CefSchemeHandlerCallbackCToCpp::BytesAvailable() { if (CEF_MEMBER_MISSING(struct_, bytes_available)) @@ -38,7 +37,6 @@ void CefSchemeHandlerCallbackCToCpp::BytesAvailable() struct_->bytes_available(struct_); } - void CefSchemeHandlerCallbackCToCpp::Cancel() { if (CEF_MEMBER_MISSING(struct_, cancel)) @@ -51,7 +49,6 @@ void CefSchemeHandlerCallbackCToCpp::Cancel() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h index 1514cdf9a..fb513c755 100644 --- a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h @@ -17,8 +17,14 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/scheme_handler_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_ctocpp.cc index 1abff2d4d..2f6a82ead 100644 --- a/libcef_dll/ctocpp/scheme_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_ctocpp.cc @@ -44,7 +44,6 @@ bool CefSchemeHandlerCToCpp::ProcessRequest(CefRefPtr request, return _retval?true:false; } - void CefSchemeHandlerCToCpp::GetResponseHeaders(CefRefPtr response, int64& response_length, CefString& redirectUrl) { @@ -65,7 +64,6 @@ void CefSchemeHandlerCToCpp::GetResponseHeaders(CefRefPtr response, redirectUrl.GetWritableStruct()); } - bool CefSchemeHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr callback) { @@ -94,7 +92,6 @@ bool CefSchemeHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, return _retval?true:false; } - void CefSchemeHandlerCToCpp::Cancel() { if (CEF_MEMBER_MISSING(struct_, cancel)) @@ -107,7 +104,6 @@ void CefSchemeHandlerCToCpp::Cancel() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/scheme_handler_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_ctocpp.h index 74dcef43d..e845f37c0 100644 --- a/libcef_dll/ctocpp/scheme_handler_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_ctocpp.h @@ -17,8 +17,14 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc index f14e99c71..3e7018fa6 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc @@ -51,7 +51,6 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h index 2aadd420a..a8823767a 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h @@ -17,8 +17,14 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/storage_visitor_ctocpp.cc b/libcef_dll/ctocpp/storage_visitor_ctocpp.cc index eabac48f6..1995250af 100644 --- a/libcef_dll/ctocpp/storage_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/storage_visitor_ctocpp.cc @@ -58,7 +58,6 @@ bool CefStorageVisitorCToCpp::Visit(CefStorageType type, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/storage_visitor_ctocpp.h b/libcef_dll/ctocpp/storage_visitor_ctocpp.h index 8921d4eec..3e9a33ce3 100644 --- a/libcef_dll/ctocpp/storage_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/storage_visitor_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_storage.h" +#include "include/capi/cef_storage_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/libcef_dll/ctocpp/stream_reader_ctocpp.cc index 98c73e515..8c38c5eee 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.cc @@ -34,7 +34,6 @@ CefRefPtr CefStreamReader::CreateForFile( return CefStreamReaderCToCpp::Wrap(_retval); } - CefRefPtr CefStreamReader::CreateForData(void* data, size_t size) { @@ -54,7 +53,6 @@ CefRefPtr CefStreamReader::CreateForData(void* data, return CefStreamReaderCToCpp::Wrap(_retval); } - CefRefPtr CefStreamReader::CreateForHandler( CefRefPtr handler) { @@ -74,7 +72,6 @@ CefRefPtr CefStreamReader::CreateForHandler( } - // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) @@ -99,7 +96,6 @@ size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) return _retval; } - int CefStreamReaderCToCpp::Seek(long offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) @@ -116,7 +112,6 @@ int CefStreamReaderCToCpp::Seek(long offset, int whence) return _retval; } - long CefStreamReaderCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) @@ -131,7 +126,6 @@ long CefStreamReaderCToCpp::Tell() return _retval; } - int CefStreamReaderCToCpp::Eof() { if (CEF_MEMBER_MISSING(struct_, eof)) @@ -147,7 +141,6 @@ int CefStreamReaderCToCpp::Eof() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.h b/libcef_dll/ctocpp/stream_reader_ctocpp.h index e9f0b7bc1..653353c81 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.h +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/libcef_dll/ctocpp/stream_writer_ctocpp.cc index 39911f21a..70306d44a 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.cc @@ -34,7 +34,6 @@ CefRefPtr CefStreamWriter::CreateForFile( return CefStreamWriterCToCpp::Wrap(_retval); } - CefRefPtr CefStreamWriter::CreateForHandler( CefRefPtr handler) { @@ -54,7 +53,6 @@ CefRefPtr CefStreamWriter::CreateForHandler( } - // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) @@ -79,7 +77,6 @@ size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) return _retval; } - int CefStreamWriterCToCpp::Seek(long offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) @@ -96,7 +93,6 @@ int CefStreamWriterCToCpp::Seek(long offset, int whence) return _retval; } - long CefStreamWriterCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) @@ -111,7 +107,6 @@ long CefStreamWriterCToCpp::Tell() return _retval; } - int CefStreamWriterCToCpp::Flush() { if (CEF_MEMBER_MISSING(struct_, flush)) @@ -127,7 +122,6 @@ int CefStreamWriterCToCpp::Flush() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.h b/libcef_dll/ctocpp/stream_writer_ctocpp.h index 12083c320..ad3351d29 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.h +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/task_ctocpp.cc b/libcef_dll/ctocpp/task_ctocpp.cc index 1b90f4de6..9904d4821 100644 --- a/libcef_dll/ctocpp/task_ctocpp.cc +++ b/libcef_dll/ctocpp/task_ctocpp.cc @@ -28,7 +28,6 @@ void CefTaskCToCpp::Execute(CefThreadId threadId) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; #endif diff --git a/libcef_dll/ctocpp/task_ctocpp.h b/libcef_dll/ctocpp/task_ctocpp.h index 79a690f83..d26524b1d 100644 --- a/libcef_dll/ctocpp/task_ctocpp.h +++ b/libcef_dll/ctocpp/task_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_task.h" +#include "include/capi/cef_task_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.cc b/libcef_dll/ctocpp/v8accessor_ctocpp.cc index 3ab76e4e3..3cca7be9d 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.cc +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.cc @@ -60,7 +60,6 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, return _retval?true:false; } - bool CefV8AccessorCToCpp::Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, CefString& exception) @@ -95,7 +94,6 @@ bool CefV8AccessorCToCpp::Set(const CefString& name, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.h b/libcef_dll/ctocpp/v8accessor_ctocpp.h index e2f78c47e..c49bfbd7e 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.h +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/v8context_ctocpp.cc b/libcef_dll/ctocpp/v8context_ctocpp.cc index 930f1312d..5ef2ca19d 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_ctocpp.cc @@ -29,7 +29,6 @@ CefRefPtr CefV8Context::GetCurrentContext() return CefV8ContextCToCpp::Wrap(_retval); } - CefRefPtr CefV8Context::GetEnteredContext() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -41,7 +40,6 @@ CefRefPtr CefV8Context::GetEnteredContext() return CefV8ContextCToCpp::Wrap(_retval); } - bool CefV8Context::InContext() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -54,7 +52,6 @@ bool CefV8Context::InContext() } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefV8ContextCToCpp::GetBrowser() @@ -71,7 +68,6 @@ CefRefPtr CefV8ContextCToCpp::GetBrowser() return CefBrowserCToCpp::Wrap(_retval); } - CefRefPtr CefV8ContextCToCpp::GetFrame() { if (CEF_MEMBER_MISSING(struct_, get_frame)) @@ -86,7 +82,6 @@ CefRefPtr CefV8ContextCToCpp::GetFrame() return CefFrameCToCpp::Wrap(_retval); } - CefRefPtr CefV8ContextCToCpp::GetGlobal() { if (CEF_MEMBER_MISSING(struct_, get_global)) @@ -101,7 +96,6 @@ CefRefPtr CefV8ContextCToCpp::GetGlobal() return CefV8ValueCToCpp::Wrap(_retval); } - bool CefV8ContextCToCpp::Enter() { if (CEF_MEMBER_MISSING(struct_, enter)) @@ -116,7 +110,6 @@ bool CefV8ContextCToCpp::Enter() return _retval?true:false; } - bool CefV8ContextCToCpp::Exit() { if (CEF_MEMBER_MISSING(struct_, exit)) @@ -131,7 +124,6 @@ bool CefV8ContextCToCpp::Exit() return _retval?true:false; } - bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) @@ -153,7 +145,6 @@ bool CefV8ContextCToCpp::IsSame(CefRefPtr that) } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8context_ctocpp.h b/libcef_dll/ctocpp/v8context_ctocpp.h index 6bb23f8e9..88a065a14 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/v8context_handler_ctocpp.cc b/libcef_dll/ctocpp/v8context_handler_ctocpp.cc index 545849ba2..0d2b17d64 100644 --- a/libcef_dll/ctocpp/v8context_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_handler_ctocpp.cc @@ -46,7 +46,6 @@ void CefV8ContextHandlerCToCpp::OnContextCreated(CefRefPtr browser, CefV8ContextCppToC::Wrap(context)); } - void CefV8ContextHandlerCToCpp::OnContextReleased(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) { @@ -76,7 +75,6 @@ void CefV8ContextHandlerCToCpp::OnContextReleased(CefRefPtr browser, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8context_handler_ctocpp.h b/libcef_dll/ctocpp/v8context_handler_ctocpp.h index a64b6bdb8..ff304f285 100644 --- a/libcef_dll/ctocpp/v8context_handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8context_handler.h" +#include "include/capi/cef_v8context_handler_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.cc b/libcef_dll/ctocpp/v8exception_ctocpp.cc index 0e3241d97..9834e64d7 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.cc +++ b/libcef_dll/ctocpp/v8exception_ctocpp.cc @@ -31,7 +31,6 @@ CefString CefV8ExceptionCToCpp::GetMessage() return _retvalStr; } - CefString CefV8ExceptionCToCpp::GetSourceLine() { if (CEF_MEMBER_MISSING(struct_, get_source_line)) @@ -48,7 +47,6 @@ CefString CefV8ExceptionCToCpp::GetSourceLine() return _retvalStr; } - CefString CefV8ExceptionCToCpp::GetScriptResourceName() { if (CEF_MEMBER_MISSING(struct_, get_script_resource_name)) @@ -65,7 +63,6 @@ CefString CefV8ExceptionCToCpp::GetScriptResourceName() return _retvalStr; } - int CefV8ExceptionCToCpp::GetLineNumber() { if (CEF_MEMBER_MISSING(struct_, get_line_number)) @@ -80,7 +77,6 @@ int CefV8ExceptionCToCpp::GetLineNumber() return _retval; } - int CefV8ExceptionCToCpp::GetStartPosition() { if (CEF_MEMBER_MISSING(struct_, get_start_position)) @@ -95,7 +91,6 @@ int CefV8ExceptionCToCpp::GetStartPosition() return _retval; } - int CefV8ExceptionCToCpp::GetEndPosition() { if (CEF_MEMBER_MISSING(struct_, get_end_position)) @@ -110,7 +105,6 @@ int CefV8ExceptionCToCpp::GetEndPosition() return _retval; } - int CefV8ExceptionCToCpp::GetStartColumn() { if (CEF_MEMBER_MISSING(struct_, get_start_column)) @@ -125,7 +119,6 @@ int CefV8ExceptionCToCpp::GetStartColumn() return _retval; } - int CefV8ExceptionCToCpp::GetEndColumn() { if (CEF_MEMBER_MISSING(struct_, get_end_column)) @@ -141,7 +134,6 @@ int CefV8ExceptionCToCpp::GetEndColumn() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.h b/libcef_dll/ctocpp/v8exception_ctocpp.h index 991888af8..12bda8822 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.h +++ b/libcef_dll/ctocpp/v8exception_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.cc b/libcef_dll/ctocpp/v8handler_ctocpp.cc index 23de82b8d..c4e342c22 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8handler_ctocpp.cc @@ -75,7 +75,6 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.h b/libcef_dll/ctocpp/v8handler_ctocpp.h index 918faf797..27412d8c4 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8handler_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/v8value_ctocpp.cc b/libcef_dll/ctocpp/v8value_ctocpp.cc index b79c53e3e..e0d5954b4 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.cc +++ b/libcef_dll/ctocpp/v8value_ctocpp.cc @@ -32,7 +32,6 @@ CefRefPtr CefV8Value::CreateUndefined() return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateNull() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -44,7 +43,6 @@ CefRefPtr CefV8Value::CreateNull() return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateBool(bool value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -57,7 +55,6 @@ CefRefPtr CefV8Value::CreateBool(bool value) return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateInt(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -70,7 +67,6 @@ CefRefPtr CefV8Value::CreateInt(int value) return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateDouble(double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -83,7 +79,6 @@ CefRefPtr CefV8Value::CreateDouble(double value) return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateDate(const CefTime& date) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -96,7 +91,6 @@ CefRefPtr CefV8Value::CreateDate(const CefTime& date) return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateString(const CefString& value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -111,7 +105,6 @@ CefRefPtr CefV8Value::CreateString(const CefString& value) return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateObject(CefRefPtr user_data, CefRefPtr accessor) { @@ -128,7 +121,6 @@ CefRefPtr CefV8Value::CreateObject(CefRefPtr user_data, return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateArray() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -140,7 +132,6 @@ CefRefPtr CefV8Value::CreateArray() return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8Value::CreateFunction(const CefString& name, CefRefPtr handler) { @@ -165,7 +156,6 @@ CefRefPtr CefV8Value::CreateFunction(const CefString& name, } - // VIRTUAL METHODS - Body may be edited by hand. bool CefV8ValueCToCpp::IsUndefined() @@ -182,7 +172,6 @@ bool CefV8ValueCToCpp::IsUndefined() return _retval?true:false; } - bool CefV8ValueCToCpp::IsNull() { if (CEF_MEMBER_MISSING(struct_, is_null)) @@ -197,7 +186,6 @@ bool CefV8ValueCToCpp::IsNull() return _retval?true:false; } - bool CefV8ValueCToCpp::IsBool() { if (CEF_MEMBER_MISSING(struct_, is_bool)) @@ -212,7 +200,6 @@ bool CefV8ValueCToCpp::IsBool() return _retval?true:false; } - bool CefV8ValueCToCpp::IsInt() { if (CEF_MEMBER_MISSING(struct_, is_int)) @@ -227,7 +214,6 @@ bool CefV8ValueCToCpp::IsInt() return _retval?true:false; } - bool CefV8ValueCToCpp::IsDouble() { if (CEF_MEMBER_MISSING(struct_, is_double)) @@ -242,7 +228,6 @@ bool CefV8ValueCToCpp::IsDouble() return _retval?true:false; } - bool CefV8ValueCToCpp::IsDate() { if (CEF_MEMBER_MISSING(struct_, is_date)) @@ -257,7 +242,6 @@ bool CefV8ValueCToCpp::IsDate() return _retval?true:false; } - bool CefV8ValueCToCpp::IsString() { if (CEF_MEMBER_MISSING(struct_, is_string)) @@ -272,7 +256,6 @@ bool CefV8ValueCToCpp::IsString() return _retval?true:false; } - bool CefV8ValueCToCpp::IsObject() { if (CEF_MEMBER_MISSING(struct_, is_object)) @@ -287,7 +270,6 @@ bool CefV8ValueCToCpp::IsObject() return _retval?true:false; } - bool CefV8ValueCToCpp::IsArray() { if (CEF_MEMBER_MISSING(struct_, is_array)) @@ -302,7 +284,6 @@ bool CefV8ValueCToCpp::IsArray() return _retval?true:false; } - bool CefV8ValueCToCpp::IsFunction() { if (CEF_MEMBER_MISSING(struct_, is_function)) @@ -317,7 +298,6 @@ bool CefV8ValueCToCpp::IsFunction() return _retval?true:false; } - bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) @@ -338,7 +318,6 @@ bool CefV8ValueCToCpp::IsSame(CefRefPtr that) return _retval?true:false; } - bool CefV8ValueCToCpp::GetBoolValue() { if (CEF_MEMBER_MISSING(struct_, get_bool_value)) @@ -353,7 +332,6 @@ bool CefV8ValueCToCpp::GetBoolValue() return _retval?true:false; } - int CefV8ValueCToCpp::GetIntValue() { if (CEF_MEMBER_MISSING(struct_, get_int_value)) @@ -368,7 +346,6 @@ int CefV8ValueCToCpp::GetIntValue() return _retval; } - double CefV8ValueCToCpp::GetDoubleValue() { if (CEF_MEMBER_MISSING(struct_, get_double_value)) @@ -383,7 +360,6 @@ double CefV8ValueCToCpp::GetDoubleValue() return _retval; } - CefTime CefV8ValueCToCpp::GetDateValue() { if (CEF_MEMBER_MISSING(struct_, get_date_value)) @@ -398,7 +374,6 @@ CefTime CefV8ValueCToCpp::GetDateValue() return _retval; } - CefString CefV8ValueCToCpp::GetStringValue() { if (CEF_MEMBER_MISSING(struct_, get_string_value)) @@ -415,7 +390,6 @@ CefString CefV8ValueCToCpp::GetStringValue() return _retvalStr; } - bool CefV8ValueCToCpp::HasValue(const CefString& key) { if (CEF_MEMBER_MISSING(struct_, has_value_bykey)) @@ -436,7 +410,6 @@ bool CefV8ValueCToCpp::HasValue(const CefString& key) return _retval?true:false; } - bool CefV8ValueCToCpp::HasValue(int index) { if (CEF_MEMBER_MISSING(struct_, has_value_byindex)) @@ -457,7 +430,6 @@ bool CefV8ValueCToCpp::HasValue(int index) return _retval?true:false; } - bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { if (CEF_MEMBER_MISSING(struct_, delete_value_bykey)) @@ -478,7 +450,6 @@ bool CefV8ValueCToCpp::DeleteValue(const CefString& key) return _retval?true:false; } - bool CefV8ValueCToCpp::DeleteValue(int index) { if (CEF_MEMBER_MISSING(struct_, delete_value_byindex)) @@ -499,7 +470,6 @@ bool CefV8ValueCToCpp::DeleteValue(int index) return _retval?true:false; } - CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { if (CEF_MEMBER_MISSING(struct_, get_value_bykey)) @@ -520,7 +490,6 @@ CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) return CefV8ValueCToCpp::Wrap(_retval); } - CefRefPtr CefV8ValueCToCpp::GetValue(int index) { if (CEF_MEMBER_MISSING(struct_, get_value_byindex)) @@ -541,7 +510,6 @@ CefRefPtr CefV8ValueCToCpp::GetValue(int index) return CefV8ValueCToCpp::Wrap(_retval); } - bool CefV8ValueCToCpp::SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) { @@ -569,7 +537,6 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, return _retval?true:false; } - bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { if (CEF_MEMBER_MISSING(struct_, set_value_byindex)) @@ -595,7 +562,6 @@ bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) return _retval?true:false; } - bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, PropertyAttribute attribute) { @@ -619,7 +585,6 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, return _retval?true:false; } - bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { if (CEF_MEMBER_MISSING(struct_, get_keys)) @@ -648,7 +613,6 @@ bool CefV8ValueCToCpp::GetKeys(std::vector& keys) return _retval?true:false; } - CefRefPtr CefV8ValueCToCpp::GetUserData() { if (CEF_MEMBER_MISSING(struct_, get_user_data)) @@ -663,7 +627,6 @@ CefRefPtr CefV8ValueCToCpp::GetUserData() return CefBaseCppToC::Unwrap(_retval); } - int CefV8ValueCToCpp::GetArrayLength() { if (CEF_MEMBER_MISSING(struct_, get_array_length)) @@ -678,7 +641,6 @@ int CefV8ValueCToCpp::GetArrayLength() return _retval; } - CefString CefV8ValueCToCpp::GetFunctionName() { if (CEF_MEMBER_MISSING(struct_, get_function_name)) @@ -695,7 +657,6 @@ CefString CefV8ValueCToCpp::GetFunctionName() return _retvalStr; } - CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() { if (CEF_MEMBER_MISSING(struct_, get_function_handler)) @@ -710,7 +671,6 @@ CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() return CefV8HandlerCppToC::Unwrap(_retval); } - bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefRefPtr& exception, bool rethrow_exception) @@ -775,7 +735,6 @@ bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr object, return _retval?true:false; } - bool CefV8ValueCToCpp::ExecuteFunctionWithContext( CefRefPtr context, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, @@ -847,7 +806,6 @@ bool CefV8ValueCToCpp::ExecuteFunctionWithContext( } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8value_ctocpp.h b/libcef_dll/ctocpp/v8value_ctocpp.h index c824d03d5..037db32d1 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.h +++ b/libcef_dll/ctocpp/v8value_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc index 67ea7c671..b158bf51c 100644 --- a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc +++ b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc @@ -37,7 +37,6 @@ void CefWebURLRequestClientCToCpp::OnStateChange( state); } - void CefWebURLRequestClientCToCpp::OnRedirect( CefRefPtr requester, CefRefPtr request, CefRefPtr response) @@ -67,7 +66,6 @@ void CefWebURLRequestClientCToCpp::OnRedirect( CefResponseCppToC::Wrap(response)); } - void CefWebURLRequestClientCToCpp::OnHeadersReceived( CefRefPtr requester, CefRefPtr response) { @@ -91,7 +89,6 @@ void CefWebURLRequestClientCToCpp::OnHeadersReceived( CefResponseCppToC::Wrap(response)); } - void CefWebURLRequestClientCToCpp::OnProgress( CefRefPtr requester, uint64 bytesSent, uint64 totalBytesToBeSent) @@ -113,7 +110,6 @@ void CefWebURLRequestClientCToCpp::OnProgress( totalBytesToBeSent); } - void CefWebURLRequestClientCToCpp::OnData(CefRefPtr requester, const void* data, int dataLength) { @@ -138,7 +134,6 @@ void CefWebURLRequestClientCToCpp::OnData(CefRefPtr requester, dataLength); } - void CefWebURLRequestClientCToCpp::OnError( CefRefPtr requester, ErrorCode errorCode) { @@ -159,7 +154,6 @@ void CefWebURLRequestClientCToCpp::OnError( } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h index 8f8ac4095..ba68f460a 100644 --- a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h +++ b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_web_urlrequest.h" +#include "include/capi/cef_web_urlrequest_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc b/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc index 589fded3f..53dd09ba6 100644 --- a/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc +++ b/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc @@ -41,7 +41,6 @@ CefRefPtr CefWebURLRequest::CreateWebURLRequest( } - // VIRTUAL METHODS - Body may be edited by hand. void CefWebURLRequestCToCpp::Cancel() @@ -55,7 +54,6 @@ void CefWebURLRequestCToCpp::Cancel() struct_->cancel(struct_); } - CefWebURLRequest::RequestState CefWebURLRequestCToCpp::GetState() { if (CEF_MEMBER_MISSING(struct_, get_state)) @@ -71,7 +69,6 @@ CefWebURLRequest::RequestState CefWebURLRequestCToCpp::GetState() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/web_urlrequest_ctocpp.h b/libcef_dll/ctocpp/web_urlrequest_ctocpp.h index 4a7e01de4..73265d229 100644 --- a/libcef_dll/ctocpp/web_urlrequest_ctocpp.h +++ b/libcef_dll/ctocpp/web_urlrequest_ctocpp.h @@ -17,8 +17,12 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_web_urlrequest.h" +#include "include/capi/cef_web_urlrequest_capi.h" +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.cc b/libcef_dll/ctocpp/write_handler_ctocpp.cc index 3d1171816..40fe0795a 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/write_handler_ctocpp.cc @@ -37,7 +37,6 @@ size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) return _retval; } - int CefWriteHandlerCToCpp::Seek(long offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) @@ -54,7 +53,6 @@ int CefWriteHandlerCToCpp::Seek(long offset, int whence) return _retval; } - long CefWriteHandlerCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) @@ -69,7 +67,6 @@ long CefWriteHandlerCToCpp::Tell() return _retval; } - int CefWriteHandlerCToCpp::Flush() { if (CEF_MEMBER_MISSING(struct_, flush)) @@ -85,7 +82,6 @@ int CefWriteHandlerCToCpp::Flush() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.h b/libcef_dll/ctocpp/write_handler_ctocpp.h index b9f9e083f..de3fbf23e 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.h +++ b/libcef_dll/ctocpp/write_handler_ctocpp.h @@ -17,8 +17,8 @@ #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/libcef_dll/ctocpp/xml_reader_ctocpp.cc index 23f7351be..5323730b2 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.cc @@ -41,7 +41,6 @@ CefRefPtr CefXmlReader::Create(CefRefPtr stream, } - // VIRTUAL METHODS - Body may be edited by hand. bool CefXmlReaderCToCpp::MoveToNextNode() @@ -58,7 +57,6 @@ bool CefXmlReaderCToCpp::MoveToNextNode() return _retval?true:false; } - bool CefXmlReaderCToCpp::Close() { if (CEF_MEMBER_MISSING(struct_, close)) @@ -73,7 +71,6 @@ bool CefXmlReaderCToCpp::Close() return _retval?true:false; } - bool CefXmlReaderCToCpp::HasError() { if (CEF_MEMBER_MISSING(struct_, has_error)) @@ -88,7 +85,6 @@ bool CefXmlReaderCToCpp::HasError() return _retval?true:false; } - CefString CefXmlReaderCToCpp::GetError() { if (CEF_MEMBER_MISSING(struct_, get_error)) @@ -105,7 +101,6 @@ CefString CefXmlReaderCToCpp::GetError() return _retvalStr; } - CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() { if (CEF_MEMBER_MISSING(struct_, get_type)) @@ -120,7 +115,6 @@ CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() return _retval; } - int CefXmlReaderCToCpp::GetDepth() { if (CEF_MEMBER_MISSING(struct_, get_depth)) @@ -135,7 +129,6 @@ int CefXmlReaderCToCpp::GetDepth() return _retval; } - CefString CefXmlReaderCToCpp::GetLocalName() { if (CEF_MEMBER_MISSING(struct_, get_local_name)) @@ -152,7 +145,6 @@ CefString CefXmlReaderCToCpp::GetLocalName() return _retvalStr; } - CefString CefXmlReaderCToCpp::GetPrefix() { if (CEF_MEMBER_MISSING(struct_, get_prefix)) @@ -169,7 +161,6 @@ CefString CefXmlReaderCToCpp::GetPrefix() return _retvalStr; } - CefString CefXmlReaderCToCpp::GetQualifiedName() { if (CEF_MEMBER_MISSING(struct_, get_qualified_name)) @@ -186,7 +177,6 @@ CefString CefXmlReaderCToCpp::GetQualifiedName() return _retvalStr; } - CefString CefXmlReaderCToCpp::GetNamespaceURI() { if (CEF_MEMBER_MISSING(struct_, get_namespace_uri)) @@ -203,7 +193,6 @@ CefString CefXmlReaderCToCpp::GetNamespaceURI() return _retvalStr; } - CefString CefXmlReaderCToCpp::GetBaseURI() { if (CEF_MEMBER_MISSING(struct_, get_base_uri)) @@ -220,7 +209,6 @@ CefString CefXmlReaderCToCpp::GetBaseURI() return _retvalStr; } - CefString CefXmlReaderCToCpp::GetXmlLang() { if (CEF_MEMBER_MISSING(struct_, get_xml_lang)) @@ -237,7 +225,6 @@ CefString CefXmlReaderCToCpp::GetXmlLang() return _retvalStr; } - bool CefXmlReaderCToCpp::IsEmptyElement() { if (CEF_MEMBER_MISSING(struct_, is_empty_element)) @@ -252,7 +239,6 @@ bool CefXmlReaderCToCpp::IsEmptyElement() return _retval?true:false; } - bool CefXmlReaderCToCpp::HasValue() { if (CEF_MEMBER_MISSING(struct_, has_value)) @@ -267,7 +253,6 @@ bool CefXmlReaderCToCpp::HasValue() return _retval?true:false; } - CefString CefXmlReaderCToCpp::GetValue() { if (CEF_MEMBER_MISSING(struct_, get_value)) @@ -284,7 +269,6 @@ CefString CefXmlReaderCToCpp::GetValue() return _retvalStr; } - bool CefXmlReaderCToCpp::HasAttributes() { if (CEF_MEMBER_MISSING(struct_, has_attributes)) @@ -299,7 +283,6 @@ bool CefXmlReaderCToCpp::HasAttributes() return _retval?true:false; } - size_t CefXmlReaderCToCpp::GetAttributeCount() { if (CEF_MEMBER_MISSING(struct_, get_attribute_count)) @@ -314,7 +297,6 @@ size_t CefXmlReaderCToCpp::GetAttributeCount() return _retval; } - CefString CefXmlReaderCToCpp::GetAttribute(int index) { if (CEF_MEMBER_MISSING(struct_, get_attribute_byindex)) @@ -337,7 +319,6 @@ CefString CefXmlReaderCToCpp::GetAttribute(int index) return _retvalStr; } - CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { if (CEF_MEMBER_MISSING(struct_, get_attribute_byqname)) @@ -360,7 +341,6 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) return _retvalStr; } - CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, const CefString& namespaceURI) { @@ -389,7 +369,6 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, return _retvalStr; } - CefString CefXmlReaderCToCpp::GetInnerXml() { if (CEF_MEMBER_MISSING(struct_, get_inner_xml)) @@ -406,7 +385,6 @@ CefString CefXmlReaderCToCpp::GetInnerXml() return _retvalStr; } - CefString CefXmlReaderCToCpp::GetOuterXml() { if (CEF_MEMBER_MISSING(struct_, get_outer_xml)) @@ -423,7 +401,6 @@ CefString CefXmlReaderCToCpp::GetOuterXml() return _retvalStr; } - int CefXmlReaderCToCpp::GetLineNumber() { if (CEF_MEMBER_MISSING(struct_, get_line_number)) @@ -438,7 +415,6 @@ int CefXmlReaderCToCpp::GetLineNumber() return _retval; } - bool CefXmlReaderCToCpp::MoveToAttribute(int index) { if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex)) @@ -459,7 +435,6 @@ bool CefXmlReaderCToCpp::MoveToAttribute(int index) return _retval?true:false; } - bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname)) @@ -480,7 +455,6 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) return _retval?true:false; } - bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, const CefString& namespaceURI) { @@ -507,7 +481,6 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, return _retval?true:false; } - bool CefXmlReaderCToCpp::MoveToFirstAttribute() { if (CEF_MEMBER_MISSING(struct_, move_to_first_attribute)) @@ -522,7 +495,6 @@ bool CefXmlReaderCToCpp::MoveToFirstAttribute() return _retval?true:false; } - bool CefXmlReaderCToCpp::MoveToNextAttribute() { if (CEF_MEMBER_MISSING(struct_, move_to_next_attribute)) @@ -537,7 +509,6 @@ bool CefXmlReaderCToCpp::MoveToNextAttribute() return _retval?true:false; } - bool CefXmlReaderCToCpp::MoveToCarryingElement() { if (CEF_MEMBER_MISSING(struct_, move_to_carrying_element)) @@ -553,7 +524,6 @@ bool CefXmlReaderCToCpp::MoveToCarryingElement() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.h b/libcef_dll/ctocpp/xml_reader_ctocpp.h index 27bbdc708..6a8d11878 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.h +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_xml_reader.h" +#include "include/capi/cef_xml_reader_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/libcef_dll/ctocpp/zip_reader_ctocpp.cc index 76d85f4b4..e160686db 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.cc @@ -34,7 +34,6 @@ CefRefPtr CefZipReader::Create(CefRefPtr stream) } - // VIRTUAL METHODS - Body may be edited by hand. bool CefZipReaderCToCpp::MoveToFirstFile() @@ -51,7 +50,6 @@ bool CefZipReaderCToCpp::MoveToFirstFile() return _retval?true:false; } - bool CefZipReaderCToCpp::MoveToNextFile() { if (CEF_MEMBER_MISSING(struct_, move_to_next_file)) @@ -66,7 +64,6 @@ bool CefZipReaderCToCpp::MoveToNextFile() return _retval?true:false; } - bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, bool caseSensitive) { @@ -89,7 +86,6 @@ bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, return _retval?true:false; } - bool CefZipReaderCToCpp::Close() { if (CEF_MEMBER_MISSING(struct_, close)) @@ -104,7 +100,6 @@ bool CefZipReaderCToCpp::Close() return _retval?true:false; } - CefString CefZipReaderCToCpp::GetFileName() { if (CEF_MEMBER_MISSING(struct_, get_file_name)) @@ -121,7 +116,6 @@ CefString CefZipReaderCToCpp::GetFileName() return _retvalStr; } - long CefZipReaderCToCpp::GetFileSize() { if (CEF_MEMBER_MISSING(struct_, get_file_size)) @@ -136,7 +130,6 @@ long CefZipReaderCToCpp::GetFileSize() return _retval; } - time_t CefZipReaderCToCpp::GetFileLastModified() { if (CEF_MEMBER_MISSING(struct_, get_file_last_modified)) @@ -151,7 +144,6 @@ time_t CefZipReaderCToCpp::GetFileLastModified() return _retval; } - bool CefZipReaderCToCpp::OpenFile(const CefString& password) { if (CEF_MEMBER_MISSING(struct_, open_file)) @@ -169,7 +161,6 @@ bool CefZipReaderCToCpp::OpenFile(const CefString& password) return _retval?true:false; } - bool CefZipReaderCToCpp::CloseFile() { if (CEF_MEMBER_MISSING(struct_, close_file)) @@ -184,7 +175,6 @@ bool CefZipReaderCToCpp::CloseFile() return _retval?true:false; } - int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { if (CEF_MEMBER_MISSING(struct_, read_file)) @@ -206,7 +196,6 @@ int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) return _retval; } - long CefZipReaderCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) @@ -221,7 +210,6 @@ long CefZipReaderCToCpp::Tell() return _retval; } - bool CefZipReaderCToCpp::Eof() { if (CEF_MEMBER_MISSING(struct_, eof)) @@ -237,7 +225,6 @@ bool CefZipReaderCToCpp::Eof() } - #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.h b/libcef_dll/ctocpp/zip_reader_ctocpp.h index c293ece3f..d19dfd495 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.h +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.h @@ -17,8 +17,10 @@ #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED -#include "include/cef.h" -#include "include/cef_capi.h" +#include "include/cef_zip_reader.h" +#include "include/capi/cef_zip_reader_capi.h" +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/libcef_dll.cc b/libcef_dll/libcef_dll.cc index d43f8196c..89f1bccd7 100644 --- a/libcef_dll/libcef_dll.cc +++ b/libcef_dll/libcef_dll.cc @@ -10,6 +10,22 @@ // for more information. // +#include "include/cef_app.h" +#include "include/capi/cef_app_capi.h" +#include "include/cef_cookie.h" +#include "include/capi/cef_cookie_capi.h" +#include "include/cef_origin_whitelist.h" +#include "include/capi/cef_origin_whitelist_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_storage.h" +#include "include/capi/cef_storage_capi.h" +#include "include/cef_task.h" +#include "include/capi/cef_task_capi.h" +#include "include/cef_url.h" +#include "include/capi/cef_url_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/domdocument_cpptoc.h" #include "libcef_dll/cpptoc/domevent_cpptoc.h" @@ -87,7 +103,6 @@ CEF_EXPORT int cef_initialize(const struct _cef_settings_t* settings, return _retval; } - CEF_EXPORT void cef_shutdown() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -147,7 +162,6 @@ CEF_EXPORT void cef_shutdown() #endif // !NDEBUG } - CEF_EXPORT void cef_do_message_loop_work() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -156,7 +170,6 @@ CEF_EXPORT void cef_do_message_loop_work() CefDoMessageLoopWork(); } - CEF_EXPORT void cef_run_message_loop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -165,7 +178,6 @@ CEF_EXPORT void cef_run_message_loop() CefRunMessageLoop(); } - CEF_EXPORT void cef_quit_message_loop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -174,89 +186,104 @@ CEF_EXPORT void cef_quit_message_loop() CefQuitMessageLoop(); } - -CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, - const cef_string_t* javascript_code, struct _cef_v8handler_t* handler) +CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: extension_name; type: string_byref_const - DCHECK(extension_name); - if (!extension_name) + // Verify param: visitor; type: refptr_diff + DCHECK(visitor); + if (!visitor) return 0; - // Verify param: javascript_code; type: string_byref_const - DCHECK(javascript_code); - if (!javascript_code) - return 0; - // Unverified params: handler // Execute - bool _retval = CefRegisterExtension( - CefString(extension_name), - CefString(javascript_code), - CefV8HandlerCToCpp::Wrap(handler)); + bool _retval = CefVisitAllCookies( + CefCookieVisitorCToCpp::Wrap(visitor)); // Return type: bool return _retval; } - -CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name, - int is_standard, int is_local, int is_display_isolated) +CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url, + int includeHttpOnly, struct _cef_cookie_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: scheme_name; type: string_byref_const - DCHECK(scheme_name); - if (!scheme_name) + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return 0; + // Verify param: visitor; type: refptr_diff + DCHECK(visitor); + if (!visitor) return 0; // Execute - bool _retval = CefRegisterCustomScheme( - CefString(scheme_name), - is_standard?true:false, - is_local?true:false, - is_display_isolated?true:false); + bool _retval = CefVisitUrlCookies( + CefString(url), + includeHttpOnly?true:false, + CefCookieVisitorCToCpp::Wrap(visitor)); // Return type: bool return _retval; } - -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) +CEF_EXPORT int cef_set_cookie(const cef_string_t* url, + const struct _cef_cookie_t* cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: scheme_name; type: string_byref_const - DCHECK(scheme_name); - if (!scheme_name) + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) return 0; - // Unverified params: domain_name, factory + // Verify param: cookie; type: struct_byref_const + DCHECK(cookie); + if (!cookie) + return 0; + + // Translate param: cookie; type: struct_byref_const + CefCookie cookieObj; + if (cookie) + cookieObj.Set(*cookie, false); // Execute - bool _retval = CefRegisterSchemeHandlerFactory( - CefString(scheme_name), - CefString(domain_name), - CefSchemeHandlerFactoryCToCpp::Wrap(factory)); + bool _retval = CefSetCookie( + CefString(url), + cookieObj); // Return type: bool return _retval; } - -CEF_EXPORT int cef_clear_scheme_handler_factories() +CEF_EXPORT int cef_delete_cookies(const cef_string_t* url, + const cef_string_t* cookie_name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + // Unverified params: url, cookie_name + // Execute - bool _retval = CefClearSchemeHandlerFactories(); + bool _retval = CefDeleteCookies( + CefString(url), + CefString(cookie_name)); // Return type: bool return _retval; } +CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: path + + // Execute + bool _retval = CefSetCookiePath( + CefString(path)); + + // Return type: bool + return _retval; +} CEF_EXPORT int cef_add_cross_origin_whitelist_entry( const cef_string_t* source_origin, const cef_string_t* target_protocol, @@ -288,7 +315,6 @@ CEF_EXPORT int cef_add_cross_origin_whitelist_entry( return _retval; } - 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) @@ -319,7 +345,6 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( return _retval; } - CEF_EXPORT int cef_clear_cross_origin_whitelist() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -331,6 +356,145 @@ CEF_EXPORT int cef_clear_cross_origin_whitelist() return _retval; } +CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name, + int is_standard, int is_local, int is_display_isolated) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const + DCHECK(scheme_name); + if (!scheme_name) + return 0; + + // Execute + bool _retval = CefRegisterCustomScheme( + CefString(scheme_name), + is_standard?true:false, + is_local?true:false, + is_display_isolated?true:false); + + // Return type: bool + return _retval; +} + +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) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const + DCHECK(scheme_name); + if (!scheme_name) + return 0; + // Unverified params: domain_name, factory + + // Execute + bool _retval = CefRegisterSchemeHandlerFactory( + CefString(scheme_name), + CefString(domain_name), + CefSchemeHandlerFactoryCToCpp::Wrap(factory)); + + // Return type: bool + return _retval; +} + +CEF_EXPORT int cef_clear_scheme_handler_factories() +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + bool _retval = CefClearSchemeHandlerFactories(); + + // Return type: bool + return _retval; +} + +CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type, + const cef_string_t* origin, const cef_string_t* key, + struct _cef_storage_visitor_t* visitor) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor); + if (!visitor) + return 0; + // Unverified params: origin, key + + // Execute + bool _retval = CefVisitStorage( + type, + CefString(origin), + CefString(key), + CefStorageVisitorCToCpp::Wrap(visitor)); + + // Return type: bool + return _retval; +} + +CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type, + const cef_string_t* origin, const cef_string_t* key, + const cef_string_t* value) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: origin; type: string_byref_const + DCHECK(origin); + if (!origin) + return 0; + // Verify param: key; type: string_byref_const + DCHECK(key); + if (!key) + return 0; + // Verify param: value; type: string_byref_const + DCHECK(value); + if (!value) + return 0; + + // Execute + bool _retval = CefSetStorage( + type, + CefString(origin), + CefString(key), + CefString(value)); + + // Return type: bool + return _retval; +} + +CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type, + const cef_string_t* origin, const cef_string_t* key) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: origin, key + + // Execute + bool _retval = CefDeleteStorage( + type, + CefString(origin), + CefString(key)); + + // Return type: bool + return _retval; +} + +CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, + const cef_string_t* path) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: path + + // Execute + bool _retval = CefSetStoragePath( + type, + CefString(path)); + + // Return type: bool + return _retval; +} CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId) { @@ -344,7 +508,6 @@ CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId) return _retval; } - CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, struct _cef_task_t* task) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -363,7 +526,6 @@ CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, struct _cef_task_t* task) return _retval; } - CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, struct _cef_task_t* task, long delay_ms) { @@ -384,7 +546,6 @@ CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, return _retval; } - CEF_EXPORT int cef_parse_url(const cef_string_t* url, struct _cef_urlparts_t* parts) { @@ -417,7 +578,6 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url, return _retval; } - CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, cef_string_t* url) { @@ -448,198 +608,28 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, return _retval; } - -CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor) +CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, + const cef_string_t* javascript_code, struct _cef_v8handler_t* handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: visitor; type: refptr_diff - DCHECK(visitor); - if (!visitor) + // Verify param: extension_name; type: string_byref_const + DCHECK(extension_name); + if (!extension_name) return 0; + // Verify param: javascript_code; type: string_byref_const + DCHECK(javascript_code); + if (!javascript_code) + return 0; + // Unverified params: handler // Execute - bool _retval = CefVisitAllCookies( - CefCookieVisitorCToCpp::Wrap(visitor)); + bool _retval = CefRegisterExtension( + CefString(extension_name), + CefString(javascript_code), + CefV8HandlerCToCpp::Wrap(handler)); // Return type: bool return _retval; } - -CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url, - int includeHttpOnly, struct _cef_cookie_visitor_t* visitor) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: url; type: string_byref_const - DCHECK(url); - if (!url) - return 0; - // Verify param: visitor; type: refptr_diff - DCHECK(visitor); - if (!visitor) - return 0; - - // Execute - bool _retval = CefVisitUrlCookies( - CefString(url), - includeHttpOnly?true:false, - CefCookieVisitorCToCpp::Wrap(visitor)); - - // Return type: bool - return _retval; -} - - -CEF_EXPORT int cef_set_cookie(const cef_string_t* url, - const struct _cef_cookie_t* cookie) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: url; type: string_byref_const - DCHECK(url); - if (!url) - return 0; - // Verify param: cookie; type: struct_byref_const - DCHECK(cookie); - if (!cookie) - return 0; - - // Translate param: cookie; type: struct_byref_const - CefCookie cookieObj; - if (cookie) - cookieObj.Set(*cookie, false); - - // Execute - bool _retval = CefSetCookie( - CefString(url), - cookieObj); - - // Return type: bool - return _retval; -} - - -CEF_EXPORT int cef_delete_cookies(const cef_string_t* url, - const cef_string_t* cookie_name) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Unverified params: url, cookie_name - - // Execute - bool _retval = CefDeleteCookies( - CefString(url), - CefString(cookie_name)); - - // Return type: bool - return _retval; -} - - -CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Unverified params: path - - // Execute - bool _retval = CefSetCookiePath( - CefString(path)); - - // Return type: bool - return _retval; -} - - -CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type, - const cef_string_t* origin, const cef_string_t* key, - struct _cef_storage_visitor_t* visitor) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: visitor; type: refptr_diff - DCHECK(visitor); - if (!visitor) - return 0; - // Unverified params: origin, key - - // Execute - bool _retval = CefVisitStorage( - type, - CefString(origin), - CefString(key), - CefStorageVisitorCToCpp::Wrap(visitor)); - - // Return type: bool - return _retval; -} - - -CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type, - const cef_string_t* origin, const cef_string_t* key, - const cef_string_t* value) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: origin; type: string_byref_const - DCHECK(origin); - if (!origin) - return 0; - // Verify param: key; type: string_byref_const - DCHECK(key); - if (!key) - return 0; - // Verify param: value; type: string_byref_const - DCHECK(value); - if (!value) - return 0; - - // Execute - bool _retval = CefSetStorage( - type, - CefString(origin), - CefString(key), - CefString(value)); - - // Return type: bool - return _retval; -} - - -CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type, - const cef_string_t* origin, const cef_string_t* key) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Unverified params: origin, key - - // Execute - bool _retval = CefDeleteStorage( - type, - CefString(origin), - CefString(key)); - - // Return type: bool - return _retval; -} - - -CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, - const cef_string_t* path) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Unverified params: path - - // Execute - bool _retval = CefSetStoragePath( - type, - CefString(path)); - - // Return type: bool - return _retval; -} - - diff --git a/libcef_dll/libcef_dll2.cc b/libcef_dll/libcef_dll2.cc index 3159b0dee..34574507a 100644 --- a/libcef_dll/libcef_dll2.cc +++ b/libcef_dll/libcef_dll2.cc @@ -3,11 +3,9 @@ // can be found in the LICENSE file. // -#include "include/cef.h" -#include "include/cef_capi.h" -#include "include/cef_version.h" #include "include/cef_nplugin.h" -#include "include/cef_nplugin_capi.h" +#include "include/capi/cef_nplugin_capi.h" +#include "include/cef_version.h" #include "cef_logging.h" CEF_EXPORT int cef_build_revision() diff --git a/libcef_dll/wrapper/cef_byte_read_handler.cc b/libcef_dll/wrapper/cef_byte_read_handler.cc index 1620f9b04..eb864ac7b 100644 --- a/libcef_dll/wrapper/cef_byte_read_handler.cc +++ b/libcef_dll/wrapper/cef_byte_read_handler.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef_wrapper.h" +#include "include/wrapper/cef_byte_read_handler.h" #include "libcef_dll/cef_logging.h" CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, size_t size, diff --git a/libcef_dll/wrapper/cef_xml_object.cc b/libcef_dll/wrapper/cef_xml_object.cc index db6b896fa..7fd2b89b5 100644 --- a/libcef_dll/wrapper/cef_xml_object.cc +++ b/libcef_dll/wrapper/cef_xml_object.cc @@ -2,7 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef_wrapper.h" +#include "include/wrapper/cef_xml_object.h" +#include "include/cef_stream.h" #include "libcef_dll/cef_logging.h" #include diff --git a/libcef_dll/wrapper/cef_zip_archive.cc b/libcef_dll/wrapper/cef_zip_archive.cc index 508750798..21c4b6e67 100644 --- a/libcef_dll/wrapper/cef_zip_archive.cc +++ b/libcef_dll/wrapper/cef_zip_archive.cc @@ -2,9 +2,13 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef_wrapper.h" +#include "include/wrapper/cef_zip_archive.h" +#include "include/cef_stream.h" +#include "include/cef_zip_reader.h" +#include "include/wrapper/cef_byte_read_handler.h" #include "libcef_dll/cef_logging.h" #include +#include #if defined(__linux__) #include diff --git a/libcef_dll/wrapper/libcef_dll_wrapper.cc b/libcef_dll/wrapper/libcef_dll_wrapper.cc index 6f2e49c22..5a3a5b2ef 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper.cc @@ -10,6 +10,22 @@ // for more information. // +#include "include/cef_app.h" +#include "include/capi/cef_app_capi.h" +#include "include/cef_cookie.h" +#include "include/capi/cef_cookie_capi.h" +#include "include/cef_origin_whitelist.h" +#include "include/capi/cef_origin_whitelist_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_storage.h" +#include "include/capi/cef_storage_capi.h" +#include "include/cef_task.h" +#include "include/capi/cef_task_capi.h" +#include "include/cef_url.h" +#include "include/capi/cef_url_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" #include "include/cef_version.h" #include "libcef_dll/cpptoc/app_cpptoc.h" #include "libcef_dll/cpptoc/content_filter_cpptoc.h" @@ -89,7 +105,6 @@ CEF_GLOBAL bool CefInitialize(const CefSettings& settings, return _retval?true:false; } - CEF_GLOBAL void CefShutdown() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -149,7 +164,6 @@ CEF_GLOBAL void CefShutdown() #endif // !NDEBUG } - CEF_GLOBAL void CefDoMessageLoopWork() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -158,7 +172,6 @@ CEF_GLOBAL void CefDoMessageLoopWork() cef_do_message_loop_work(); } - CEF_GLOBAL void CefRunMessageLoop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -167,7 +180,6 @@ CEF_GLOBAL void CefRunMessageLoop() cef_run_message_loop(); } - CEF_GLOBAL void CefQuitMessageLoop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -176,88 +188,94 @@ CEF_GLOBAL void CefQuitMessageLoop() cef_quit_message_loop(); } - -CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, - const CefString& javascript_code, CefRefPtr handler) +CEF_GLOBAL bool CefVisitAllCookies(CefRefPtr visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: extension_name; type: string_byref_const - DCHECK(!extension_name.empty()); - if (extension_name.empty()) + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) return false; - // Verify param: javascript_code; type: string_byref_const - DCHECK(!javascript_code.empty()); - if (javascript_code.empty()) - return false; - // Unverified params: handler // Execute - int _retval = cef_register_extension( - extension_name.GetStruct(), - javascript_code.GetStruct(), - CefV8HandlerCppToC::Wrap(handler)); + int _retval = cef_visit_all_cookies( + CefCookieVisitorCppToC::Wrap(visitor)); // Return type: bool return _retval?true:false; } - -CEF_GLOBAL bool CefRegisterCustomScheme(const CefString& scheme_name, - bool is_standard, bool is_local, bool is_display_isolated) +CEF_GLOBAL bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, + CefRefPtr visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: scheme_name; type: string_byref_const - DCHECK(!scheme_name.empty()); - if (scheme_name.empty()) + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) return false; // Execute - int _retval = cef_register_custom_scheme( - scheme_name.GetStruct(), - is_standard, - is_local, - is_display_isolated); + int _retval = cef_visit_url_cookies( + url.GetStruct(), + includeHttpOnly, + CefCookieVisitorCppToC::Wrap(visitor)); // Return type: bool return _retval?true:false; } - -CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, - const CefString& domain_name, CefRefPtr factory) +CEF_GLOBAL bool CefSetCookie(const CefString& url, const CefCookie& cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: scheme_name; type: string_byref_const - DCHECK(!scheme_name.empty()); - if (scheme_name.empty()) + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) return false; - // Unverified params: domain_name, factory // Execute - int _retval = cef_register_scheme_handler_factory( - scheme_name.GetStruct(), - domain_name.GetStruct(), - CefSchemeHandlerFactoryCppToC::Wrap(factory)); + int _retval = cef_set_cookie( + url.GetStruct(), + &cookie); // Return type: bool return _retval?true:false; } - -CEF_GLOBAL bool CefClearSchemeHandlerFactories() +CEF_GLOBAL bool CefDeleteCookies(const CefString& url, + const CefString& cookie_name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + // Unverified params: url, cookie_name + // Execute - int _retval = cef_clear_scheme_handler_factories(); + int _retval = cef_delete_cookies( + url.GetStruct(), + cookie_name.GetStruct()); // Return type: bool return _retval?true:false; } +CEF_GLOBAL bool CefSetCookiePath(const CefString& path) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: path + + // Execute + int _retval = cef_set_cookie_path( + path.GetStruct()); + + // Return type: bool + return _retval?true:false; +} CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, @@ -289,7 +307,6 @@ CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, return _retval?true:false; } - CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, bool allow_target_subdomains) @@ -320,7 +337,6 @@ CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( return _retval?true:false; } - CEF_GLOBAL bool CefClearCrossOriginWhitelist() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -332,187 +348,59 @@ CEF_GLOBAL bool CefClearCrossOriginWhitelist() return _retval?true:false; } - -CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) +CEF_GLOBAL bool CefRegisterCustomScheme(const CefString& scheme_name, + bool is_standard, bool is_local, bool is_display_isolated) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Execute - int _retval = cef_currently_on( - threadId); - - // Return type: bool - return _retval?true:false; -} - - -CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: task; type: refptr_diff - DCHECK(task.get()); - if (!task.get()) + // Verify param: scheme_name; type: string_byref_const + DCHECK(!scheme_name.empty()); + if (scheme_name.empty()) return false; // Execute - int _retval = cef_post_task( - threadId, - CefTaskCppToC::Wrap(task)); + int _retval = cef_register_custom_scheme( + scheme_name.GetStruct(), + is_standard, + is_local, + is_display_isolated); // Return type: bool return _retval?true:false; } - -CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, - CefRefPtr task, long delay_ms) +CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, + const CefString& domain_name, CefRefPtr factory) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: task; type: refptr_diff - DCHECK(task.get()); - if (!task.get()) + // Verify param: scheme_name; type: string_byref_const + DCHECK(!scheme_name.empty()); + if (scheme_name.empty()) return false; + // Unverified params: domain_name, factory // Execute - int _retval = cef_post_delayed_task( - threadId, - CefTaskCppToC::Wrap(task), - delay_ms); + int _retval = cef_register_scheme_handler_factory( + scheme_name.GetStruct(), + domain_name.GetStruct(), + CefSchemeHandlerFactoryCppToC::Wrap(factory)); // Return type: bool return _retval?true:false; } - -CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: url; type: string_byref_const - DCHECK(!url.empty()); - if (url.empty()) - return false; - - // Execute - int _retval = cef_parse_url( - url.GetStruct(), - &parts); - - // Return type: bool - return _retval?true:false; -} - - -CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) +CEF_GLOBAL bool CefClearSchemeHandlerFactories() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = cef_create_url( - &parts, - url.GetWritableStruct()); + int _retval = cef_clear_scheme_handler_factories(); // Return type: bool return _retval?true:false; } - -CEF_GLOBAL bool CefVisitAllCookies(CefRefPtr visitor) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: visitor; type: refptr_diff - DCHECK(visitor.get()); - if (!visitor.get()) - return false; - - // Execute - int _retval = cef_visit_all_cookies( - CefCookieVisitorCppToC::Wrap(visitor)); - - // Return type: bool - return _retval?true:false; -} - - -CEF_GLOBAL bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr visitor) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: url; type: string_byref_const - DCHECK(!url.empty()); - if (url.empty()) - return false; - // Verify param: visitor; type: refptr_diff - DCHECK(visitor.get()); - if (!visitor.get()) - return false; - - // Execute - int _retval = cef_visit_url_cookies( - url.GetStruct(), - includeHttpOnly, - CefCookieVisitorCppToC::Wrap(visitor)); - - // Return type: bool - return _retval?true:false; -} - - -CEF_GLOBAL bool CefSetCookie(const CefString& url, const CefCookie& cookie) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: url; type: string_byref_const - DCHECK(!url.empty()); - if (url.empty()) - return false; - - // Execute - int _retval = cef_set_cookie( - url.GetStruct(), - &cookie); - - // Return type: bool - return _retval?true:false; -} - - -CEF_GLOBAL bool CefDeleteCookies(const CefString& url, - const CefString& cookie_name) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Unverified params: url, cookie_name - - // Execute - int _retval = cef_delete_cookies( - url.GetStruct(), - cookie_name.GetStruct()); - - // Return type: bool - return _retval?true:false; -} - - -CEF_GLOBAL bool CefSetCookiePath(const CefString& path) -{ - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Unverified params: path - - // Execute - int _retval = cef_set_cookie_path( - path.GetStruct()); - - // Return type: bool - return _retval?true:false; -} - - CEF_GLOBAL bool CefVisitStorage(CefStorageType type, const CefString& origin, const CefString& key, CefRefPtr visitor) { @@ -535,7 +423,6 @@ CEF_GLOBAL bool CefVisitStorage(CefStorageType type, const CefString& origin, return _retval?true:false; } - CEF_GLOBAL bool CefSetStorage(CefStorageType type, const CefString& origin, const CefString& key, const CefString& value) { @@ -565,7 +452,6 @@ CEF_GLOBAL bool CefSetStorage(CefStorageType type, const CefString& origin, return _retval?true:false; } - CEF_GLOBAL bool CefDeleteStorage(CefStorageType type, const CefString& origin, const CefString& key) { @@ -583,7 +469,6 @@ CEF_GLOBAL bool CefDeleteStorage(CefStorageType type, const CefString& origin, return _retval?true:false; } - CEF_GLOBAL bool CefSetStoragePath(CefStorageType type, const CefString& path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -599,4 +484,109 @@ CEF_GLOBAL bool CefSetStoragePath(CefStorageType type, const CefString& path) return _retval?true:false; } +CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_currently_on( + threadId); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = cef_post_task( + threadId, + CefTaskCppToC::Wrap(task)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, + CefRefPtr task, long delay_ms) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = cef_post_delayed_task( + threadId, + CefTaskCppToC::Wrap(task), + delay_ms); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + + // Execute + int _retval = cef_parse_url( + url.GetStruct(), + &parts); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_create_url( + &parts, + url.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, + const CefString& javascript_code, CefRefPtr handler) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: extension_name; type: string_byref_const + DCHECK(!extension_name.empty()); + if (extension_name.empty()) + return false; + // Verify param: javascript_code; type: string_byref_const + DCHECK(!javascript_code.empty()); + if (javascript_code.empty()) + return false; + // Unverified params: handler + + // Execute + int _retval = cef_register_extension( + extension_name.GetStruct(), + javascript_code.GetStruct(), + CefV8HandlerCppToC::Wrap(handler)); + + // Return type: bool + return _retval?true:false; +} diff --git a/libcef_dll/wrapper/libcef_dll_wrapper2.cc b/libcef_dll/wrapper/libcef_dll_wrapper2.cc index 28943a1b8..4647f5d65 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper2.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper2.cc @@ -2,10 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_capi.h" #include "include/cef_nplugin.h" -#include "include/cef_nplugin_capi.h" +#include "include/capi/cef_nplugin_capi.h" bool CefRegisterPlugin(const CefPluginInfo& plugin_info) { diff --git a/tests/cefclient/binding_test.cpp b/tests/cefclient/binding_test.cpp index f6545f70c..4439a5808 100644 --- a/tests/cefclient/binding_test.cpp +++ b/tests/cefclient/binding_test.cpp @@ -3,6 +3,9 @@ // can be found in the LICENSE file. #include "binding_test.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_v8.h" #include diff --git a/tests/cefclient/binding_test.h b/tests/cefclient/binding_test.h index 57cbf6510..7343faa8a 100644 --- a/tests/cefclient/binding_test.h +++ b/tests/cefclient/binding_test.h @@ -5,7 +5,11 @@ #ifndef _CEFCLIENT_BINDING_TEST_H #define _CEFCLIENT_BINDING_TEST_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefBrowser; +class CefFrame; +class CefV8Value; // Add the V8 bindings. void InitBindingTest(CefRefPtr browser, diff --git a/tests/cefclient/cefclient.cpp b/tests/cefclient/cefclient.cpp index 0a716c005..24f4ab58a 100644 --- a/tests/cefclient/cefclient.cpp +++ b/tests/cefclient/cefclient.cpp @@ -2,10 +2,13 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_runnable.h" -#include "include/cef_wrapper.h" #include "cefclient.h" +#include "include/cef_app.h" +#include "include/cef_browser.h" +#include "include/cef_command_line.h" +#include "include/cef_frame.h" +#include "include/cef_runnable.h" +#include "include/cef_web_urlrequest.h" #include "cefclient_switches.h" #include "client_handler.h" #include "binding_test.h" diff --git a/tests/cefclient/cefclient.h b/tests/cefclient/cefclient.h index ad768d30d..f8e08190c 100644 --- a/tests/cefclient/cefclient.h +++ b/tests/cefclient/cefclient.h @@ -5,7 +5,11 @@ #ifndef _CEFCLIENT_H #define _CEFCLIENT_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefApp; +class CefBrowser; +class CefCommandLine; // Returns the main browser window instance. CefRefPtr AppGetBrowser(); diff --git a/tests/cefclient/cefclient_gtk.cpp b/tests/cefclient/cefclient_gtk.cpp index 9fc122839..8463f29a6 100644 --- a/tests/cefclient/cefclient_gtk.cpp +++ b/tests/cefclient/cefclient_gtk.cpp @@ -1,11 +1,16 @@ -#include "include/cef.h" -#include "cefclient.h" -#include "client_handler.h" +// 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. +#include "cefclient.h" +#include "include/cef_app.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_runnable.h" #include "binding_test.h" +#include "client_handler.h" #include "extension_test.h" #include "scheme_test.h" - #include #include #include diff --git a/tests/cefclient/cefclient_mac.mm b/tests/cefclient/cefclient_mac.mm index 3e07303b3..fcc3b09ab 100644 --- a/tests/cefclient/cefclient_mac.mm +++ b/tests/cefclient/cefclient_mac.mm @@ -3,9 +3,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "include/cef.h" -#import "include/cef_application_mac.h" #include "cefclient.h" +#include "include/cef_app.h" +#import "include/cef_application_mac.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_runnable.h" #include "binding_test.h" #include "client_handler.h" #include "extension_test.h" diff --git a/tests/cefclient/cefclient_win.cpp b/tests/cefclient/cefclient_win.cpp index 71f27d908..900b873e4 100644 --- a/tests/cefclient/cefclient_win.cpp +++ b/tests/cefclient/cefclient_win.cpp @@ -2,9 +2,11 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_runnable.h" #include "cefclient.h" +#include "include/cef_app.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_runnable.h" #include "binding_test.h" #include "client_handler.h" #include "extension_test.h" diff --git a/tests/cefclient/client_handler.cpp b/tests/cefclient/client_handler.cpp index a800874ca..2190bbed9 100644 --- a/tests/cefclient/client_handler.cpp +++ b/tests/cefclient/client_handler.cpp @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" #include "client_handler.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" #include "binding_test.h" #include "cefclient.h" #include "download_handler.h" diff --git a/tests/cefclient/client_handler.h b/tests/cefclient/client_handler.h index 42983c93b..0aee64b65 100644 --- a/tests/cefclient/client_handler.h +++ b/tests/cefclient/client_handler.h @@ -5,7 +5,7 @@ #ifndef _CLIENT_HANDLER_H #define _CLIENT_HANDLER_H -#include "include/cef.h" +#include "include/cef_client.h" #include "download_handler.h" #include "util.h" diff --git a/tests/cefclient/client_handler_gtk.cpp b/tests/cefclient/client_handler_gtk.cpp index 433bcd7c0..33bb30cd4 100644 --- a/tests/cefclient/client_handler_gtk.cpp +++ b/tests/cefclient/client_handler_gtk.cpp @@ -1,7 +1,10 @@ -#include "include/cef.h" -#include "include/cef_wrapper.h" -#include "cefclient.h" +// 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. + #include "client_handler.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" #include "resource_util.h" #include "string_util.h" #include diff --git a/tests/cefclient/client_handler_mac.mm b/tests/cefclient/client_handler_mac.mm index 0127e56eb..dfe084953 100644 --- a/tests/cefclient/client_handler_mac.mm +++ b/tests/cefclient/client_handler_mac.mm @@ -2,10 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_wrapper.h" -#include "cefclient.h" #include "client_handler.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" #include "resource_util.h" #include "string_util.h" #import diff --git a/tests/cefclient/client_handler_win.cpp b/tests/cefclient/client_handler_win.cpp index 2db190dc2..37086f5ac 100644 --- a/tests/cefclient/client_handler_win.cpp +++ b/tests/cefclient/client_handler_win.cpp @@ -2,9 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_wrapper.h" #include "client_handler.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" #include "resource.h" #include "resource_util.h" #include "string_util.h" diff --git a/tests/cefclient/client_popup_handler.cpp b/tests/cefclient/client_popup_handler.cpp index c7e004281..a35197930 100644 --- a/tests/cefclient/client_popup_handler.cpp +++ b/tests/cefclient/client_popup_handler.cpp @@ -2,8 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" #include "client_popup_handler.h" +#include "include/cef_frame.h" #include "util.h" ClientPopupHandler::ClientPopupHandler(CefRefPtr parentBrowser) diff --git a/tests/cefclient/client_popup_handler.h b/tests/cefclient/client_popup_handler.h index a26a16de9..18888f760 100644 --- a/tests/cefclient/client_popup_handler.h +++ b/tests/cefclient/client_popup_handler.h @@ -5,7 +5,9 @@ #ifndef _CLIENT_POPUP_HANDLER_H #define _CLIENT_POPUP_HANDLER_H -#include "include/cef.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" +#include "include/cef_request_handler.h" // Handler for popup windows that loads the request in an existing browser // window. diff --git a/tests/cefclient/download_handler.cpp b/tests/cefclient/download_handler.cpp index a4ea052e8..99ac9807b 100644 --- a/tests/cefclient/download_handler.cpp +++ b/tests/cefclient/download_handler.cpp @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef_runnable.h" #include "download_handler.h" +#include "include/cef_download_handler.h" +#include "include/cef_runnable.h" #include "util.h" #include #include diff --git a/tests/cefclient/download_handler.h b/tests/cefclient/download_handler.h index 39637e373..64a41b3f2 100644 --- a/tests/cefclient/download_handler.h +++ b/tests/cefclient/download_handler.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_DOWNLOAD_HANDLER_H #define _CEFCLIENT_DOWNLOAD_HANDLER_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefDownloadHandler; // Implement this interface to receive download notifications. class DownloadListener : public virtual CefBase diff --git a/tests/cefclient/extension_test.cpp b/tests/cefclient/extension_test.cpp index 485358e6d..37426797a 100644 --- a/tests/cefclient/extension_test.cpp +++ b/tests/cefclient/extension_test.cpp @@ -3,6 +3,10 @@ // can be found in the LICENSE file. #include "extension_test.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_stream.h" +#include "include/cef_v8.h" #include "resource_util.h" // Implementation of the V8 handler class for the "cef.test" extension. diff --git a/tests/cefclient/extension_test.h b/tests/cefclient/extension_test.h index 805efa788..73a6d5d8b 100644 --- a/tests/cefclient/extension_test.h +++ b/tests/cefclient/extension_test.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_EXTENSION_TEST_H #define _CEFCLIENT_EXTENSION_TEST_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefBrowser; // Register the V8 extension handler. void InitExtensionTest(); diff --git a/tests/cefclient/osrplugin.cpp b/tests/cefclient/osrplugin.cpp index f349b71bf..e6945ebb4 100644 --- a/tests/cefclient/osrplugin.cpp +++ b/tests/cefclient/osrplugin.cpp @@ -3,10 +3,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "include/cef.h" +#include "osrplugin.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" #include "cefclient.h" #include "client_popup_handler.h" -#include "osrplugin.h" #include "resource.h" #include "resource_util.h" #include "string_util.h" diff --git a/tests/cefclient/osrplugin.h b/tests/cefclient/osrplugin.h index 0ea76ca1e..a62501b33 100644 --- a/tests/cefclient/osrplugin.h +++ b/tests/cefclient/osrplugin.h @@ -9,11 +9,14 @@ #ifndef _CEFCLIENT_OSRPLUGIN_H #define _CEFCLIENT_OSRPLUGIN_H -#include "include/cef.h" -#include "include/cef_nplugin.h" +#include "include/cef_base.h" #if defined(OS_WIN) +#include "include/cef_nplugin.h" + +class CefBrowser; + extern NPNetscapeFuncs* g_osrbrowser; NPError API_CALL NP_OSRGetEntryPoints(NPPluginFuncs* pFuncs); diff --git a/tests/cefclient/osrplugin_test.cpp b/tests/cefclient/osrplugin_test.cpp index 5f1f2e985..51ef750de 100644 --- a/tests/cefclient/osrplugin_test.cpp +++ b/tests/cefclient/osrplugin_test.cpp @@ -3,6 +3,8 @@ // can be found in the LICENSE file. #include "osrplugin_test.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" #include "osrplugin.h" #include "cefclient.h" #include "client_handler.h" diff --git a/tests/cefclient/osrplugin_test.h b/tests/cefclient/osrplugin_test.h index 25a7b0d07..fb3f9f0b5 100644 --- a/tests/cefclient/osrplugin_test.h +++ b/tests/cefclient/osrplugin_test.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_OSRPLUGIN_TEST_H #define _CEFCLIENT_OSRPLUGIN_TEST_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefBrowser; // Register the internal client plugin and V8 extension. void InitOSRPluginTest(); diff --git a/tests/cefclient/plugin_test.cpp b/tests/cefclient/plugin_test.cpp index 5b0fb4651..0cb2355f3 100644 --- a/tests/cefclient/plugin_test.cpp +++ b/tests/cefclient/plugin_test.cpp @@ -2,7 +2,10 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_nplugin.h" #include "clientplugin.h" void InitPluginTest() diff --git a/tests/cefclient/plugin_test.h b/tests/cefclient/plugin_test.h index a3a460dfd..d08fb3237 100644 --- a/tests/cefclient/plugin_test.h +++ b/tests/cefclient/plugin_test.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_PLUGIN_TEST_H #define _CEFCLIENT_PLUGIN_TEST_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefBrowser; // Register the internal client plugin. void InitPluginTest(); diff --git a/tests/cefclient/resource_util.h b/tests/cefclient/resource_util.h index e1fe9c246..8ee57ccc3 100644 --- a/tests/cefclient/resource_util.h +++ b/tests/cefclient/resource_util.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_RESOURCE_UTIL #define _CEFCLIENT_RESOURCE_UTIL -#include "include/cef.h" +#include "include/cef_base.h" + +class CefStreamReader; #if defined(OS_WIN) diff --git a/tests/cefclient/resource_util_linux.cpp b/tests/cefclient/resource_util_linux.cpp index fec21ef55..14514d722 100644 --- a/tests/cefclient/resource_util_linux.cpp +++ b/tests/cefclient/resource_util_linux.cpp @@ -4,6 +4,7 @@ // found in the LICENSE file. #include "resource_util.h" +#include "include/cef_stream.h" #include "util.h" #include diff --git a/tests/cefclient/resource_util_mac.mm b/tests/cefclient/resource_util_mac.mm index 5ef4ad766..7b853349e 100644 --- a/tests/cefclient/resource_util_mac.mm +++ b/tests/cefclient/resource_util_mac.mm @@ -4,6 +4,7 @@ // found in the LICENSE file. #include "resource_util.h" +#include "include/cef_stream.h" #include "util.h" #import diff --git a/tests/cefclient/resource_util_win.cpp b/tests/cefclient/resource_util_win.cpp index 6023b5535..78b23b6a2 100644 --- a/tests/cefclient/resource_util_win.cpp +++ b/tests/cefclient/resource_util_win.cpp @@ -3,7 +3,8 @@ // can be found in the LICENSE file. #include "resource_util.h" -#include "include/cef_wrapper.h" +#include "include/cef_stream.h" +#include "include/wrapper/cef_byte_read_handler.h" #if defined(OS_WIN) diff --git a/tests/cefclient/scheme_test.cpp b/tests/cefclient/scheme_test.cpp index df9c0f7db..ce769c62b 100644 --- a/tests/cefclient/scheme_test.cpp +++ b/tests/cefclient/scheme_test.cpp @@ -1,10 +1,14 @@ -// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights +// 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. -#include "include/cef_wrapper.h" -#include "resource_util.h" #include "scheme_test.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_response.h" +#include "include/cef_request.h" +#include "include/cef_scheme.h" +#include "resource_util.h" #include "string_util.h" #include "util.h" diff --git a/tests/cefclient/scheme_test.h b/tests/cefclient/scheme_test.h index 5655cf90a..acf091e23 100644 --- a/tests/cefclient/scheme_test.h +++ b/tests/cefclient/scheme_test.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_SCHEME_TEST #define _CEFCLIENT_SCHEME_TEST -#include "include/cef.h" +#include "include/cef_base.h" + +class CefBrowser; // Register the scheme handler. void InitSchemeTest(); diff --git a/tests/cefclient/string_util.cpp b/tests/cefclient/string_util.cpp index 14a7388f9..1c415baaf 100644 --- a/tests/cefclient/string_util.cpp +++ b/tests/cefclient/string_util.cpp @@ -3,6 +3,7 @@ // can be found in the LICENSE file. #include "string_util.h" +#include "include/cef_request.h" #include void DumpRequestContents(CefRefPtr request, std::string& str) diff --git a/tests/cefclient/string_util.h b/tests/cefclient/string_util.h index 6893e4dbb..a7391c7ff 100644 --- a/tests/cefclient/string_util.h +++ b/tests/cefclient/string_util.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_STRING_UTIL_H #define _CEFCLIENT_STRING_UTIL_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefRequest; // Dump the contents of the request into a string. void DumpRequestContents(CefRefPtr request, std::string& str); diff --git a/tests/cefclient/uiplugin.cpp b/tests/cefclient/uiplugin.cpp index d6fd4cef0..69da2c9ee 100644 --- a/tests/cefclient/uiplugin.cpp +++ b/tests/cefclient/uiplugin.cpp @@ -4,6 +4,8 @@ // found in the LICENSE file. #include "uiplugin.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" #include "cefclient.h" #include #include diff --git a/tests/cefclient/uiplugin_test.cpp b/tests/cefclient/uiplugin_test.cpp index f7b8cd8a5..a99ab02ec 100644 --- a/tests/cefclient/uiplugin_test.cpp +++ b/tests/cefclient/uiplugin_test.cpp @@ -3,6 +3,9 @@ // can be found in the LICENSE file. #include "uiplugin_test.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_v8.h" #include "uiplugin.h" #include "cefclient.h" diff --git a/tests/cefclient/uiplugin_test.h b/tests/cefclient/uiplugin_test.h index b98229782..7f9d7c852 100644 --- a/tests/cefclient/uiplugin_test.h +++ b/tests/cefclient/uiplugin_test.h @@ -5,7 +5,9 @@ #ifndef _CEFCLIENT_UIPLUGIN_TEST_H #define _CEFCLIENT_UIPLUGIN_TEST_H -#include "include/cef.h" +#include "include/cef_base.h" + +class CefBrowser; // Register the internal client plugin and V8 extension. void InitUIPluginTest(); diff --git a/tests/cefclient/util.h b/tests/cefclient/util.h index e7a064fc5..aca202295 100644 --- a/tests/cefclient/util.h +++ b/tests/cefclient/util.h @@ -5,7 +5,7 @@ #ifndef _CEFCLIENT_UTIL_H #define _CEFCLIENT_UTIL_H -#include "include/cef.h" +#include "include/cef_task.h" #if defined(OS_WIN) diff --git a/tests/unittests/command_line_unittest.cc b/tests/unittests/command_line_unittest.cc index 757a15a9d..642c2992c 100644 --- a/tests/unittests/command_line_unittest.cc +++ b/tests/unittests/command_line_unittest.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_command_line.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/tests/unittests/content_filter_unittest.cc b/tests/unittests/content_filter_unittest.cc index fa706d940..712068252 100644 --- a/tests/unittests/content_filter_unittest.cc +++ b/tests/unittests/content_filter_unittest.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_content_filter.h" #include "testing/gtest/include/gtest/gtest.h" #include "test_handler.h" diff --git a/tests/unittests/cookie_unittest.cc b/tests/unittests/cookie_unittest.cc index b64882a43..b12cd46e2 100644 --- a/tests/unittests/cookie_unittest.cc +++ b/tests/unittests/cookie_unittest.cc @@ -2,10 +2,10 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +#include "include/cef_cookie.h" +#include "include/cef_runnable.h" #include "base/scoped_temp_dir.h" #include "base/synchronization/waitable_event.h" -#include "include/cef.h" -#include "include/cef_runnable.h" #include "testing/gtest/include/gtest/gtest.h" #include "test_suite.h" #include diff --git a/tests/unittests/dom_unittest.cc b/tests/unittests/dom_unittest.cc index 07daf207d..4d772355d 100644 --- a/tests/unittests/dom_unittest.cc +++ b/tests/unittests/dom_unittest.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_dom.h" #include "testing/gtest/include/gtest/gtest.h" #include "test_handler.h" diff --git a/tests/unittests/navigation_unittest.cc b/tests/unittests/navigation_unittest.cc index 7f7f0e043..85e25405d 100644 --- a/tests/unittests/navigation_unittest.cc +++ b/tests/unittests/navigation_unittest.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_scheme.h" #include "testing/gtest/include/gtest/gtest.h" #include "test_handler.h" diff --git a/tests/unittests/request_unittest.cc b/tests/unittests/request_unittest.cc index 4b48208e6..dbe62a3ba 100644 --- a/tests/unittests/request_unittest.cc +++ b/tests/unittests/request_unittest.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_request.h" #include "testing/gtest/include/gtest/gtest.h" #include "test_handler.h" diff --git a/tests/unittests/scheme_handler_unittest.cc b/tests/unittests/scheme_handler_unittest.cc index 970d1ed6d..f229d6224 100644 --- a/tests/unittests/scheme_handler_unittest.cc +++ b/tests/unittests/scheme_handler_unittest.cc @@ -2,7 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef_runnable.h" +#include "include/cef_origin_whitelist.h" +#include "include/cef_scheme.h" #include "test_handler.h" namespace { diff --git a/tests/unittests/storage_unittest.cc b/tests/unittests/storage_unittest.cc index c748efc84..f36a8c187 100644 --- a/tests/unittests/storage_unittest.cc +++ b/tests/unittests/storage_unittest.cc @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +#include "include/cef_storage.h" +#include "include/cef_v8.h" #include "base/scoped_temp_dir.h" -#include "include/cef.h" #include "testing/gtest/include/gtest/gtest.h" #include "test_handler.h" #include "test_suite.h" diff --git a/tests/unittests/stream_unittest.cc b/tests/unittests/stream_unittest.cc index 886726d58..4f7ca119e 100644 --- a/tests/unittests/stream_unittest.cc +++ b/tests/unittests/stream_unittest.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_stream.h" #include "testing/gtest/include/gtest/gtest.h" static void VerifyStreamReadBehavior(CefRefPtr stream, diff --git a/tests/unittests/test_handler.h b/tests/unittests/test_handler.h index 35b48a8df..19f4d740c 100644 --- a/tests/unittests/test_handler.h +++ b/tests/unittests/test_handler.h @@ -5,7 +5,9 @@ #ifndef _TEST_HANDLER_H #define _TEST_HANDLER_H -#include "include/cef.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_client.h" #include "include/cef_runnable.h" #include "base/synchronization/waitable_event.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/test_suite.cc b/tests/unittests/test_suite.cc index 558f6b675..29b90bd94 100644 --- a/tests/unittests/test_suite.cc +++ b/tests/unittests/test_suite.cc @@ -2,8 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" #include "test_suite.h" +#include "include/cef_app.h" #include "base/command_line.h" #include "build/build_config.h" #include "base/threading/platform_thread.h" diff --git a/tests/unittests/url_unittest.cc b/tests/unittests/url_unittest.cc index f9c7c78e0..453c10548 100644 --- a/tests/unittests/url_unittest.cc +++ b/tests/unittests/url_unittest.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" +#include "include/cef_url.h" #include "testing/gtest/include/gtest/gtest.h" TEST(URLTest, CreateURL) diff --git a/tests/unittests/v8_unittest.cc b/tests/unittests/v8_unittest.cc index efe1ddc9e..8515d6c25 100644 --- a/tests/unittests/v8_unittest.cc +++ b/tests/unittests/v8_unittest.cc @@ -2,8 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_runnable.h" +#include "include/cef_v8.h" #include "testing/gtest/include/gtest/gtest.h" #include "test_handler.h" diff --git a/tests/unittests/web_urlrequest_unittest.cc b/tests/unittests/web_urlrequest_unittest.cc index 3e80f2a20..77e5ffd53 100644 --- a/tests/unittests/web_urlrequest_unittest.cc +++ b/tests/unittests/web_urlrequest_unittest.cc @@ -2,6 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +#include "include/cef_web_urlrequest.h" #include "test_handler.h" //#define WEB_URLREQUEST_DEBUG diff --git a/tests/unittests/xml_reader_unittest.cc b/tests/unittests/xml_reader_unittest.cc index 49ca74bbc..33f0a0530 100644 --- a/tests/unittests/xml_reader_unittest.cc +++ b/tests/unittests/xml_reader_unittest.cc @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_wrapper.h" +#include "include/cef_stream.h" +#include "include/cef_xml_reader.h" +#include "include/wrapper/cef_xml_object.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/tests/unittests/zip_reader_unittest.cc b/tests/unittests/zip_reader_unittest.cc index af052dea5..75a292bba 100644 --- a/tests/unittests/zip_reader_unittest.cc +++ b/tests/unittests/zip_reader_unittest.cc @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/cef.h" -#include "include/cef_wrapper.h" +#include "include/cef_stream.h" +#include "include/cef_zip_reader.h" +#include "include/wrapper/cef_zip_archive.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/tools/cef_parser.py b/tools/cef_parser.py index 3927a7be7..dad04226c 100644 --- a/tools/cef_parser.py +++ b/tools/cef_parser.py @@ -94,6 +94,10 @@ def wrap_code(code, indent = ' ', maxchars = 80, splitchars = '(=,'): return output +def get_capi_file_name(cppname): + """ Convert a C++ header file name to a C API header file name. """ + return cppname[:-2]+'_capi.h' + def get_capi_name(cppname, isclassname, prefix = None): """ Convert a C++ CamelCaps name to a C API underscore name. """ result = '' @@ -193,7 +197,7 @@ def format_comment(comment, indent, translate_map = None, maxchars = 80): if didremovespace: result += ' '+line else: - result += line; + result += line result += '\n' else: # add to the current paragraph @@ -321,8 +325,12 @@ def dict_to_str(dict): str = [] for name in dict.keys(): if not isinstance(dict[name], list): - # currently a string value - str.append(name+'='+dict[name]) + if dict[name] is True: + # currently a bool value + str.append(name) + else: + # currently a string value + str.append(name+'='+dict[name]) else: # currently a list value for val in dict[name]: @@ -420,11 +428,26 @@ def get_copyright(): class obj_header: """ Class representing a C++ header file. """ - def __init__(self, filename): - self.filename = filename; + def __init__(self): + self.filenames = [] + self.typedefs = [] + self.funcs = [] + self.classes = [] + + def add_directory(self, directory): + """ Add all header files from the specified directory. """ + files = get_files(os.path.join(directory, '*.h')) + for file in files: + self.add_file(file) + + def add_file(self, filepath): + """ Add a header file. """ + + filename = os.path.split(filepath)[1] + added = False # read the input file into memory - data = read_file(filename) + data = read_file(filepath) # remove space from between template definition end brackets data = data.replace("> >", ">>") @@ -434,23 +457,27 @@ class obj_header: _cre_space+_cre_cfname+';', re.MULTILINE | re.DOTALL) list = p.findall(data) - - # build the global typedef objects - self.typedefs = [] - for value, alias in list: - self.typedefs.append(obj_typedef(self, value, alias)) + if len(list) > 0: + # build the global typedef objects + for value, alias in list: + self.typedefs.append(obj_typedef(self, filename, value, alias)) # extract global functions p = re.compile('\n'+_cre_attrib+'\n'+_cre_func+'\((.*?)\)', re.MULTILINE | re.DOTALL) list = p.findall(data) + if len(list) > 0: + added = True + + # build the global function objects + for attrib, retval, argval in list: + comment = get_comment(data, retval+'('+argval+');') + self.funcs.append(obj_function(self, filename, attrib, retval, + argval, comment)) - # build the global function objects - self.funcs = [] - for attrib, retval, argval in list: - comment = get_comment(data, retval+'('+argval+');') - self.funcs.append(obj_function(self, attrib, retval, argval, - comment)) + # extract forward declarations + p = re.compile('\nclass'+_cre_space+_cre_cfname+';') + forward_declares = p.findall(data) # extract classes p = re.compile('\n'+_cre_attrib+ @@ -459,13 +486,19 @@ class obj_header: _cre_space+'CefBase'+ '\n{(.*?)};', re.MULTILINE | re.DOTALL) list = p.findall(data) - - # build the class objects - self.classes = [] - for attrib, name, body in list: - comment = get_comment(data, name+' : public virtual CefBase') - self.classes.append( - obj_class(self, attrib, name, body, comment)) + if len(list) > 0: + added = True + + # build the class objects + for attrib, name, body in list: + comment = get_comment(data, name+' : public virtual CefBase') + self.classes.append( + obj_class(self, filename, attrib, name, body, comment, + forward_declares)) + + if added: + # a global function or class was read from the header file + self.filenames.append(filename) def __repr__(self): result = '' @@ -490,21 +523,37 @@ class obj_header: return result - def get_file_name(self): - """ Return the file name. """ - return self.filename + def get_file_names(self): + """ Return the array of header file names. """ + return self.filenames def get_typedefs(self): """ Return the array of typedef objects. """ return self.typedefs - def get_funcs(self): + def get_funcs(self, filename = None): """ Return the array of function objects. """ - return self.funcs + if filename is None: + return self.funcs + else: + # only return the functions in the specified file + res = [] + for func in self.funcs: + if func.get_file_name() == filename: + res.append(func) + return res - def get_classes(self): + def get_classes(self, filename = None): """ Return the array of class objects. """ - return self.classes + if filename is None: + return self.classes + else: + # only return the classes in the specified file + res = [] + for cls in self.classes: + if cls.get_file_name() == filename: + res.append(cls) + return res def get_class(self, classname, defined_structs = None): """ Return the specified class or None if not found. """ @@ -544,8 +593,7 @@ class obj_header: def get_defined_structs(self): """ Return a list of names already defined structure names. """ - return ['cef_print_info_t', 'cef_window_info_t', - 'cef_handler_menuinfo_t', 'cef_base_t'] + return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_t'] def get_capi_translations(self): """ Return a dictionary that maps C++ terminology to C API terminology. @@ -585,14 +633,17 @@ class obj_header: class obj_class: """ Class representing a C++ class. """ - def __init__(self, parent, attrib, name, body, comment): + def __init__(self, parent, filename, attrib, name, body, comment, + forward_declares): if not isinstance(parent, obj_header): raise Exception('Invalid parent object type') self.parent = parent + self.filename = filename self.attribs = str_to_dict(attrib) self.name = name self.comment = comment + self.forward_declares = forward_declares # extract typedefs p = re.compile('\n'+_cre_space+'typedef'+_cre_space+_cre_retval+ @@ -603,7 +654,7 @@ class obj_class: # build the typedef objects self.typedefs = [] for value, alias in list: - self.typedefs.append(obj_typedef(self, value, alias)) + self.typedefs.append(obj_typedef(self, filename, value, alias)) # extract static functions p = re.compile('\n'+_cre_space+_cre_attrib+'\n'+_cre_space+'static'+ @@ -659,9 +710,17 @@ class obj_class: result += "\n};\n" return result + def get_file_name(self): + """ Return the C++ header file name. """ + return self.filename + + def get_capi_file_name(self): + """ Return the CAPI header file name. """ + return get_capi_file_name(self.filename) + def get_name(self): """ Return the class name. """ - return self.name; + return self.name def get_capi_name(self): """ Return the CAPI structure name for this class. """ @@ -671,6 +730,11 @@ class obj_class: """ Return the class comment as an array of lines. """ return self.comment + def get_forward_declares(self): + """ Return the list of classes that are forward declared for this + class. """ + return self.forward_declares + def get_attribs(self): """ Return all attributes as a dictionary. """ return self.attribs @@ -688,7 +752,7 @@ class obj_class: else: # the value is a string return self.attribs[name] - return None; + return None def get_attrib_list(self, name): """ Return all values for specified attribute as a list. """ @@ -699,19 +763,19 @@ class obj_class: else: # convert the value to a list return [self.attribs[name]] - return None; + return None def get_typedefs(self): """ Return the array of typedef objects. """ - return self.typedefs; + return self.typedefs def get_static_funcs(self): """ Return the array of static function objects. """ - return self.staticfuncs; + return self.staticfuncs def get_virtual_funcs(self): """ Return the array of virtual function objects. """ - return self.virtualfuncs; + return self.virtualfuncs def get_types(self, list): """ Return a dictionary mapping data types to analyzed values. """ @@ -748,18 +812,27 @@ class obj_class: class obj_typedef: """ Class representing a typedef statement. """ - def __init__(self, parent, value, alias): + def __init__(self, parent, filename, value, alias): if not isinstance(parent, obj_header) \ and not isinstance(parent, obj_class): raise Exception('Invalid parent object type') self.parent = parent + self.filename = filename self.alias = alias self.value = self.parent.get_analysis(value, False) def __repr__(self): return 'typedef '+self.value.get_type()+' '+self.alias+';' + def get_file_name(self): + """ Return the C++ header file name. """ + return self.filename + + def get_capi_file_name(self): + """ Return the CAPI header file name. """ + return get_capi_file_name(self.filename) + def get_alias(self): """ Return the alias. """ return self.alias @@ -774,14 +847,15 @@ class obj_typedef: """ Return a dictionary mapping data types to analyzed values. """ name = self.value.get_type() if not name in list: - list[name] = self.value; + list[name] = self.value class obj_function: """ Class representing a function. """ - def __init__(self, parent, attrib, retval, argval, comment): + def __init__(self, parent, filename, attrib, retval, argval, comment): self.parent = parent + self.filename = filename self.attribs = str_to_dict(attrib) self.retval = obj_argument(self, retval) self.name = self.retval.remove_name() @@ -809,6 +883,14 @@ class obj_function: def __repr__(self): return '/* '+dict_to_str(self.attribs)+' */ '+self.get_cpp_proto() + def get_file_name(self): + """ Return the C++ header file name. """ + return self.filename + + def get_capi_file_name(self): + """ Return the CAPI header file name. """ + return get_capi_file_name(self.filename) + def get_name(self): """ Return the function name. """ return self.name @@ -849,7 +931,7 @@ class obj_function: else: # the value is a string return self.attribs[name] - return None; + return None def get_attrib_list(self, name): """ Return all values for specified attribute as a list. """ @@ -860,7 +942,7 @@ class obj_function: else: # convert the value to a list return [self.attribs[name]] - return None; + return None def get_retval(self): """ Return the return value object. """ @@ -977,7 +1059,8 @@ class obj_function_static(obj_function): def __init__(self, parent, attrib, retval, argval, comment): if not isinstance(parent, obj_class): raise Exception('Invalid parent object type') - obj_function.__init__(self, parent, attrib, retval, argval, comment) + obj_function.__init__(self, parent, parent.filename, attrib, retval, + argval, comment) def __repr__(self): return 'static '+obj_function.__repr__(self)+';' @@ -995,7 +1078,8 @@ class obj_function_virtual(obj_function): def __init__(self, parent, attrib, retval, argval, comment, vfmod): if not isinstance(parent, obj_class): raise Exception('Invalid parent object type') - obj_function.__init__(self, parent, attrib, retval, argval, comment) + obj_function.__init__(self, parent, parent.filename, attrib, retval, + argval, comment) if vfmod == 'const': self.isconst = True else: @@ -1067,8 +1151,8 @@ class obj_argument: """ Returns the count function for this argument. """ # The 'count_func' attribute value format is name:function if not self.parent.has_attrib('count_func'): - return None; - name = self.type.get_name(); + return None + name = self.type.get_name() vals = self.parent.get_attrib_list('count_func') for val in vals: parts = string.split(val, ':') @@ -1193,7 +1277,7 @@ class obj_argument: return 'string_map_multi_byref_const' return 'string_map_multi_byref' - return 'invalid'; + return 'invalid' def get_retval_type(self): """ Returns the retval type as defined in translator.README.txt. """ @@ -1226,7 +1310,7 @@ class obj_argument: else: return 'refptr_diff' - return 'invalid'; + return 'invalid' def get_retval_default(self, for_capi): """ Returns the default return value based on the retval type. """ @@ -1239,7 +1323,7 @@ class obj_argument: return '1' if retval == 'false': return '0' - return retval; + return retval # next look at the retval type value. type = self.get_retval_type() @@ -1678,7 +1762,7 @@ class obj_analysis: result += resdict['value'] if self.has_name(): - result += ' '+self.get_name(); + result += ' '+self.get_name() return {'format' : format, 'value' : result} @@ -1690,13 +1774,14 @@ if __name__ == "__main__": # verify that the correct number of command-line arguments are provided if len(sys.argv) != 2: - sys.stderr.write('Usage: '+sys.argv[0]+' ') + sys.stderr.write('Usage: '+sys.argv[0]+' ') sys.exit() pp = pprint.PrettyPrinter(indent=4) # create the header object - header = obj_header(sys.argv[1]) + header = obj_header() + header.add_directory(sys.argv[1]) # output the type mapping types = {} diff --git a/tools/distrib/cefclient.gyp b/tools/distrib/cefclient.gyp index 769cf9614..af4db28ce 100644 --- a/tools/distrib/cefclient.gyp +++ b/tools/distrib/cefclient.gyp @@ -14,7 +14,7 @@ }, 'includes': [ # Bring in the source file lists for cefclient. - 'cef_paths.gypi', + 'cef_paths2.gypi', ], 'targets': [ { @@ -34,6 +34,7 @@ ], 'sources': [ '<@(includes_common)', + '<@(includes_wrapper)', '<@(cefclient_sources_common)', ], 'mac_bundle_resources': [ @@ -133,6 +134,8 @@ ], 'sources': [ '<@(includes_common)', + '<@(includes_capi)', + '<@(includes_wrapper)', '<@(libcef_dll_wrapper_sources_common)', ], 'xcode_settings': { diff --git a/tools/make_capi_header.py b/tools/make_capi_header.py index 746e60791..2de81666e 100644 --- a/tools/make_capi_header.py +++ b/tools/make_capi_header.py @@ -37,7 +37,7 @@ def make_capi_member_funcs(funcs, defined_names, translate_map, indent): first = False return result -def make_capi_header(header): +def make_capi_header(header, filename): # structure names that have already been defined defined_names = header.get_defined_structs() @@ -82,64 +82,29 @@ def make_capi_header(header): // more information. // -#ifndef _CEF_CAPI_H -#define _CEF_CAPI_H +#ifndef $GUARD$ +#define $GUARD$ #ifdef __cplusplus extern "C" { #endif -#include "internal/cef_export.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_types.h" +#include "cef_base_capi.h" """ - # add the copyright year - result = result.replace('$YEAR$', get_year()) - # output global functions - result += make_capi_global_funcs(header.get_funcs(), defined_names, - translate_map, '') - - # before classes string - result += \ -""" -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)) - -""" + funcs = header.get_funcs(filename) + if len(funcs) > 0: + result += make_capi_global_funcs(funcs, defined_names, translate_map, '') # output classes - classes = header.get_classes() + classes = header.get_classes(filename) for cls in classes: # virtual functions are inside the structure classname = cls.get_capi_name() result += '\n'+format_comment(cls.get_comment(), '', translate_map); result += 'typedef struct _'+classname+ \ - '\n{\n // Base structure.\n cef_base_t base;\n' + '\n{\n ///\n // Base structure.\n ///\n cef_base_t base;\n' funcs = cls.get_virtual_funcs() result += make_capi_member_funcs(funcs, defined_names, translate_map, ' ') @@ -160,23 +125,31 @@ typedef struct _cef_base_t } #endif -#endif // _CEF_CAPI_H +#endif // $GUARD$ """ + # add the copyright year + result = result.replace('$YEAR$', get_year()) + # add the guard string + guard = '_'+string.upper(filename.replace('.', '_capi_')) + result = result.replace('$GUARD$', guard) + return result -def write_capi_header(header, file, backup): - if path_exists(file): - oldcontents = read_file(file) +def write_capi_header(header, filepath, backup): + capi_path = get_capi_file_name(filepath) + if path_exists(capi_path): + oldcontents = read_file(capi_path) else: oldcontents = '' - - newcontents = make_capi_header(header) + + filename = os.path.split(filepath)[1] + newcontents = make_capi_header(header, filename) if newcontents != oldcontents: if backup and oldcontents != '': - backup_file(file) - write_file(file, newcontents) + backup_file(capi_path) + write_file(capi_path, newcontents) return True return False @@ -192,7 +165,9 @@ if __name__ == "__main__": sys.exit() # create the header object - header = obj_header(sys.argv[1]) + header = obj_header() + header.add_file(sys.argv[1]) # dump the result to stdout - sys.stdout.write(make_capi_header(header)) + filename = os.path.split(sys.argv[1])[1] + sys.stdout.write(make_capi_header(header, filename)) diff --git a/tools/make_cppdocs.bat b/tools/make_cppdocs.bat index 531cea8bf..f18e3b090 100644 --- a/tools/make_cppdocs.bat +++ b/tools/make_cppdocs.bat @@ -12,7 +12,7 @@ set CPPDOC_REV="%1" if not exist %CPPDOC_EXE% ( echo ERROR: Please install CppDoc from http://www.cppdoc.com/ ) else ( -%CPPDOC_EXE% -overwrite -title="CEF C++ API Docs - Revision %CPPDOC_REV%" -footer="

Chromium Embedded Framework (CEF) Copyright © 2011 Marshall A. Greenblatt
" -namespace-as-project -comment-format="///;//;///" -classdir=projects -module="cppdoc-standard" -extensions=h -languages="c=cpp,cc=cpp,cpp=cpp,cs=csharp,cxx=cpp,h=cpp,hpp=cpp,hxx=cpp,java=java" -D"OS_WIN" -D"USING_CEF_SHARED" -D"__cplusplus" -D"CEF_STRING_TYPE_UTF16" -enable-author=false -enable-deprecations=true -enable-since=true -enable-version=false -file-links-for-globals=false -generate-deprecations-list=false -generate-hierarchy=true -header-background-dark="#ccccff" -header-background-light="#eeeeff" -include-private=false -include-protected=true -index-file-base=index -overview-html=overview.html -reduce-summary-font=true -selected-text-background=navy -selected-text-foreground=white -separate-index-pages=false -show-cppdoc-version=false -show-timestamp=false -summary-html=project.html -suppress-details=false -suppress-frames-links=false -table-background=white -wrap-long-lines=false ..\include #cef_capi.h #cef_nplugin_capi.h #cef_runnable.h #cef_tuple.h "..\docs\index.html" +%CPPDOC_EXE% -overwrite -title="CEF C++ API Docs - Revision %CPPDOC_REV%" -footer="
Chromium Embedded Framework (CEF) Copyright © 2011 Marshall A. Greenblatt
" -namespace-as-project -comment-format="///;//;///" -classdir=projects -module="cppdoc-standard" -extensions=h -languages="c=cpp,cc=cpp,cpp=cpp,cs=csharp,cxx=cpp,h=cpp,hpp=cpp,hxx=cpp,java=java" -D"OS_WIN" -D"USING_CEF_SHARED" -D"__cplusplus" -D"CEF_STRING_TYPE_UTF16" -enable-author=false -enable-deprecations=true -enable-since=true -enable-version=false -file-links-for-globals=false -generate-deprecations-list=false -generate-hierarchy=true -header-background-dark="#ccccff" -header-background-light="#eeeeff" -include-private=false -include-protected=true -index-file-base=index -overview-html=overview.html -reduce-summary-font=true -selected-text-background=navy -selected-text-foreground=white -separate-index-pages=false -show-cppdoc-version=false -show-timestamp=false -summary-html=project.html -suppress-details=false -suppress-frames-links=false -table-background=white -wrap-long-lines=false ..\include #cef_runnable.h #cef_tuple.h #capi "..\docs\index.html" ) endlocal \ No newline at end of file diff --git a/tools/make_cpptoc_header.py b/tools/make_cpptoc_header.py index 0fc9bba26..99476c404 100644 --- a/tools/make_cpptoc_header.py +++ b/tools/make_cpptoc_header.py @@ -31,10 +31,19 @@ def make_cpptoc_header(header, clsname): #else // USING_CEF_SHARED """ - result += """ -#include "include/cef.h" -#include "include/cef_capi.h" -#include "libcef_dll/cpptoc/cpptoc.h" + # include the headers for this class + result += '\n#include "include/'+cls.get_file_name()+'"\n' \ + '#include "include/capi/'+cls.get_capi_file_name()+'"\n' + + # include headers for any forward declared classes that are not in the same file + declares = cls.get_forward_declares() + for declare in declares: + dcls = header.get_class(declare) + if dcls.get_file_name() != cls.get_file_name(): + result += '#include "include/'+dcls.get_file_name()+'"\n' \ + '#include "include/capi/'+dcls.get_capi_file_name()+'"\n' + + result += """#include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. """ @@ -90,7 +99,8 @@ if __name__ == "__main__": sys.exit() # create the header object - header = obj_header(sys.argv[1]) + header = obj_header() + header.add_file(sys.argv[1]) # dump the result to stdout sys.stdout.write(make_cpptoc_header(header, sys.argv[2])) diff --git a/tools/make_cpptoc_impl.py b/tools/make_cpptoc_impl.py index e1c8293ca..a122a6223 100644 --- a/tools/make_cpptoc_impl.py +++ b/tools/make_cpptoc_impl.py @@ -24,7 +24,7 @@ def make_cpptoc_function_impl_existing(name, func, impl, defined_names): notify(name+' prototype changed') return wrap_code(make_cpptoc_impl_proto(name, func, parts))+'{'+ \ - changes+impl['body']+'\n}\n\n' + changes+impl['body']+'\n}\n' return result def make_cpptoc_function_impl_new(name, func, defined_names): @@ -396,7 +396,7 @@ def make_cpptoc_function_impl_new(name, func, defined_names): if len(result) != result_len: result += '\n' - result += '}\n\n' + result += '}\n' return wrap_code(result) def make_cpptoc_function_impl(funcs, existing, prefixname, defined_names): @@ -489,10 +489,21 @@ def make_cpptoc_global_impl(header, impl): if len(impl) > 0: impl = '\n// GLOBAL FUNCTIONS - Body may be edited by hand.\n\n'+impl + includes = '' + + # include required headers for global functions + filenames = [] + for func in header.get_funcs(): + filename = func.get_file_name() + if not filename in filenames: + includes += '#include "include/'+func.get_file_name()+'"\n' \ + '#include "include/capi/'+func.get_capi_file_name()+'"\n' + filenames.append(filename) + # determine what includes are required by identifying what translation # classes are being used - includes = format_translation_includes(impl) - + includes += format_translation_includes(impl) + # build the final output result = get_copyright() @@ -536,7 +547,8 @@ if __name__ == "__main__": sys.exit() # create the header object - header = obj_header(sys.argv[1]) + header = obj_header() + header.add_file(sys.argv[1]) # read the existing implementation file into memory try: @@ -548,4 +560,4 @@ if __name__ == "__main__": f.close() # dump the result to stdout - sys.stdout.write(make_cpptoc_impl(header, sys.argv[2], data)) + sys.stdout.write(make_cpptoc_class_impl(header, sys.argv[2], data)) diff --git a/tools/make_ctocpp_header.py b/tools/make_ctocpp_header.py index 1b08cf7cc..3121986a9 100644 --- a/tools/make_ctocpp_header.py +++ b/tools/make_ctocpp_header.py @@ -31,10 +31,19 @@ def make_ctocpp_header(header, clsname): #else // USING_CEF_SHARED """ - result += """ -#include "include/cef.h" -#include "include/cef_capi.h" -#include "libcef_dll/ctocpp/ctocpp.h" + # include the headers for this class + result += '\n#include "include/'+cls.get_file_name()+'"\n' \ + '#include "include/capi/'+cls.get_capi_file_name()+'"\n' + + # include headers for any forward declared classes that are not in the same file + declares = cls.get_forward_declares() + for declare in declares: + dcls = header.get_class(declare) + if dcls.get_file_name() != cls.get_file_name(): + result += '#include "include/'+dcls.get_file_name()+'"\n' \ + '#include "include/capi/'+dcls.get_capi_file_name()+'"\n' + + result += """#include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. """ @@ -97,7 +106,8 @@ if __name__ == "__main__": sys.exit() # create the header object - header = obj_header(sys.argv[1]) + header = obj_header() + header.add_file(sys.argv[1]) # dump the result to stdout sys.stdout.write(make_ctocpp_header(header, sys.argv[2])) diff --git a/tools/make_ctocpp_impl.py b/tools/make_ctocpp_impl.py index dd8a7496c..58cbce807 100644 --- a/tools/make_ctocpp_impl.py +++ b/tools/make_ctocpp_impl.py @@ -32,7 +32,7 @@ def make_ctocpp_function_impl_existing(clsname, name, func, impl): notify(name+' prototype changed') return wrap_code(make_ctocpp_impl_proto(clsname, name, func, parts))+'{'+ \ - changes+impl['body']+'\n}\n\n' + changes+impl['body']+'\n}\n' def make_ctocpp_function_impl_new(clsname, name, func): # build the C++ prototype @@ -430,7 +430,7 @@ def make_ctocpp_function_impl_new(clsname, name, func): if len(result) != result_len: result += '\n' - result += '}\n\n' + result += '}\n' return wrap_code(result) def make_ctocpp_function_impl(clsname, funcs, existing): @@ -496,11 +496,22 @@ def make_ctocpp_global_impl(header, impl): impl = make_ctocpp_function_impl(None, header.get_funcs(), existing) if len(impl) > 0: impl = '\n// GLOBAL METHODS - Body may be edited by hand.\n\n'+impl - + + includes = '' + + # include required headers for global functions + filenames = [] + for func in header.get_funcs(): + filename = func.get_file_name() + if not filename in filenames: + includes += '#include "include/'+func.get_file_name()+'"\n' \ + '#include "include/capi/'+func.get_capi_file_name()+'"\n' + filenames.append(filename) + # determine what includes are required by identifying what translation # classes are being used - includes = format_translation_includes(impl) - + includes += format_translation_includes(impl) + # build the final output result = get_copyright() @@ -544,7 +555,8 @@ if __name__ == "__main__": sys.exit() # create the header object - header = obj_header(sys.argv[1]) + header = obj_header() + header.add_file(sys.argv[1]) # read the existing implementation file into memory try: @@ -556,4 +568,4 @@ if __name__ == "__main__": f.close() # dump the result to stdout - sys.stdout.write(make_ctocpp_impl(header, sys.argv[2], data)) + sys.stdout.write(make_ctocpp_class_impl(header, sys.argv[2], data)) diff --git a/tools/make_distrib.py b/tools/make_distrib.py index af74fb186..233177e75 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -50,6 +50,9 @@ def eval_file(src): def transfer_gypi_files(src_dir, gypi_paths, gypi_path_prefix, dst_dir, quiet): """ Transfer files from one location to another. """ for path in gypi_paths: + # skip gyp includes + if path[:2] == '<@': + continue src = os.path.join(src_dir, path) dst = os.path.join(dst_dir, path.replace(gypi_path_prefix, '')) dst_path = os.path.dirname(dst) @@ -200,10 +203,14 @@ make_dir(symbol_dir, options.quiet) # transfer the LICENSE.txt file copy_file(os.path.join(cef_dir, 'LICENSE.txt'), output_dir, options.quiet) -# read the variables list from cef_paths.gypi +# read the variables list from the autogenerated cef_paths.gypi file cef_paths = eval_file(os.path.join(cef_dir, 'cef_paths.gypi')) cef_paths = cef_paths['variables'] +# read the variables list from the manually edited cef_paths2.gypi file +cef_paths2 = eval_file(os.path.join(cef_dir, 'cef_paths2.gypi')) +cef_paths2 = cef_paths2['variables'] + # create the include directory include_dir = os.path.join(output_dir, 'include') make_dir(include_dir, options.quiet) @@ -217,23 +224,35 @@ wrapper_dir = os.path.join(output_dir, 'libcef_dll') make_dir(wrapper_dir, options.quiet) # transfer common include files -transfer_gypi_files(cef_dir, cef_paths['includes_common'], \ +transfer_gypi_files(cef_dir, cef_paths2['includes_common'], \ + 'include/', include_dir, options.quiet) +transfer_gypi_files(cef_dir, cef_paths2['includes_capi'], \ + 'include/', include_dir, options.quiet) +transfer_gypi_files(cef_dir, cef_paths2['includes_wrapper'], \ + 'include/', include_dir, options.quiet) +transfer_gypi_files(cef_dir, cef_paths['autogen_cpp_includes'], \ + 'include/', include_dir, options.quiet) +transfer_gypi_files(cef_dir, cef_paths['autogen_capi_includes'], \ 'include/', include_dir, options.quiet) # transfer common cefclient files -transfer_gypi_files(cef_dir, cef_paths['cefclient_sources_common'], \ +transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_common'], \ 'tests/cefclient/', cefclient_dir, options.quiet) # transfer common libcef_dll_wrapper files -transfer_gypi_files(cef_dir, cef_paths['libcef_dll_wrapper_sources_common'], \ +transfer_gypi_files(cef_dir, cef_paths2['libcef_dll_wrapper_sources_common'], \ + 'libcef_dll/', wrapper_dir, options.quiet) +transfer_gypi_files(cef_dir, cef_paths['autogen_client_side'], \ 'libcef_dll/', wrapper_dir, options.quiet) # transfer gyp files copy_file(os.path.join(script_dir, 'distrib/cefclient.gyp'), output_dir, options.quiet) -paths_gypi = os.path.join(cef_dir, 'cef_paths.gypi') +paths_gypi = os.path.join(cef_dir, 'cef_paths2.gypi') data = read_file(paths_gypi) data = data.replace('tests/cefclient/', 'cefclient/') -write_file(os.path.join(output_dir, 'cef_paths.gypi'), data) +write_file(os.path.join(output_dir, 'cef_paths2.gypi'), data) +copy_file(os.path.join(cef_dir, 'cef_paths.gypi'), \ + os.path.join(output_dir, 'cef_paths.gypi'), options.quiet) # transfer additional files transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/transfer.cfg'), \ @@ -245,11 +264,11 @@ if platform == 'windows': cef_rev, cef_ver, chromium_url, chromium_rev, chromium_ver, date) # transfer include files - transfer_gypi_files(cef_dir, cef_paths['includes_win'], \ + transfer_gypi_files(cef_dir, cef_paths2['includes_win'], \ 'include/', include_dir, options.quiet) # transfer cefclient files - transfer_gypi_files(cef_dir, cef_paths['cefclient_sources_win'], \ + transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_win'], \ 'tests/cefclient/', cefclient_dir, options.quiet) # transfer build/Debug files @@ -316,11 +335,11 @@ elif platform == 'macosx': cef_rev, cef_ver, chromium_url, chromium_rev, chromium_ver, date) # transfer include files - transfer_gypi_files(cef_dir, cef_paths['includes_mac'], \ + transfer_gypi_files(cef_dir, cef_paths2['includes_mac'], \ 'include/', include_dir, options.quiet) # transfer cefclient files - transfer_gypi_files(cef_dir, cef_paths['cefclient_sources_mac'], \ + transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_mac'], \ 'tests/cefclient/', cefclient_dir, options.quiet) # transfer cefclient/mac files @@ -403,11 +422,11 @@ elif platform == 'linux': sys.stderr.write("No Release build files.\n") # transfer include files - transfer_gypi_files(cef_dir, cef_paths['includes_linux'], \ + transfer_gypi_files(cef_dir, cef_paths2['includes_linux'], \ 'include/', include_dir, options.quiet) # transfer cefclient files - transfer_gypi_files(cef_dir, cef_paths['cefclient_sources_linux'], \ + transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_linux'], \ 'tests/cefclient/', cefclient_dir, options.quiet) # transfer additional files, if any diff --git a/tools/make_gypi_file.py b/tools/make_gypi_file.py new file mode 100644 index 000000000..e5cefd7a9 --- /dev/null +++ b/tools/make_gypi_file.py @@ -0,0 +1,108 @@ +# 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. + +from cef_parser import * + +def make_gypi_file(header): + # header string + result = \ +"""# Copyright (c) $YEAR$ 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': { +""" + + filenames = sorted(header.get_file_names()) + + # cpp includes + result += " 'autogen_cpp_includes': [\n" + for filename in filenames: + result += " 'include/"+filename+"',\n" + result += " ],\n" + + # capi includes + result += " 'autogen_capi_includes': [\n" + for filename in filenames: + result += " 'include/capi/"+get_capi_file_name(filename)+"',\n" + result += " ],\n" + + classes = sorted(header.get_class_names()) + + # library side includes + result += " 'autogen_library_side': [\n" + for clsname in classes: + cls = header.get_class(clsname) + filename = get_capi_name(clsname[3:], False) + if cls.is_library_side(): + result += " 'libcef_dll/cpptoc/"+filename+"_cpptoc.cc',\n" \ + " 'libcef_dll/cpptoc/"+filename+"_cpptoc.h',\n" + else: + result += " 'libcef_dll/ctocpp/"+filename+"_ctocpp.cc',\n" \ + " 'libcef_dll/ctocpp/"+filename+"_ctocpp.h',\n" + result += " ],\n" + + # client side includes + result += " 'autogen_client_side': [\n" + for clsname in classes: + cls = header.get_class(clsname) + filename = get_capi_name(clsname[3:], False) + if cls.is_library_side(): + result += " 'libcef_dll/ctocpp/"+filename+"_ctocpp.cc',\n" \ + " 'libcef_dll/ctocpp/"+filename+"_ctocpp.h',\n" + else: + result += " 'libcef_dll/cpptoc/"+filename+"_cpptoc.cc',\n" \ + " 'libcef_dll/cpptoc/"+filename+"_cpptoc.h',\n" + result += " ],\n" + + # footer string + result += \ +""" }, +} +""" + + # add the copyright year + result = result.replace('$YEAR$', get_year()) + + return result + +def write_gypi_file(header, file, backup): + if path_exists(file): + oldcontents = read_file(file) + else: + oldcontents = '' + + newcontents = make_gypi_file(header) + if newcontents != oldcontents: + if backup and oldcontents != '': + backup_file(file) + write_file(file, newcontents) + return True + + return False + + +# test the module +if __name__ == "__main__": + import sys + + # verify that the correct number of command-line arguments are provided + if len(sys.argv) < 2: + sys.stderr.write('Usage: '+sys.argv[0]+' ') + sys.exit() + + # create the header object + header = obj_header() + header.add_file(sys.argv[1]) + + # dump the result to stdout + sys.stdout.write(make_gypi_file(header)) diff --git a/tools/translator.bat b/tools/translator.bat index 4c80f49a1..44b80f385 100644 --- a/tools/translator.bat +++ b/tools/translator.bat @@ -1,3 +1,3 @@ @echo off -..\..\third_party\python_26\python.exe translator.py --cpp-header ..\include\cef.h --capi-header ..\include\cef_capi.h --cpptoc-global-impl ..\libcef_dll\libcef_dll.cc --ctocpp-global-impl ..\libcef_dll\wrapper\libcef_dll_wrapper.cc --cpptoc-dir ..\libcef_dll\cpptoc --ctocpp-dir ..\libcef_dll\ctocpp +..\..\third_party\python_26\python.exe translator.py --cpp-header-dir ..\include --capi-header-dir ..\include\capi --cpptoc-global-impl ..\libcef_dll\libcef_dll.cc --ctocpp-global-impl ..\libcef_dll\wrapper\libcef_dll_wrapper.cc --cpptoc-dir ..\libcef_dll\cpptoc --ctocpp-dir ..\libcef_dll\ctocpp --gypi-file ..\cef_paths.gypi pause \ No newline at end of file diff --git a/tools/translator.py b/tools/translator.py index 22b61fc8d..ab8b584c3 100644 --- a/tools/translator.py +++ b/tools/translator.py @@ -9,6 +9,7 @@ from make_cpptoc_header import * from make_cpptoc_impl import * from make_ctocpp_header import * from make_ctocpp_impl import * +from make_gypi_file import * from optparse import OptionParser @@ -24,10 +25,10 @@ This utility generates files for the CEF C++ to C API translation layer. """ parser = OptionParser(description=disc) -parser.add_option('--cpp-header', dest='cppheader', metavar='FILE', - help='source CEF C++ header file [required]') -parser.add_option('--capi-header', dest='capiheader', metavar='FILE', - help='output CEF C API header file') +parser.add_option('--cpp-header-dir', dest='cppheaderdir', metavar='DIR', + help='input directory for C++ header files [required]') +parser.add_option('--capi-header-dir', dest='capiheaderdir', metavar='DIR', + help='output directory for C API header files') parser.add_option('--cpptoc-global-impl', dest='cpptocglobalimpl', metavar='FILE', help='input/output file for CppToC global translations') parser.add_option('--ctocpp-global-impl', dest='ctocppglobalimpl', metavar='FILE', @@ -36,6 +37,8 @@ parser.add_option('--cpptoc-dir', dest='cpptocdir', metavar='DIR', help='input/output directory for CppToC class translations') parser.add_option('--ctocpp-dir', dest='ctocppdir', metavar='DIR', help='input/output directory for CppToC class translations') +parser.add_option('--gypi-file', dest='gypifile', metavar='FILE', + help='output file for path information') parser.add_option('--no-cpptoc-header', action='store_true', dest='nocpptocheader', default=False, help='do not output the CppToC headers') @@ -59,28 +62,34 @@ parser.add_option('-q', '--quiet', (options, args) = parser.parse_args() # the cppheader option is required -if options.cppheader is None: +if options.cppheaderdir is None: parser.print_help(sys.stdout) sys.exit() # make sure the header exists -if not path_exists(options.cppheader): - sys.stderr.write('File '+options.cppheader+' does not exist.') +if not path_exists(options.cppheaderdir): + sys.stderr.write('File '+options.cppheaderdir+' does not exist.') sys.exit() # create the header object if not options.quiet: - sys.stdout.write('Parsing '+options.cppheader+'...\n') -header = obj_header(options.cppheader) + sys.stdout.write('Parsing C++ headers from '+options.cppheaderdir+'...\n') +header = obj_header() +header.add_directory(options.cppheaderdir) writect = 0 -if not options.capiheader is None: +if not options.capiheaderdir is None: #output the C API header if not options.quiet: - sys.stdout.write('Generating C API header...\n') - writect += write_capi_header(header, options.capiheader, - not options.nobackup) + sys.stdout.write('In C API header directory '+options.capiheaderdir+'...\n') + filenames = sorted(header.get_file_names()) + for filename in filenames: + if not options.quiet: + sys.stdout.write('Generating '+filename+' C API header...\n') + writect += write_capi_header(header, + os.path.join(options.capiheaderdir, filename), + not options.nobackup) # build the list of classes to parse allclasses = header.get_class_names() @@ -110,7 +119,7 @@ if not options.ctocppglobalimpl is None: not options.nobackup) if not options.cpptocdir is None: - #output CppToC class files + # output CppToC class files if not options.quiet: sys.stdout.write('In CppToC directory '+options.cpptocdir+'...\n') @@ -127,7 +136,7 @@ if not options.cpptocdir is None: not options.nobackup) if not options.ctocppdir is None: - #output CppToC class files + # output CppToC class files if not options.quiet: sys.stdout.write('In CToCpp directory '+options.ctocppdir+'...\n') for cls in classes: @@ -142,6 +151,12 @@ if not options.ctocppdir is None: writect += write_ctocpp_impl(header, cls, options.ctocppdir, not options.nobackup) +if not options.gypifile is None: + # output the gypi file + if not options.quiet: + sys.stdout.write('Generating '+options.gypifile+' file...\n') + writect += write_gypi_file(header, options.gypifile, not options.nobackup) + if not options.quiet: sys.stdout.write('Done - Wrote '+str(writect)+' files.\n') diff --git a/tools/translator.sh b/tools/translator.sh index f91737e00..abd1c6e91 100755 --- a/tools/translator.sh +++ b/tools/translator.sh @@ -1,2 +1,2 @@ #!/bin/sh -python translator.py --cpp-header ../include/cef.h --capi-header ../include/cef_capi.h --cpptoc-global-impl ../libcef_dll/libcef_dll.cc --ctocpp-global-impl ../libcef_dll/wrapper/libcef_dll_wrapper.cc --cpptoc-dir ../libcef_dll/cpptoc --ctocpp-dir ../libcef_dll/ctocpp +python translator.py --cpp-header-dir ../include --capi-header-dir ../include/capi --cpptoc-global-impl ../libcef_dll/libcef_dll.cc --ctocpp-global-impl ../libcef_dll/wrapper/libcef_dll_wrapper.cc --cpptoc-dir ../libcef_dll/cpptoc --ctocpp-dir ../libcef_dll/ctocpp --gypi-file ../cef_paths.gypi