diff --git a/ports/cef/interfaces/mod.rs b/ports/cef/interfaces/mod.rs index 7efeacc13d4..f07ed203e9b 100644 --- a/ports/cef/interfaces/mod.rs +++ b/ports/cef/interfaces/mod.rs @@ -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_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,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_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_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,}; diff --git a/ports/cef/types.rs b/ports/cef/types.rs index 2c9ba1852ef..60c3e6beb56 100644 --- a/ports/cef/types.rs +++ b/ports/cef/types.rs @@ -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; diff --git a/ports/cef/wrappers.rs b/ports/cef/wrappers.rs index 5c036c99787..165163f3dc9 100644 --- a/ports/cef/wrappers.rs +++ b/ports/cef/wrappers.rs @@ -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);