1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::translate::*;

use crate::{PageRange, PrintSettings};

impl PrintSettings {
    /// Sets the value of [`PRINT_SETTINGS_PAGE_RANGES`][crate::PRINT_SETTINGS_PAGE_RANGES].
    /// ## `page_ranges`
    /// an array of [`PageRange`][crate::PageRange]s
    #[doc(alias = "gtk_print_settings_set_page_ranges")]
    pub fn set_page_ranges(&self, page_ranges: &[PageRange]) {
        let num_ranges = page_ranges.len() as i32;
        unsafe {
            ffi::gtk_print_settings_set_page_ranges(
                self.to_glib_none().0,
                mut_override(page_ranges.to_glib_none().0),
                num_ranges,
            );
        }
    }
}