Auto merge of #7629 - zmike:THE_RETURN_OF_EMBEDDING, r=larsbergstrom

sync cef interfaces with upstream

@larsbergstrom I guess

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7629)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-14 14:24:18 -06:00
commit 3d420abe40
14 changed files with 490 additions and 41 deletions

View file

@ -942,6 +942,157 @@ impl CefWrap<*mut cef_navigation_entry_visitor_t> for Option<CefNavigationEntryV
}
//
// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
// structure will be called on the browser process UI thread.
//
#[repr(C)]
pub struct _cef_pdf_print_callback_t {
//
// Base structure.
//
pub base: types::cef_base_t,
//
// Method that will be executed when the PDF printing has completed. |path| is
// the output path. |ok| will be true (1) if the printing completed
// successfully or false (0) otherwise.
//
pub on_pdf_print_finished: Option<extern "C" fn(
this: *mut cef_pdf_print_callback_t, path: *const types::cef_string_t,
ok: libc::c_int) -> ()>,
//
// The reference count. This will only be present for Rust instances!
//
pub ref_count: u32,
//
// Extra data. This will only be present for Rust instances!
//
pub extra: u8,
}
pub type cef_pdf_print_callback_t = _cef_pdf_print_callback_t;
//
// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
// structure will be called on the browser process UI thread.
//
pub struct CefPdfPrintCallback {
c_object: *mut cef_pdf_print_callback_t,
}
impl Clone for CefPdfPrintCallback {
fn clone(&self) -> CefPdfPrintCallback{
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
}
CefPdfPrintCallback {
c_object: self.c_object,
}
}
}
}
impl Drop for CefPdfPrintCallback {
fn drop(&mut self) {
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
}
}
}
}
impl CefPdfPrintCallback {
pub unsafe fn from_c_object(c_object: *mut cef_pdf_print_callback_t) -> CefPdfPrintCallback {
CefPdfPrintCallback {
c_object: c_object,
}
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_pdf_print_callback_t) -> CefPdfPrintCallback {
if !c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
}
CefPdfPrintCallback {
c_object: c_object,
}
}
pub fn c_object(&self) -> *mut cef_pdf_print_callback_t {
self.c_object
}
pub fn c_object_addrefed(&self) -> *mut cef_pdf_print_callback_t {
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
eutil::add_ref(self.c_object as *mut types::cef_base_t);
}
self.c_object
}
}
pub fn is_null_cef_object(&self) -> bool {
self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
}
pub fn is_not_null_cef_object(&self) -> bool {
!self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
}
//
// Method that will be executed when the PDF printing has completed. |path| is
// the output path. |ok| will be true (1) if the printing completed
// successfully or false (0) otherwise.
//
pub fn on_pdf_print_finished(&self, path: &[u16], ok: libc::c_int) -> () {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).on_pdf_print_finished.unwrap())(
self.c_object,
CefWrap::to_c(path),
CefWrap::to_c(ok)))
}
}
}
impl CefWrap<*mut cef_pdf_print_callback_t> for CefPdfPrintCallback {
fn to_c(rust_object: CefPdfPrintCallback) -> *mut cef_pdf_print_callback_t {
rust_object.c_object_addrefed()
}
unsafe fn to_rust(c_object: *mut cef_pdf_print_callback_t) -> CefPdfPrintCallback {
CefPdfPrintCallback::from_c_object_addref(c_object)
}
}
impl CefWrap<*mut cef_pdf_print_callback_t> for Option<CefPdfPrintCallback> {
fn to_c(rust_object: Option<CefPdfPrintCallback>) -> *mut cef_pdf_print_callback_t {
match rust_object {
None => ptr::null_mut(),
Some(rust_object) => rust_object.c_object_addrefed(),
}
}
unsafe fn to_rust(c_object: *mut cef_pdf_print_callback_t) -> Option<CefPdfPrintCallback> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
None
} else {
Some(CefPdfPrintCallback::from_c_object_addref(c_object))
}
}
}
//
// Structure used to represent the browser process aspects of a browser window.
// The functions of this structure can only be called in the browser process.
@ -1062,6 +1213,17 @@ pub struct _cef_browser_host_t {
//
pub print: Option<extern "C" fn(this: *mut cef_browser_host_t) -> ()>,
//
// Print the current browser contents to the PDF file specified by |path| and
// execute |callback| on completion. The caller is responsible for deleting
// |path| when done. For PDF printing to work on Linux you must implement the
// cef_print_handler_t::GetPdfPaperSize function.
//
pub print_to_pdf: Option<extern "C" fn(this: *mut cef_browser_host_t,
path: *const types::cef_string_t,
settings: *const interfaces::cef_pdf_print_settings_t,
callback: *mut interfaces::cef_pdf_print_callback_t) -> ()>,
//
// Search for |searchText|. |identifier| can be used to have multiple searches
// running simultaniously. |forward| indicates whether to search forward or
@ -1231,6 +1393,26 @@ pub struct _cef_browser_host_t {
pub notify_move_or_resize_started: Option<extern "C" fn(
this: *mut cef_browser_host_t) -> ()>,
//
// Returns the maximum rate in frames per second (fps) that
// cef_render_handler_t:: OnPaint will be called for a windowless browser. The
// actual fps may be lower if the browser cannot generate frames at the
// requested rate. The minimum value is 1 and the maximum value is 60 (default
// 30). This function can only be called on the UI thread.
//
pub get_windowless_frame_rate: Option<extern "C" fn(
this: *mut cef_browser_host_t) -> libc::c_int>,
//
// Set the maximum rate in frames per second (fps) that cef_render_handler_t::
// OnPaint will be called for a windowless browser. The actual fps may be
// lower if the browser cannot generate frames at the requested rate. The
// minimum value is 1 and the maximum value is 60 (default 30). Can also be
// set at browser creation via cef_browser_tSettings.windowless_frame_rate.
//
pub set_windowless_frame_rate: Option<extern "C" fn(
this: *mut cef_browser_host_t, frame_rate: libc::c_int) -> ()>,
//
// Get the NSTextInputContext implementation for enabling IME on Mac when
// window rendering is disabled.
@ -1657,6 +1839,29 @@ impl CefBrowserHost {
}
}
//
// Print the current browser contents to the PDF file specified by |path| and
// execute |callback| on completion. The caller is responsible for deleting
// |path| when done. For PDF printing to work on Linux you must implement the
// cef_print_handler_t::GetPdfPaperSize function.
//
pub fn print_to_pdf(&self, path: &[u16],
settings: &interfaces::CefPdfPrintSettings,
callback: interfaces::CefPdfPrintCallback) -> () {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).print_to_pdf.unwrap())(
self.c_object,
CefWrap::to_c(path),
CefWrap::to_c(settings),
CefWrap::to_c(callback)))
}
}
//
// Search for |searchText|. |identifier| can be used to have multiple searches
// running simultaniously. |forward| indicates whether to search forward or
@ -2041,6 +2246,45 @@ impl CefBrowserHost {
}
}
//
// Returns the maximum rate in frames per second (fps) that
// cef_render_handler_t:: OnPaint will be called for a windowless browser. The
// actual fps may be lower if the browser cannot generate frames at the
// requested rate. The minimum value is 1 and the maximum value is 60 (default
// 30). This function can only be called on the UI thread.
//
pub fn get_windowless_frame_rate(&self) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).get_windowless_frame_rate.unwrap())(
self.c_object))
}
}
//
// Set the maximum rate in frames per second (fps) that cef_render_handler_t::
// OnPaint will be called for a windowless browser. The actual fps may be
// lower if the browser cannot generate frames at the requested rate. The
// minimum value is 1 and the maximum value is 60 (default 30). Can also be
// set at browser creation via cef_browser_tSettings.windowless_frame_rate.
//
pub fn set_windowless_frame_rate(&self, frame_rate: libc::c_int) -> () {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).set_windowless_frame_rate.unwrap())(
self.c_object,
CefWrap::to_c(frame_rate)))
}
}
//
// Get the NSTextInputContext implementation for enabling IME on Mac when
// window rendering is disabled.

