// GENERATED — DO NOT EDIT
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/class.Picture.html).
pub type Picture
///|
pub(open) trait IPicture {
fn as_picture(Self) -> Picture
fn get_alternative_text(Self) -> String? = _
fn get_can_shrink(Self) -> Bool = _
fn get_content_fit(Self) -> ContentFit = _
fn get_file(Self) -> @gio.File? = _
fn get_isolate_contents(Self) -> Bool = _
fn get_paintable(Self) -> @gdk.Paintable? = _
fn set_alternative_text(Self, String?) -> Unit = _
fn set_can_shrink(Self, Bool) -> Unit = _
fn set_content_fit(Self, ContentFit) -> Unit = _
fn set_file(Self, &@gio.IFile?) -> Unit = _
fn set_filename(Self, String?) -> Unit = _
fn set_isolate_contents(Self, Bool) -> Unit = _
fn set_paintable(Self, &@gdk.IPaintable?) -> Unit = _
fn set_resource(Self, String?) -> Unit = _
}
///|
pub impl IPicture for Picture with fn as_picture(self) {
self
}
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.Picture.new.html).
pub extern "c" fn Picture::new() -> Picture = "moonbit_gtk_picture_new"
///|
#borrow(file)
extern "c" fn moonbit_gtk_picture_new_for_file(
file : @glib.Nullable[@gio.File],
) -> Picture = "moonbit_gtk_picture_new_for_file"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.Picture.new_for_file.html).
pub fn Picture::new_for_file(file : &@gio.IFile?) -> Picture {
moonbit_gtk_picture_new_for_file(
match file {
Some(v) => @glib.Nullable::some(v.as_file())
None => @glib.Nullable::null()
},
)
}
///|
#borrow(filename)
extern "c" fn moonbit_gtk_picture_new_for_filename(
filename : @glib.Nullable[Bytes],
) -> Picture = "moonbit_gtk_picture_new_for_filename"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.Picture.new_for_filename.html).
pub fn Picture::new_for_filename(filename : String?) -> Picture {
moonbit_gtk_picture_new_for_filename(
match filename {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
)
}
///|
#borrow(paintable)
extern "c" fn moonbit_gtk_picture_new_for_paintable(
paintable : @glib.Nullable[@gdk.Paintable],
) -> Picture = "moonbit_gtk_picture_new_for_paintable"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.Picture.new_for_paintable.html).
pub fn Picture::new_for_paintable(paintable : &@gdk.IPaintable?) -> Picture {
moonbit_gtk_picture_new_for_paintable(
match paintable {
Some(v) => @glib.Nullable::some(v.as_paintable())
None => @glib.Nullable::null()
},
)
}
///|
#borrow(resource_path)
extern "c" fn moonbit_gtk_picture_new_for_resource(
resource_path : @glib.Nullable[Bytes],
) -> Picture = "moonbit_gtk_picture_new_for_resource"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.Picture.new_for_resource.html).
pub fn Picture::new_for_resource(resource_path : String?) -> Picture {
moonbit_gtk_picture_new_for_resource(
match resource_path {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
)
}
///|
#borrow(self_)
extern "c" fn moonbit_gtk_picture_get_alternative_text(
self_ : Picture,
) -> @glib.Nullable[Bytes] = "moonbit_gtk_picture_get_alternative_text"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.get_alternative_text.html).
pub fn Picture::get_alternative_text(self : Picture) -> String? {
let result = moonbit_gtk_picture_get_alternative_text(self)
match result.to_option() {
Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
None => None
}
}
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.get_can_shrink.html).
#borrow(self)
pub extern "c" fn Picture::get_can_shrink(self : Picture) -> Bool = "moonbit_gtk_picture_get_can_shrink"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.get_content_fit.html).
#borrow(self)
pub extern "c" fn Picture::get_content_fit(self : Picture) -> ContentFit = "moonbit_gtk_picture_get_content_fit"
///|
#borrow(self_)
extern "c" fn moonbit_gtk_picture_get_file(
self_ : Picture,
) -> @glib.Nullable[@gio.File] = "moonbit_gtk_picture_get_file"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.get_file.html).
pub fn Picture::get_file(self : Picture) -> @gio.File? {
let raw_result = moonbit_gtk_picture_get_file(self)
raw_result.to_option()
}
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.get_isolate_contents.html).
#borrow(self)
pub extern "c" fn Picture::get_isolate_contents(self : Picture) -> Bool = "moonbit_gtk_picture_get_isolate_contents"
///|
#borrow(self_)
extern "c" fn moonbit_gtk_picture_get_paintable(
self_ : Picture,
) -> @glib.Nullable[@gdk.Paintable] = "moonbit_gtk_picture_get_paintable"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.get_paintable.html).
pub fn Picture::get_paintable(self : Picture) -> @gdk.Paintable? {
let raw_result = moonbit_gtk_picture_get_paintable(self)
raw_result.to_option()
}
///|
#borrow(self_, alternative_text)
extern "c" fn moonbit_gtk_picture_set_alternative_text(
self_ : Picture,
alternative_text : @glib.Nullable[Bytes],
) = "moonbit_gtk_picture_set_alternative_text"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_alternative_text.html).
pub fn Picture::set_alternative_text(
self : Picture,
alternative_text : String?,
) -> Unit {
moonbit_gtk_picture_set_alternative_text(
self,
match alternative_text {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
)
}
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_can_shrink.html).
#borrow(self)
pub extern "c" fn Picture::set_can_shrink(self : Picture, can_shrink : Bool) = "moonbit_gtk_picture_set_can_shrink"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_content_fit.html).
#borrow(self)
pub extern "c" fn Picture::set_content_fit(
self : Picture,
content_fit : ContentFit,
) = "moonbit_gtk_picture_set_content_fit"
///|
#borrow(self_, file)
extern "c" fn moonbit_gtk_picture_set_file(
self_ : Picture,
file : @glib.Nullable[@gio.File],
) = "moonbit_gtk_picture_set_file"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_file.html).
pub fn Picture::set_file(self : Picture, file : &@gio.IFile?) -> Unit {
moonbit_gtk_picture_set_file(
self,
match file {
Some(v) => @glib.Nullable::some(v.as_file())
None => @glib.Nullable::null()
},
)
}
///|
#borrow(self_, filename)
extern "c" fn moonbit_gtk_picture_set_filename(
self_ : Picture,
filename : @glib.Nullable[Bytes],
) = "moonbit_gtk_picture_set_filename"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_filename.html).
pub fn Picture::set_filename(self : Picture, filename : String?) -> Unit {
moonbit_gtk_picture_set_filename(
self,
match filename {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
)
}
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_isolate_contents.html).
#borrow(self)
pub extern "c" fn Picture::set_isolate_contents(
self : Picture,
isolate_contents : Bool,
) = "moonbit_gtk_picture_set_isolate_contents"
///|
#borrow(self_, paintable)
extern "c" fn moonbit_gtk_picture_set_paintable(
self_ : Picture,
paintable : @glib.Nullable[@gdk.Paintable],
) = "moonbit_gtk_picture_set_paintable"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_paintable.html).
pub fn Picture::set_paintable(
self : Picture,
paintable : &@gdk.IPaintable?,
) -> Unit {
moonbit_gtk_picture_set_paintable(
self,
match paintable {
Some(v) => @glib.Nullable::some(v.as_paintable())
None => @glib.Nullable::null()
},
)
}
///|
#borrow(self_, resource_path)
extern "c" fn moonbit_gtk_picture_set_resource(
self_ : Picture,
resource_path : @glib.Nullable[Bytes],
) = "moonbit_gtk_picture_set_resource"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Picture.set_resource.html).
pub fn Picture::set_resource(self : Picture, resource_path : String?) -> Unit {
moonbit_gtk_picture_set_resource(
self,
match resource_path {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
)
}
///|
impl IPicture with fn get_alternative_text(self) -> String? {
self.as_picture().get_alternative_text()
}
///|
impl IPicture with fn get_can_shrink(self) -> Bool {
self.as_picture().get_can_shrink()
}
///|
impl IPicture with fn get_content_fit(self) -> ContentFit {
self.as_picture().get_content_fit()
}
///|
impl IPicture with fn get_file(self) -> @gio.File? {
self.as_picture().get_file()
}
///|
impl IPicture with fn get_isolate_contents(self) -> Bool {
self.as_picture().get_isolate_contents()
}
///|
impl IPicture with fn get_paintable(self) -> @gdk.Paintable? {
self.as_picture().get_paintable()
}
///|
impl IPicture with fn set_alternative_text(self, alternative_text) -> Unit {
self.as_picture().set_alternative_text(alternative_text)
}
///|
impl IPicture with fn set_can_shrink(self, can_shrink) -> Unit {
self.as_picture().set_can_shrink(can_shrink)
}
///|
impl IPicture with fn set_content_fit(self, content_fit) -> Unit {
self.as_picture().set_content_fit(content_fit)
}
///|
impl IPicture with fn set_file(self, file) -> Unit {
self.as_picture().set_file(file)
}
///|
impl IPicture with fn set_filename(self, filename) -> Unit {
self.as_picture().set_filename(filename)
}
///|
impl IPicture with fn set_isolate_contents(self, isolate_contents) -> Unit {
self.as_picture().set_isolate_contents(isolate_contents)
}
///|
impl IPicture with fn set_paintable(self, paintable) -> Unit {
self.as_picture().set_paintable(paintable)
}
///|
impl IPicture with fn set_resource(self, resource_path) -> Unit {
self.as_picture().set_resource(resource_path)
}
///|
pub fn Picture::as_widget(self : Picture) -> Widget = "%identity"
///|
pub impl IWidget for Picture with fn as_widget(self) {
self.as_widget()
}
///|
pub fn Picture::as_gobject_object(self : Picture) -> @gobject.Object = "%identity"
///|
pub impl @gobject.IObject for Picture with fn as_object(self) {
self.as_gobject_object()
}