// GENERATED — DO NOT EDIT
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/class.Display.html).
pub type Display
///|
pub(open) trait IDisplay {
fn as_display(Self) -> Display
fn beep(Self) -> Unit = _
fn close(Self) -> Unit = _
fn create_gl_context(Self) -> GLContext raise @glib.Error_ = _
fn device_is_grabbed(Self, &IDevice) -> Bool = _
fn flush(Self) -> Unit = _
fn get_clipboard(Self) -> Clipboard = _
fn get_monitor_at_surface(Self, &ISurface) -> Monitor? = _
fn get_name(Self) -> String = _
fn get_primary_clipboard(Self) -> Clipboard = _
fn is_closed(Self) -> Bool = _
fn is_composited(Self) -> Bool = _
fn is_rgba(Self) -> Bool = _
fn prepare_gl(Self) -> Bool raise @glib.Error_ = _
fn supports_input_shapes(Self) -> Bool = _
fn supports_shadow_width(Self) -> Bool = _
fn sync(Self) -> Unit = _
fn translate_key(Self, UInt, ModifierType, Int) -> (
Bool,
UInt,
Int,
Int,
ModifierType,
) = _
fn connect_closed(Self, (Display, Bool) -> Unit) -> UInt64 = _
fn connect_opened(Self, (Display) -> Unit) -> UInt64 = _
fn connect_setting_changed(Self, (Display, String) -> Unit) -> UInt64 = _
}
///|
pub impl IDisplay for Display with fn as_display(self) {
self
}
///|
extern "c" fn moonbit_gdk_display_get_default() -> @glib.Nullable[Display] = "moonbit_gdk_display_get_default"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/type_func.Display.get_default.html).
pub fn Display::get_default() -> Display? {
let raw_result = moonbit_gdk_display_get_default()
raw_result.to_option()
}
///|
#borrow(display_name)
extern "c" fn moonbit_gdk_display_open(
display_name : @glib.Nullable[Bytes],
) -> @glib.Nullable[Display] = "moonbit_gdk_display_open"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/type_func.Display.open.html).
pub fn Display::open(display_name : String?) -> Display? {
let raw_result = moonbit_gdk_display_open(
match display_name {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
)
raw_result.to_option()
}
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.beep.html).
#borrow(self)
pub extern "c" fn Display::beep(self : Display) = "moonbit_gdk_display_beep"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.close.html).
#borrow(self)
pub extern "c" fn Display::close(self : Display) = "moonbit_gdk_display_close"
///|
#borrow(self_, error)
extern "c" fn moonbit_gdk_display_create_gl_context(
self_ : Display,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> GLContext = "moonbit_gdk_display_create_gl_context"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.create_gl_context.html).
pub fn Display::create_gl_context(
self : Display,
) -> GLContext raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_gdk_display_create_gl_context(self, error_)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
#borrow(self_, device)
extern "c" fn moonbit_gdk_display_device_is_grabbed(
self_ : Display,
device : Device,
) -> Bool = "moonbit_gdk_display_device_is_grabbed"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.device_is_grabbed.html).
pub fn Display::device_is_grabbed(self : Display, device : &IDevice) -> Bool {
moonbit_gdk_display_device_is_grabbed(self, device.as_device())
}
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.flush.html).
#borrow(self)
pub extern "c" fn Display::flush(self : Display) = "moonbit_gdk_display_flush"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.get_clipboard.html).
#borrow(self)
pub extern "c" fn Display::get_clipboard(self : Display) -> Clipboard = "moonbit_gdk_display_get_clipboard"
///|
#borrow(self_, surface)
extern "c" fn moonbit_gdk_display_get_monitor_at_surface(
self_ : Display,
surface : Surface,
) -> @glib.Nullable[Monitor] = "moonbit_gdk_display_get_monitor_at_surface"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.get_monitor_at_surface.html).
pub fn Display::get_monitor_at_surface(
self : Display,
surface : &ISurface,
) -> Monitor? {
let raw_result = moonbit_gdk_display_get_monitor_at_surface(
self,
surface.as_surface(),
)
raw_result.to_option()
}
///|
#borrow(self_)
extern "c" fn moonbit_gdk_display_get_name(self_ : Display) -> Bytes = "moonbit_gdk_display_get_name"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.get_name.html).
pub fn Display::get_name(self : Display) -> String {
@encoding/utf8.decode_lossy(moonbit_gdk_display_get_name(self))
}
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.get_primary_clipboard.html).
#borrow(self)
pub extern "c" fn Display::get_primary_clipboard(self : Display) -> Clipboard = "moonbit_gdk_display_get_primary_clipboard"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.is_closed.html).
#borrow(self)
pub extern "c" fn Display::is_closed(self : Display) -> Bool = "moonbit_gdk_display_is_closed"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.is_composited.html).
#borrow(self)
pub extern "c" fn Display::is_composited(self : Display) -> Bool = "moonbit_gdk_display_is_composited"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.is_rgba.html).
#borrow(self)
pub extern "c" fn Display::is_rgba(self : Display) -> Bool = "moonbit_gdk_display_is_rgba"
///|
#borrow(self_, error)
extern "c" fn moonbit_gdk_display_prepare_gl(
self_ : Display,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_gdk_display_prepare_gl"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.prepare_gl.html).
pub fn Display::prepare_gl(self : Display) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_gdk_display_prepare_gl(self, error_)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.supports_input_shapes.html).
#borrow(self)
pub extern "c" fn Display::supports_input_shapes(self : Display) -> Bool = "moonbit_gdk_display_supports_input_shapes"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.supports_shadow_width.html).
#borrow(self)
pub extern "c" fn Display::supports_shadow_width(self : Display) -> Bool = "moonbit_gdk_display_supports_shadow_width"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.sync.html).
#borrow(self)
pub extern "c" fn Display::sync(self : Display) = "moonbit_gdk_display_sync"
///|
#borrow(self_, keyval, effective_group, level, consumed)
extern "c" fn moonbit_gdk_display_translate_key(
self_ : Display,
keycode : UInt,
state : Int,
group : Int,
keyval : Ref[UInt],
effective_group : Ref[Int],
level : Ref[Int],
consumed : Ref[Int],
) -> Bool = "moonbit_gdk_display_translate_key"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.Display.translate_key.html).
pub fn Display::translate_key(
self : Display,
keycode : UInt,
state : ModifierType,
group : Int,
) -> (Bool, UInt, Int, Int, ModifierType) {
let keyval = Ref(0U)
let effective_group = Ref(0)
let level = Ref(0)
let consumed = Ref(0)
let result = moonbit_gdk_display_translate_key(
self,
keycode,
state.to_int(),
group,
keyval,
effective_group,
level,
consumed,
)
(
result,
keyval.val,
effective_group.val,
level.val,
ModifierType::from_int(consumed.val),
)
}
///|
#borrow(instance)
extern "c" fn gdk_display_connect_closed(
instance : Display,
function : FuncRef[(Display, Bool, (Display, Bool) -> Unit) -> Unit],
closure : (Display, Bool) -> Unit,
) -> UInt64 = "moonbit_gdk_display_connect_closed"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.Display.closed.html).
pub fn Display::connect_closed(
self : Display,
f : (Display, Bool) -> Unit,
) -> UInt64 {
gdk_display_connect_closed(
self,
fn(instance_, is_error, f) { f(instance_, is_error) },
f,
)
}
///|
#borrow(instance)
extern "c" fn gdk_display_connect_opened(
instance : Display,
function : FuncRef[(Display, (Display) -> Unit) -> Unit],
closure : (Display) -> Unit,
) -> UInt64 = "moonbit_gdk_display_connect_opened"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.Display.opened.html).
pub fn Display::connect_opened(self : Display, f : (Display) -> Unit) -> UInt64 {
gdk_display_connect_opened(self, fn(instance_, f) { f(instance_) }, f)
}
///|
#borrow(instance)
extern "c" fn gdk_display_connect_setting_changed(
instance : Display,
function : FuncRef[(Display, Bytes, (Display, String) -> Unit) -> Unit],
closure : (Display, String) -> Unit,
) -> UInt64 = "moonbit_gdk_display_connect_setting_changed"
///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.Display.setting-changed.html).
pub fn Display::connect_setting_changed(
self : Display,
f : (Display, String) -> Unit,
) -> UInt64 {
gdk_display_connect_setting_changed(
self,
fn(instance_, setting, f) {
f(instance_, @encoding/utf8.decode_lossy(setting))
},
f,
)
}
///|
impl IDisplay with fn beep(self) -> Unit {
self.as_display().beep()
}
///|
impl IDisplay with fn close(self) -> Unit {
self.as_display().close()
}
///|
impl IDisplay with fn create_gl_context(self) -> GLContext raise @glib.Error_ {
self.as_display().create_gl_context()
}
///|
impl IDisplay with fn device_is_grabbed(self, device) -> Bool {
self.as_display().device_is_grabbed(device)
}
///|
impl IDisplay with fn flush(self) -> Unit {
self.as_display().flush()
}
///|
impl IDisplay with fn get_clipboard(self) -> Clipboard {
self.as_display().get_clipboard()
}
///|
impl IDisplay with fn get_monitor_at_surface(self, surface) -> Monitor? {
self.as_display().get_monitor_at_surface(surface)
}
///|
impl IDisplay with fn get_name(self) -> String {
self.as_display().get_name()
}
///|
impl IDisplay with fn get_primary_clipboard(self) -> Clipboard {
self.as_display().get_primary_clipboard()
}
///|
impl IDisplay with fn is_closed(self) -> Bool {
self.as_display().is_closed()
}
///|
impl IDisplay with fn is_composited(self) -> Bool {
self.as_display().is_composited()
}
///|
impl IDisplay with fn is_rgba(self) -> Bool {
self.as_display().is_rgba()
}
///|
impl IDisplay with fn prepare_gl(self) -> Bool raise @glib.Error_ {
self.as_display().prepare_gl()
}
///|
impl IDisplay with fn supports_input_shapes(self) -> Bool {
self.as_display().supports_input_shapes()
}
///|
impl IDisplay with fn supports_shadow_width(self) -> Bool {
self.as_display().supports_shadow_width()
}
///|
impl IDisplay with fn sync(self) -> Unit {
self.as_display().sync()
}
///|
impl IDisplay with fn translate_key(self, keycode, state, group) -> (
Bool,
UInt,
Int,
Int,
ModifierType,
) {
self.as_display().translate_key(keycode, state, group)
}
///|
impl IDisplay with fn connect_closed(self, f) -> UInt64 {
self.as_display().connect_closed(f)
}
///|
impl IDisplay with fn connect_opened(self, f) -> UInt64 {
self.as_display().connect_opened(f)
}
///|
impl IDisplay with fn connect_setting_changed(self, f) -> UInt64 {
self.as_display().connect_setting_changed(f)
}
///|
pub fn Display::as_gobject_object(self : Display) -> @gobject.Object = "%identity"
///|
pub impl @gobject.IObject for Display with fn as_object(self) {
self.as_gobject_object()
}