// GENERATED — DO NOT EDIT

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/class.FrameClock.html).
pub type FrameClock

///|
pub(open) trait IFrameClock {
  fn as_frame_clock(Self) -> FrameClock
  fn begin_updating(Self) -> Unit = _
  fn end_updating(Self) -> Unit = _
  fn get_fps(Self) -> Double = _
  fn get_frame_counter(Self) -> Int64 = _
  fn get_frame_time(Self) -> Int64 = _
  fn get_history_start(Self) -> Int64 = _
  fn get_refresh_info(Self, Int64) -> (Int64, Int64) = _
  fn request_phase(Self, FrameClockPhase) -> Unit = _
  fn connect_after_paint(Self, (FrameClock) -> Unit) -> UInt64 = _
  fn connect_before_paint(Self, (FrameClock) -> Unit) -> UInt64 = _
  fn connect_flush_events(Self, (FrameClock) -> Unit) -> UInt64 = _
  fn connect_layout(Self, (FrameClock) -> Unit) -> UInt64 = _
  fn connect_paint(Self, (FrameClock) -> Unit) -> UInt64 = _
  fn connect_resume_events(Self, (FrameClock) -> Unit) -> UInt64 = _
  fn connect_update(Self, (FrameClock) -> Unit) -> UInt64 = _
}

///|
pub impl IFrameClock for FrameClock with fn as_frame_clock(self) {
  self
}

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.begin_updating.html).
#borrow(self)
pub extern "c" fn FrameClock::begin_updating(self : FrameClock) = "moonbit_gdk_frame_clock_begin_updating"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.end_updating.html).
#borrow(self)
pub extern "c" fn FrameClock::end_updating(self : FrameClock) = "moonbit_gdk_frame_clock_end_updating"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.get_fps.html).
#borrow(self)
pub extern "c" fn FrameClock::get_fps(self : FrameClock) -> Double = "moonbit_gdk_frame_clock_get_fps"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.get_frame_counter.html).
#borrow(self)
pub extern "c" fn FrameClock::get_frame_counter(self : FrameClock) -> Int64 = "moonbit_gdk_frame_clock_get_frame_counter"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.get_frame_time.html).
#borrow(self)
pub extern "c" fn FrameClock::get_frame_time(self : FrameClock) -> Int64 = "moonbit_gdk_frame_clock_get_frame_time"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.get_history_start.html).
#borrow(self)
pub extern "c" fn FrameClock::get_history_start(self : FrameClock) -> Int64 = "moonbit_gdk_frame_clock_get_history_start"

///|
#borrow(self_, refresh_interval_return, presentation_time_return)
extern "c" fn moonbit_gdk_frame_clock_get_refresh_info(
  self_ : FrameClock,
  base_time : Int64,
  refresh_interval_return : Ref[Int64],
  presentation_time_return : Ref[Int64],
) = "moonbit_gdk_frame_clock_get_refresh_info"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.get_refresh_info.html).
pub fn FrameClock::get_refresh_info(
  self : FrameClock,
  base_time : Int64,
) -> (Int64, Int64) {
  let refresh_interval_return = Ref(0L)
  let presentation_time_return = Ref(0L)
  moonbit_gdk_frame_clock_get_refresh_info(
    self, base_time, refresh_interval_return, presentation_time_return,
  )
  (refresh_interval_return.val, presentation_time_return.val)
}

///|
#borrow(self_)
extern "c" fn moonbit_gdk_frame_clock_request_phase(
  self_ : FrameClock,
  phase : Int,
) = "moonbit_gdk_frame_clock_request_phase"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/method.FrameClock.request_phase.html).
pub fn FrameClock::request_phase(
  self : FrameClock,
  phase : FrameClockPhase,
) -> Unit {
  moonbit_gdk_frame_clock_request_phase(self, phase.to_int())
}