View file

@ -58,10 +58,10 @@ pub struct _cef_cookie_manager_t {
pub base: types::cef_base_t,
//
// Set the schemes supported by this manager. By default only "http" and
// "https" schemes are supported. If |callback| is non-NULL it will be
// executed asnychronously on the IO thread after the change has been applied.
// Must be called before any cookies are accessed.
// Set the schemes supported by this manager. The default schemes ("http",
// "https", "ws" and "wss") will always be supported. If |callback| is non-
// NULL it will be executed asnychronously on the IO thread after the change
// has been applied. Must be called before any cookies are accessed.
//
pub set_supported_schemes: Option<extern "C" fn(
this: *mut cef_cookie_manager_t, schemes: &types::cef_string_list_t,
@ -222,10 +222,10 @@ impl CefCookieManager {
}
//
// Set the schemes supported by this manager. By default only "http" and
// "https" schemes are supported. If |callback| is non-NULL it will be
// executed asnychronously on the IO thread after the change has been applied.
// Must be called before any cookies are accessed.
// Set the schemes supported by this manager. The default schemes ("http",
// "https", "ws" and "wss") will always be supported. If |callback| is non-
// NULL it will be executed asnychronously on the IO thread after the change
// has been applied. Must be called before any cookies are accessed.
//
pub fn set_supported_schemes(&self, schemes: &Vec<String>,
callback: interfaces::CefCompletionCallback) -> () {

View file

@ -79,6 +79,17 @@ pub struct _cef_display_handler_t {
this: *mut cef_display_handler_t, browser: *mut interfaces::cef_browser_t,
icon_urls: &types::cef_string_list_t) -> ()>,
//
// Called when web content in the page has toggled fullscreen mode. If
// |fullscreen| is true (1) the content will automatically be sized to fill
// the browser content area. If |fullscreen| is false (0) the content will
// automatically return to its original size and position. The client is
// responsible for resizing the browser if desired.
//
pub on_fullscreen_mode_change: Option<extern "C" fn(
this: *mut cef_display_handler_t, browser: *mut interfaces::cef_browser_t,
fullscreen: libc::c_int) -> ()>,
//
// 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
@ -248,6 +259,28 @@ impl CefDisplayHandler {
}
}
//
// Called when web content in the page has toggled fullscreen mode. If
// |fullscreen| is true (1) the content will automatically be sized to fill
// the browser content area. If |fullscreen| is false (0) the content will
// automatically return to its original size and position. The client is
// responsible for resizing the browser if desired.
//
pub fn on_fullscreen_mode_change(&self, browser: interfaces::CefBrowser,
fullscreen: libc::c_int) -> () {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).on_fullscreen_mode_change.unwrap())(
self.c_object,
CefWrap::to_c(browser),
CefWrap::to_c(fullscreen)))
}
}
//
// 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

