Fix C compiler errors when using the C API (issue #1165).

- Replace 'bool' with 'int' in cef_types[_*].h.
- Typedef enums in cef_types.h
- Add includes and struct forward declarations in C API header files.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1558 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2014-01-06 19:59:48 +00:00
parent 7074154725
commit 72660c6fed
72 changed files with 612 additions and 477 deletions

View File

@ -43,72 +43,13 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_process_handler_capi.h"
#include "include/capi/cef_command_line_capi.h"
#include "include/capi/cef_render_process_handler_capi.h"
#include "include/capi/cef_resource_bundle_handler_capi.h"
#include "include/capi/cef_scheme_capi.h"
///
// This function should be called from the application entry point function to
// execute a secondary process. It can be used to run secondary processes from
// the browser client executable (default behavior) or from a separate
// executable specified by the CefSettings.browser_subprocess_path value. If
// called for the browser process (identified by no "type" command-line value)
// it will return immediately with a value of -1. If called for a recognized
// secondary process it will block until the process should exit and then return
// the process exit code. The |application| parameter may be NULL. The
// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see
// cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
struct _cef_app_t* application, void* windows_sandbox_info);
///
// This function should be called on the main application thread to initialize
// the CEF browser process. The |application| parameter may be NULL. A return
// value of true (1) indicates that it succeeded and false (0) indicates that it
// failed. The |windows_sandbox_info| parameter is only used on Windows and may
// be NULL (see cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
const struct _cef_settings_t* settings, struct _cef_app_t* application,
void* windows_sandbox_info);
///
// This function should be called on the main application thread to shut down
// the CEF browser process before the application exits.
///
CEF_EXPORT void cef_shutdown();
///
// Perform a single iteration of CEF message loop processing. This function is
// used to integrate the CEF message loop into an existing application message
// loop. Care must be taken to balance performance against excessive CPU usage.
// This function should only be called on the main application thread and only
// if cef_initialize() is called with a CefSettings.multi_threaded_message_loop
// value of false (0). This function will not block.
///
CEF_EXPORT void cef_do_message_loop_work();
///
// Run the CEF message loop. Use this function instead of an application-
// provided message loop to get the best balance between performance and CPU
// usage. This function should only be called on the main application thread and
// only if cef_initialize() is called with a
// CefSettings.multi_threaded_message_loop value of false (0). This function
// will block until a quit message is received by the system.
///
CEF_EXPORT void cef_run_message_loop();
///
// Quit the CEF message loop that was started by calling cef_run_message_loop().
// This function should only be called on the main application thread and only
// if cef_run_message_loop() was used.
///
CEF_EXPORT void cef_quit_message_loop();
///
// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
// modal message loop. Set to false (0) after exiting the modal message loop.
///
CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop);
struct _cef_app_t;
///
// Implement this structure to provide handler implementations. Methods will be
@ -169,6 +110,71 @@ typedef struct _cef_app_t {
} cef_app_t;
///
// This function should be called from the application entry point function to
// execute a secondary process. It can be used to run secondary processes from
// the browser client executable (default behavior) or from a separate
// executable specified by the CefSettings.browser_subprocess_path value. If
// called for the browser process (identified by no "type" command-line value)
// it will return immediately with a value of -1. If called for a recognized
// secondary process it will block until the process should exit and then return
// the process exit code. The |application| parameter may be NULL. The
// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see
// cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
cef_app_t* application, void* windows_sandbox_info);
///
// This function should be called on the main application thread to initialize
// the CEF browser process. The |application| parameter may be NULL. A return
// value of true (1) indicates that it succeeded and false (0) indicates that it
// failed. The |windows_sandbox_info| parameter is only used on Windows and may
// be NULL (see cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
const struct _cef_settings_t* settings, cef_app_t* application,
void* windows_sandbox_info);
///
// This function should be called on the main application thread to shut down
// the CEF browser process before the application exits.
///
CEF_EXPORT void cef_shutdown();
///
// Perform a single iteration of CEF message loop processing. This function is
// used to integrate the CEF message loop into an existing application message
// loop. Care must be taken to balance performance against excessive CPU usage.
// This function should only be called on the main application thread and only
// if cef_initialize() is called with a CefSettings.multi_threaded_message_loop
// value of false (0). This function will not block.
///
CEF_EXPORT void cef_do_message_loop_work();
///
// Run the CEF message loop. Use this function instead of an application-
// provided message loop to get the best balance between performance and CPU
// usage. This function should only be called on the main application thread and
// only if cef_initialize() is called with a
// CefSettings.multi_threaded_message_loop value of false (0). This function
// will block until a quit message is received by the system.
///
CEF_EXPORT void cef_run_message_loop();
///
// Quit the CEF message loop that was started by calling cef_run_message_loop().
// This function should only be called on the main application thread and only
// if cef_run_message_loop() was used.
///
CEF_EXPORT void cef_quit_message_loop();
///
// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
// modal message loop. Set to false (0) after exiting the modal message loop.
///
CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop);
#ifdef __cplusplus
}
#endif

View File

@ -43,7 +43,12 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_request_context_capi.h"
struct _cef_browser_host_t;
struct _cef_client_t;
///
// Structure used to represent a browser window. When used in the browser
@ -172,7 +177,7 @@ typedef struct _cef_browser_t {
// message was sent successfully.
///
int (CEF_CALLBACK *send_process_message)(struct _cef_browser_t* self,
enum cef_process_id_t target_process,
cef_process_id_t target_process,
struct _cef_process_message_t* message);
} cef_browser_t;
@ -297,7 +302,7 @@ typedef struct _cef_browser_host_t {
// the UI thread.
///
void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self,
enum cef_file_dialog_mode_t mode, const cef_string_t* title,
cef_file_dialog_mode_t mode, const cef_string_t* title,
const cef_string_t* default_file_name, cef_string_list_t accept_types,
struct _cef_run_file_dialog_callback_t* callback);
@ -393,7 +398,7 @@ typedef struct _cef_browser_host_t {
// function is only used when window rendering is disabled.
///
void (CEF_CALLBACK *invalidate)(struct _cef_browser_host_t* self,
const cef_rect_t* dirtyRect, enum cef_paint_element_type_t type);
const cef_rect_t* dirtyRect, cef_paint_element_type_t type);
///
// Send a key event to the browser.
@ -406,8 +411,8 @@ typedef struct _cef_browser_host_t {
// relative to the upper-left corner of the view.
///
void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event,
enum cef_mouse_button_type_t type, int mouseUp, int clickCount);
const struct _cef_mouse_event_t* event, cef_mouse_button_type_t type,
int mouseUp, int clickCount);
///
// Send a mouse move event to the browser. The |x| and |y| coordinates are

View File

@ -43,6 +43,8 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_command_line_capi.h"
#include "include/capi/cef_values_capi.h"
///

View File

@ -43,6 +43,20 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_context_menu_handler_capi.h"
#include "include/capi/cef_dialog_handler_capi.h"
#include "include/capi/cef_display_handler_capi.h"
#include "include/capi/cef_download_handler_capi.h"
#include "include/capi/cef_drag_handler_capi.h"
#include "include/capi/cef_focus_handler_capi.h"
#include "include/capi/cef_geolocation_handler_capi.h"
#include "include/capi/cef_jsdialog_handler_capi.h"
#include "include/capi/cef_keyboard_handler_capi.h"
#include "include/capi/cef_life_span_handler_capi.h"
#include "include/capi/cef_load_handler_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_render_handler_capi.h"
#include "include/capi/cef_request_handler_capi.h"
///
@ -143,7 +157,7 @@ typedef struct _cef_client_t {
// reference to or attempt to access the message outside of this callback.
///
int (CEF_CALLBACK *on_process_message_received)(struct _cef_client_t* self,
struct _cef_browser_t* browser, enum cef_process_id_t source_process,
struct _cef_browser_t* browser, cef_process_id_t source_process,
struct _cef_process_message_t* message);
} cef_client_t;

View File

