-
-
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.
gtk4: Manually implement
GraphicsOffload
constructor for now
Needs to be transfer-none instead of transfer-full
- Loading branch information
Showing
4 changed files
with
38 additions
and
20 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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Take a look at the license at the top of the repository in the LICENSE file. | ||
|
||
use glib::translate::*; | ||
|
||
use crate::{prelude::*, GraphicsOffload}; | ||
|
||
impl GraphicsOffload { | ||
#[doc(alias = "gtk_graphics_offload_new")] | ||
pub fn new(child: Option<&impl IsA<Widget>>) -> GraphicsOffload { | ||
assert_initialized_main_thread!(); | ||
unsafe { | ||
Widget::from_glib_none(ffi::gtk_graphics_offload_new( | ||
child.map(|p| p.as_ref()).to_glib_none().0, | ||
)) | ||
.unsafe_cast() | ||
} | ||
} | ||
} | ||
|
||
#[cfg(feature = "v4_14")] | ||
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] | ||
impl Default for GraphicsOffload { | ||
fn default() -> Self { | ||
glib::object::Object::new::<Self>() | ||
} | ||
} |
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