///|
#borrow(instance)
extern "c" fn gdk_frame_clock_connect_after_paint(
  instance : FrameClock,
  function : FuncRef[(FrameClock, (FrameClock) -> Unit) -> Unit],
  closure : (FrameClock) -> Unit,
) -> UInt64 = "moonbit_gdk_frame_clock_connect_after_paint"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.FrameClock.after-paint.html).
pub fn FrameClock::connect_after_paint(
  self : FrameClock,
  f : (FrameClock) -> Unit,
) -> UInt64 {
  gdk_frame_clock_connect_after_paint(
    self,
    fn(instance_, f) { f(instance_) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gdk_frame_clock_connect_before_paint(
  instance : FrameClock,
  function : FuncRef[(FrameClock, (FrameClock) -> Unit) -> Unit],
  closure : (FrameClock) -> Unit,
) -> UInt64 = "moonbit_gdk_frame_clock_connect_before_paint"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.FrameClock.before-paint.html).
pub fn FrameClock::connect_before_paint(
  self : FrameClock,
  f : (FrameClock) -> Unit,
) -> UInt64 {
  gdk_frame_clock_connect_before_paint(
    self,
    fn(instance_, f) { f(instance_) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gdk_frame_clock_connect_flush_events(
  instance : FrameClock,
  function : FuncRef[(FrameClock, (FrameClock) -> Unit) -> Unit],
  closure : (FrameClock) -> Unit,
) -> UInt64 = "moonbit_gdk_frame_clock_connect_flush_events"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.FrameClock.flush-events.html).
pub fn FrameClock::connect_flush_events(
  self : FrameClock,
  f : (FrameClock) -> Unit,
) -> UInt64 {
  gdk_frame_clock_connect_flush_events(
    self,
    fn(instance_, f) { f(instance_) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gdk_frame_clock_connect_layout(
  instance : FrameClock,
  function : FuncRef[(FrameClock, (FrameClock) -> Unit) -> Unit],
  closure : (FrameClock) -> Unit,
) -> UInt64 = "moonbit_gdk_frame_clock_connect_layout"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.FrameClock.layout.html).
pub fn FrameClock::connect_layout(
  self : FrameClock,
  f : (FrameClock) -> Unit,
) -> UInt64 {
  gdk_frame_clock_connect_layout(self, fn(instance_, f) { f(instance_) }, f)
}

///|
#borrow(instance)
extern "c" fn gdk_frame_clock_connect_paint(
  instance : FrameClock,
  function : FuncRef[(FrameClock, (FrameClock) -> Unit) -> Unit],
  closure : (FrameClock) -> Unit,
) -> UInt64 = "moonbit_gdk_frame_clock_connect_paint"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.FrameClock.paint.html).
pub fn FrameClock::connect_paint(
  self : FrameClock,
  f : (FrameClock) -> Unit,
) -> UInt64 {
  gdk_frame_clock_connect_paint(self, fn(instance_, f) { f(instance_) }, f)
}

///|
#borrow(instance)
extern "c" fn gdk_frame_clock_connect_resume_events(
  instance : FrameClock,
  function : FuncRef[(FrameClock, (FrameClock) -> Unit) -> Unit],
  closure : (FrameClock) -> Unit,
) -> UInt64 = "moonbit_gdk_frame_clock_connect_resume_events"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.FrameClock.resume-events.html).
pub fn FrameClock::connect_resume_events(
  self : FrameClock,
  f : (FrameClock) -> Unit,
) -> UInt64 {
  gdk_frame_clock_connect_resume_events(
    self,
    fn(instance_, f) { f(instance_) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gdk_frame_clock_connect_update(
  instance : FrameClock,
  function : FuncRef[(FrameClock, (FrameClock) -> Unit) -> Unit],
  closure : (FrameClock) -> Unit,
) -> UInt64 = "moonbit_gdk_frame_clock_connect_update"

///|
/// [Upstream documentation](https://docs.gtk.org/gdk4/signal.FrameClock.update.html).
pub fn FrameClock::connect_update(
  self : FrameClock,
  f : (FrameClock) -> Unit,
) -> UInt64 {
  gdk_frame_clock_connect_update(self, fn(instance_, f) { f(instance_) }, f)
}

///|
impl IFrameClock with fn begin_updating(self) -> Unit {
  self.as_frame_clock().begin_updating()
}

///|
impl IFrameClock with fn end_updating(self) -> Unit {
  self.as_frame_clock().end_updating()
}

///|
impl IFrameClock with fn get_fps(self) -> Double {
  self.as_frame_clock().get_fps()
}

///|
impl IFrameClock with fn get_frame_counter(self) -> Int64 {
  self.as_frame_clock().get_frame_counter()
}

///|
impl IFrameClock with fn get_frame_time(self) -> Int64 {
  self.as_frame_clock().get_frame_time()
}

///|
impl IFrameClock with fn get_history_start(self) -> Int64 {
  self.as_frame_clock().get_history_start()
}

///|
impl IFrameClock with fn get_refresh_info(self, base_time) -> (Int64, Int64) {
  self.as_frame_clock().get_refresh_info(base_time)
}

///|
impl IFrameClock with fn request_phase(self, phase) -> Unit {
  self.as_frame_clock().request_phase(phase)
}

///|
impl IFrameClock with fn connect_after_paint(self, f) -> UInt64 {
  self.as_frame_clock().connect_after_paint(f)
}

///|
impl IFrameClock with fn connect_before_paint(self, f) -> UInt64 {
  self.as_frame_clock().connect_before_paint(f)
}

///|
impl IFrameClock with fn connect_flush_events(self, f) -> UInt64 {
  self.as_frame_clock().connect_flush_events(f)
}

///|
impl IFrameClock with fn connect_layout(self, f) -> UInt64 {
  self.as_frame_clock().connect_layout(f)
}

///|
impl IFrameClock with fn connect_paint(self, f) -> UInt64 {
  self.as_frame_clock().connect_paint(f)
}

///|
impl IFrameClock with fn connect_resume_events(self, f) -> UInt64 {
  self.as_frame_clock().connect_resume_events(f)
}

///|
impl IFrameClock with fn connect_update(self, f) -> UInt64 {
  self.as_frame_clock().connect_update(f)
}

///|
pub fn FrameClock::as_gobject_object(self : FrameClock) -> @gobject.Object = "%identity"

///|
pub impl @gobject.IObject for FrameClock with fn as_object(self) {
  self.as_gobject_object()
}