// GENERATED — DO NOT EDIT
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/iface.Paintable.html).
pub type Paintable
///|
pub(open) trait IPaintable {
fn as_paintable(Self) -> Paintable
fn compute_concrete_size(Self, Double, Double, Double, Double) -> (
Double,
Double,
) = _
fn get_current_image(Self) -> Paintable = _
fn get_flags(Self) -> PaintableFlags = _
fn get_intrinsic_aspect_ratio(Self) -> Double = _
fn get_intrinsic_height(Self) -> Int = _
fn get_intrinsic_width(Self) -> Int = _
fn invalidate_contents(Self) -> Unit = _
fn invalidate_size(Self) -> Unit = _
fn snapshot(Self, &ISnapshot, Double, Double) -> Unit = _
}
///|
pub impl IPaintable for Paintable with fn as_paintable(self) {
self
}
///|
/// Implementation contract for Paintable.snapshot. Self is the retained MoonBit state; the second parameter is the invoked Paintable object.
pub(open) trait VPaintableSnapshot {
fn snapshot(Self, Paintable, &ISnapshot, Double, Double) -> Unit
}
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/type_func.Paintable.new_empty.html).
pub extern "c" fn Paintable::new_empty(
intrinsic_width : Int,
intrinsic_height : Int,
) -> Paintable = "moonbit_gdk_paintable_new_empty"
///|
#borrow(self_, concrete_width, concrete_height)
extern "c" fn moonbit_gdk_paintable_compute_concrete_size(
self_ : Paintable,
specified_width : Double,
specified_height : Double,
default_width : Double,
default_height : Double,
concrete_width : Ref[Double],
concrete_height : Ref[Double],
) = "moonbit_gdk_paintable_compute_concrete_size"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.compute_concrete_size.html).
pub fn Paintable::compute_concrete_size(
self : Paintable,
specified_width : Double,
specified_height : Double,
default_width : Double,
default_height : Double,
) -> (Double, Double) {
let concrete_width = Ref(0.0)
let concrete_height = Ref(0.0)
moonbit_gdk_paintable_compute_concrete_size(
self, specified_width, specified_height, default_width, default_height, concrete_width,
concrete_height,
)
(concrete_width.val, concrete_height.val)
}
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.get_current_image.html).
#borrow(self)
pub extern "c" fn Paintable::get_current_image(self : Paintable) -> Paintable = "moonbit_gdk_paintable_get_current_image"
///|
#borrow(self_)
extern "c" fn moonbit_gdk_paintable_get_flags(self_ : Paintable) -> Int = "moonbit_gdk_paintable_get_flags"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.get_flags.html).
pub fn Paintable::get_flags(self : Paintable) -> PaintableFlags {
PaintableFlags::from_int(moonbit_gdk_paintable_get_flags(self))
}
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.get_intrinsic_aspect_ratio.html).
#borrow(self)
pub extern "c" fn Paintable::get_intrinsic_aspect_ratio(
self : Paintable,
) -> Double = "moonbit_gdk_paintable_get_intrinsic_aspect_ratio"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.get_intrinsic_height.html).
#borrow(self)
pub extern "c" fn Paintable::get_intrinsic_height(self : Paintable) -> Int = "moonbit_gdk_paintable_get_intrinsic_height"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.get_intrinsic_width.html).
#borrow(self)
pub extern "c" fn Paintable::get_intrinsic_width(self : Paintable) -> Int = "moonbit_gdk_paintable_get_intrinsic_width"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.invalidate_contents.html).
#borrow(self)
pub extern "c" fn Paintable::invalidate_contents(self : Paintable) = "moonbit_gdk_paintable_invalidate_contents"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.invalidate_size.html).
#borrow(self)
pub extern "c" fn Paintable::invalidate_size(self : Paintable) = "moonbit_gdk_paintable_invalidate_size"
///|
#borrow(self_, snapshot)
extern "c" fn moonbit_gdk_paintable_snapshot(
self_ : Paintable,
snapshot : Snapshot,
width : Double,
height : Double,
) = "moonbit_gdk_paintable_snapshot"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Paintable.snapshot.html).
pub fn Paintable::snapshot(
self : Paintable,
snapshot : &ISnapshot,
width : Double,
height : Double,
) -> Unit {
moonbit_gdk_paintable_snapshot(self, snapshot.as_snapshot(), width, height)
}
///|
impl IPaintable with fn compute_concrete_size(
self,
specified_width,
specified_height,
default_width,
default_height,
) -> (Double, Double) {
self
.as_paintable()
.compute_concrete_size(
specified_width, specified_height, default_width, default_height,
)
}
///|
impl IPaintable with fn get_current_image(self) -> Paintable {
self.as_paintable().get_current_image()
}
///|
impl IPaintable with fn get_flags(self) -> PaintableFlags {
self.as_paintable().get_flags()
}
///|
impl IPaintable with fn get_intrinsic_aspect_ratio(self) -> Double {
self.as_paintable().get_intrinsic_aspect_ratio()
}
///|
impl IPaintable with fn get_intrinsic_height(self) -> Int {
self.as_paintable().get_intrinsic_height()
}
///|
impl IPaintable with fn get_intrinsic_width(self) -> Int {
self.as_paintable().get_intrinsic_width()
}
///|
impl IPaintable with fn invalidate_contents(self) -> Unit {
self.as_paintable().invalidate_contents()
}
///|
impl IPaintable with fn invalidate_size(self) -> Unit {
self.as_paintable().invalidate_size()
}
///|
impl IPaintable with fn snapshot(self, snapshot, width, height) -> Unit {
self.as_paintable().snapshot(snapshot, width, height)
}