gdk4/
popup_layout.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::PopupLayout;
6
7impl PopupLayout {
8    /// Retrieves the offset for the anchor rectangle.
9    ///
10    /// # Returns
11    ///
12    ///
13    /// ## `dx`
14    /// return location for the delta X coordinate
15    ///
16    /// ## `dy`
17    /// return location for the delta Y coordinate
18    #[doc(alias = "gdk_popup_layout_get_offset")]
19    #[doc(alias = "get_offset")]
20    pub fn offset(&self) -> (i32, i32) {
21        let mut dx = 0;
22        let mut dy = 0;
23        unsafe {
24            crate::ffi::gdk_popup_layout_get_offset(self.to_glib_none().0, &mut dx, &mut dy);
25        }
26        (dx, dy)
27    }
28}