1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::{ColorChooser, Orientation};
use gdk::RGBA;
use glib::object::IsA;
use glib::translate::*;
use libc::c_int;
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
pub trait ColorChooserExtManual: 'static {
#[doc(alias = "gtk_color_chooser_add_palette")]
fn add_palette(&self, orientation: Orientation, colors_per_line: i32, colors: &[RGBA]);
}
impl<O: IsA<ColorChooser>> ColorChooserExtManual for O {
fn add_palette(&self, orientation: Orientation, colors_per_line: i32, colors: &[RGBA]) {
unsafe {
ffi::gtk_color_chooser_add_palette(
self.as_ref().to_glib_none().0,
orientation.into_glib(),
colors_per_line,
colors.len() as c_int,
if colors.is_empty() {
std::ptr::null_mut()
} else {
colors.as_ptr() as *mut gdk::ffi::GdkRGBA
},
)
}
}
}