gdk/
frame_clock.rs

1// Copyright 2013-2015, The Gtk-rs Project Developers.
2// See the COPYRIGHT file at the top-level directory of this distribution.
3// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
5use gdk_sys;
6use glib::translate::*;
7use FrameClock;
8
9impl FrameClock {
10    pub fn get_refresh_info(&self, base_time: i64) -> (i64, i64) {
11        unsafe {
12            let mut refresh_interval = 0;
13            let mut presentation_time = 0;
14            gdk_sys::gdk_frame_clock_get_refresh_info(
15                self.to_glib_none().0,
16                base_time,
17                &mut refresh_interval,
18                &mut presentation_time,
19            );
20            (refresh_interval, presentation_time)
21        }
22    }
23}