1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::translate::*;

use crate::PopupLayout;

impl PopupLayout {
    /// Retrieves the offset for the anchor rectangle.
    ///
    /// # Returns
    ///
    ///
    /// ## `dx`
    /// return location for the delta X coordinate
    ///
    /// ## `dy`
    /// return location for the delta Y coordinate
    #[doc(alias = "gdk_popup_layout_get_offset")]
    #[doc(alias = "get_offset")]
    pub fn offset(&self) -> (i32, i32) {
        let mut dx = 0;
        let mut dy = 0;
        unsafe {
            ffi::gdk_popup_layout_get_offset(self.to_glib_none().0, &mut dx, &mut dy);
        }
        (dx, dy)
    }
}