View file

@ -68,6 +68,18 @@ pub struct _cef_drag_handler_t {
dragData: *mut interfaces::cef_drag_data_t,
mask: types::cef_drag_operations_mask_t) -> libc::c_int>,
//
// Called whenever draggable regions for the browser window change. These can
// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
// draggable regions are never defined in a document this function will also
// never be called. If the last draggable region is removed from a document
// this function will be called with an NULL vector.
//
pub on_draggable_regions_changed: Option<extern "C" fn(
this: *mut cef_drag_handler_t, browser: *mut interfaces::cef_browser_t,
regions_count: libc::size_t,
regions: *const types::cef_draggable_region_t) -> ()>,
//
// The reference count. This will only be present for Rust instances!
//
@ -175,6 +187,30 @@ impl CefDragHandler {
CefWrap::to_c(mask)))
}
}
//
// Called whenever draggable regions for the browser window change. These can
// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
// draggable regions are never defined in a document this function will also
// never be called. If the last draggable region is removed from a document
// this function will be called with an NULL vector.
//
pub fn on_draggable_regions_changed(&self, browser: interfaces::CefBrowser,
regions_count: libc::size_t,
regions: *const types::cef_draggable_region_t) -> () {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).on_draggable_regions_changed.unwrap())(
self.c_object,
CefWrap::to_c(browser),
CefWrap::to_c(regions_count),
CefWrap::to_c(regions)))
}
}
}
impl CefWrap<*mut cef_drag_handler_t> for CefDragHandler {

View file

@ -105,14 +105,6 @@ pub struct _cef_navigation_entry_t {
pub has_post_data: Option<extern "C" fn(
this: *mut cef_navigation_entry_t) -> libc::c_int>,
//
// Returns the name of the sub-frame that navigated or an NULL value if the
// main frame navigated.
//
// The resulting string must be freed by calling cef_string_userfree_free().
pub get_frame_name: Option<extern "C" fn(
this: *mut cef_navigation_entry_t) -> types::cef_string_userfree_t>,
//
// Returns the time for the last known successful navigation completion. A
// navigation may be completed more than once if the page is reloaded. May be
@ -325,23 +317,6 @@ impl CefNavigationEntry {
}
}
//
// Returns the name of the sub-frame that navigated or an NULL value if the
// main frame navigated.
//
// The resulting string must be freed by calling cef_string_userfree_free().
pub fn get_frame_name(&self) -> String {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).get_frame_name.unwrap())(
self.c_object))
}
}
//
// Returns the time for the last known successful navigation completion. A
// navigation may be completed more than once if the page is reloaded. May be

