gdk4/drag_surface_size.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::{ffi, prelude::*};
4use glib::translate::*;
5
6/// Contains information that is useful to compute the size of a drag surface.
7#[repr(transparent)]
8#[doc(alias = "GdkDragSurfaceSize")]
9pub struct DragSurfaceSize(std::ptr::NonNull<ffi::GdkDragSurfaceSize>);
10
11impl StaticType for DragSurfaceSize {
12 fn static_type() -> glib::Type {
13 unsafe { from_glib(ffi::gdk_drag_surface_size_get_type()) }
14 }
15}
16
17impl DragSurfaceSize {
18 /// Sets the size the drag surface prefers to be resized to.
19 /// ## `width`
20 /// the width
21 /// ## `height`
22 /// the height
23 #[doc(alias = "gdk_drag_surface_size_set_size")]
24 pub fn set_size(&self, width: i32, height: i32) {
25 unsafe { ffi::gdk_drag_surface_size_set_size(self.0.as_ptr(), width, height) }
26 }
27}