@ -43,7 +43,11 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_menu_model_capi.h"
struct _cef_context_menu_params_t;
///
// Implement this structure to handle context menu events. The functions of this
@ -79,7 +83,7 @@ typedef struct _cef_context_menu_handler_t {
int (CEF_CALLBACK *on_context_menu_command)(
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
int command_id, enum cef_event_flags_t event_flags);
int command_id, cef_event_flags_t event_flags);
///
// Called when the context menu is dismissed irregardless of whether the menu
@ -117,7 +121,7 @@ typedef struct _cef_context_menu_params_t {
// Returns flags representing the type of node that the context menu was
// invoked on.
///
enum cef_context_menu_type_flags_t (CEF_CALLBACK *get_type_flags)(
cef_context_menu_type_flags_t (CEF_CALLBACK *get_type_flags)(
struct _cef_context_menu_params_t* self);
///
@ -176,15 +180,14 @@ typedef struct _cef_context_menu_params_t {
///
// Returns the type of context node that the context menu was invoked on.
///
enum cef_context_menu_media_type_t (CEF_CALLBACK *get_media_type)(
cef_context_menu_media_type_t (CEF_CALLBACK *get_media_type)(
struct _cef_context_menu_params_t* self);
///
// Returns flags representing the actions supported by the media element, if
// any, that the context menu was invoked on.
///
enum cef_context_menu_media_state_flags_t (
CEF_CALLBACK *get_media_state_flags)(
cef_context_menu_media_state_flags_t (CEF_CALLBACK *get_media_state_flags)(
struct _cef_context_menu_params_t* self);
///
@ -211,7 +214,7 @@ typedef struct _cef_context_menu_params_t {
// Returns flags representing the actions supported by the editable node, if
// any, that the context menu was invoked on.
///
enum cef_context_menu_edit_state_flags_t (CEF_CALLBACK *get_edit_state_flags)(
cef_context_menu_edit_state_flags_t (CEF_CALLBACK *get_edit_state_flags)(
struct _cef_context_menu_params_t* self);
} cef_context_menu_params_t;

View File

@ -43,7 +43,9 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_callback_capi.h"
struct _cef_cookie_visitor_t;
///
// Structure used for managing cookies. The functions of this structure may be

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
///
@ -91,7 +92,7 @@ typedef struct _cef_dialog_handler_t {
// return false (0).
///
int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self,
struct _cef_browser_t* browser, enum cef_file_dialog_mode_t mode,
struct _cef_browser_t* browser, cef_file_dialog_mode_t mode,
const cef_string_t* title, const cef_string_t* default_file_name,
cef_string_list_t accept_types,
struct _cef_file_dialog_callback_t* callback);

View File

@ -43,6 +43,8 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
///

View File

@ -44,6 +44,9 @@ extern "C" {
#include "include/capi/cef_base_capi.h"
struct _cef_domdocument_t;
struct _cef_domevent_listener_t;
struct _cef_domnode_t;
///
// Structure to implement for visiting the DOM. The functions of this structure
@ -80,7 +83,7 @@ typedef struct _cef_domdocument_t {
///
// Returns the document type.
///
enum cef_dom_document_type_t (CEF_CALLBACK *get_type)(
cef_dom_document_type_t (CEF_CALLBACK *get_type)(
struct _cef_domdocument_t* self);
///
@ -192,8 +195,7 @@ typedef struct _cef_domnode_t {
///
// Returns the type for this node.
///
enum cef_dom_node_type_t (CEF_CALLBACK *get_type)(
struct _cef_domnode_t* self);
cef_dom_node_type_t (CEF_CALLBACK *get_type)(struct _cef_domnode_t* self);
///
// Returns true (1) if this is a text node.
@ -378,14 +380,13 @@ typedef struct _cef_domevent_t {
///
// Returns the event category.
///
enum cef_dom_event_category_t (CEF_CALLBACK *get_category)(
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);
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.

View File

@ -43,6 +43,8 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_download_item_capi.h"
///

View File

@ -43,6 +43,8 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_drag_data_capi.h"
///
@ -63,7 +65,7 @@ typedef struct _cef_drag_handler_t {
///
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_operations_mask_t mask);
} cef_drag_handler_t;

View File

@ -43,6 +43,9 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_dom_capi.h"
#include "include/capi/cef_frame_capi.h"
///
@ -70,7 +73,7 @@ typedef struct _cef_focus_handler_t {
// 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_focus_source_t source);
struct _cef_browser_t* browser, cef_focus_source_t source);
///
// Called when the browser component has received focus.

View File

@ -43,7 +43,13 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_dom_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_stream_capi.h"
#include "include/capi/cef_string_visitor_capi.h"
struct _cef_browser_t;
struct _cef_v8context_t;
///
// Structure used to represent a frame in the browser window. When used in the

View File

@ -45,14 +45,6 @@ extern "C" {
#include "include/capi/cef_base_capi.h"
///
// Request a one-time geolocation update. This function bypasses any user
// permission checks so should only be used by code that is allowed to access
// location information.
///
CEF_EXPORT int cef_get_geolocation(
struct _cef_get_geolocation_callback_t* callback);
///
// Implement this structure to receive geolocation updates. The functions of
// this structure will be called on the browser process UI thread.
@ -73,6 +65,13 @@ typedef struct _cef_get_geolocation_callback_t {
} cef_get_geolocation_callback_t;
///
// Request a one-time geolocation update. This function bypasses any user
// permission checks so should only be used by code that is allowed to access
// location information.
///
CEF_EXPORT int cef_get_geolocation(cef_get_geolocation_callback_t* callback);
#ifdef __cplusplus
}
#endif

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
///

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
///
@ -91,7 +92,7 @@ typedef struct _cef_jsdialog_handler_t {
///
int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* origin_url,
const cef_string_t* accept_lang, enum cef_jsdialog_type_t dialog_type,
const cef_string_t* accept_lang, cef_jsdialog_type_t dialog_type,
const cef_string_t* message_text,
const cef_string_t* default_prompt_text,
struct _cef_jsdialog_callback_t* callback, int* suppress_message);

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
///

View File

@ -43,7 +43,9 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
struct _cef_client_t;
///
// Implement this structure to handle events related to browser life span. The

View File

@ -43,6 +43,8 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
///
@ -98,7 +100,7 @@ typedef struct _cef_load_handler_t {
///
void (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
enum cef_errorcode_t errorCode, const cef_string_t* errorText,
cef_errorcode_t errorCode, const cef_string_t* errorText,
const cef_string_t* failedUrl);
} cef_load_handler_t;

View File

@ -196,13 +196,13 @@ typedef struct _cef_menu_model_t {
///
// Returns the item type for the specified |command_id|.
///
enum cef_menu_item_type_t (CEF_CALLBACK *get_type)(
struct _cef_menu_model_t* self, int command_id);
cef_menu_item_type_t (CEF_CALLBACK *get_type)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns the item type at the specified |index|.
///
enum cef_menu_item_type_t (CEF_CALLBACK *get_type_at)(
cef_menu_item_type_t (CEF_CALLBACK *get_type_at)(
struct _cef_menu_model_t* self, int index);
///

View File

@ -49,7 +49,7 @@ extern "C" {
// Retrieve the path associated with the specified |key|. Returns true (1) on
// success. Can be called on any thread in the browser process.
///
CEF_EXPORT int cef_get_path(enum cef_path_key_t key, cef_string_t* path);
CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path);
#ifdef __cplusplus
}

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_values_capi.h"
///

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
///
@ -111,7 +112,7 @@ typedef struct _cef_render_handler_t {
// 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,
struct _cef_browser_t* browser, cef_paint_element_type_t type,
size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer,
int width, int height);

View File

@ -43,6 +43,13 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_dom_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_load_handler_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_v8_capi.h"
#include "include/capi/cef_values_capi.h"
///
@ -102,8 +109,8 @@ typedef struct _cef_render_process_handler_t {
int (CEF_CALLBACK *on_before_navigation)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_request_t* request,
enum cef_navigation_type_t navigation_type, int is_redirect);
struct _cef_request_t* request, cef_navigation_type_t navigation_type,
int is_redirect);
///
// Called immediately after the V8 context for a frame has been created. To
@ -158,7 +165,7 @@ typedef struct _cef_render_process_handler_t {
///
int (CEF_CALLBACK *on_process_message_received)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser, enum cef_process_id_t source_process,
struct _cef_browser_t* browser, cef_process_id_t source_process,
struct _cef_process_message_t* message);
} cef_render_process_handler_t;

View File

@ -44,6 +44,8 @@ extern "C" {
#include "include/capi/cef_base_capi.h"
struct _cef_post_data_element_t;
struct _cef_post_data_t;
///
// Structure used to represent a web request. The functions of this structure
@ -147,7 +149,7 @@ typedef struct _cef_request_t {
// Get the resource type for this request. Accurate resource type information
// may only be available in the browser process.
///
enum cef_resource_type_t (CEF_CALLBACK *get_resource_type)(
cef_resource_type_t (CEF_CALLBACK *get_resource_type)(
struct _cef_request_t* self);
///
@ -155,7 +157,7 @@ typedef struct _cef_request_t {
// process and only applies to requests that represent a main frame or sub-
// frame navigation.
///
enum cef_transition_type_t (CEF_CALLBACK *get_transition_type)(
cef_transition_type_t (CEF_CALLBACK *get_transition_type)(
struct _cef_request_t* self);
} cef_request_t;
@ -254,7 +256,7 @@ typedef struct _cef_post_data_element_t {
///
// Return the type of this post data element.
///
enum cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
struct _cef_post_data_element_t* self);
///

View File

@ -42,7 +42,7 @@
extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_request_context_handler_capi.h"
///

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_cookie_capi.h"
///

View File

@ -42,7 +42,14 @@
extern "C" {
#endif
#include "include/capi/cef_auth_callback_capi.h"
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_resource_handler_capi.h"
#include "include/capi/cef_response_capi.h"
#include "include/capi/cef_web_plugin_capi.h"
///
@ -184,7 +191,7 @@ typedef struct _cef_request_handler_t {
// be accepted without calling this function.
///
int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self,
enum cef_errorcode_t cert_error, const cef_string_t* request_url,
cef_errorcode_t cert_error, const cef_string_t* request_url,
struct _cef_allow_certificate_error_callback_t* callback);
///
@ -208,7 +215,7 @@ typedef struct _cef_request_handler_t {
///
void (CEF_CALLBACK *on_render_process_terminated)(
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
enum cef_termination_status_t status);
cef_termination_status_t status);
} cef_request_handler_t;

View File

@ -43,6 +43,11 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_callback_capi.h"
#include "include/capi/cef_cookie_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_response_capi.h"
///

View File

@ -43,30 +43,13 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_resource_handler_capi.h"
#include "include/capi/cef_response_capi.h"
///
// 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 then also
// implement the cef_app_t::on_register_custom_schemes() function in all
// processes. 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 in the browser process.
///
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 in the browser process.
///
CEF_EXPORT int cef_clear_scheme_handler_factories();
struct _cef_scheme_handler_factory_t;
///
// Structure that manages custom scheme registrations.
@ -155,6 +138,29 @@ typedef struct _cef_scheme_handler_factory_t {
} cef_scheme_handler_factory_t;
///
// 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 then also
// implement the cef_app_t::on_register_custom_schemes() function in all
// processes. 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 in the browser process.
///
CEF_EXPORT int cef_register_scheme_handler_factory(
const cef_string_t* scheme_name, const cef_string_t* domain_name,
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 in the browser process.
///
CEF_EXPORT int cef_clear_scheme_handler_factories();
#ifdef __cplusplus
}
#endif

View File

@ -45,27 +45,6 @@ extern "C" {
#include "include/capi/cef_base_capi.h"
///
// Returns true (1) if called on the specified thread. Equivalent to using
// cef_task_runner_t::GetForThread(threadId)->belongs_to_current_thread().
///
CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId);
///
// Post a task for execution on the specified thread. Equivalent to using
// cef_task_runner_t::GetForThread(threadId)->PostTask(task).
///
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. Equivalent to
// using cef_task_runner_t::GetForThread(threadId)->PostDelayedTask(task,
// delay_ms).
///
CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId,
struct _cef_task_t* task, int64 delay_ms);
///
// Implement this structure for asynchronous task execution. If the task is
// posted successfully and if the associated message loop is still running then
@ -153,6 +132,26 @@ CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread(
cef_thread_id_t threadId);
///
// Returns true (1) if called on the specified thread. Equivalent to using
// cef_task_runner_t::GetForThread(threadId)->belongs_to_current_thread().
///
CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId);
///
// Post a task for execution on the specified thread. Equivalent to using
// cef_task_runner_t::GetForThread(threadId)->PostTask(task).
///
CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, cef_task_t* task);
///
// Post a task for delayed execution on the specified thread. Equivalent to
// using cef_task_runner_t::GetForThread(threadId)->PostDelayedTask(task,
// delay_ms).
///
CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, cef_task_t* task,
int64 delay_ms);
#ifdef __cplusplus
}
#endif

View File

@ -45,6 +45,28 @@ extern "C" {
#include "include/capi/cef_base_capi.h"
///
// Implement this structure to receive notification when tracing has completed.
// The functions of this structure will be called on the browser process UI
// thread.
///
typedef struct _cef_end_tracing_callback_t {
///
// Base structure.
///
cef_base_t base;
///
// Called after all processes have sent their trace data. |tracing_file| is
// the path at which tracing data was written. The client is responsible for
// deleting |tracing_file|.
///
void (CEF_CALLBACK *on_end_tracing_complete)(
struct _cef_end_tracing_callback_t* self,
const cef_string_t* tracing_file);
} cef_end_tracing_callback_t;
///
// Start tracing events on all processes. Tracing begins immediately locally,
// and asynchronously on child processes as soon as they receive the
@ -78,7 +100,7 @@ CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories);
// This function must be called on the browser process UI thread.
///
CEF_EXPORT int cef_end_tracing_async(const cef_string_t* tracing_file,
struct _cef_end_tracing_callback_t* callback);
cef_end_tracing_callback_t* callback);
///
// Returns the current system trace time or, if none is defined, the current
@ -87,28 +109,6 @@ CEF_EXPORT int cef_end_tracing_async(const cef_string_t* tracing_file,
///
CEF_EXPORT int64 cef_now_from_system_trace_time();
///
// Implement this structure to receive notification when tracing has completed.
// The functions of this structure will be called on the browser process UI
// thread.
///
typedef struct _cef_end_tracing_callback_t {
///
// Base structure.
///
cef_base_t base;
///
// Called after all processes have sent their trace data. |tracing_file| is
// the path at which tracing data was written. The client is responsible for
// deleting |tracing_file|.
///
void (CEF_CALLBACK *on_end_tracing_complete)(
struct _cef_end_tracing_callback_t* self,
const cef_string_t* tracing_file);
} cef_end_tracing_callback_t;
#ifdef __cplusplus
}
#endif

View File

@ -42,8 +42,12 @@
extern "C" {
#endif
#include "include/capi/cef_auth_callback_capi.h"
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_response_capi.h"
struct _cef_urlrequest_client_t;
///
// Structure used to make a URL request. URL requests are not associated with a
@ -74,14 +78,14 @@ typedef struct _cef_urlrequest_t {
///
// Returns the request status.
///
enum cef_urlrequest_status_t (CEF_CALLBACK *get_request_status)(
cef_urlrequest_status_t (CEF_CALLBACK *get_request_status)(
struct _cef_urlrequest_t* self);
///
// Returns the request error if status is UR_CANCELED or UR_FAILED, or 0
// otherwise.
///
enum cef_errorcode_t (CEF_CALLBACK *get_request_error)(
cef_errorcode_t (CEF_CALLBACK *get_request_error)(
struct _cef_urlrequest_t* self);
///

View File

@ -43,66 +43,14 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_task_capi.h"
///
// Register a new V8 extension with the specified JavaScript extension code and
// handler. Functions implemented by the handler are prototyped using the
// keyword 'native'. The calling of a native function is restricted to the scope
// in which the prototype of the native function is defined. This function may
// only be called on the render process main thread.
//
// Example JavaScript extension code: <pre>
// // create the 'example' global object if it doesn't already exist.
// if (!example)
// example = {};
// // create the 'example.test' global object if it doesn't already exist.
// if (!example.test)
// example.test = {};
// (function() {
// // Define the function 'example.test.myfunction'.
// example.test.myfunction = function() {
// // Call CefV8Handler::Execute() with the function name 'MyFunction'
// // and no arguments.
// native function MyFunction();
// return MyFunction();
// };
// // Define the getter function for parameter 'example.test.myparam'.
// example.test.__defineGetter__('myparam', function() {
// // Call CefV8Handler::Execute() with the function name 'GetMyParam'
// // and no arguments.
// native function GetMyParam();
// return GetMyParam();
// });
// // Define the setter function for parameter 'example.test.myparam'.
// example.test.__defineSetter__('myparam', function(b) {
// // Call CefV8Handler::Execute() with the function name 'SetMyParam'
// // and a single argument.
// native function SetMyParam();
// if(b) SetMyParam(b);
// });
//
// // Extension definitions can also contain normal JavaScript variables
// // and functions.
// var myint = 0;
// example.test.increment = function() {
// myint += 1;
// return myint;
// };
// })();
// </pre> Example usage in the page: <pre>
// // Call the function.
// example.test.myfunction();
// // Set the parameter.
// example.test.myparam = value;
// // Get the parameter.
// value = example.test.myparam;
// // Call another function.
// example.test.increment();
// </pre>
///
CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
const cef_string_t* javascript_code, struct _cef_v8handler_t* handler);
struct _cef_v8exception_t;
struct _cef_v8handler_t;
struct _cef_v8stack_frame_t;
struct _cef_v8value_t;
///
// Structure representing a V8 context handle. V8 handles can only be accessed
@ -542,7 +490,7 @@ typedef struct _cef_v8value_t {
///
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);
cef_v8_propertyattribute_t attribute);
///
// Associates a value with the specified identifier and returns true (1) on
@ -561,8 +509,8 @@ typedef struct _cef_v8value_t {
// values this function will return true (1) even though assignment failed.
///
int (CEF_CALLBACK *set_value_byaccessor)(struct _cef_v8value_t* self,
const cef_string_t* key, enum cef_v8_accesscontrol_t settings,
enum cef_v8_propertyattribute_t attribute);
const cef_string_t* key, cef_v8_accesscontrol_t settings,
cef_v8_propertyattribute_t attribute);
///
// Read the keys for the object's values into the specified vector. Integer-
@ -837,6 +785,65 @@ typedef struct _cef_v8stack_frame_t {
} cef_v8stack_frame_t;
///
// Register a new V8 extension with the specified JavaScript extension code and
// handler. Functions implemented by the handler are prototyped using the
// keyword 'native'. The calling of a native function is restricted to the scope
// in which the prototype of the native function is defined. This function may
// only be called on the render process main thread.
//
// Example JavaScript extension code: <pre>
// // create the 'example' global object if it doesn't already exist.
// if (!example)
// example = {};
// // create the 'example.test' global object if it doesn't already exist.
// if (!example.test)
// example.test = {};
// (function() {
// // Define the function 'example.test.myfunction'.
// example.test.myfunction = function() {
// // Call CefV8Handler::Execute() with the function name 'MyFunction'
// // and no arguments.
// native function MyFunction();
// return MyFunction();
// };
// // Define the getter function for parameter 'example.test.myparam'.
// example.test.__defineGetter__('myparam', function() {
// // Call CefV8Handler::Execute() with the function name 'GetMyParam'
// // and no arguments.
// native function GetMyParam();
// return GetMyParam();
// });
// // Define the setter function for parameter 'example.test.myparam'.
// example.test.__defineSetter__('myparam', function(b) {
// // Call CefV8Handler::Execute() with the function name 'SetMyParam'
// // and a single argument.
// native function SetMyParam();
// if(b) SetMyParam(b);
// });
//
// // Extension definitions can also contain normal JavaScript variables
// // and functions.
// var myint = 0;
// example.test.increment = function() {
// myint += 1;
// return myint;
// };
// })();
// </pre> Example usage in the page: <pre>
// // Call the function.
// example.test.myfunction();
// // Set the parameter.
// example.test.myparam = value;
// // Get the parameter.
// value = example.test.myparam;
// // Call another function.
// example.test.increment();
// </pre>
///
CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
const cef_string_t* javascript_code, cef_v8handler_t* handler);
#ifdef __cplusplus
}
#endif

View File

@ -44,6 +44,8 @@ extern "C" {
#include "include/capi/cef_base_capi.h"
struct _cef_dictionary_value_t;
struct _cef_list_value_t;
///
// Structure representing a binary value. Can be used on any process and thread.
@ -159,7 +161,7 @@ typedef struct _cef_dictionary_value_t {
///
// Returns the value type for the specified key.
///
enum cef_value_type_t (CEF_CALLBACK *get_type)(
cef_value_type_t (CEF_CALLBACK *get_type)(
struct _cef_dictionary_value_t* self, const cef_string_t* key);
///
@ -336,7 +338,7 @@ typedef struct _cef_list_value_t {
///
// Returns the value type at the specified index.
///
enum cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_list_value_t* self,
cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_list_value_t* self,
int index);
///

View File

@ -43,69 +43,9 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
///
// Visit web plugin information. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_visit_web_plugin_info(
struct _cef_web_plugin_info_visitor_t* visitor);
///
// Cause the plugin list to refresh the next time it is accessed regardless of
// whether it has already been loaded. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_refresh_web_plugins();
///
// Add a plugin path (directory + file). This change may not take affect until
// after cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_add_web_plugin_path(const cef_string_t* path);
///
// Add a plugin directory. This change may not take affect until after
// cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_add_web_plugin_directory(const cef_string_t* dir);
///
// Remove a plugin path (directory + file). This change may not take affect
// until after cef_refresh_web_plugins() is called. Can be called on any thread
// in the browser process.
///
CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path);
///
// Unregister an internal plugin. This may be undone the next time
// cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path);
///
// Force a plugin to shutdown. Can be called on any thread in the browser
// process but will be executed on the IO thread.
///
CEF_EXPORT void cef_force_web_plugin_shutdown(const cef_string_t* path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.
///
CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path);
///
// Query if a plugin is unstable. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path,
struct _cef_web_plugin_unstable_callback_t* callback);
///
// Information about a specific web plugin.
///
@ -187,6 +127,67 @@ typedef struct _cef_web_plugin_unstable_callback_t {
} cef_web_plugin_unstable_callback_t;
///
// Visit web plugin information. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_visit_web_plugin_info(
cef_web_plugin_info_visitor_t* visitor);
///
// Cause the plugin list to refresh the next time it is accessed regardless of
// whether it has already been loaded. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_refresh_web_plugins();
///
// Add a plugin path (directory + file). This change may not take affect until
// after cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_add_web_plugin_path(const cef_string_t* path);
///
// Add a plugin directory. This change may not take affect until after
// cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_add_web_plugin_directory(const cef_string_t* dir);
///
// Remove a plugin path (directory + file). This change may not take affect
// until after cef_refresh_web_plugins() is called. Can be called on any thread
// in the browser process.
///
CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path);
///
// Unregister an internal plugin. This may be undone the next time
// cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path);
///
// Force a plugin to shutdown. Can be called on any thread in the browser
// process but will be executed on the IO thread.
///
CEF_EXPORT void cef_force_web_plugin_shutdown(const cef_string_t* path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.
///
CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path);
///
// Query if a plugin is unstable. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path,
cef_web_plugin_unstable_callback_t* callback);
#ifdef __cplusplus
}
#endif

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_stream_capi.h"
///
@ -88,8 +89,7 @@ typedef struct _cef_xml_reader_t {
///
// Returns the node type.
///
enum cef_xml_node_type_t (CEF_CALLBACK *get_type)(
struct _cef_xml_reader_t* self);
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.
@ -267,8 +267,8 @@ typedef struct _cef_xml_reader_t {
// 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);
struct _cef_stream_reader_t* stream, cef_xml_encoding_type_t encodingType,
const cef_string_t* URI);
#ifdef __cplusplus

View File

@ -43,6 +43,7 @@ extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_stream_capi.h"
///

View File

@ -1,4 +1,4 @@
// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2014 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
@ -46,6 +46,7 @@
#include "include/internal/cef_types_linux.h"
#endif
#include <limits.h> // For UINT_MAX
#include <stddef.h> // For size_t
// The NSPR system headers define 64-bit as |long| when possible, except on
@ -91,7 +92,7 @@ extern "C" {
///
// Log severity levels.
///
enum cef_log_severity_t {
typedef enum {
///
// Default logging (currently INFO logging).
///
@ -126,12 +127,12 @@ enum cef_log_severity_t {
// Completely disable logging.
///
LOGSEVERITY_DISABLE = 99
};
} cef_log_severity_t;
///
// Represents the state of a setting.
///
enum cef_state_t {
typedef enum {
///
// Use the default state for the setting.
///
@ -146,7 +147,7 @@ enum cef_state_t {
// Disable or disallow the setting.
///
STATE_DISABLED,
};
} cef_state_t;
///
// Initialization settings. Specify NULL or 0 to get the recommended default
@ -165,14 +166,14 @@ typedef struct _cef_settings_t {
// the multi-process default. Also configurable using the "single-process"
// command-line switch.
///
bool single_process;
int single_process;
///
// Set to true (1) to disable the sandbox for sub-processes. See
// cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also
// configurable using the "no-sandbox" command-line switch.
///
bool no_sandbox;
int no_sandbox;
///
// The path to a separate executable that will be launched for sub-processes.
@ -187,7 +188,7 @@ typedef struct _cef_settings_t {
// thread. If false (0) than the CefDoMessageLoopWork() function must be
// called from your application message loop.
///
bool multi_threaded_message_loop;
int multi_threaded_message_loop;
///
// Set to true (1) to disable configuration of browser process features using
@ -195,7 +196,7 @@ typedef struct _cef_settings_t {
// be specified using CEF data structures or via the
// CefApp::OnBeforeCommandLineProcessing() method.
///
bool command_line_args_disabled;
int command_line_args_disabled;
///
// The location where cache data will be stored on disk. If empty an in-memory
@ -213,7 +214,7 @@ typedef struct _cef_settings_t {
// enable this feature. Also configurable using the "persist-session-cookies"
// command-line switch.
///
bool persist_session_cookies;
int persist_session_cookies;
///
// Value that will be returned as the User-Agent HTTP header. If empty the
@ -259,7 +260,7 @@ typedef struct _cef_settings_t {
// Enable DCHECK in release mode to ease debugging. Also configurable using the
// "enable-release-dcheck" command-line switch.
///
bool release_dcheck_enabled;
int release_dcheck_enabled;
///
// Custom flags that will be used when initializing the V8 JavaScript engine.
@ -293,7 +294,7 @@ typedef struct _cef_settings_t {
// is disabled. Also configurable using the "disable-pack-loading" command-
// line switch.
///
bool pack_loading_disabled;
int pack_loading_disabled;
///
// Set to a value between 1024 and 65535 to enable remote debugging on the
@ -342,7 +343,7 @@ typedef struct _cef_settings_t {
// internet should not enable this setting. Also configurable using the
// "ignore-certificate-errors" command-line switch.
///
bool ignore_certificate_errors;
int ignore_certificate_errors;
} cef_settings_t;
///
@ -594,12 +595,12 @@ typedef struct _cef_cookie_t {
///
// If |secure| is true the cookie will only be sent for HTTPS requests.
///
bool secure;
int secure;
///
// If |httponly| is true the cookie will only be sent for HTTP requests.
///
bool httponly;
int httponly;
///
// The cookie creation date. This is automatically populated by the system on
@ -616,14 +617,14 @@ typedef struct _cef_cookie_t {
///
// The cookie expiration date is only valid if |has_expires| is true.
///
bool has_expires;
int has_expires;
cef_time_t expires;
} cef_cookie_t;
///
// Process termination status values.
///
enum cef_termination_status_t {
typedef enum {
///
// Non-zero exit status.
///
@ -638,12 +639,12 @@ enum cef_termination_status_t {
// Segmentation fault.
///
TS_PROCESS_CRASHED,
};
} cef_termination_status_t;
///
// Path key values.
///
enum cef_path_key_t {
typedef enum {
///
// Current directory.
///
@ -674,21 +675,21 @@ enum cef_path_key_t {
// module).
///
PK_FILE_MODULE,
};
} cef_path_key_t;
///
// Storage types.
///
enum cef_storage_type_t {
typedef enum {
ST_LOCALSTORAGE = 0,
ST_SESSIONSTORAGE,
};
} cef_storage_type_t;
///
// Supported error code values. See net\base\net_error_list.h for complete
// descriptions of the error codes.
///
enum cef_errorcode_t {
typedef enum {
ERR_NONE = 0,
ERR_FAILED = -2,
ERR_ABORTED = -3,
@ -738,14 +739,14 @@ enum cef_errorcode_t {
ERR_RESPONSE_HEADERS_TOO_BIG = -325,
ERR_CACHE_MISS = -400,
ERR_INSECURE_RESPONSE = -501,
};
} cef_errorcode_t;
///
// "Verb" of a drag-and-drop operation as negotiated between the source and
// destination. These constants match their equivalents in WebCore's
// DragActions.h and should not be renumbered.
///
enum cef_drag_operations_mask_t {
typedef enum {
DRAG_OPERATION_NONE = 0,
DRAG_OPERATION_COPY = 1,
DRAG_OPERATION_LINK = 2,
@ -754,42 +755,42 @@ enum cef_drag_operations_mask_t {
DRAG_OPERATION_MOVE = 16,
DRAG_OPERATION_DELETE = 32,
DRAG_OPERATION_EVERY = UINT_MAX
};
} cef_drag_operations_mask_t;
///
// V8 access control values.
///
enum cef_v8_accesscontrol_t {
typedef enum {
V8_ACCESS_CONTROL_DEFAULT = 0,
V8_ACCESS_CONTROL_ALL_CAN_READ = 1,
V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1,
V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2
};
} cef_v8_accesscontrol_t;
///
// V8 property attribute values.
///
enum cef_v8_propertyattribute_t {
typedef enum {
V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable,
// Configurable
V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, // Not writeable
V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, // Not enumerable
V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable
};
} cef_v8_propertyattribute_t;
///
// Post data elements may represent either bytes or files.
///
enum cef_postdataelement_type_t {
typedef enum {
PDE_TYPE_EMPTY = 0,
PDE_TYPE_BYTES,
PDE_TYPE_FILE,
};
} cef_postdataelement_type_t;
///
// Resource type for a request.
///
enum cef_resource_type_t {
typedef enum {
///
// Top level page.
///
@ -860,13 +861,13 @@ enum cef_resource_type_t {
// XMLHttpRequest.
///
RT_XHR,
};
} cef_resource_type_t;
///
// Transition type for a request. Made up of one source value and 0 or more
// qualifiers.
///
enum cef_transition_type_t {
typedef enum {
///
// Source is a link click or the JavaScript window.open function. This is
// also the default value for requests like sub-resource loads that are not
@ -961,12 +962,12 @@ enum cef_transition_type_t {
// General mask defining the bits used for the qualifiers.
///
TT_QUALIFIER_MASK = 0xFFFFFF00,
};
} cef_transition_type_t;
///
// Flags used to customize the behavior of CefURLRequest.
///
enum cef_urlrequest_flags_t {
typedef enum {
///
// Default behavior.
///
@ -1014,12 +1015,12 @@ enum cef_urlrequest_flags_t {
// originated in the browser process.
///
UR_FLAG_NO_RETRY_ON_5XX = 1 << 7,
};
} cef_urlrequest_flags_t;
///
// Flags that represent CefURLRequest status.
///
enum cef_urlrequest_status_t {
typedef enum {
///
// Unknown status.
///
@ -1045,7 +1046,7 @@ enum cef_urlrequest_status_t {
// Request failed for some reason.
///
UR_FAILED,
};
} cef_urlrequest_status_t;
///
// Structure representing a rectangle.
@ -1060,7 +1061,7 @@ typedef struct _cef_rect_t {
///
// Existing process IDs.
///
enum cef_process_id_t {
typedef enum {
///
// Browser process.
///
@ -1069,12 +1070,12 @@ enum cef_process_id_t {
// Renderer process.
///
PID_RENDERER,
};
} cef_process_id_t;
///
// Existing thread IDs.
///
enum cef_thread_id_t {
typedef enum {
// BROWSER PROCESS THREADS -- Only available in the browser process.
///
@ -1121,12 +1122,12 @@ enum cef_thread_id_t {
// The main thread in the renderer. Used for all WebKit and V8 interaction.
///
TID_RENDERER,
};
} cef_thread_id_t;
///
// Supported value types.
///
enum cef_value_type_t {
typedef enum {
VTYPE_INVALID = 0,
VTYPE_NULL,
VTYPE_BOOL,
@ -1136,16 +1137,16 @@ enum cef_value_type_t {
VTYPE_BINARY,
VTYPE_DICTIONARY,
VTYPE_LIST,
};
} cef_value_type_t;
///
// Supported JavaScript dialog types.
///
enum cef_jsdialog_type_t {
typedef enum {
JSDIALOGTYPE_ALERT = 0,
JSDIALOGTYPE_CONFIRM,
JSDIALOGTYPE_PROMPT,
};
} cef_jsdialog_type_t;
///
// Screen information used when window rendering is disabled. This structure is
@ -1173,7 +1174,7 @@ typedef struct _cef_screen_info_t {
///
// This can be true for black and white printers.
///
bool is_monochrome;
int is_monochrome;
///
// This is set from the rcMonitor member of MONITORINFOEX, to whit:
@ -1207,7 +1208,7 @@ typedef struct _cef_screen_info_t {
// Supported menu IDs. Non-English translations can be provided for the
// IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString().
///
enum cef_menu_id_t {
typedef enum {
// Navigation.
MENU_ID_BACK = 100,
MENU_ID_FORWARD = 101,
@ -1234,16 +1235,16 @@ enum cef_menu_id_t {
// defined in the tools/gritsettings/resource_ids file.
MENU_ID_USER_FIRST = 26500,
MENU_ID_USER_LAST = 28500,
};
} cef_menu_id_t;
///
// Mouse button types.
///
enum cef_mouse_button_type_t {
typedef enum {
MBT_LEFT = 0,
MBT_MIDDLE,
MBT_RIGHT,
};
} cef_mouse_button_type_t;
///
// Structure representing mouse event information.
@ -1269,15 +1270,15 @@ typedef struct _cef_mouse_event_t {
///
// Paint element types.
///
enum cef_paint_element_type_t {
typedef enum {
PET_VIEW = 0,
PET_POPUP,
};
} cef_paint_element_type_t;
///
// Supported event bit flags.
///
enum cef_event_flags_t {
typedef enum {
EVENTFLAG_NONE = 0,
EVENTFLAG_CAPS_LOCK_ON = 1 << 0,
EVENTFLAG_SHIFT_DOWN = 1 << 1,
@ -1292,24 +1293,24 @@ enum cef_event_flags_t {
EVENTFLAG_IS_KEY_PAD = 1 << 9,
EVENTFLAG_IS_LEFT = 1 << 10,
EVENTFLAG_IS_RIGHT = 1 << 11,
};
} cef_event_flags_t;
///
// Supported menu item types.
///
enum cef_menu_item_type_t {
typedef enum {
MENUITEMTYPE_NONE,
MENUITEMTYPE_COMMAND,
MENUITEMTYPE_CHECK,
MENUITEMTYPE_RADIO,
MENUITEMTYPE_SEPARATOR,
MENUITEMTYPE_SUBMENU,
};
} cef_menu_item_type_t;
///
// Supported context menu type flags.
///
enum cef_context_menu_type_flags_t {
typedef enum {
///
// No node is selected.
///
@ -1338,12 +1339,12 @@ enum cef_context_menu_type_flags_t {
// An editable element is selected.
///
CM_TYPEFLAG_EDITABLE = 1 << 5,
};
} cef_context_menu_type_flags_t;
///
// Supported context menu media types.
///
enum cef_context_menu_media_type_t {
typedef enum {
///
// No special node is in context.
///
@ -1368,12 +1369,12 @@ enum cef_context_menu_media_type_t {
// A plugin node is selected.
///
CM_MEDIATYPE_PLUGIN,
};
} cef_context_menu_media_type_t;
///
// Supported context menu media state bit flags.
///
enum cef_context_menu_media_state_flags_t {
typedef enum {
CM_MEDIAFLAG_NONE = 0,
CM_MEDIAFLAG_ERROR = 1 << 0,
CM_MEDIAFLAG_PAUSED = 1 << 1,
@ -1385,12 +1386,12 @@ enum cef_context_menu_media_state_flags_t {
CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7,
CM_MEDIAFLAG_CAN_PRINT = 1 << 8,
CM_MEDIAFLAG_CAN_ROTATE = 1 << 9,
};
} cef_context_menu_media_state_flags_t;
///
// Supported context menu edit state bit flags.
///
enum cef_context_menu_edit_state_flags_t {
typedef enum {
CM_EDITFLAG_NONE = 0,
CM_EDITFLAG_CAN_UNDO = 1 << 0,
CM_EDITFLAG_CAN_REDO = 1 << 1,
@ -1400,17 +1401,17 @@ enum cef_context_menu_edit_state_flags_t {
CM_EDITFLAG_CAN_DELETE = 1 << 5,
CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6,
CM_EDITFLAG_CAN_TRANSLATE = 1 << 7,
};
} cef_context_menu_edit_state_flags_t;
///
// Key event types.
///
enum cef_key_event_type_t {
typedef enum {
KEYEVENT_RAWKEYDOWN = 0,
KEYEVENT_KEYDOWN,
KEYEVENT_KEYUP,
KEYEVENT_CHAR
};
} cef_key_event_type_t;
///
// Structure representing keyboard event information.
@ -1445,7 +1446,7 @@ typedef struct _cef_key_event_t {
// http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details).
// This value will always be false on non-Windows platforms.
///
bool is_system_key;
int is_system_key;
///
// The character generated by the keystroke.
@ -1462,13 +1463,13 @@ typedef struct _cef_key_event_t {
// True if the focus is currently on an editable field on the page. This is
// useful for determining if standard key events should be intercepted.
///
bool focus_on_editable_field;
int focus_on_editable_field;
} cef_key_event_t;
///
// Focus sources.
///
enum cef_focus_source_t {
typedef enum {
///
// The source is explicit navigation via the API (LoadURL(), etc).
///
@ -1477,19 +1478,19 @@ enum cef_focus_source_t {
// The source is a system-generated focus event.
///
FOCUS_SOURCE_SYSTEM,
};
} cef_focus_source_t;
///
// Navigation types.
///
enum cef_navigation_type_t {
typedef enum {
NAVIGATION_LINK_CLICKED = 0,
NAVIGATION_FORM_SUBMITTED,
NAVIGATION_BACK_FORWARD,
NAVIGATION_RELOAD,
NAVIGATION_FORM_RESUBMITTED,
NAVIGATION_OTHER,
};
} cef_navigation_type_t;
///
// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and
@ -1497,18 +1498,18 @@ enum cef_navigation_type_t {
// before being passed to the parser. If a BOM is detected and the correct
// decoder is available then that decoder will be used automatically.
///
enum cef_xml_encoding_type_t {
typedef enum {
XML_ENCODING_NONE = 0,
XML_ENCODING_UTF8,
XML_ENCODING_UTF16LE,
XML_ENCODING_UTF16BE,
XML_ENCODING_ASCII,
};
} cef_xml_encoding_type_t;
///
// XML node types.
///
enum cef_xml_node_type_t {
typedef enum {
XML_NODE_UNSUPPORTED = 0,
XML_NODE_PROCESSING_INSTRUCTION,
XML_NODE_DOCUMENT_TYPE,
@ -1520,47 +1521,47 @@ enum cef_xml_node_type_t {
XML_NODE_ENTITY_REFERENCE,
XML_NODE_WHITESPACE,
XML_NODE_COMMENT,
};
} cef_xml_node_type_t;
///
// Popup window features.
///
typedef struct _cef_popup_features_t {
int x;
bool xSet;
int xSet;
int y;
bool ySet;
int ySet;
int width;
bool widthSet;
int widthSet;
int height;
bool heightSet;
int heightSet;
bool menuBarVisible;
bool statusBarVisible;
bool toolBarVisible;
bool locationBarVisible;
bool scrollbarsVisible;
bool resizable;
int menuBarVisible;
int statusBarVisible;
int toolBarVisible;
int locationBarVisible;
int scrollbarsVisible;
int resizable;
bool fullscreen;
bool dialog;
int fullscreen;
int dialog;
cef_string_list_t additionalFeatures;
} cef_popup_features_t;
///
// DOM document types.
///
enum cef_dom_document_type_t {
typedef enum {
DOM_DOCUMENT_TYPE_UNKNOWN = 0,
DOM_DOCUMENT_TYPE_HTML,
DOM_DOCUMENT_TYPE_XHTML,
DOM_DOCUMENT_TYPE_PLUGIN,
};
} cef_dom_document_type_t;
///
// DOM event category flags.
///
enum cef_dom_event_category_t {
typedef enum {
DOM_EVENT_CATEGORY_UNKNOWN = 0x0,
DOM_EVENT_CATEGORY_UI = 0x1,
DOM_EVENT_CATEGORY_MOUSE = 0x2,
@ -1579,22 +1580,22 @@ enum cef_dom_event_category_t {
DOM_EVENT_CATEGORY_PROGRESS = 0x4000,
DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000,
DOM_EVENT_CATEGORY_BEFORE_LOAD = 0x10000,
};
} cef_dom_event_category_t;
///
// DOM event processing phases.
///
enum cef_dom_event_phase_t {
typedef enum {
DOM_EVENT_PHASE_UNKNOWN = 0,
DOM_EVENT_PHASE_CAPTURING,
DOM_EVENT_PHASE_AT_TARGET,
DOM_EVENT_PHASE_BUBBLING,
};
} cef_dom_event_phase_t;
///
// DOM node types.
///
enum cef_dom_node_type_t {
typedef enum {
DOM_NODE_TYPE_UNSUPPORTED = 0,
DOM_NODE_TYPE_ELEMENT,
DOM_NODE_TYPE_ATTRIBUTE,
@ -1608,12 +1609,12 @@ enum cef_dom_node_type_t {
DOM_NODE_TYPE_DOCUMENT_FRAGMENT,
DOM_NODE_TYPE_NOTATION,
DOM_NODE_TYPE_XPATH_NAMESPACE,
};
} cef_dom_node_type_t;
///
// Supported file dialog modes.
///
enum cef_file_dialog_mode_t {
typedef enum {
///
// Requires that the file exists before allowing the user to pick it.
///
@ -1629,17 +1630,17 @@ enum cef_file_dialog_mode_t {
// already exists.
///
FILE_DIALOG_SAVE,
};
} cef_file_dialog_mode_t;
///
// Geoposition error codes.
///
enum cef_geoposition_error_code_t {
typedef enum {
GEOPOSITON_ERROR_NONE = 0,
GEOPOSITON_ERROR_PERMISSION_DENIED,
GEOPOSITON_ERROR_POSITION_UNAVAILABLE,
GEOPOSITON_ERROR_TIMEOUT,
};
} cef_geoposition_error_code_t;
///
// Structure representing geoposition information. The properties of this

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2014 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
@ -66,10 +66,10 @@ typedef struct _cef_window_info_t {
// If window rendering is disabled no browser window will be created. Set
// |parent_widget| to the window that will act as the parent for popup menus,
// dialog boxes, etc.
bool window_rendering_disabled;
int window_rendering_disabled;
// Set to true to enable transparent painting.
bool transparent_painting;
int transparent_painting;
// Pointer for the new browser widget.
cef_window_handle_t widget;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2014 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
@ -90,10 +90,10 @@ typedef struct _cef_window_info_t {
// If window rendering is disabled no browser window will be created. Set
// |parent_view| to the window that will act as the parent for popup menus,
// dialog boxes, etc.
bool window_rendering_disabled;
int window_rendering_disabled;
// Set to true to enable transparent painting.
bool transparent_painting;
int transparent_painting;
// NSView pointer for the new browser view.
cef_window_handle_t view;

View File

@ -884,7 +884,7 @@ void CefBrowserHostImpl::PlatformTranslateKeyEvent(
result.windowsKeyCode = key_event.windows_key_code;
result.nativeKeyCode = key_event.native_key_code;
result.isSystemKey = key_event.is_system_key;
result.isSystemKey = key_event.is_system_key ? 1 : 0;
switch (key_event.type) {
case KEYEVENT_RAWKEYDOWN:
case KEYEVENT_KEYDOWN:

View File

@ -222,8 +222,11 @@ bool CefCookieManagerImpl::SetCookie(const CefString& url,
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,
cookie_monster_->SetCookieWithDetailsAsync(
gurl, name, value, domain, path,
expiration_time,
cookie.secure ? true : false,
cookie.httponly ? true : false,
net::COOKIE_PRIORITY_DEFAULT,
net::CookieStore::SetCookiesCallback());
return true;

View File

@ -24,7 +24,7 @@ static blink::WebScreenInfo webScreenInfoFrom(const CefScreenInfo& src) {
webScreenInfo.deviceScaleFactor = src.device_scale_factor;
webScreenInfo.depth = src.depth;
webScreenInfo.depthPerComponent = src.depth_per_component;
webScreenInfo.isMonochrome = src.is_monochrome;
webScreenInfo.isMonochrome = src.is_monochrome ? true : false;
webScreenInfo.rect = blink::WebRect(src.rect.x, src.rect.y,
src.rect.width, src.rect.height);
webScreenInfo.availableRect = blink::WebRect(src.available_rect.x,

View File

@ -179,7 +179,7 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
if (settings.single_process)
command_line->AppendSwitch(switches::kSingleProcess);
bool no_sandbox = settings.no_sandbox;
bool no_sandbox = settings.no_sandbox ? true : false;
if (settings.browser_subprocess_path.length > 0) {
base::FilePath file_path =

View File

@ -334,8 +334,7 @@ void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self,
}
int CEF_CALLBACK browser_send_process_message(struct _cef_browser_t* self,
enum cef_process_id_t target_process,
struct _cef_process_message_t* message) {
cef_process_id_t target_process, struct _cef_process_message_t* message) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -242,7 +242,7 @@ void CEF_CALLBACK browser_host_set_zoom_level(struct _cef_browser_host_t* self,
}
void CEF_CALLBACK browser_host_run_file_dialog(struct _cef_browser_host_t* self,
enum cef_file_dialog_mode_t mode, const cef_string_t* title,
cef_file_dialog_mode_t mode, const cef_string_t* title,
const cef_string_t* default_file_name, cef_string_list_t accept_types,
cef_run_file_dialog_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -461,7 +461,7 @@ void CEF_CALLBACK browser_host_notify_screen_info_changed(
}
void CEF_CALLBACK browser_host_invalidate(struct _cef_browser_host_t* self,
const cef_rect_t* dirtyRect, enum cef_paint_element_type_t type) {
const cef_rect_t* dirtyRect, cef_paint_element_type_t type) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@ -505,7 +505,7 @@ void CEF_CALLBACK browser_host_send_key_event(struct _cef_browser_host_t* self,
void CEF_CALLBACK browser_host_send_mouse_click_event(
struct _cef_browser_host_t* self, const struct _cef_mouse_event_t* event,
enum cef_mouse_button_type_t type, int mouseUp, int clickCount) {
cef_mouse_button_type_t type, int mouseUp, int clickCount) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -239,7 +239,7 @@ struct _cef_request_handler_t* CEF_CALLBACK client_get_request_handler(
}
int CEF_CALLBACK client_on_process_message_received(struct _cef_client_t* self,
cef_browser_t* browser, enum cef_process_id_t source_process,
cef_browser_t* browser, cef_process_id_t source_process,
struct _cef_process_message_t* message) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -56,7 +56,7 @@ void CEF_CALLBACK context_menu_handler_on_before_context_menu(
int CEF_CALLBACK context_menu_handler_on_context_menu_command(
struct _cef_context_menu_handler_t* self, cef_browser_t* browser,
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
int command_id, enum cef_event_flags_t event_flags) {
int command_id, cef_event_flags_t event_flags) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -45,7 +45,7 @@ int CEF_CALLBACK context_menu_params_get_ycoord(
return _retval;
}
enum cef_context_menu_type_flags_t CEF_CALLBACK context_menu_params_get_type_flags(
cef_context_menu_type_flags_t CEF_CALLBACK context_menu_params_get_type_flags(
struct _cef_context_menu_params_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -167,7 +167,7 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_frame_charset(
return _retval.DetachToUserFree();
}
enum cef_context_menu_media_type_t CEF_CALLBACK context_menu_params_get_media_type(
cef_context_menu_media_type_t CEF_CALLBACK context_menu_params_get_media_type(
struct _cef_context_menu_params_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -183,7 +183,7 @@ enum cef_context_menu_media_type_t CEF_CALLBACK context_menu_params_get_media_ty
return _retval;
}
enum cef_context_menu_media_state_flags_t CEF_CALLBACK context_menu_params_get_media_state_flags(
cef_context_menu_media_state_flags_t CEF_CALLBACK context_menu_params_get_media_state_flags(
struct _cef_context_menu_params_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -244,7 +244,7 @@ int CEF_CALLBACK context_menu_params_is_speech_input_enabled(
return _retval;
}
enum cef_context_menu_edit_state_flags_t CEF_CALLBACK context_menu_params_get_edit_state_flags(
cef_context_menu_edit_state_flags_t CEF_CALLBACK context_menu_params_get_edit_state_flags(
struct _cef_context_menu_params_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -20,7 +20,7 @@
int CEF_CALLBACK dialog_handler_on_file_dialog(
struct _cef_dialog_handler_t* self, cef_browser_t* browser,
enum cef_file_dialog_mode_t mode, const cef_string_t* title,
cef_file_dialog_mode_t mode, const cef_string_t* title,
const cef_string_t* default_file_name, cef_string_list_t accept_types,
cef_file_dialog_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -190,7 +190,7 @@ int CEF_CALLBACK dictionary_value_remove(struct _cef_dictionary_value_t* self,
return _retval;
}
enum cef_value_type_t CEF_CALLBACK dictionary_value_get_type(
cef_value_type_t CEF_CALLBACK dictionary_value_get_type(
struct _cef_dictionary_value_t* self, const cef_string_t* key) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -16,7 +16,7 @@
// MEMBER FUNCTIONS - Body may be edited by hand.
enum cef_dom_document_type_t CEF_CALLBACK domdocument_get_type(
cef_dom_document_type_t CEF_CALLBACK domdocument_get_type(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -32,7 +32,7 @@ cef_string_userfree_t CEF_CALLBACK domevent_get_type(
return _retval.DetachToUserFree();
}
enum cef_dom_event_category_t CEF_CALLBACK domevent_get_category(
cef_dom_event_category_t CEF_CALLBACK domevent_get_category(
struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -48,7 +48,7 @@ enum cef_dom_event_category_t CEF_CALLBACK domevent_get_category(
return _retval;
}
enum cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase(
cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase(
struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -18,8 +18,7 @@
// MEMBER FUNCTIONS - Body may be edited by hand.
enum cef_dom_node_type_t CEF_CALLBACK domnode_get_type(
struct _cef_domnode_t* self) {
cef_dom_node_type_t CEF_CALLBACK domnode_get_type(struct _cef_domnode_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -19,7 +19,7 @@
int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self,
cef_browser_t* browser, cef_drag_data_t* dragData,
enum cef_drag_operations_mask_t mask) {
cef_drag_operations_mask_t mask) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -35,7 +35,7 @@ void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self,
}
int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self,
cef_browser_t* browser, enum cef_focus_source_t source) {
cef_browser_t* browser, cef_focus_source_t source) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -20,7 +20,7 @@
int CEF_CALLBACK jsdialog_handler_on_jsdialog(
struct _cef_jsdialog_handler_t* self, cef_browser_t* browser,
const cef_string_t* origin_url, const cef_string_t* accept_lang,
enum cef_jsdialog_type_t dialog_type, const cef_string_t* message_text,
cef_jsdialog_type_t dialog_type, const cef_string_t* message_text,
const cef_string_t* default_prompt_text, cef_jsdialog_callback_t* callback,
int* suppress_message) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -150,7 +150,7 @@ int CEF_CALLBACK list_value_remove(struct _cef_list_value_t* self, int index) {
return _retval;
}
enum cef_value_type_t CEF_CALLBACK list_value_get_type(
cef_value_type_t CEF_CALLBACK list_value_get_type(
struct _cef_list_value_t* self, int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -84,7 +84,7 @@ void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self,
}
void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self,
cef_browser_t* browser, cef_frame_t* frame, enum cef_errorcode_t errorCode,
cef_browser_t* browser, cef_frame_t* frame, cef_errorcode_t errorCode,
const cef_string_t* errorText, const cef_string_t* failedUrl) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -405,7 +405,7 @@ int CEF_CALLBACK menu_model_set_label_at(struct _cef_menu_model_t* self,
return _retval;
}
enum cef_menu_item_type_t CEF_CALLBACK menu_model_get_type(
cef_menu_item_type_t CEF_CALLBACK menu_model_get_type(
struct _cef_menu_model_t* self, int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -421,7 +421,7 @@ enum cef_menu_item_type_t CEF_CALLBACK menu_model_get_type(
return _retval;
}
enum cef_menu_item_type_t CEF_CALLBACK menu_model_get_type_at(
cef_menu_item_type_t CEF_CALLBACK menu_model_get_type_at(
struct _cef_menu_model_t* self, int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -90,7 +90,7 @@ void CEF_CALLBACK post_data_element_set_to_bytes(
bytes);
}
enum cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type(
cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type(
struct _cef_post_data_element_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -207,7 +207,7 @@ void CEF_CALLBACK render_handler_on_popup_size(
}
void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self,
cef_browser_t* browser, enum cef_paint_element_type_t type,
cef_browser_t* browser, cef_paint_element_type_t type,
size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer,
int width, int height) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -108,7 +108,7 @@ cef_load_handler_t* CEF_CALLBACK render_process_handler_get_load_handler(
int CEF_CALLBACK render_process_handler_on_before_navigation(
struct _cef_render_process_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, struct _cef_request_t* request,
enum cef_navigation_type_t navigation_type, int is_redirect) {
cef_navigation_type_t navigation_type, int is_redirect) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@ -258,7 +258,7 @@ void CEF_CALLBACK render_process_handler_on_focused_node_changed(
int CEF_CALLBACK render_process_handler_on_process_message_received(
struct _cef_render_process_handler_t* self, cef_browser_t* browser,
enum cef_process_id_t source_process, cef_process_message_t* message) {
cef_process_id_t source_process, cef_process_message_t* message) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -278,7 +278,7 @@ void CEF_CALLBACK request_set_first_party_for_cookies(
CefString(url));
}
enum cef_resource_type_t CEF_CALLBACK request_get_resource_type(
cef_resource_type_t CEF_CALLBACK request_get_resource_type(
struct _cef_request_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -293,7 +293,7 @@ enum cef_resource_type_t CEF_CALLBACK request_get_resource_type(
return _retval;
}
enum cef_transition_type_t CEF_CALLBACK request_get_transition_type(
cef_transition_type_t CEF_CALLBACK request_get_transition_type(
struct _cef_request_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -271,7 +271,7 @@ void CEF_CALLBACK request_handler_on_protocol_execution(
}
int CEF_CALLBACK request_handler_on_certificate_error(
struct _cef_request_handler_t* self, enum cef_errorcode_t cert_error,
struct _cef_request_handler_t* self, cef_errorcode_t cert_error,
const cef_string_t* request_url,
cef_allow_certificate_error_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -353,7 +353,7 @@ void CEF_CALLBACK request_handler_on_plugin_crashed(
void CEF_CALLBACK request_handler_on_render_process_terminated(
struct _cef_request_handler_t* self, cef_browser_t* browser,
enum cef_termination_status_t status) {
cef_termination_status_t status) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -74,7 +74,7 @@ struct _cef_urlrequest_client_t* CEF_CALLBACK urlrequest_get_client(
return CefURLRequestClientCToCpp::Unwrap(_retval);
}
enum cef_urlrequest_status_t CEF_CALLBACK urlrequest_get_request_status(
cef_urlrequest_status_t CEF_CALLBACK urlrequest_get_request_status(
struct _cef_urlrequest_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -90,7 +90,7 @@ enum cef_urlrequest_status_t CEF_CALLBACK urlrequest_get_request_status(
return _retval;
}
enum cef_errorcode_t CEF_CALLBACK urlrequest_get_request_error(
cef_errorcode_t CEF_CALLBACK urlrequest_get_request_error(
struct _cef_urlrequest_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -641,7 +641,7 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex(
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) {
cef_v8_propertyattribute_t attribute) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@ -689,8 +689,8 @@ int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self,
}
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) {
const cef_string_t* key, cef_v8_accesscontrol_t settings,
cef_v8_propertyattribute_t attribute) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);

View File

@ -17,7 +17,7 @@
// GLOBAL FUNCTIONS - Body may be edited by hand.
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) {
cef_xml_encoding_type_t encodingType, const cef_string_t* URI) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: stream; type: refptr_same
@ -99,7 +99,7 @@ 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(
cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type(
struct _cef_xml_reader_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -357,7 +357,7 @@ CEF_EXPORT int cef_clear_cross_origin_whitelist() {
return _retval;
}
CEF_EXPORT int cef_get_path(enum cef_path_key_t key, cef_string_t* path) {
CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: path; type: string_byref

View File

@ -510,7 +510,11 @@ class obj_header:
comment = get_comment(data, retval+'('+argval+');')
self.funcs.append(obj_function(self, filename, attrib, retval,
argval, comment))
# extract includes
p = re.compile('\n#include \"include/'+_cre_cfname+'.h')
includes = p.findall(data)
# extract forward declarations
p = re.compile('\nclass'+_cre_space+_cre_cfname+';')
forward_declares = p.findall(data)
@ -530,7 +534,7 @@ class obj_header:
comment = get_comment(data, name+' : public virtual CefBase')
self.classes.append(
obj_class(self, filename, attrib, name, body, comment,
forward_declares))
includes, forward_declares))
if added:
# a global function or class was read from the header file
@ -670,7 +674,7 @@ class obj_class:
""" Class representing a C++ class. """
def __init__(self, parent, filename, attrib, name, body, comment,
forward_declares):
includes, forward_declares):
if not isinstance(parent, obj_header):
raise Exception('Invalid parent object type')
@ -679,6 +683,7 @@ class obj_class:
self.attribs = str_to_dict(attrib)
self.name = name
self.comment = comment
self.includes = includes
self.forward_declares = forward_declares
# extract typedefs
@ -770,6 +775,11 @@ class obj_class:
""" Return the class comment as an array of lines. """
return self.comment
def get_includes(self):
""" Return the list of classes that are included from this class'
header file. """
return self.includes
def get_forward_declares(self):
""" Return the list of classes that are forward declared for this
class. """
@ -1657,8 +1667,6 @@ class obj_analysis:
result += 'const '
if not self.result_value in defined_structs:
result += 'struct _'
else:
result += 'enum '
result += self.result_value
if not is_enum:
result += '*'

View File

@ -90,16 +90,37 @@ def make_capi_header(header, filename):
extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
"""
# output global functions
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(filename)
# identify all includes and forward declarations
all_includes = set([])
all_declares = set([])
for cls in classes:
includes = cls.get_includes()
for include in includes:
all_includes.add(include)
declares = cls.get_forward_declares()
for declare in declares:
all_declares.add(header.get_class(declare).get_capi_name())
# output includes
if len(all_includes) > 0:
sorted_includes = sorted(all_includes)
for include in sorted_includes:
result += '#include "include/capi/' + include + '_capi.h"\n'
else:
result += '#include "include/capi/cef_base_capi.h"\n'
result += '\n'
# output forward declarations
if len(all_declares) > 0:
sorted_declares = sorted(all_declares)
for declare in sorted_declares:
result += 'struct _' + declare + ';\n'
# output classes
for cls in classes:
# virtual functions are inside the structure
classname = cls.get_capi_name()
@ -118,7 +139,12 @@ extern "C" {
if len(funcs) > 0:
result += make_capi_global_funcs(funcs, defined_names,
translate_map, '')+'\n'
# output global functions
funcs = header.get_funcs(filename)
if len(funcs) > 0:
result += make_capi_global_funcs(funcs, defined_names, translate_map, '')
# footer string
result += \
"""