View file

@ -41,3 +41,7 @@ use interfaces;
use types;
use wrappers::CefWrap;
use libc;
use std::collections::HashMap;
use std::mem;
use std::ptr;

View file

@ -41,3 +41,7 @@ use interfaces;
use types;
use wrappers::CefWrap;
use libc;
use std::collections::HashMap;
use std::mem;
use std::ptr;

View file

@ -41,3 +41,7 @@ use interfaces;
use types;
use wrappers::CefWrap;
use libc;
use std::collections::HashMap;
use std::mem;
use std::ptr;

View file

@ -396,6 +396,13 @@ pub struct _cef_print_handler_t {
pub on_print_reset: Option<extern "C" fn(this: *mut cef_print_handler_t) -> (
)>,
//
// Return the PDF paper size in device units. Used in combination with
// cef_browser_host_t::print_to_pdf().
//
pub get_pdf_paper_size: Option<extern "C" fn(this: *mut cef_print_handler_t,
device_units_per_inch: libc::c_int) -> types::cef_size_t>,
//
// The reference count. This will only be present for Rust instances!
//
@ -556,6 +563,24 @@ impl CefPrintHandler {
self.c_object))
}
}
//
// Return the PDF paper size in device units. Used in combination with
// cef_browser_host_t::print_to_pdf().
//
pub fn get_pdf_paper_size(&self,
device_units_per_inch: libc::c_int) -> types::cef_size_t {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
panic!("called a CEF method on a null object")
}
unsafe {
CefWrap::to_rust(
((*self.c_object).get_pdf_paper_size.unwrap())(
self.c_object,
CefWrap::to_c(device_units_per_inch)))
}
}
}
impl CefWrap<*mut cef_print_handler_t> for CefPrintHandler {

View file

@ -41,3 +41,7 @@ use interfaces;
use types;
use wrappers::CefWrap;
use libc;
use std::collections::HashMap;
use std::mem;
use std::ptr;

View file

@ -5,7 +5,7 @@
pub use interfaces::cef_app::{CefApp,cef_app_t,};
pub use interfaces::cef_auth_callback::{CefAuthCallback,cef_auth_callback_t,};
pub use interfaces::cef_browser_process_handler::{CefBrowserProcessHandler,cef_browser_process_handler_t,};
pub use interfaces::cef_browser::{CefBrowser,CefRunFileDialogCallback,CefNavigationEntryVisitor,CefBrowserHost,cef_browser_t,cef_run_file_dialog_callback_t,cef_navigation_entry_visitor_t,cef_browser_host_t,};
pub use interfaces::cef_browser::{CefBrowser,CefRunFileDialogCallback,CefNavigationEntryVisitor,CefPdfPrintCallback,CefBrowserHost,cef_browser_t,cef_run_file_dialog_callback_t,cef_navigation_entry_visitor_t,cef_pdf_print_callback_t,cef_browser_host_t,};
pub use interfaces::cef_callback::{CefCallback,CefCompletionCallback,cef_callback_t,cef_completion_callback_t,};
pub use interfaces::cef_client::{CefClient,cef_client_t,};
pub use interfaces::cef_command_line::{CefCommandLine,cef_command_line_t,};
@ -57,7 +57,7 @@ pub use interfaces::cef_values::{CefValue,CefBinaryValue,CefDictionaryValue,CefL
pub use interfaces::cef_web_plugin::{CefWebPluginInfo,CefWebPluginInfoVisitor,CefWebPluginUnstableCallback,cef_web_plugin_info_t,cef_web_plugin_info_visitor_t,cef_web_plugin_unstable_callback_t,};
pub use interfaces::cef_xml_reader::{CefXmlReader,cef_xml_reader_t,};
pub use interfaces::cef_zip_reader::{CefZipReader,cef_zip_reader_t,};
pub use types::{cef_window_handle_t,cef_cursor_handle_t,cef_string_t,cef_string_userfree_t,cef_string_utf8_t,cef_string_userfree_utf8_t,cef_string_utf16_t,cef_string_userfree_utf16_t,cef_string_wide_t,cef_string_userfree_wide_t,cef_main_args_t,cef_color_t,cef_mouse_event_t,CefMouseEvent,cef_key_event_t,CefKeyEvent,cef_point_t,CefValueType,CefProcessId,cef_settings_t,cef_base_t,CefBase,cef_window_info_t,CefWindowInfo,cef_time_t,cef_size_t,cef_page_range_t,cef_geoposition_t,CefGeoposition,cef_cookie_t,CefCookie,cef_popup_features_t,CefPopupFeatures,cef_screen_info_t,CefScreenInfo,cef_browser_settings_t,CefBrowserSettings,cef_cursor_info_t,CefCursorInfo,cef_request_context_settings_t,CefRequestContextSettings,cef_string_map_t,cef_string_multimap_t,cef_string_list_t,cef_text_input_context_t,cef_event_handle_t,cef_state_t,cef_thread_id_t,cef_navigation_type_t,cef_mouse_button_type_t,cef_postdataelement_type_t,cef_urlrequest_flags_t,cef_urlrequest_status_t,cef_errorcode_t,cef_key_event_type_t,cef_paint_element_type_t,cef_dom_document_type_t,cef_file_dialog_mode_t,cef_value_type_t,cef_process_id_t,cef_log_severity_t,cef_menu_item_type_t,cef_context_menu_type_flags_t,cef_context_menu_media_type_t,cef_context_menu_media_state_flags_t,cef_context_menu_edit_state_flags_t,cef_event_flags_t,cef_dom_event_phase_t,cef_dom_node_type_t,cef_focus_source_t,cef_jsdialog_type_t,cef_duplex_mode_t,cef_color_model_t,cef_resource_type_t,cef_transition_type_t,cef_termination_status_t,cef_v8_accesscontrol_t,cef_v8_propertyattribute_t,cef_xml_node_type_t,cef_geoposition_error_code_t,cef_drag_operations_mask_t,cef_xml_encoding_type_t,cef_window_open_disposition_t,cef_cursor_type_t,cef_return_value_t,};
pub use types::{cef_string_map_t,cef_string_multimap_t,cef_string_list_t,cef_window_handle_t,cef_cursor_handle_t,cef_string_t,cef_string_userfree_t,cef_string_utf8_t,cef_string_userfree_utf8_t,cef_string_utf16_t,cef_string_userfree_utf16_t,cef_string_wide_t,cef_string_userfree_wide_t,cef_main_args_t,cef_color_t,cef_mouse_event_t,CefMouseEvent,cef_errorcode_t,cef_key_event_t,CefKeyEvent,cef_point_t,cef_draggable_region_t,CefValueType,CefProcessId,cef_settings_t,cef_base_t,CefBase,cef_window_info_t,CefWindowInfo,cef_time_t,cef_size_t,cef_page_range_t,cef_geoposition_t,CefGeoposition,cef_cookie_t,CefCookie,cef_popup_features_t,CefPopupFeatures,cef_screen_info_t,CefScreenInfo,cef_browser_settings_t,CefBrowserSettings,cef_cursor_info_t,CefCursorInfo,cef_request_context_settings_t,CefRequestContextSettings,cef_pdf_print_settings_t,CefPdfPrintSettings,cef_text_input_context_t,cef_event_handle_t,cef_json_parser_error_t,cef_state_t,cef_thread_id_t,cef_navigation_type_t,cef_mouse_button_type_t,cef_postdataelement_type_t,cef_urlrequest_flags_t,cef_urlrequest_status_t,cef_key_event_type_t,cef_paint_element_type_t,cef_dom_document_type_t,cef_file_dialog_mode_t,cef_value_type_t,cef_process_id_t,cef_log_severity_t,cef_menu_item_type_t,cef_context_menu_type_flags_t,cef_context_menu_media_type_t,cef_context_menu_media_state_flags_t,cef_context_menu_edit_state_flags_t,cef_event_flags_t,cef_dom_event_phase_t,cef_dom_node_type_t,cef_focus_source_t,cef_jsdialog_type_t,cef_duplex_mode_t,cef_color_model_t,cef_resource_type_t,cef_transition_type_t,cef_termination_status_t,cef_v8_accesscontrol_t,cef_v8_propertyattribute_t,cef_xml_node_type_t,cef_geoposition_error_code_t,cef_drag_operations_mask_t,cef_xml_encoding_type_t,cef_window_open_disposition_t,cef_cursor_type_t,cef_return_value_t,cef_pdf_print_margin_type_t,};

View file

@ -6,11 +6,11 @@
setopt extended_glob
echo -e $(cat << END_MPL
/* This Source Code Form is subject to the terms of the Mozilla Public\n
* License, v. 2.0. If a copy of the MPL was not distributed with this\n
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n
END_MPL) >>| interfaces_mod.rs
echo \
"/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
" >>| interfaces_mod.rs
# loop all files in interfaces dir
for x in $(print interfaces/*.rs~interfaces/mod.rs)

View file

@ -69,6 +69,19 @@ pub struct cef_main_args {
pub type cef_color_t = c_uint;
pub enum cef_json_parser_error_t {
JSON_NO_ERROR = 0,
JSON_INVALID_ESCAPE,
JSON_SYNTAX_ERROR,
JSON_UNEXPECTED_TOKEN,
JSON_TRAILING_COMMA,
JSON_TOO_MUCH_NESTING,
JSON_UNEXPECTED_DATA_AFTER_ROOT,
JSON_UNSUPPORTED_ENCODING,
JSON_UNQUOTED_DICTIONARY_KEY,
JSON_PARSE_ERROR_COUNT
}
///
// Represents the state of a setting.
///
@ -379,6 +392,22 @@ impl cef_rect {
}
}
pub type cef_draggable_region_t = cef_draggable_region;
///
// Structure representing a draggable region.
///
pub struct cef_draggable_region {
///
// Bounds of the region.
///
pub bounds: cef_rect_t,
///
// True (1) this this region is draggable and false (0) otherwise.
///
pub draggable: i32
}
//
// Paint element types.
//
@ -1915,3 +1944,90 @@ pub struct _cef_request_context_settings {
pub type cef_request_context_settings_t = _cef_request_context_settings;
pub type CefRequestContextSettings = cef_request_context_settings_t;
///
// Margin type for PDF printing.
///
pub enum cef_pdf_print_margin_type_t {
///
// Default margins.
///
PDF_PRINT_MARGIN_DEFAULT = 0,
///
// No margins.
///
PDF_PRINT_MARGIN_NONE,
///
// Minimum margins.
///
PDF_PRINT_MARGIN_MINIMUM,
///
// Custom margins using the |margin_*| values from cef_pdf_print_settings_t.
///
PDF_PRINT_MARGIN_CUSTOM,
}
///
// Structure representing PDF print settings.
///
pub struct cef_pdf_print_settings {
///
// Page title to display in the header. Only used if |header_footer_enabled|
// is set to true (1).
///
pub header_footer_title: cef_string_t,
///
// URL to display in the footer. Only used if |header_footer_enabled| is set
// to true (1).
///
pub header_footer_url: cef_string_t,
///
// Output page size in microns. If either of these values is less than or
// equal to zero then the default paper size (A4) will be used.
///
pub page_width: i32,
pub page_height: i32,
///
// Margins in millimeters. Only used if |margin_type| is set to
// PDF_PRINT_MARGIN_CUSTOM.
///
pub margin_top: f64,
pub margin_right: f64,
pub margin_bottom: f64,
pub margin_left: f64,
///
// Margin type.
///
pub margin_type: cef_pdf_print_margin_type_t,
///
// Set to true (1) to print headers and footers or false (0) to not print
// headers and footers.
///
pub header_footer_enabled: i32,
///
// Set to true (1) to print the selection only or false (0) to print all.
///
pub selection_only: i32,
///
// Set to true (1) for landscape mode or false (0) for portrait mode.
///
pub landscape: i32,
///
// Set to true (1) to print background graphics or false (0) to not print
// background graphics.
///
pub backgrounds_enabled: i32,
}
pub type cef_pdf_print_settings_t = cef_pdf_print_settings;
pub type CefPdfPrintSettings = cef_pdf_print_settings;

View file

@ -14,7 +14,7 @@ use types::{cef_context_menu_edit_state_flags_t};
use types::{cef_context_menu_media_state_flags_t};
use types::{cef_context_menu_media_type_t, cef_context_menu_type_flags_t, cef_cookie_t, cef_cursor_info_t, CefCursorInfo, cef_cursor_type_t};
use types::{cef_dom_document_type_t, cef_dom_node_type_t};
use types::{cef_drag_operations_mask_t, cef_duplex_mode_t};
use types::{cef_drag_operations_mask_t, cef_draggable_region_t, cef_duplex_mode_t};
use types::{cef_errorcode_t, cef_event_flags_t, cef_event_handle_t};
use types::{cef_file_dialog_mode_t, cef_focus_source_t};
use types::{cef_geoposition_t};
@ -23,6 +23,7 @@ use types::{cef_key_event};
use types::{cef_menu_item_type_t, cef_mouse_button_type_t};
use types::{cef_mouse_event, cef_navigation_type_t};
use types::{cef_page_range_t, cef_paint_element_type_t, cef_point_t, cef_postdataelement_type_t};
use types::{cef_pdf_print_settings_t};
use types::{cef_popup_features_t, cef_process_id_t};
use types::{cef_rect_t, cef_request_context_settings_t, CefRequestContextSettings};
use types::{cef_resource_type_t, cef_return_value_t};
@ -102,10 +103,12 @@ cef_pointer_wrapper!(cef_base_t);
cef_pointer_wrapper!(cef_browser_settings_t);
cef_pointer_wrapper!(cef_cookie_t);
cef_pointer_wrapper!(cef_cursor_info_t);
cef_pointer_wrapper!(cef_draggable_region_t);
cef_pointer_wrapper!(cef_geoposition_t);
cef_pointer_wrapper!(cef_key_event);
cef_pointer_wrapper!(cef_mouse_event);
cef_pointer_wrapper!(cef_page_range_t);
cef_pointer_wrapper!(cef_pdf_print_settings_t);
cef_pointer_wrapper!(cef_point_t);
cef_pointer_wrapper!(cef_popup_features_t);
cef_pointer_wrapper!(cef_rect_t);
@ -167,6 +170,7 @@ cef_noop_wrapper!(cef_postdataelement_type_t);
cef_noop_wrapper!(cef_process_id_t);
cef_noop_wrapper!(cef_resource_type_t);
cef_noop_wrapper!(cef_return_value_t);
cef_noop_wrapper!(cef_size_t);
cef_noop_wrapper!(cef_termination_status_t);
cef_noop_wrapper!(cef_text_input_context_t);
cef_noop_wrapper!(cef_thread_id_t);