gdk: implement Debug/Display for TimeCoord
use crate::AxisFlags;
use glib::translate::*;
+use std::fmt;
#[repr(C)]
pub struct TimeCoord(ffi::GdkTimeCoord);
@@ -29,6 +30,22 @@ impl TimeCoord {
}
}
+impl fmt::Display for TimeCoord {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_struct("TimeCoord")
+ .field("time", &self.get_time())
+ .field("axes", &self.get_axes())
+ .field("flags", &self.get_flags())
+ .finish()
+ }
+}
+
+impl fmt::Debug for TimeCoord {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.write_fmt(format_args!("{}", self))
+ }
+}
+
#[doc(hidden)]
impl GlibPtrDefault for TimeCoord {
type GlibType = *mut ffi::GdkTimeCoord;
