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
29
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::translate::*;

glib::wrapper! {
    /// The [`DragSurfaceSize`][crate::DragSurfaceSize] struct contains information that is useful
    /// to compute the size of a drag surface.
    #[doc(alias = "GdkDragSurfaceSize")]
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct DragSurfaceSize(Boxed<ffi::GdkDragSurfaceSize>);

    match fn {
        copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gdk_drag_surface_size_get_type(), ptr as *mut _) as *mut ffi::GdkDragSurfaceSize,
        free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gdk_drag_surface_size_get_type(), ptr as *mut _),
        type_ => || ffi::gdk_drag_surface_size_get_type(),
    }
}

impl DragSurfaceSize {
    /// Sets the size the drag surface prefers to be resized to.
    /// ## `width`
    /// the width
    /// ## `height`
    /// the height
    #[doc(alias = "gdk_drag_surface_size_set_size")]
    pub fn set_size(&self, width: i32, height: i32) {
        unsafe { ffi::gdk_drag_surface_size_set_size(self.to_glib_none().0, width, height) }
    }
}