-
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is similar to ToplevelSize type, it is not a boxed type
- Loading branch information
1 parent
01c393b
commit b3132cc
Showing
1 changed file
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
// Take a look at the license at the top of the repository in the LICENSE file. | ||
|
||
use std::ptr::NonNull; | ||
|
||
use glib::translate::*; | ||
|
||
glib::wrapper! { | ||
#[doc(alias = "GdkDragSurfaceSize")] | ||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
pub struct DragSurfaceSize(Boxed<ffi::GdkDragSurfaceSize>); | ||
#[repr(transparent)] | ||
#[doc(alias = "GdkDragSurfaceSize")] | ||
pub struct DragSurfaceSize(NonNull<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 glib::StaticType for DragSurfaceSize { | ||
fn static_type() -> glib::Type { | ||
unsafe { from_glib(ffi::gdk_drag_surface_size_get_type()) } | ||
} | ||
} | ||
|
||
impl DragSurfaceSize { | ||
#[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) } | ||
unsafe { ffi::gdk_drag_surface_size_set_size(self.0.as_ptr(), width, height) } | ||
} | ||
} |