mirror of
https://github.com/servo/servo.git
synced 2025-08-25 23:28:21 +01:00
update cef interfaces from upstream
This commit is contained in:
parent
f749fe4125
commit
5f9aac6c1a
11 changed files with 364 additions and 35 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue