use crate::ffi;
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::boxed::Box as Box_;
glib::wrapper! {
#[doc(alias = "GeglConfig")]
pub struct Config(Object<ffi::GeglConfig>);
match fn {
type_ => || ffi::gegl_config_get_type(),
}
}
impl Config {
#[doc(alias = "application-license")]
pub fn application_license(&self) -> Option<glib::GString> {
ObjectExt::property(self, "application-license")
}
#[doc(alias = "application-license")]
pub fn set_application_license(&self, application_license: Option<&str>) {
ObjectExt::set_property(self, "application-license", application_license)
}
#[doc(alias = "chunk-size")]
pub fn chunk_size(&self) -> i32 {
ObjectExt::property(self, "chunk-size")
}
#[doc(alias = "chunk-size")]
pub fn set_chunk_size(&self, chunk_size: i32) {
ObjectExt::set_property(self, "chunk-size", chunk_size)
}
#[doc(alias = "mipmap-rendering")]
pub fn is_mipmap_rendering(&self) -> bool {
ObjectExt::property(self, "mipmap-rendering")
}
#[doc(alias = "mipmap-rendering")]
pub fn set_mipmap_rendering(&self, mipmap_rendering: bool) {
ObjectExt::set_property(self, "mipmap-rendering", mipmap_rendering)
}
pub fn quality(&self) -> f64 {
ObjectExt::property(self, "quality")
}
pub fn set_quality(&self, quality: f64) {
ObjectExt::set_property(self, "quality", quality)
}
#[doc(alias = "queue-size")]
pub fn queue_size(&self) -> i32 {
ObjectExt::property(self, "queue-size")
}
#[doc(alias = "queue-size")]
pub fn set_queue_size(&self, queue_size: i32) {
ObjectExt::set_property(self, "queue-size", queue_size)
}
pub fn swap(&self) -> Option<glib::GString> {
ObjectExt::property(self, "swap")
}
pub fn set_swap(&self, swap: Option<&str>) {
ObjectExt::set_property(self, "swap", swap)
}
#[doc(alias = "swap-compression")]
pub fn swap_compression(&self) -> Option<glib::GString> {
ObjectExt::property(self, "swap-compression")
}
#[doc(alias = "swap-compression")]
pub fn set_swap_compression(&self, swap_compression: Option<&str>) {
ObjectExt::set_property(self, "swap-compression", swap_compression)
}
pub fn threads(&self) -> i32 {
ObjectExt::property(self, "threads")
}
pub fn set_threads(&self, threads: i32) {
ObjectExt::set_property(self, "threads", threads)
}
#[doc(alias = "tile-cache-size")]
pub fn tile_cache_size(&self) -> u64 {
ObjectExt::property(self, "tile-cache-size")
}
#[doc(alias = "tile-cache-size")]
pub fn set_tile_cache_size(&self, tile_cache_size: u64) {
ObjectExt::set_property(self, "tile-cache-size", tile_cache_size)
}
#[doc(alias = "tile-height")]
pub fn tile_height(&self) -> i32 {
ObjectExt::property(self, "tile-height")
}
#[doc(alias = "tile-height")]
pub fn set_tile_height(&self, tile_height: i32) {
ObjectExt::set_property(self, "tile-height", tile_height)
}
#[doc(alias = "tile-width")]
pub fn tile_width(&self) -> i32 {
ObjectExt::property(self, "tile-width")
}
#[doc(alias = "tile-width")]
pub fn set_tile_width(&self, tile_width: i32) {
ObjectExt::set_property(self, "tile-width", tile_width)
}
#[doc(alias = "use-opencl")]
pub fn uses_opencl(&self) -> bool {
ObjectExt::property(self, "use-opencl")
}
#[doc(alias = "use-opencl")]
pub fn set_use_opencl(&self, use_opencl: bool) {
ObjectExt::set_property(self, "use-opencl", use_opencl)
}
#[doc(alias = "application-license")]
pub fn connect_application_license_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_application_license_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::application-license\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_application_license_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "chunk-size")]
pub fn connect_chunk_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_chunk_size_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::chunk-size\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_chunk_size_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "mipmap-rendering")]
pub fn connect_mipmap_rendering_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_mipmap_rendering_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::mipmap-rendering\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_mipmap_rendering_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "quality")]
pub fn connect_quality_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_quality_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::quality\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_quality_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "queue-size")]
pub fn connect_queue_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_queue_size_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::queue-size\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_queue_size_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "swap")]
pub fn connect_swap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_swap_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::swap\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_swap_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "swap-compression")]
pub fn connect_swap_compression_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_swap_compression_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::swap-compression\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_swap_compression_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "threads")]
pub fn connect_threads_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_threads_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::threads\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_threads_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "tile-cache-size")]
pub fn connect_tile_cache_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_tile_cache_size_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::tile-cache-size\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_tile_cache_size_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "tile-height")]
pub fn connect_tile_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_tile_height_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::tile-height\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_tile_height_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "tile-width")]
pub fn connect_tile_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_tile_width_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::tile-width\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_tile_width_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "use-opencl")]
pub fn connect_use_opencl_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_use_opencl_trampoline<F: Fn(&Config) + 'static>(
this: *mut ffi::GeglConfig,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::use-opencl\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_use_opencl_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}