diff --git a/Cargo.toml b/Cargo.toml index 16645dfcbe28..117e87d1d445 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,6 +58,9 @@ libc = "0.2" pango-sys = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.20", branch = "master", features = ["v1_46"]} pango = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.20", branch = "master", features = ["v1_46"]} gir-format-check = "^0.1" +gdk4-x11-sys = {path = "gdk4-x11/sys", version = "0.9"} +gdk4-wayland-sys = {path = "gdk4-wayland/sys", version = "0.9"} +gdk4-win32-sys = {path = "gdk4-win32/sys", version = "0.9"} gdk4-sys = {path = "gdk4/sys", version = "0.9"} gdk = {package = "gdk4", path = "gdk4", version = "0.9"} gsk4-sys = {path = "gsk4/sys", version = "0.9"} diff --git a/gdk4-wayland/Cargo.toml b/gdk4-wayland/Cargo.toml index 46ea1257a2b7..36469d6476e5 100644 --- a/gdk4-wayland/Cargo.toml +++ b/gdk4-wayland/Cargo.toml @@ -14,15 +14,15 @@ rust-version.workspace = true version.workspace = true [features] -v4_4 = ["ffi/v4_4", "gdk/v4_4"] -v4_10 = ["ffi/v4_10", "v4_4", "gdk/v4_10"] -v4_12 = ["ffi/v4_12", "v4_10", "gdk/v4_12"] -v4_16 = ["ffi/v4_16", "v4_12", "gdk/v4_16"] +v4_4 = ["gdk4-wayland-sys/v4_4", "gdk/v4_4"] +v4_10 = ["gdk4-wayland-sys/v4_10", "v4_4", "gdk/v4_10"] +v4_12 = ["gdk4-wayland-sys/v4_12", "v4_10", "gdk/v4_12"] +v4_16 = ["gdk4-wayland-sys/v4_16", "v4_12", "gdk/v4_16"] wayland_crate = ["wayland-client", "wayland-backend"] egl = ["khronos-egl"] [dependencies] -ffi = {path = "./sys", package = "gdk4-wayland-sys", version = "0.9"} +gdk4-wayland-sys.workspace = true gdk.workspace= true gio.workspace = true glib.workspace = true diff --git a/gdk4-wayland/src/lib.rs b/gdk4-wayland/src/lib.rs index e8fe60ab986e..ee2ba2d57cb5 100644 --- a/gdk4-wayland/src/lib.rs +++ b/gdk4-wayland/src/lib.rs @@ -4,8 +4,8 @@ #![allow(deprecated)] #![cfg_attr(docsrs, feature(doc_cfg))] -pub use ffi; pub use gdk; +pub use gdk4_wayland_sys as ffi; pub use gio; pub use glib; #[cfg(all(feature = "v4_4", feature = "egl"))] diff --git a/gdk4-wayland/src/wayland_device.rs b/gdk4-wayland/src/wayland_device.rs index 4108065cf949..06bd9900d96b 100644 --- a/gdk4-wayland/src/wayland_device.rs +++ b/gdk4-wayland/src/wayland_device.rs @@ -11,10 +11,10 @@ use wayland_client::{ Proxy, }; +use crate::WaylandDevice; #[cfg(feature = "wayland_crate")] #[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] -use crate::prelude::*; -use crate::WaylandDevice; +use crate::{ffi, prelude::*}; impl WaylandDevice { #[doc(alias = "gdk_wayland_device_get_wl_keyboard")] diff --git a/gdk4-wayland/src/wayland_display.rs b/gdk4-wayland/src/wayland_display.rs index 34d1db0d82e6..e381b9449e8d 100644 --- a/gdk4-wayland/src/wayland_display.rs +++ b/gdk4-wayland/src/wayland_display.rs @@ -1,5 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. +#[cfg(feature = "wayland_crate")] +#[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] +use crate::ffi; #[cfg(feature = "wayland_crate")] #[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] use glib::{prelude::*, translate::*, Quark}; diff --git a/gdk4-wayland/src/wayland_monitor.rs b/gdk4-wayland/src/wayland_monitor.rs index 41ad63a17f3b..89c96d2ed7fd 100644 --- a/gdk4-wayland/src/wayland_monitor.rs +++ b/gdk4-wayland/src/wayland_monitor.rs @@ -5,7 +5,10 @@ use wayland_client::{backend::ObjectId, protocol::wl_output::WlOutput, Proxy}; #[cfg(feature = "wayland_crate")] #[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] -use {crate::prelude::*, glib::translate::*}; +use { + crate::{ffi, prelude::*}, + glib::translate::*, +}; use crate::WaylandMonitor; diff --git a/gdk4-wayland/src/wayland_seat.rs b/gdk4-wayland/src/wayland_seat.rs index f27a9d792313..a9d4f4997e68 100644 --- a/gdk4-wayland/src/wayland_seat.rs +++ b/gdk4-wayland/src/wayland_seat.rs @@ -5,7 +5,10 @@ use wayland_client::{backend::ObjectId, protocol::wl_seat::WlSeat, Proxy}; #[cfg(feature = "wayland_crate")] #[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] -use {crate::prelude::*, glib::translate::*}; +use { + crate::{ffi, prelude::*}, + glib::translate::*, +}; use crate::WaylandSeat; diff --git a/gdk4-wayland/src/wayland_surface.rs b/gdk4-wayland/src/wayland_surface.rs index 86358242d35e..2faa70029953 100644 --- a/gdk4-wayland/src/wayland_surface.rs +++ b/gdk4-wayland/src/wayland_surface.rs @@ -7,7 +7,7 @@ use glib::translate::*; #[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] use wayland_client::{backend::ObjectId, protocol::wl_surface::WlSurface, Proxy}; -use crate::{prelude::*, WaylandSurface}; +use crate::{ffi, prelude::*, WaylandSurface}; mod sealed { pub trait Sealed {} diff --git a/gdk4-wayland/src/wayland_toplevel.rs b/gdk4-wayland/src/wayland_toplevel.rs index 213fe93e302e..c8a11d1fed1b 100644 --- a/gdk4-wayland/src/wayland_toplevel.rs +++ b/gdk4-wayland/src/wayland_toplevel.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::WaylandToplevel; +use crate::{ffi, WaylandToplevel}; use glib::translate::*; use std::boxed::Box as Box_; diff --git a/gdk4-win32/Cargo.toml b/gdk4-win32/Cargo.toml index 262df0bdad2c..4078b9dd205a 100644 --- a/gdk4-win32/Cargo.toml +++ b/gdk4-win32/Cargo.toml @@ -18,12 +18,12 @@ name = "gtk4-win32" version = "4" [features] -v4_4 = ["ffi/v4_4", "gdk/v4_4"] +v4_4 = ["gdk4-win32-sys/v4_4", "gdk/v4_4"] egl = ["khronos-egl"] win32 = ["windows"] [dependencies] -ffi = { path = "./sys", version = "0.9", package = "gdk4-win32-sys"} +gdk4-win32-sys.workspace = true gdk.workspace = true gio.workspace = true glib.workspace = true diff --git a/gdk4-win32/src/lib.rs b/gdk4-win32/src/lib.rs index 55afbc761920..10435b995303 100644 --- a/gdk4-win32/src/lib.rs +++ b/gdk4-win32/src/lib.rs @@ -4,8 +4,8 @@ #![allow(deprecated)] #![cfg_attr(docsrs, feature(doc_cfg))] -pub use ffi; pub use gdk; +pub use gdk4_win32_sys as ffi; pub use gio; pub use glib; #[cfg(feature = "win32")] diff --git a/gdk4-win32/src/win32_display.rs b/gdk4-win32/src/win32_display.rs index e05c0fb3f2c1..2249205fff17 100644 --- a/gdk4-win32/src/win32_display.rs +++ b/gdk4-win32/src/win32_display.rs @@ -5,7 +5,7 @@ use glib::translate::*; #[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "egl"))))] use khronos_egl as egl; -use crate::{Win32Display, Win32MessageFilterReturn, MSG}; +use crate::{ffi, Win32Display, Win32MessageFilterReturn, MSG}; impl Win32Display { #[cfg(all(feature = "v4_4", feature = "egl"))] diff --git a/gdk4-win32/src/win32_hcursor.rs b/gdk4-win32/src/win32_hcursor.rs index bc3cfa99f282..8c2f39b8c014 100644 --- a/gdk4-win32/src/win32_hcursor.rs +++ b/gdk4-win32/src/win32_hcursor.rs @@ -4,7 +4,7 @@ use std::ptr::NonNull; use glib::{translate::*, types::Pointee}; -use crate::{prelude::*, Win32HCursor, HCURSOR}; +use crate::{ffi, prelude::*, Win32HCursor, HCURSOR}; impl Win32HCursor { #[doc(alias = "gdk_win32_hcursor_new")] diff --git a/gdk4-win32/src/win32_surface.rs b/gdk4-win32/src/win32_surface.rs index 447ca86e0d37..37491d365524 100644 --- a/gdk4-win32/src/win32_surface.rs +++ b/gdk4-win32/src/win32_surface.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, Win32Surface, HWND}; +use crate::{ffi, prelude::*, Win32Surface, HWND}; impl Win32Surface { #[doc(alias = "gdk_win32_surface_lookup_for_display")] diff --git a/gdk4-x11/Cargo.toml b/gdk4-x11/Cargo.toml index 2a57db35b9f9..db4ef21be2d4 100644 --- a/gdk4-x11/Cargo.toml +++ b/gdk4-x11/Cargo.toml @@ -14,14 +14,14 @@ rust-version.workspace = true version.workspace = true [features] -v4_4 = ["ffi/v4_4", "gdk/v4_4"] -v4_10 = ["ffi/v4_10", "v4_4", "gdk/v4_10"] -v4_16 = ["ffi/v4_16", "v4_10", "gdk/v4_16"] +v4_4 = ["gdk4-x11-sys/v4_4", "gdk/v4_4"] +v4_10 = ["gdk4-x11-sys/v4_10", "v4_4", "gdk/v4_10"] +v4_16 = ["gdk4-x11-sys/v4_16", "v4_10", "gdk/v4_16"] egl = ["khronos-egl"] xlib = ["x11"] [dependencies] -ffi = {path = "./sys", package = "gdk4-x11-sys", version = "0.9"} +gdk4-x11-sys.workspace = true gdk.workspace = true gio.workspace = true glib.workspace = true diff --git a/gdk4-x11/src/functions.rs b/gdk4-x11/src/functions.rs index fc34f03df142..770f8894f0d3 100644 --- a/gdk4-x11/src/functions.rs +++ b/gdk4-x11/src/functions.rs @@ -6,9 +6,9 @@ use glib::translate::*; use x11::xlib::Atom as XAtom; pub use crate::auto::functions::*; -use crate::X11Display; #[cfg(not(feature = "xlib"))] use crate::XAtom; +use crate::{ffi, X11Display}; #[doc(alias = "gdk_x11_get_xatom_by_name_for_display")] pub fn x11_get_xatom_by_name_for_display(display: &X11Display, atom_name: impl IntoGStr) -> XAtom { diff --git a/gdk4-x11/src/lib.rs b/gdk4-x11/src/lib.rs index c0ea8e5f740e..f3f78a2455ec 100644 --- a/gdk4-x11/src/lib.rs +++ b/gdk4-x11/src/lib.rs @@ -4,8 +4,8 @@ #![allow(deprecated)] #![cfg_attr(docsrs, feature(doc_cfg))] -pub use ffi; pub use gdk; +pub use gdk4_x11_sys as ffi; pub use gio; pub use glib; #[cfg(all(feature = "v4_4", feature = "egl"))] diff --git a/gdk4-x11/src/x11_display.rs b/gdk4-x11/src/x11_display.rs index f38704225429..55e6006e4ec5 100644 --- a/gdk4-x11/src/x11_display.rs +++ b/gdk4-x11/src/x11_display.rs @@ -18,7 +18,7 @@ use x11::xlib; #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))] use x11::xlib::{Cursor as XCursor, Window as XWindow}; -use crate::{prelude::*, X11Display}; +use crate::{ffi, prelude::*, X11Display}; #[cfg(not(feature = "xlib"))] use crate::{XCursor, XWindow}; diff --git a/gdk4-x11/src/x11_monitor.rs b/gdk4-x11/src/x11_monitor.rs index fb8b91558efd..d4458a00da7d 100644 --- a/gdk4-x11/src/x11_monitor.rs +++ b/gdk4-x11/src/x11_monitor.rs @@ -5,9 +5,9 @@ use glib::translate::*; #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))] use x11::xlib::XID; -use crate::X11Monitor; #[cfg(not(feature = "xlib"))] use crate::XID; +use crate::{ffi, X11Monitor}; impl X11Monitor { #[doc(alias = "gdk_x11_monitor_get_output")] diff --git a/gdk4-x11/src/x11_screen.rs b/gdk4-x11/src/x11_screen.rs index 363c1c3dffcb..ac9d4f971585 100644 --- a/gdk4-x11/src/x11_screen.rs +++ b/gdk4-x11/src/x11_screen.rs @@ -5,9 +5,9 @@ use glib::translate::*; #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))] use x11::xlib::{self, XID}; -use crate::X11Screen; #[cfg(not(feature = "xlib"))] use crate::XID; +use crate::{ffi, X11Screen}; impl X11Screen { #[cfg(feature = "xlib")] diff --git a/gdk4-x11/src/x11_surface.rs b/gdk4-x11/src/x11_surface.rs index 297177e48f93..f981f851f2a2 100644 --- a/gdk4-x11/src/x11_surface.rs +++ b/gdk4-x11/src/x11_surface.rs @@ -5,9 +5,9 @@ use glib::translate::*; #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))] use x11::xlib::Window as XWindow; -use crate::X11Surface; #[cfg(not(feature = "xlib"))] use crate::XWindow; +use crate::{ffi, X11Surface}; impl X11Surface { #[doc(alias = "gdk_x11_surface_get_xid")] diff --git a/gdk4/Cargo.toml b/gdk4/Cargo.toml index 0233ff4409da..be2970479f5b 100644 --- a/gdk4/Cargo.toml +++ b/gdk4/Cargo.toml @@ -17,18 +17,18 @@ version.workspace = true name = "gdk4" [features] -v4_2 = ["ffi/v4_2"] -v4_4 = ["ffi/v4_4", "v4_2"] -v4_6 = ["ffi/v4_6", "v4_4"] -v4_8 = ["ffi/v4_8", "v4_6"] -v4_10 = ["ffi/v4_10", "v4_8"] -v4_12 = ["ffi/v4_12", "v4_10"] -v4_14 = ["ffi/v4_14", "v4_12"] -v4_16 = ["ffi/v4_16", "v4_14"] +v4_2 = ["gdk4-sys/v4_2"] +v4_4 = ["gdk4-sys/v4_4", "v4_2"] +v4_6 = ["gdk4-sys/v4_6", "v4_4"] +v4_8 = ["gdk4-sys/v4_8", "v4_6"] +v4_10 = ["gdk4-sys/v4_10", "v4_8"] +v4_12 = ["gdk4-sys/v4_12", "v4_10"] +v4_14 = ["gdk4-sys/v4_14", "v4_12"] +v4_16 = ["gdk4-sys/v4_16", "v4_14"] gl = ["dep:gl"] [dependencies] -ffi = {package = "gdk4-sys", path = "./sys", version = "0.9"} +gdk4-sys.workspace = true cairo-rs.workspace = true gdk-pixbuf.workspace = true gio.workspace = true diff --git a/gdk4/src/button_event.rs b/gdk4/src/button_event.rs index f90e0121695e..164fb488113c 100644 --- a/gdk4/src/button_event.rs +++ b/gdk4/src/button_event.rs @@ -6,7 +6,7 @@ use crate::{ButtonEvent, EventType}; define_event! { ButtonEvent, - ffi::GdkButtonEvent, + crate::ffi::GdkButtonEvent, &[EventType::ButtonPress, EventType::ButtonRelease] } diff --git a/gdk4/src/cairo_interaction.rs b/gdk4/src/cairo_interaction.rs index 2b23c387e18a..930681be4eb3 100644 --- a/gdk4/src/cairo_interaction.rs +++ b/gdk4/src/cairo_interaction.rs @@ -4,7 +4,7 @@ use cairo::{Context, Region}; use gdk_pixbuf::Pixbuf; use glib::translate::*; -use crate::{Rectangle, Surface, RGBA}; +use crate::{ffi, Rectangle, Surface, RGBA}; // rustdoc-stripper-ignore-next /// Trait containing integration methods with [`cairo::Surface`]. diff --git a/gdk4/src/clipboard.rs b/gdk4/src/clipboard.rs index 1702ffb03912..b1871919f4a8 100644 --- a/gdk4/src/clipboard.rs +++ b/gdk4/src/clipboard.rs @@ -4,7 +4,7 @@ use std::{future, pin::Pin, ptr}; use glib::{translate::*, GString}; -use crate::{prelude::*, Clipboard}; +use crate::{ffi, prelude::*, Clipboard}; impl Clipboard { #[doc(alias = "gdk_clipboard_read_async")] diff --git a/gdk4/src/content_deserializer.rs b/gdk4/src/content_deserializer.rs index 52068f5f94fa..ce61511db82d 100644 --- a/gdk4/src/content_deserializer.rs +++ b/gdk4/src/content_deserializer.rs @@ -2,7 +2,7 @@ use glib::{translate::*, value::FromValue}; -use crate::ContentDeserializer; +use crate::{ffi, ContentDeserializer}; impl ContentDeserializer { pub fn set_value(&self, value: glib::Value) { diff --git a/gdk4/src/content_formats.rs b/gdk4/src/content_formats.rs index f5958058a0f9..3da42b0485f4 100644 --- a/gdk4/src/content_formats.rs +++ b/gdk4/src/content_formats.rs @@ -2,7 +2,7 @@ use glib::{translate::*, Slice}; -use crate::{ContentFormats, ContentFormatsBuilder}; +use crate::{ffi, ContentFormats, ContentFormatsBuilder}; impl ContentFormats { #[doc(alias = "gdk_content_formats_get_gtypes")] diff --git a/gdk4/src/content_formats_builder.rs b/gdk4/src/content_formats_builder.rs index 1365953aa0da..48517a04ce01 100644 --- a/gdk4/src/content_formats_builder.rs +++ b/gdk4/src/content_formats_builder.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{ContentFormats, ContentFormatsBuilder}; +use crate::{ffi, ContentFormats, ContentFormatsBuilder}; impl ContentFormatsBuilder { #[doc(alias = "gdk_content_formats_builder_add_formats")] diff --git a/gdk4/src/content_provider.rs b/gdk4/src/content_provider.rs index 1380989a532f..cb4c909cbd7a 100644 --- a/gdk4/src/content_provider.rs +++ b/gdk4/src/content_provider.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, ContentProvider}; +use crate::{ffi, prelude::*, ContentProvider}; mod sealed { pub trait Sealed {} diff --git a/gdk4/src/content_serializer.rs b/gdk4/src/content_serializer.rs index 7ef5dab89e2a..598bb59f3c03 100644 --- a/gdk4/src/content_serializer.rs +++ b/gdk4/src/content_serializer.rs @@ -2,7 +2,7 @@ use glib::{translate::*, value::FromValue}; -use crate::ContentSerializer; +use crate::{ffi, ContentSerializer}; impl ContentSerializer { #[doc(alias = "gdk_content_serializer_get_priority")] diff --git a/gdk4/src/crossing_event.rs b/gdk4/src/crossing_event.rs index 8b694cc2f210..2fb002b54aa7 100644 --- a/gdk4/src/crossing_event.rs +++ b/gdk4/src/crossing_event.rs @@ -6,7 +6,7 @@ use crate::{CrossingEvent, EventType}; define_event! { CrossingEvent, - ffi::GdkCrossingEvent, + crate::ffi::GdkCrossingEvent, &[EventType::EnterNotify, EventType::LeaveNotify] } diff --git a/gdk4/src/cursor.rs b/gdk4/src/cursor.rs index ce68889d4b6f..ee6d25509176 100644 --- a/gdk4/src/cursor.rs +++ b/gdk4/src/cursor.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::{Cursor, Texture}; +use crate::{ffi, Cursor, Texture}; use glib::translate::*; use std::boxed::Box as Box_; diff --git a/gdk4/src/delete_event.rs b/gdk4/src/delete_event.rs index 147665d8406f..3e218653bc0e 100644 --- a/gdk4/src/delete_event.rs +++ b/gdk4/src/delete_event.rs @@ -6,7 +6,7 @@ use crate::{DeleteEvent, EventType}; define_event! { DeleteEvent, - ffi::GdkDeleteEvent, + crate::ffi::GdkDeleteEvent, &[EventType::Delete] } diff --git a/gdk4/src/display.rs b/gdk4/src/display.rs index 3639dbc21a0a..ddbfa2627746 100644 --- a/gdk4/src/display.rs +++ b/gdk4/src/display.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, Display, Key, KeymapKey, ModifierType}; +use crate::{ffi, prelude::*, Display, Key, KeymapKey, ModifierType}; #[derive(Debug, PartialEq, Eq, Ord, PartialOrd)] pub enum Backend { diff --git a/gdk4/src/dmabuf_texture_builder.rs b/gdk4/src/dmabuf_texture_builder.rs index 2e3c7eed5c3b..afa5cfc558a3 100644 --- a/gdk4/src/dmabuf_texture_builder.rs +++ b/gdk4/src/dmabuf_texture_builder.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{DmabufTextureBuilder, Texture}; +use crate::{ffi, DmabufTextureBuilder, Texture}; impl DmabufTextureBuilder { #[doc(alias = "gdk_dmabuf_texture_builder_build")] diff --git a/gdk4/src/dnd_event.rs b/gdk4/src/dnd_event.rs index d03d448752aa..c94eda011532 100644 --- a/gdk4/src/dnd_event.rs +++ b/gdk4/src/dnd_event.rs @@ -6,7 +6,7 @@ use crate::{DNDEvent, EventType}; define_event! { DNDEvent, - ffi::GdkDNDEvent, + crate::ffi::GdkDNDEvent, &[EventType::DragEnter, EventType::DragLeave, EventType::DragMotion, EventType::DropStart] } diff --git a/gdk4/src/drag_surface.rs b/gdk4/src/drag_surface.rs index e9cdf4641a69..c29cb6cc3562 100644 --- a/gdk4/src/drag_surface.rs +++ b/gdk4/src/drag_surface.rs @@ -7,7 +7,7 @@ use glib::{ translate::*, }; -use crate::{prelude::*, DragSurface, DragSurfaceSize}; +use crate::{ffi, prelude::*, DragSurface, DragSurfaceSize}; mod sealed { pub trait Sealed {} diff --git a/gdk4/src/drag_surface_size.rs b/gdk4/src/drag_surface_size.rs index cac902e9c9b0..f89527571ad4 100644 --- a/gdk4/src/drag_surface_size.rs +++ b/gdk4/src/drag_surface_size.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::prelude::*; +use crate::{ffi, prelude::*}; use glib::translate::*; #[repr(transparent)] diff --git a/gdk4/src/draw_context.rs b/gdk4/src/draw_context.rs index 45938f0ebffe..dc8c3bc38268 100644 --- a/gdk4/src/draw_context.rs +++ b/gdk4/src/draw_context.rs @@ -17,10 +17,9 @@ pub trait DrawContextExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "get_frame_region")] fn frame_region(&self) -> Option { unsafe { - from_glib_none( - ffi::gdk_draw_context_get_frame_region(self.as_ref().to_glib_none().0) - as *mut cairo::ffi::cairo_region_t, - ) + from_glib_none(crate::ffi::gdk_draw_context_get_frame_region( + self.as_ref().to_glib_none().0, + ) as *mut cairo::ffi::cairo_region_t) } } } diff --git a/gdk4/src/drop.rs b/gdk4/src/drop.rs index 381121dee083..96a35d254cdb 100644 --- a/gdk4/src/drop.rs +++ b/gdk4/src/drop.rs @@ -4,7 +4,7 @@ use std::{future, pin::Pin, ptr}; use glib::{translate::*, GString}; -use crate::{prelude::*, Drop}; +use crate::{ffi, prelude::*, Drop}; impl Drop { #[doc(alias = "gdk_drop_read_async")] diff --git a/gdk4/src/event.rs b/gdk4/src/event.rs index bb5d8efa21cd..4ab3bbbc1ba0 100644 --- a/gdk4/src/event.rs +++ b/gdk4/src/event.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, Event, EventType}; +use crate::{ffi, prelude::*, Event, EventType}; impl Event { #[inline] @@ -164,9 +164,9 @@ macro_rules! define_event { } #[doc(hidden)] - impl glib::translate::FromGlibPtrFull<*mut ffi::GdkEvent> for $rust_type { + impl glib::translate::FromGlibPtrFull<*mut crate::ffi::GdkEvent> for $rust_type { #[inline] - unsafe fn from_glib_full(ptr: *mut ffi::GdkEvent) -> Self { + unsafe fn from_glib_full(ptr: *mut crate::ffi::GdkEvent) -> Self { glib::translate::FromGlibPtrFull::from_glib_full(ptr as *mut $ffi_type) } } diff --git a/gdk4/src/focus_event.rs b/gdk4/src/focus_event.rs index 4bb73139a121..47281f6345a1 100644 --- a/gdk4/src/focus_event.rs +++ b/gdk4/src/focus_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, FocusEvent}; define_event! { FocusEvent, - ffi::GdkFocusEvent, + crate::ffi::GdkFocusEvent, &[EventType::FocusChange] } diff --git a/gdk4/src/functions.rs b/gdk4/src/functions.rs index a59e7132091f..b8dcd591007d 100644 --- a/gdk4/src/functions.rs +++ b/gdk4/src/functions.rs @@ -5,7 +5,7 @@ use std::{future, pin::Pin, ptr}; use glib::translate::*; pub use crate::auto::functions::*; -use crate::{prelude::*, ContentDeserializer, ContentSerializer}; +use crate::{ffi, prelude::*, ContentDeserializer, ContentSerializer}; #[repr(packed)] pub struct GRange(pub i32, pub i32); diff --git a/gdk4/src/gl_texture.rs b/gdk4/src/gl_texture.rs index 9a2657726da8..1e2ddb85982a 100644 --- a/gdk4/src/gl_texture.rs +++ b/gdk4/src/gl_texture.rs @@ -5,7 +5,7 @@ use glib::translate::*; #[cfg(feature = "v4_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))] use crate::builders::GLTextureBuilder; -use crate::{GLContext, GLTexture}; +use crate::{ffi, GLContext, GLTexture}; impl GLTexture { #[doc(alias = "gdk_gl_texture_new")] diff --git a/gdk4/src/gl_texture_builder.rs b/gdk4/src/gl_texture_builder.rs index 12baf089eac3..4e27386c75ff 100644 --- a/gdk4/src/gl_texture_builder.rs +++ b/gdk4/src/gl_texture_builder.rs @@ -2,7 +2,7 @@ use glib::{prelude::*, translate::*}; -use crate::{GLContext, GLTextureBuilder, MemoryFormat, Texture}; +use crate::{ffi, GLContext, GLTextureBuilder, MemoryFormat, Texture}; #[cfg(not(feature = "gl"))] pub type GLsync = *const libc::c_void; diff --git a/gdk4/src/grab_broken_event.rs b/gdk4/src/grab_broken_event.rs index ebfa08409c6d..4c07b868c4e7 100644 --- a/gdk4/src/grab_broken_event.rs +++ b/gdk4/src/grab_broken_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, GrabBrokenEvent}; define_event! { GrabBrokenEvent, - ffi::GdkGrabBrokenEvent, + crate::ffi::GdkGrabBrokenEvent, &[EventType::GrabBroken] } diff --git a/gdk4/src/key_event.rs b/gdk4/src/key_event.rs index c06dbc3ea99b..fd80dc1edffc 100644 --- a/gdk4/src/key_event.rs +++ b/gdk4/src/key_event.rs @@ -4,7 +4,7 @@ use std::{fmt, mem}; use glib::translate::*; -use crate::{EventType, Key, KeyEvent, KeyMatch, ModifierType}; +use crate::{ffi, EventType, Key, KeyEvent, KeyMatch, ModifierType}; define_event! { KeyEvent, diff --git a/gdk4/src/keymap_key.rs b/gdk4/src/keymap_key.rs index 6886c6437dcc..dd8bd6a37cd0 100644 --- a/gdk4/src/keymap_key.rs +++ b/gdk4/src/keymap_key.rs @@ -2,6 +2,7 @@ use std::fmt; +use crate::ffi; use glib::translate::*; glib::wrapper! { diff --git a/gdk4/src/keys.rs b/gdk4/src/keys.rs index 447f407df89a..b78421ec6ce4 100644 --- a/gdk4/src/keys.rs +++ b/gdk4/src/keys.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::prelude::*; +use crate::{ffi, prelude::*}; use glib::{translate::*, value::FromValue, GString, Type, Value}; #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/gdk4/src/lib.rs b/gdk4/src/lib.rs index d145cd826edc..4624cf65419e 100644 --- a/gdk4/src/lib.rs +++ b/gdk4/src/lib.rs @@ -5,7 +5,7 @@ #![doc = include_str!("../README.md")] pub use cairo; -pub use ffi; +pub use gdk4_sys as ffi; pub use gdk_pixbuf; pub use gio; #[cfg(feature = "gl")] diff --git a/gdk4/src/motion_event.rs b/gdk4/src/motion_event.rs index 2a5b09e9a2b8..cd7c35abc9ab 100644 --- a/gdk4/src/motion_event.rs +++ b/gdk4/src/motion_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, MotionEvent}; define_event! { MotionEvent, - ffi::GdkMotionEvent, + crate::ffi::GdkMotionEvent, &[EventType::MotionNotify] } diff --git a/gdk4/src/pad_event.rs b/gdk4/src/pad_event.rs index dc3b64a49d94..23b75eeb1cac 100644 --- a/gdk4/src/pad_event.rs +++ b/gdk4/src/pad_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, PadEvent}; define_event! { PadEvent, - ffi::GdkPadEvent, + crate::ffi::GdkPadEvent, &[EventType::PadButtonPress, EventType::PadButtonRelease, EventType::PadRing, EventType::PadStrip, EventType::PadGroupMode] } diff --git a/gdk4/src/popup_layout.rs b/gdk4/src/popup_layout.rs index 3fc18e7af035..7f4a3c9c6c3c 100644 --- a/gdk4/src/popup_layout.rs +++ b/gdk4/src/popup_layout.rs @@ -11,7 +11,7 @@ impl PopupLayout { let mut dx = 0; let mut dy = 0; unsafe { - ffi::gdk_popup_layout_get_offset(self.to_glib_none().0, &mut dx, &mut dy); + crate::ffi::gdk_popup_layout_get_offset(self.to_glib_none().0, &mut dx, &mut dy); } (dx, dy) } diff --git a/gdk4/src/proximity_event.rs b/gdk4/src/proximity_event.rs index e59106f8420d..7a69df112752 100644 --- a/gdk4/src/proximity_event.rs +++ b/gdk4/src/proximity_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, ProximityEvent}; define_event! { ProximityEvent, - ffi::GdkProximityEvent, + crate::ffi::GdkProximityEvent, &[EventType::ProximityIn, EventType::ProximityOut] } diff --git a/gdk4/src/rectangle.rs b/gdk4/src/rectangle.rs index 0a44b379778e..74609b8132ec 100644 --- a/gdk4/src/rectangle.rs +++ b/gdk4/src/rectangle.rs @@ -12,7 +12,7 @@ impl Rectangle { pub fn new(x: i32, y: i32, width: i32, height: i32) -> Self { skip_assert_initialized!(); unsafe { - Self::unsafe_from(ffi::GdkRectangle { + Self::unsafe_from(crate::ffi::GdkRectangle { x, y, width, diff --git a/gdk4/src/rgba.rs b/gdk4/src/rgba.rs index f3266a56b801..c2b3e1a0dae0 100644 --- a/gdk4/src/rgba.rs +++ b/gdk4/src/rgba.rs @@ -4,7 +4,7 @@ use std::{fmt, str::FromStr}; use glib::translate::*; -use crate::RGBA; +use crate::{ffi, RGBA}; #[derive(Debug)] // rustdoc-stripper-ignore-next diff --git a/gdk4/src/scroll_event.rs b/gdk4/src/scroll_event.rs index 641426cf95eb..a1418c5d8968 100644 --- a/gdk4/src/scroll_event.rs +++ b/gdk4/src/scroll_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, ScrollEvent}; define_event! { ScrollEvent, - ffi::GdkScrollEvent, + crate::ffi::GdkScrollEvent, &[EventType::Scroll] } diff --git a/gdk4/src/subclass/content_provider.rs b/gdk4/src/subclass/content_provider.rs index 4dffeb1d8c8c..50c11a0798c9 100644 --- a/gdk4/src/subclass/content_provider.rs +++ b/gdk4/src/subclass/content_provider.rs @@ -7,7 +7,7 @@ use std::{future::Future, pin::Pin}; use glib::{translate::*, Value}; -use crate::{prelude::*, subclass::prelude::*, Clipboard, ContentFormats, ContentProvider}; +use crate::{ffi, prelude::*, subclass::prelude::*, Clipboard, ContentFormats, ContentProvider}; pub trait ContentProviderImpl: ContentProviderImplExt + ObjectImpl { fn content_changed(&self) { diff --git a/gdk4/src/subclass/paintable.rs b/gdk4/src/subclass/paintable.rs index 1514b4d1270e..c0bb7451a9b9 100644 --- a/gdk4/src/subclass/paintable.rs +++ b/gdk4/src/subclass/paintable.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Paintable, PaintableFlags, Snapshot}; +use crate::{ffi, prelude::*, subclass::prelude::*, Paintable, PaintableFlags, Snapshot}; pub trait PaintableImpl: PaintableImplExt + ObjectImpl { #[doc(alias = "get_current_image")] diff --git a/gdk4/src/surface.rs b/gdk4/src/surface.rs index 044fedc96c78..71e506cb5eda 100644 --- a/gdk4/src/surface.rs +++ b/gdk4/src/surface.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, Surface}; +use crate::{ffi, prelude::*, Surface}; mod sealed { pub trait Sealed {} diff --git a/gdk4/src/texture.rs b/gdk4/src/texture.rs index 4531e88124e8..a44dbbda5eaf 100644 --- a/gdk4/src/texture.rs +++ b/gdk4/src/texture.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, Texture}; +use crate::{ffi, prelude::*, Texture}; mod sealed { pub trait Sealed {} diff --git a/gdk4/src/time_coord.rs b/gdk4/src/time_coord.rs index 8631437005fe..08a8e64fdd3e 100644 --- a/gdk4/src/time_coord.rs +++ b/gdk4/src/time_coord.rs @@ -4,7 +4,7 @@ use std::fmt; use glib::translate::*; -use crate::AxisFlags; +use crate::{ffi, AxisFlags}; glib::wrapper! { #[doc(alias = "GdkTimeCoord")] diff --git a/gdk4/src/toplevel.rs b/gdk4/src/toplevel.rs index 289bbcec22e4..57ae5b4c755e 100644 --- a/gdk4/src/toplevel.rs +++ b/gdk4/src/toplevel.rs @@ -7,7 +7,7 @@ use glib::{ translate::*, }; -use crate::{prelude::*, Toplevel, ToplevelSize}; +use crate::{ffi, prelude::*, Toplevel, ToplevelSize}; mod sealed { pub trait Sealed {} diff --git a/gdk4/src/toplevel_size.rs b/gdk4/src/toplevel_size.rs index eaa5c85ce7a1..c6cedbab48b9 100644 --- a/gdk4/src/toplevel_size.rs +++ b/gdk4/src/toplevel_size.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::prelude::*; +use crate::{ffi, prelude::*}; use glib::translate::*; #[repr(transparent)] diff --git a/gdk4/src/touch_event.rs b/gdk4/src/touch_event.rs index 577d89197240..0f1864381e08 100644 --- a/gdk4/src/touch_event.rs +++ b/gdk4/src/touch_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, TouchEvent}; define_event! { TouchEvent, - ffi::GdkTouchEvent, + crate::ffi::GdkTouchEvent, &[EventType::TouchBegin, EventType::TouchUpdate, EventType::TouchEnd, EventType::TouchCancel] } diff --git a/gdk4/src/touchpad_event.rs b/gdk4/src/touchpad_event.rs index 097f1308f0cf..c97c569796db 100644 --- a/gdk4/src/touchpad_event.rs +++ b/gdk4/src/touchpad_event.rs @@ -6,7 +6,7 @@ use crate::{EventType, TouchpadEvent}; define_event! { TouchpadEvent, - ffi::GdkTouchpadEvent, + crate::ffi::GdkTouchpadEvent, &[ EventType::TouchpadSwipe, EventType::TouchpadPinch, diff --git a/gsk4/Cargo.toml b/gsk4/Cargo.toml index 52552f84fdc8..8959be1e8dbf 100644 --- a/gsk4/Cargo.toml +++ b/gsk4/Cargo.toml @@ -17,16 +17,16 @@ version.workspace = true name = "gsk4" [features] -broadway = ["ffi/broadway"] -vulkan = ["ffi/vulkan"] -v4_2 = ["ffi/v4_2", "gdk/v4_2"] -v4_4 = ["ffi/v4_4", "gdk/v4_4", "v4_2"] -v4_6 = ["ffi/v4_6", "gdk/v4_6", "v4_4"] -v4_10 = ["ffi/v4_10", "gdk/v4_10", "v4_6"] -v4_14 = ["ffi/v4_14", "v4_10"] +broadway = ["gsk4-sys/broadway"] +vulkan = ["gsk4-sys/vulkan"] +v4_2 = ["gsk4-sys/v4_2", "gdk/v4_2"] +v4_4 = ["gsk4-sys/v4_4", "gdk/v4_4", "v4_2"] +v4_6 = ["gsk4-sys/v4_6", "gdk/v4_6", "v4_4"] +v4_10 = ["gsk4-sys/v4_10", "gdk/v4_10", "v4_6"] +v4_14 = ["gsk4-sys/v4_14", "v4_10"] [dependencies] -ffi = {package = "gsk4-sys", path = "./sys", version = "0.9"} +gsk4-sys.workspace = true cairo-rs.workspace = true gdk.workspace = true glib.workspace = true diff --git a/gsk4/src/blend_node.rs b/gsk4/src/blend_node.rs index 26a5782a1d6e..acda3b8a57ac 100644 --- a/gsk4/src/blend_node.rs +++ b/gsk4/src/blend_node.rs @@ -2,7 +2,11 @@ use crate::{BlendNode, RenderNodeType}; -define_render_node!(BlendNode, ffi::GskBlendNode, RenderNodeType::BlendNode); +define_render_node!( + BlendNode, + crate::ffi::GskBlendNode, + RenderNodeType::BlendNode +); impl std::fmt::Debug for BlendNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/blur_node.rs b/gsk4/src/blur_node.rs index ba0ba78bf0b5..430432d296b7 100644 --- a/gsk4/src/blur_node.rs +++ b/gsk4/src/blur_node.rs @@ -2,7 +2,7 @@ use crate::{BlurNode, RenderNodeType}; -define_render_node!(BlurNode, ffi::GskBlurNode, RenderNodeType::BlurNode); +define_render_node!(BlurNode, crate::ffi::GskBlurNode, RenderNodeType::BlurNode); impl std::fmt::Debug for BlurNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/border_node.rs b/gsk4/src/border_node.rs index 99839691f779..8def9351f449 100644 --- a/gsk4/src/border_node.rs +++ b/gsk4/src/border_node.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{BorderNode, RenderNodeType, RoundedRect}; +use crate::{ffi, BorderNode, RenderNodeType, RoundedRect}; define_render_node!(BorderNode, ffi::GskBorderNode, RenderNodeType::BorderNode); diff --git a/gsk4/src/cairo_node.rs b/gsk4/src/cairo_node.rs index 23db669a50bc..a1097397d9dc 100644 --- a/gsk4/src/cairo_node.rs +++ b/gsk4/src/cairo_node.rs @@ -2,7 +2,11 @@ use crate::{CairoNode, RenderNodeType}; -define_render_node!(CairoNode, ffi::GskCairoNode, RenderNodeType::CairoNode); +define_render_node!( + CairoNode, + crate::ffi::GskCairoNode, + RenderNodeType::CairoNode +); impl std::fmt::Debug for CairoNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/clip_node.rs b/gsk4/src/clip_node.rs index 606ca01b27c4..248f1da8b985 100644 --- a/gsk4/src/clip_node.rs +++ b/gsk4/src/clip_node.rs @@ -2,7 +2,7 @@ use crate::{ClipNode, RenderNodeType}; -define_render_node!(ClipNode, ffi::GskClipNode, RenderNodeType::ClipNode); +define_render_node!(ClipNode, crate::ffi::GskClipNode, RenderNodeType::ClipNode); impl std::fmt::Debug for ClipNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/color_matrix_node.rs b/gsk4/src/color_matrix_node.rs index a727a7da34af..64e3404ddf00 100644 --- a/gsk4/src/color_matrix_node.rs +++ b/gsk4/src/color_matrix_node.rs @@ -4,7 +4,7 @@ use crate::{ColorMatrixNode, RenderNodeType}; define_render_node!( ColorMatrixNode, - ffi::GskColorMatrixNode, + crate::ffi::GskColorMatrixNode, RenderNodeType::ColorMatrixNode ); diff --git a/gsk4/src/color_node.rs b/gsk4/src/color_node.rs index 7de9cf92b330..790f40521786 100644 --- a/gsk4/src/color_node.rs +++ b/gsk4/src/color_node.rs @@ -2,7 +2,11 @@ use crate::{ColorNode, RenderNodeType}; -define_render_node!(ColorNode, ffi::GskColorNode, RenderNodeType::ColorNode); +define_render_node!( + ColorNode, + crate::ffi::GskColorNode, + RenderNodeType::ColorNode +); impl std::fmt::Debug for ColorNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/color_stop.rs b/gsk4/src/color_stop.rs index 95a181db41e4..6c5aac593e96 100644 --- a/gsk4/src/color_stop.rs +++ b/gsk4/src/color_stop.rs @@ -2,6 +2,7 @@ use std::fmt; +use crate::ffi; use gdk::RGBA; use glib::translate::*; diff --git a/gsk4/src/conic_gradient_node.rs b/gsk4/src/conic_gradient_node.rs index 1af126442d22..2748e356c292 100644 --- a/gsk4/src/conic_gradient_node.rs +++ b/gsk4/src/conic_gradient_node.rs @@ -4,7 +4,7 @@ use crate::{ConicGradientNode, RenderNodeType}; define_render_node!( ConicGradientNode, - ffi::GskConicGradientNode, + crate::ffi::GskConicGradientNode, RenderNodeType::ConicGradientNode ); diff --git a/gsk4/src/container_node.rs b/gsk4/src/container_node.rs index b276347ebd5c..4aac77caa132 100644 --- a/gsk4/src/container_node.rs +++ b/gsk4/src/container_node.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{ContainerNode, RenderNode, RenderNodeType}; +use crate::{ffi, ContainerNode, RenderNode, RenderNodeType}; define_render_node!( ContainerNode, diff --git a/gsk4/src/cross_fade_node.rs b/gsk4/src/cross_fade_node.rs index d28565432666..453adbdc5b20 100644 --- a/gsk4/src/cross_fade_node.rs +++ b/gsk4/src/cross_fade_node.rs @@ -4,7 +4,7 @@ use crate::{CrossFadeNode, RenderNodeType}; define_render_node!( CrossFadeNode, - ffi::GskCrossFadeNode, + crate::ffi::GskCrossFadeNode, RenderNodeType::CrossFadeNode ); diff --git a/gsk4/src/debug_node.rs b/gsk4/src/debug_node.rs index 83764c69d76b..1643228f0f0c 100644 --- a/gsk4/src/debug_node.rs +++ b/gsk4/src/debug_node.rs @@ -2,7 +2,11 @@ use crate::{DebugNode, RenderNodeType}; -define_render_node!(DebugNode, ffi::GskDebugNode, RenderNodeType::DebugNode); +define_render_node!( + DebugNode, + crate::ffi::GskDebugNode, + RenderNodeType::DebugNode +); impl std::fmt::Debug for DebugNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/fill_node.rs b/gsk4/src/fill_node.rs index cdfe5d4b8300..40cb1bdc3064 100644 --- a/gsk4/src/fill_node.rs +++ b/gsk4/src/fill_node.rs @@ -2,7 +2,7 @@ use crate::{FillNode, RenderNodeType}; -define_render_node!(FillNode, ffi::GskFillNode, RenderNodeType::FillNode); +define_render_node!(FillNode, crate::ffi::GskFillNode, RenderNodeType::FillNode); impl std::fmt::Debug for FillNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/gl_shader.rs b/gsk4/src/gl_shader.rs index b4084bb1611c..97c878ea5de6 100644 --- a/gsk4/src/gl_shader.rs +++ b/gsk4/src/gl_shader.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::GLShader; +use crate::{ffi, GLShader}; impl GLShader { #[doc(alias = "gsk_gl_shader_get_arg_vec2")] diff --git a/gsk4/src/gl_shader_node.rs b/gsk4/src/gl_shader_node.rs index 9fe8ec856f0a..00f0fbfc06d7 100644 --- a/gsk4/src/gl_shader_node.rs +++ b/gsk4/src/gl_shader_node.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{GLShaderNode, RenderNode, RenderNodeType}; +use crate::{ffi, GLShaderNode, RenderNode, RenderNodeType}; define_render_node!( GLShaderNode, diff --git a/gsk4/src/inset_shadow_node.rs b/gsk4/src/inset_shadow_node.rs index 951eb8cce8b9..0eb212d39e9f 100644 --- a/gsk4/src/inset_shadow_node.rs +++ b/gsk4/src/inset_shadow_node.rs @@ -4,7 +4,7 @@ use crate::{InsetShadowNode, RenderNodeType}; define_render_node!( InsetShadowNode, - ffi::GskInsetShadowNode, + crate::ffi::GskInsetShadowNode, RenderNodeType::InsetShadowNode ); diff --git a/gsk4/src/lib.rs b/gsk4/src/lib.rs index b85e407e34a4..f26ce908515b 100644 --- a/gsk4/src/lib.rs +++ b/gsk4/src/lib.rs @@ -5,10 +5,10 @@ #![doc = include_str!("../README.md")] pub use cairo; -pub use ffi; pub use gdk; pub use glib; pub use graphene; +pub use gsk4_sys as ffi; pub use pango; // GSK 4 has no runtime to initialize diff --git a/gsk4/src/linear_gradient_node.rs b/gsk4/src/linear_gradient_node.rs index 58cdb0422b14..93118af86c3d 100644 --- a/gsk4/src/linear_gradient_node.rs +++ b/gsk4/src/linear_gradient_node.rs @@ -4,7 +4,7 @@ use crate::{LinearGradientNode, RenderNodeType}; define_render_node!( LinearGradientNode, - ffi::GskLinearGradientNode, + crate::ffi::GskLinearGradientNode, RenderNodeType::LinearGradientNode ); diff --git a/gsk4/src/mask_node.rs b/gsk4/src/mask_node.rs index aaa895b27ff3..77c7ce2022de 100644 --- a/gsk4/src/mask_node.rs +++ b/gsk4/src/mask_node.rs @@ -2,7 +2,7 @@ use crate::{MaskNode, RenderNodeType}; -define_render_node!(MaskNode, ffi::GskMaskNode, RenderNodeType::MaskNode); +define_render_node!(MaskNode, crate::ffi::GskMaskNode, RenderNodeType::MaskNode); impl std::fmt::Debug for MaskNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/ngl_renderer.rs b/gsk4/src/ngl_renderer.rs index 8a3fc2640743..a46294d83ae4 100644 --- a/gsk4/src/ngl_renderer.rs +++ b/gsk4/src/ngl_renderer.rs @@ -4,7 +4,7 @@ use std::fmt; use glib::translate::*; -use crate::{prelude::*, Renderer}; +use crate::{ffi, prelude::*, Renderer}; glib::wrapper! { #[doc(alias = "GskNglRenderer")] diff --git a/gsk4/src/opacity_node.rs b/gsk4/src/opacity_node.rs index 507081a58681..09b847c7179a 100644 --- a/gsk4/src/opacity_node.rs +++ b/gsk4/src/opacity_node.rs @@ -4,7 +4,7 @@ use crate::{OpacityNode, RenderNodeType}; define_render_node!( OpacityNode, - ffi::GskOpacityNode, + crate::ffi::GskOpacityNode, RenderNodeType::OpacityNode ); diff --git a/gsk4/src/outset_shadow_node.rs b/gsk4/src/outset_shadow_node.rs index f3a233d54d6f..cf7abfb16b19 100644 --- a/gsk4/src/outset_shadow_node.rs +++ b/gsk4/src/outset_shadow_node.rs @@ -4,7 +4,7 @@ use crate::{OutsetShadowNode, RenderNodeType}; define_render_node!( OutsetShadowNode, - ffi::GskOutsetShadowNode, + crate::ffi::GskOutsetShadowNode, RenderNodeType::OutsetShadowNode ); diff --git a/gsk4/src/parse_location.rs b/gsk4/src/parse_location.rs index 48bd4749ce99..027bf5050e5a 100644 --- a/gsk4/src/parse_location.rs +++ b/gsk4/src/parse_location.rs @@ -4,7 +4,7 @@ use std::fmt; glib::wrapper! { #[doc(alias = "GskParseLocation")] - pub struct ParseLocation(BoxedInline); + pub struct ParseLocation(BoxedInline); } impl ParseLocation { diff --git a/gsk4/src/path.rs b/gsk4/src/path.rs index 1f301f2a4d62..afd3967fb5e7 100644 --- a/gsk4/src/path.rs +++ b/gsk4/src/path.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{Path, PathForeachFlags, PathOperation}; +use crate::{ffi, Path, PathForeachFlags, PathOperation}; impl Path { #[doc(alias = "gsk_path_foreach")] diff --git a/gsk4/src/path_builder.rs b/gsk4/src/path_builder.rs index 6ce61c86213f..be6cd1511f93 100644 --- a/gsk4/src/path_builder.rs +++ b/gsk4/src/path_builder.rs @@ -8,7 +8,7 @@ impl PathBuilder { #[doc(alias = "gsk_path_builder_add_cairo_path")] pub fn add_cairo_path(&self, path: &cairo::Path) { unsafe { - ffi::gsk_path_builder_add_cairo_path(self.to_glib_none().0, path.as_ptr()); + crate::ffi::gsk_path_builder_add_cairo_path(self.to_glib_none().0, path.as_ptr()); } } } diff --git a/gsk4/src/path_point.rs b/gsk4/src/path_point.rs index ef4af63e6a63..d6b397cfdc49 100644 --- a/gsk4/src/path_point.rs +++ b/gsk4/src/path_point.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{Path, PathDirection, PathPoint}; +use crate::{ffi, Path, PathDirection, PathPoint}; impl PathPoint { #[doc(alias = "gsk_path_point_get_curvature")] diff --git a/gsk4/src/radial_gradient_node.rs b/gsk4/src/radial_gradient_node.rs index 6b1fead132f8..27790fabd9e1 100644 --- a/gsk4/src/radial_gradient_node.rs +++ b/gsk4/src/radial_gradient_node.rs @@ -4,7 +4,7 @@ use crate::{RadialGradientNode, RenderNodeType}; define_render_node!( RadialGradientNode, - ffi::GskRadialGradientNode, + crate::ffi::GskRadialGradientNode, RenderNodeType::RadialGradientNode ); diff --git a/gsk4/src/render_node.rs b/gsk4/src/render_node.rs index a86b28dce33b..f1dc870f64b9 100644 --- a/gsk4/src/render_node.rs +++ b/gsk4/src/render_node.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, ParseLocation, RenderNode, RenderNodeType}; +use crate::{ffi, prelude::*, ParseLocation, RenderNode, RenderNodeType}; impl RenderNode { #[inline] @@ -146,7 +146,7 @@ macro_rules! define_render_node { unsafe { glib::translate::from_glib_full( glib::translate::IntoGlibPtr::<*mut $ffi_type>::into_glib_ptr(self) - as *mut ffi::GskRenderNode, + as *mut crate::ffi::GskRenderNode, ) } } @@ -158,9 +158,9 @@ macro_rules! define_render_node { } #[doc(hidden)] - impl glib::translate::FromGlibPtrFull<*mut ffi::GskRenderNode> for $rust_type { + impl glib::translate::FromGlibPtrFull<*mut crate::ffi::GskRenderNode> for $rust_type { #[inline] - unsafe fn from_glib_full(ptr: *mut ffi::GskRenderNode) -> Self { + unsafe fn from_glib_full(ptr: *mut crate::ffi::GskRenderNode) -> Self { glib::translate::from_glib_full(ptr as *mut $ffi_type) } } @@ -179,7 +179,7 @@ macro_rules! define_render_node { #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); - glib::translate::from_glib_full(ffi::gsk_value_dup_render_node( + glib::translate::from_glib_full(crate::ffi::gsk_value_dup_render_node( glib::translate::ToGlibPtr::to_glib_none(value).0, )) } @@ -192,7 +192,7 @@ macro_rules! define_render_node { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { - ffi::gsk_value_set_render_node( + crate::ffi::gsk_value_set_render_node( glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0, self.as_ptr() as *mut _, ) @@ -215,7 +215,7 @@ macro_rules! define_render_node { skip_assert_initialized!(); let mut value = glib::Value::for_value_type::(); unsafe { - ffi::gsk_value_set_render_node( + crate::ffi::gsk_value_set_render_node( glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0, s.map(|s| s.as_ptr()).unwrap_or(std::ptr::null_mut()) as *mut _, ) diff --git a/gsk4/src/repeat_node.rs b/gsk4/src/repeat_node.rs index 0067aaaae531..01eb61af1976 100644 --- a/gsk4/src/repeat_node.rs +++ b/gsk4/src/repeat_node.rs @@ -2,7 +2,11 @@ use crate::{RenderNodeType, RepeatNode}; -define_render_node!(RepeatNode, ffi::GskRepeatNode, RenderNodeType::RepeatNode); +define_render_node!( + RepeatNode, + crate::ffi::GskRepeatNode, + RenderNodeType::RepeatNode +); impl std::fmt::Debug for RepeatNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/repeating_linear_gradient_node.rs b/gsk4/src/repeating_linear_gradient_node.rs index 3f43ac6eefd4..c2e9d97870a7 100644 --- a/gsk4/src/repeating_linear_gradient_node.rs +++ b/gsk4/src/repeating_linear_gradient_node.rs @@ -4,7 +4,7 @@ use crate::{RenderNodeType, RepeatingLinearGradientNode}; define_render_node!( RepeatingLinearGradientNode, - ffi::GskRepeatingLinearGradientNode, + crate::ffi::GskRepeatingLinearGradientNode, RenderNodeType::RepeatingLinearGradientNode ); diff --git a/gsk4/src/repeating_radial_gradient_node.rs b/gsk4/src/repeating_radial_gradient_node.rs index ee72183d7fa8..4399f76f8226 100644 --- a/gsk4/src/repeating_radial_gradient_node.rs +++ b/gsk4/src/repeating_radial_gradient_node.rs @@ -4,7 +4,7 @@ use crate::{RenderNodeType, RepeatingRadialGradientNode}; define_render_node!( RepeatingRadialGradientNode, - ffi::GskRepeatingRadialGradientNode, + crate::ffi::GskRepeatingRadialGradientNode, RenderNodeType::RepeatingRadialGradientNode ); diff --git a/gsk4/src/rounded_clip_node.rs b/gsk4/src/rounded_clip_node.rs index 46c0fd701736..cbcfb98afdf7 100644 --- a/gsk4/src/rounded_clip_node.rs +++ b/gsk4/src/rounded_clip_node.rs @@ -4,7 +4,7 @@ use crate::{RenderNodeType, RoundedClipNode}; define_render_node!( RoundedClipNode, - ffi::GskRoundedClipNode, + crate::ffi::GskRoundedClipNode, RenderNodeType::RoundedClipNode ); diff --git a/gsk4/src/rounded_rect.rs b/gsk4/src/rounded_rect.rs index a4b7a422328e..8f99c5492810 100644 --- a/gsk4/src/rounded_rect.rs +++ b/gsk4/src/rounded_rect.rs @@ -2,6 +2,7 @@ use std::mem; +use crate::ffi; use glib::translate::*; use graphene::{Point, Rect, Size}; diff --git a/gsk4/src/shadow.rs b/gsk4/src/shadow.rs index 79ca8a03956c..dfd974a3bcd4 100644 --- a/gsk4/src/shadow.rs +++ b/gsk4/src/shadow.rs @@ -2,6 +2,7 @@ use std::fmt; +use crate::ffi; use gdk::RGBA; use glib::translate::*; diff --git a/gsk4/src/shadow_node.rs b/gsk4/src/shadow_node.rs index 0db43507d749..71836a75c607 100644 --- a/gsk4/src/shadow_node.rs +++ b/gsk4/src/shadow_node.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{RenderNodeType, Shadow, ShadowNode}; +use crate::{ffi, RenderNodeType, Shadow, ShadowNode}; define_render_node!(ShadowNode, ffi::GskShadowNode, RenderNodeType::ShadowNode); diff --git a/gsk4/src/stroke_node.rs b/gsk4/src/stroke_node.rs index 3247ef2dd6bc..b76330c75f0e 100644 --- a/gsk4/src/stroke_node.rs +++ b/gsk4/src/stroke_node.rs @@ -2,7 +2,11 @@ use crate::{RenderNodeType, StrokeNode}; -define_render_node!(StrokeNode, ffi::GskStrokeNode, RenderNodeType::StrokeNode); +define_render_node!( + StrokeNode, + crate::ffi::GskStrokeNode, + RenderNodeType::StrokeNode +); impl std::fmt::Debug for StrokeNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/text_node.rs b/gsk4/src/text_node.rs index ffab8936a1d7..bda786310f02 100644 --- a/gsk4/src/text_node.rs +++ b/gsk4/src/text_node.rs @@ -2,7 +2,7 @@ use crate::{RenderNodeType, TextNode}; -define_render_node!(TextNode, ffi::GskTextNode, RenderNodeType::TextNode); +define_render_node!(TextNode, crate::ffi::GskTextNode, RenderNodeType::TextNode); impl std::fmt::Debug for TextNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/gsk4/src/texture_node.rs b/gsk4/src/texture_node.rs index 9f38a4fe61fb..7ce6507cf7d7 100644 --- a/gsk4/src/texture_node.rs +++ b/gsk4/src/texture_node.rs @@ -4,7 +4,7 @@ use crate::{RenderNodeType, TextureNode}; define_render_node!( TextureNode, - ffi::GskTextureNode, + crate::ffi::GskTextureNode, RenderNodeType::TextureNode ); diff --git a/gsk4/src/texture_scale_node.rs b/gsk4/src/texture_scale_node.rs index 765375f674a1..ab126b925bec 100644 --- a/gsk4/src/texture_scale_node.rs +++ b/gsk4/src/texture_scale_node.rs @@ -4,7 +4,7 @@ use crate::{RenderNodeType, TextureScaleNode}; define_render_node!( TextureScaleNode, - ffi::GskTextureScaleNode, + crate::ffi::GskTextureScaleNode, RenderNodeType::TextureScaleNode ); diff --git a/gsk4/src/transform.rs b/gsk4/src/transform.rs index bdb214a52c9c..29a1d2e69aa1 100644 --- a/gsk4/src/transform.rs +++ b/gsk4/src/transform.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::Transform; +use crate::{ffi, Transform}; impl Transform { #[doc(alias = "gsk_transform_parse")] diff --git a/gsk4/src/transform_node.rs b/gsk4/src/transform_node.rs index 17a1b7297ec5..b53d58f58337 100644 --- a/gsk4/src/transform_node.rs +++ b/gsk4/src/transform_node.rs @@ -4,7 +4,7 @@ use crate::{RenderNodeType, TransformNode}; define_render_node!( TransformNode, - ffi::GskTransformNode, + crate::ffi::GskTransformNode, RenderNodeType::TransformNode ); diff --git a/gtk4/Cargo.toml b/gtk4/Cargo.toml index 27d9e4d5508f..a4eab54f863a 100644 --- a/gtk4/Cargo.toml +++ b/gtk4/Cargo.toml @@ -17,14 +17,14 @@ version.workspace = true name = "gtk4" [features] -v4_2 = ["ffi/v4_2", "gdk/v4_2", "gsk/v4_2"] -v4_4 = ["ffi/v4_4", "v4_2", "gdk/v4_4", "gsk/v4_4"] -v4_6 = ["ffi/v4_6", "v4_4", "gdk/v4_6", "gsk/v4_6", "pango/v1_50"] -v4_8 = ["ffi/v4_8", "v4_6", "gdk/v4_8"] -v4_10 = ["ffi/v4_10", "v4_8", "gdk/v4_10", "gsk/v4_10"] -v4_12 = ["ffi/v4_12", "v4_10", "gdk/v4_12"] -v4_14 = ["ffi/v4_14", "v4_12", "gdk/v4_14", "gsk/v4_14"] -v4_16 = ["ffi/v4_16", "v4_14", "gdk/v4_16"] +v4_2 = ["gtk4-sys/v4_2", "gdk/v4_2", "gsk/v4_2"] +v4_4 = ["gtk4-sys/v4_4", "v4_2", "gdk/v4_4", "gsk/v4_4"] +v4_6 = ["gtk4-sys/v4_6", "v4_4", "gdk/v4_6", "gsk/v4_6", "pango/v1_50"] +v4_8 = ["gtk4-sys/v4_8", "v4_6", "gdk/v4_8"] +v4_10 = ["gtk4-sys/v4_10", "v4_8", "gdk/v4_10", "gsk/v4_10"] +v4_12 = ["gtk4-sys/v4_12", "v4_10", "gdk/v4_12"] +v4_14 = ["gtk4-sys/v4_14", "v4_12", "gdk/v4_14", "gsk/v4_14"] +v4_16 = ["gtk4-sys/v4_16", "v4_14", "gdk/v4_16"] gio_v2_80 = ["gio/v2_80"] xml_validation = ["gtk4-macros/xml_validation"] blueprint = ["gtk4-macros/blueprint"] @@ -40,7 +40,7 @@ gnome_43 = ["v4_8", "cairo-rs/v1_16", "gdk-pixbuf/v2_42", "gio/v2_74"] gnome_42 = ["v4_6", "cairo-rs/v1_16", "gdk-pixbuf/v2_42", "gio/v2_72"] [dependencies] -ffi = {package = "gtk4-sys", path = "./sys", version = "0.9"} +gtk4-sys.workspace = true field-offset = "0.3" futures-channel = "0.3" gdk.workspace = true diff --git a/gtk4/src/accessible.rs b/gtk4/src/accessible.rs index df1178c6a7d9..291cd5bae833 100644 --- a/gtk4/src/accessible.rs +++ b/gtk4/src/accessible.rs @@ -3,8 +3,9 @@ use glib::{translate::*, Value}; use crate::{ - prelude::*, Accessible, AccessibleAutocomplete, AccessibleInvalidState, AccessibleProperty, - AccessibleRelation, AccessibleSort, AccessibleState, AccessibleTristate, Orientation, + ffi, prelude::*, Accessible, AccessibleAutocomplete, AccessibleInvalidState, + AccessibleProperty, AccessibleRelation, AccessibleSort, AccessibleState, AccessibleTristate, + Orientation, }; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/accessible_text_range.rs b/gtk4/src/accessible_text_range.rs index 79a4b3cc9412..10a7a3072b0b 100644 --- a/gtk4/src/accessible_text_range.rs +++ b/gtk4/src/accessible_text_range.rs @@ -3,7 +3,7 @@ #[derive(Copy, Clone)] #[doc(alias = "GtkAccessibleTextRange")] #[repr(transparent)] -pub struct AccessibleTextRange(ffi::GtkAccessibleTextRange); +pub struct AccessibleTextRange(crate::ffi::GtkAccessibleTextRange); impl AccessibleTextRange { pub fn start(&self) -> usize { diff --git a/gtk4/src/actionable.rs b/gtk4/src/actionable.rs index c159df45df02..a5c7574fc8e3 100644 --- a/gtk4/src/actionable.rs +++ b/gtk4/src/actionable.rs @@ -17,7 +17,7 @@ pub trait ActionableExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "gtk_actionable_set_action_target_value")] fn set_action_target(&self, target: Option>) { unsafe { - ffi::gtk_actionable_set_action_target_value( + crate::ffi::gtk_actionable_set_action_target_value( self.as_ref().to_glib_none().0, target.map(|v| v.into()).to_glib_none().0, ); diff --git a/gtk4/src/application.rs b/gtk4/src/application.rs index 9f72e4678955..f2020ea07712 100644 --- a/gtk4/src/application.rs +++ b/gtk4/src/application.rs @@ -13,7 +13,7 @@ impl Application { skip_assert_initialized!(); let app: Application = unsafe { application_id.run_with_gstr(|application_id| { - from_glib_full(ffi::gtk_application_new( + from_glib_full(crate::ffi::gtk_application_new( application_id.to_glib_none().0, flags.into_glib(), )) diff --git a/gtk4/src/assistant.rs b/gtk4/src/assistant.rs index 58c6ebf06cfc..19faf68131a0 100644 --- a/gtk4/src/assistant.rs +++ b/gtk4/src/assistant.rs @@ -9,7 +9,7 @@ impl Assistant { #[doc(alias = "set_forward_page_func")] pub fn unset_forward_page_func(&self) { unsafe { - ffi::gtk_assistant_set_forward_page_func( + crate::ffi::gtk_assistant_set_forward_page_func( self.to_glib_none().0, None, std::ptr::null_mut(), diff --git a/gtk4/src/bitset_iter.rs b/gtk4/src/bitset_iter.rs index bce2dda95191..ac4fcb52f74c 100644 --- a/gtk4/src/bitset_iter.rs +++ b/gtk4/src/bitset_iter.rs @@ -4,7 +4,7 @@ use std::marker::PhantomData; use glib::translate::*; -use crate::Bitset; +use crate::{ffi, Bitset}; #[derive(Copy, Clone)] #[doc(alias = "GtkBitsetIter")] diff --git a/gtk4/src/bookmark_list.rs b/gtk4/src/bookmark_list.rs index b372fc8197b1..85deaef40d18 100644 --- a/gtk4/src/bookmark_list.rs +++ b/gtk4/src/bookmark_list.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::BookmarkList; +use crate::{ffi, BookmarkList}; impl BookmarkList { #[doc(alias = "gtk_bookmark_list_get_io_priority")] diff --git a/gtk4/src/border.rs b/gtk4/src/border.rs index c0b948812989..a70a5d861700 100644 --- a/gtk4/src/border.rs +++ b/gtk4/src/border.rs @@ -2,6 +2,7 @@ use std::fmt; +use crate::ffi; use glib::translate::*; glib::wrapper! { diff --git a/gtk4/src/builder.rs b/gtk4/src/builder.rs index 5aa6c398c9d6..413e7b4cbcb8 100644 --- a/gtk4/src/builder.rs +++ b/gtk4/src/builder.rs @@ -4,7 +4,7 @@ use std::path::Path; use glib::{translate::*, Object}; -use crate::{prelude::*, Builder}; +use crate::{ffi, prelude::*, Builder}; impl Builder { #[doc(alias = "gtk_builder_new_from_file")] diff --git a/gtk4/src/builder_cscope.rs b/gtk4/src/builder_cscope.rs index a65694d0ff19..68ce61166f99 100644 --- a/gtk4/src/builder_cscope.rs +++ b/gtk4/src/builder_cscope.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::BuilderScope; +use crate::{ffi, BuilderScope}; glib::wrapper! { #[doc(alias = "GtkBuilderCScope")] diff --git a/gtk4/src/callback_action.rs b/gtk4/src/callback_action.rs index 54e602593717..7eb7c260590c 100644 --- a/gtk4/src/callback_action.rs +++ b/gtk4/src/callback_action.rs @@ -3,7 +3,7 @@ use glib::translate::*; use std::boxed::Box as Box_; -use crate::{CallbackAction, Widget}; +use crate::{ffi, CallbackAction, Widget}; impl CallbackAction { #[doc(alias = "gtk_callback_action_new")] diff --git a/gtk4/src/cell_area.rs b/gtk4/src/cell_area.rs index 38c97ebca83f..79a0ffb951fe 100644 --- a/gtk4/src/cell_area.rs +++ b/gtk4/src/cell_area.rs @@ -2,7 +2,7 @@ use glib::{translate::*, value::FromValue, Value}; -use crate::{prelude::*, CellArea, CellRenderer}; +use crate::{ffi, prelude::*, CellArea, CellRenderer}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/cell_layout.rs b/gtk4/src/cell_layout.rs index 1752ed799829..65529c932eea 100644 --- a/gtk4/src/cell_layout.rs +++ b/gtk4/src/cell_layout.rs @@ -26,7 +26,7 @@ pub trait CellLayoutExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "set_cell_data_func")] fn unset_cell_data_func(&self, cell: &impl IsA) { unsafe { - ffi::gtk_cell_layout_set_cell_data_func( + crate::ffi::gtk_cell_layout_set_cell_data_func( self.as_ref().to_glib_none().0, cell.as_ref().to_glib_none().0, None, diff --git a/gtk4/src/closure_expression.rs b/gtk4/src/closure_expression.rs index 05125e32120f..1af385b32d1b 100644 --- a/gtk4/src/closure_expression.rs +++ b/gtk4/src/closure_expression.rs @@ -2,7 +2,7 @@ use glib::{translate::*, Value}; -use crate::{prelude::*, ClosureExpression, Expression}; +use crate::{ffi, prelude::*, ClosureExpression, Expression}; define_expression!(ClosureExpression, ffi::GtkClosureExpression); diff --git a/gtk4/src/color_chooser.rs b/gtk4/src/color_chooser.rs index 204229745678..93dc67b15b5e 100644 --- a/gtk4/src/color_chooser.rs +++ b/gtk4/src/color_chooser.rs @@ -4,7 +4,7 @@ use gdk::RGBA; use glib::translate::*; use libc::c_int; -use crate::{prelude::*, ColorChooser, Orientation}; +use crate::{ffi, prelude::*, ColorChooser, Orientation}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/combo_box.rs b/gtk4/src/combo_box.rs index 9f658d09e982..9b282f76a256 100644 --- a/gtk4/src/combo_box.rs +++ b/gtk4/src/combo_box.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, ComboBox}; +use crate::{ffi, prelude::*, ComboBox}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/constant_expression.rs b/gtk4/src/constant_expression.rs index 85ad276dda31..f508e3a970b0 100644 --- a/gtk4/src/constant_expression.rs +++ b/gtk4/src/constant_expression.rs @@ -2,7 +2,7 @@ use glib::{translate::*, value::FromValue}; -use crate::{prelude::*, ConstantExpression}; +use crate::{ffi, prelude::*, ConstantExpression}; define_expression!(ConstantExpression, ffi::GtkConstantExpression); diff --git a/gtk4/src/constraint_guide.rs b/gtk4/src/constraint_guide.rs index 31b06e180ef6..b0203bbf8fa1 100644 --- a/gtk4/src/constraint_guide.rs +++ b/gtk4/src/constraint_guide.rs @@ -4,7 +4,7 @@ use std::mem::MaybeUninit; use glib::translate::*; -use crate::ConstraintGuide; +use crate::{ffi, ConstraintGuide}; impl ConstraintGuide { #[doc(alias = "gtk_constraint_guide_get_max_size")] diff --git a/gtk4/src/constraint_layout.rs b/gtk4/src/constraint_layout.rs index a8512b5ecf10..59332bc58410 100644 --- a/gtk4/src/constraint_layout.rs +++ b/gtk4/src/constraint_layout.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, Constraint, ConstraintLayout, Widget}; +use crate::{ffi, prelude::*, Constraint, ConstraintLayout, Widget}; impl ConstraintLayout { #[doc(alias = "gtk_constraint_layout_add_constraints_from_descriptionv")] diff --git a/gtk4/src/css_location.rs b/gtk4/src/css_location.rs index a6663c07d158..6369e12ae332 100644 --- a/gtk4/src/css_location.rs +++ b/gtk4/src/css_location.rs @@ -2,6 +2,7 @@ use std::fmt; +use crate::ffi; use glib::translate::*; glib::wrapper! { diff --git a/gtk4/src/custom_filter.rs b/gtk4/src/custom_filter.rs index 9bfc2e1707c8..c59d8873d3d5 100644 --- a/gtk4/src/custom_filter.rs +++ b/gtk4/src/custom_filter.rs @@ -4,7 +4,7 @@ use std::ptr; use glib::translate::*; -use crate::CustomFilter; +use crate::{ffi, CustomFilter}; impl CustomFilter { #[doc(alias = "gtk_custom_filter_new")] diff --git a/gtk4/src/custom_sorter.rs b/gtk4/src/custom_sorter.rs index 21ae53cc4555..d6dd8863e3bc 100644 --- a/gtk4/src/custom_sorter.rs +++ b/gtk4/src/custom_sorter.rs @@ -4,7 +4,7 @@ use std::ptr; use glib::translate::*; -use crate::{CustomSorter, Ordering}; +use crate::{ffi, CustomSorter, Ordering}; impl CustomSorter { #[doc(alias = "gtk_custom_sorter_new")] diff --git a/gtk4/src/dialog.rs b/gtk4/src/dialog.rs index 3d77806b20f5..4c1405148801 100644 --- a/gtk4/src/dialog.rs +++ b/gtk4/src/dialog.rs @@ -10,7 +10,7 @@ use std::{ use glib::translate::*; -use crate::{prelude::*, Dialog, DialogFlags, ResponseType, Widget, Window}; +use crate::{ffi, prelude::*, Dialog, DialogFlags, ResponseType, Widget, Window}; impl Dialog { #[doc(alias = "gtk_dialog_new_with_buttons")] diff --git a/gtk4/src/directory_list.rs b/gtk4/src/directory_list.rs index f75db878f86f..2bace284d7b0 100644 --- a/gtk4/src/directory_list.rs +++ b/gtk4/src/directory_list.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, DirectoryList}; +use crate::{ffi, prelude::*, DirectoryList}; impl DirectoryList { #[doc(alias = "gtk_directory_list_get_io_priority")] diff --git a/gtk4/src/drawing_area.rs b/gtk4/src/drawing_area.rs index cdeb2f85e757..f482c614217a 100644 --- a/gtk4/src/drawing_area.rs +++ b/gtk4/src/drawing_area.rs @@ -4,7 +4,7 @@ use std::{cell::RefCell, ptr}; use glib::translate::*; -use crate::{prelude::*, DrawingArea}; +use crate::{ffi, prelude::*, DrawingArea}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/drop_target.rs b/gtk4/src/drop_target.rs index dc06e0f1556e..2c2a21e6f0b8 100644 --- a/gtk4/src/drop_target.rs +++ b/gtk4/src/drop_target.rs @@ -9,7 +9,7 @@ use glib::{ Slice, Type, }; -use crate::{prelude::*, DropTarget}; +use crate::{ffi, prelude::*, DropTarget}; impl DropTarget { #[doc(alias = "gtk_drop_target_set_gtypes")] diff --git a/gtk4/src/editable.rs b/gtk4/src/editable.rs index 918256e84555..64689932642c 100644 --- a/gtk4/src/editable.rs +++ b/gtk4/src/editable.rs @@ -39,7 +39,7 @@ pub trait EditableExtManual: sealed::Sealed + IsA + 'static { impl> EditableExtManual for O {} unsafe extern "C" fn insert_text_trampoline( - this: *mut ffi::GtkEditable, + this: *mut crate::ffi::GtkEditable, new_text: *mut c_char, new_text_length: c_int, position: *mut c_int, diff --git a/gtk4/src/editable_label.rs b/gtk4/src/editable_label.rs index a035c5d93965..64f5d066b8fe 100644 --- a/gtk4/src/editable_label.rs +++ b/gtk4/src/editable_label.rs @@ -7,7 +7,7 @@ use glib::{ translate::*, }; -use crate::{prelude::*, EditableLabel}; +use crate::{ffi, prelude::*, EditableLabel}; impl EditableLabel { #[doc(alias = "editing")] diff --git a/gtk4/src/entry.rs b/gtk4/src/entry.rs index 05bcc621d0a4..211a0afc2b5b 100644 --- a/gtk4/src/entry.rs +++ b/gtk4/src/entry.rs @@ -15,7 +15,8 @@ pub trait EntryExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "gtk_entry_get_invisible_char")] #[doc(alias = "get_invisible_char")] fn invisible_char(&self) -> Option { - let ret = unsafe { ffi::gtk_entry_get_invisible_char(self.as_ref().to_glib_none().0) }; + let ret = + unsafe { crate::ffi::gtk_entry_get_invisible_char(self.as_ref().to_glib_none().0) }; if ret == 0 { return None; } diff --git a/gtk4/src/entry_buffer.rs b/gtk4/src/entry_buffer.rs index 5867a92d1fdd..8acd7ce8aadb 100644 --- a/gtk4/src/entry_buffer.rs +++ b/gtk4/src/entry_buffer.rs @@ -3,7 +3,7 @@ use glib::{translate::*, GString}; use libc::{c_int, c_uint}; -use crate::{prelude::*, EntryBuffer}; +use crate::{ffi, prelude::*, EntryBuffer}; impl EntryBuffer { #[doc(alias = "gtk_entry_buffer_new")] diff --git a/gtk4/src/entry_completion.rs b/gtk4/src/entry_completion.rs index cd55f237d84c..61bbb9963853 100644 --- a/gtk4/src/entry_completion.rs +++ b/gtk4/src/entry_completion.rs @@ -11,7 +11,7 @@ impl EntryCompletion { #[allow(deprecated)] pub fn entry(&self) -> Option { unsafe { - Option::::from_glib_none(ffi::gtk_entry_completion_get_entry( + Option::::from_glib_none(crate::ffi::gtk_entry_completion_get_entry( self.to_glib_none().0, )) .map(|widget| { diff --git a/gtk4/src/enums.rs b/gtk4/src/enums.rs index f1797da33ac8..e3a3b3bab587 100644 --- a/gtk4/src/enums.rs +++ b/gtk4/src/enums.rs @@ -4,7 +4,7 @@ use std::cmp; use glib::{translate::*, Quark}; -use crate::{prelude::*, CssParserWarning, Ordering}; +use crate::{ffi, prelude::*, CssParserWarning, Ordering}; impl From for Ordering { #[inline] diff --git a/gtk4/src/event_controller_key.rs b/gtk4/src/event_controller_key.rs index 55e4e97417b8..21e4812d8ff6 100644 --- a/gtk4/src/event_controller_key.rs +++ b/gtk4/src/event_controller_key.rs @@ -5,7 +5,7 @@ use std::{boxed::Box as Box_, mem::transmute}; use gdk::Key; use glib::{signal::connect_raw, translate::*, SignalHandlerId}; -use crate::{prelude::*, EventControllerKey}; +use crate::{ffi, prelude::*, EventControllerKey}; impl EventControllerKey { pub fn connect_key_pressed< diff --git a/gtk4/src/expression.rs b/gtk4/src/expression.rs index d4afa66ef5b7..4377eb7c8552 100644 --- a/gtk4/src/expression.rs +++ b/gtk4/src/expression.rs @@ -2,7 +2,7 @@ use glib::{translate::*, value::FromValue, Object, Type, Value}; -use crate::{prelude::*, Expression}; +use crate::{ffi, prelude::*, Expression}; #[doc(hidden)] impl AsRef for Expression { @@ -180,7 +180,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for Expression { #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); - from_glib_full(ffi::gtk_value_dup_expression(value.to_glib_none().0)) + from_glib_full(crate::ffi::gtk_value_dup_expression(value.to_glib_none().0)) } } @@ -188,7 +188,9 @@ impl glib::value::ToValue for Expression { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); - unsafe { ffi::gtk_value_set_expression(value.to_glib_none_mut().0, self.to_glib_none().0) } + unsafe { + crate::ffi::gtk_value_set_expression(value.to_glib_none_mut().0, self.to_glib_none().0) + } value } @@ -202,7 +204,9 @@ impl glib::value::ToValueOptional for Expression { fn to_value_optional(s: Option<&Self>) -> glib::Value { skip_assert_initialized!(); let mut value = glib::Value::for_value_type::(); - unsafe { ffi::gtk_value_set_expression(value.to_glib_none_mut().0, s.to_glib_none().0) } + unsafe { + crate::ffi::gtk_value_set_expression(value.to_glib_none_mut().0, s.to_glib_none().0) + } value } } @@ -211,7 +215,9 @@ impl From for glib::Value { fn from(e: Expression) -> Self { skip_assert_initialized!(); let mut value = glib::Value::for_value_type::(); - unsafe { ffi::gtk_value_take_expression(value.to_glib_none_mut().0, e.into_glib_ptr()) } + unsafe { + crate::ffi::gtk_value_take_expression(value.to_glib_none_mut().0, e.into_glib_ptr()) + } value } } @@ -292,68 +298,68 @@ macro_rules! define_expression { } #[doc(hidden)] - impl<'a> ToGlibPtr<'a, *const ffi::GtkExpression> for $rust_type { + impl<'a> ToGlibPtr<'a, *const crate::ffi::GtkExpression> for $rust_type { type Storage = ::std::marker::PhantomData<&'a $crate::glib::shared::Shared<$ffi_type, $rust_type>>; #[inline] fn to_glib_none( &'a self, - ) -> $crate::glib::translate::Stash<'a, *const ffi::GtkExpression, Self> { + ) -> $crate::glib::translate::Stash<'a, *const crate::ffi::GtkExpression, Self> { let stash = $crate::glib::translate::ToGlibPtr::<*const $ffi_type>::to_glib_none(self); $crate::glib::translate::Stash(stash.0 as *const _, stash.1) } #[inline] - fn to_glib_full(&self) -> *const ffi::GtkExpression { + fn to_glib_full(&self) -> *const crate::ffi::GtkExpression { $crate::glib::translate::ToGlibPtr::<*const $ffi_type>::to_glib_full(self) as *const _ } } #[doc(hidden)] - impl<'a> ToGlibPtr<'a, *mut ffi::GtkExpression> for $rust_type { + impl<'a> ToGlibPtr<'a, *mut crate::ffi::GtkExpression> for $rust_type { type Storage = ::std::marker::PhantomData<&'a $crate::glib::shared::Shared<$ffi_type, $rust_type>>; #[inline] fn to_glib_none( &'a self, - ) -> $crate::glib::translate::Stash<'a, *mut ffi::GtkExpression, Self> { + ) -> $crate::glib::translate::Stash<'a, *mut crate::ffi::GtkExpression, Self> { let stash = $crate::glib::translate::ToGlibPtr::<*mut $ffi_type>::to_glib_none(self); $crate::glib::translate::Stash(stash.0 as *mut _, stash.1) } #[inline] - fn to_glib_full(&self) -> *mut ffi::GtkExpression { + fn to_glib_full(&self) -> *mut crate::ffi::GtkExpression { $crate::glib::translate::ToGlibPtr::<*mut $ffi_type>::to_glib_full(self) as *mut _ } } #[doc(hidden)] - impl IntoGlibPtr<*mut ffi::GtkExpression> for $rust_type { + impl IntoGlibPtr<*mut crate::ffi::GtkExpression> for $rust_type { #[inline] - unsafe fn into_glib_ptr(self) -> *mut ffi::GtkExpression { + unsafe fn into_glib_ptr(self) -> *mut crate::ffi::GtkExpression { let s = std::mem::ManuallyDrop::new(self); s.to_glib_none().0 } } #[doc(hidden)] - impl IntoGlibPtr<*const ffi::GtkExpression> for $rust_type { + impl IntoGlibPtr<*const crate::ffi::GtkExpression> for $rust_type { #[inline] - unsafe fn into_glib_ptr(self) -> *const ffi::GtkExpression { + unsafe fn into_glib_ptr(self) -> *const crate::ffi::GtkExpression { let s = std::mem::ManuallyDrop::new(self); s.to_glib_none().0 } } #[doc(hidden)] - impl FromGlibPtrFull<*mut ffi::GtkExpression> for $rust_type { + impl FromGlibPtrFull<*mut crate::ffi::GtkExpression> for $rust_type { #[inline] - unsafe fn from_glib_full(ptr: *mut ffi::GtkExpression) -> Self { + unsafe fn from_glib_full(ptr: *mut crate::ffi::GtkExpression) -> Self { from_glib_full(ptr as *mut $ffi_type) } } @@ -370,7 +376,7 @@ macro_rules! define_expression { #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); - from_glib_full(ffi::gtk_value_dup_expression(value.to_glib_none().0)) + from_glib_full(crate::ffi::gtk_value_dup_expression(value.to_glib_none().0)) } } @@ -379,7 +385,7 @@ macro_rules! define_expression { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { - ffi::gtk_value_set_expression( + crate::ffi::gtk_value_set_expression( value.to_glib_none_mut().0, self.as_ptr() as *mut _, ) @@ -400,7 +406,7 @@ macro_rules! define_expression { skip_assert_initialized!(); let mut value = glib::Value::for_value_type::(); unsafe { - ffi::gtk_value_set_expression( + crate::ffi::gtk_value_set_expression( value.to_glib_none_mut().0, s.map(|s| s.as_ptr()).unwrap_or(std::ptr::null_mut()) as *mut _, ) @@ -414,7 +420,10 @@ macro_rules! define_expression { skip_assert_initialized!(); let mut value = glib::Value::for_value_type::<$rust_type>(); unsafe { - ffi::gtk_value_take_expression(value.to_glib_none_mut().0, e.into_glib_ptr()) + crate::ffi::gtk_value_take_expression( + value.to_glib_none_mut().0, + e.into_glib_ptr(), + ) } value } diff --git a/gtk4/src/expression_watch.rs b/gtk4/src/expression_watch.rs index 4c7f0739296e..3b7fba342284 100644 --- a/gtk4/src/expression_watch.rs +++ b/gtk4/src/expression_watch.rs @@ -2,6 +2,8 @@ use glib::{translate::*, value::FromValue, Value}; +use crate::ffi; + glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[doc(alias = "GtkExpressionWatch")] diff --git a/gtk4/src/file_chooser.rs b/gtk4/src/file_chooser.rs index 210d02791c92..deaa2af927a6 100644 --- a/gtk4/src/file_chooser.rs +++ b/gtk4/src/file_chooser.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::{prelude::*, FileChooser}; +use crate::{ffi, prelude::*, FileChooser}; use glib::translate::*; mod sealed { diff --git a/gtk4/src/file_chooser_dialog.rs b/gtk4/src/file_chooser_dialog.rs index f7276f4a92d7..235f96f469b1 100644 --- a/gtk4/src/file_chooser_dialog.rs +++ b/gtk4/src/file_chooser_dialog.rs @@ -5,7 +5,7 @@ use std::ptr; use glib::translate::*; use libc::c_char; -use crate::{prelude::*, FileChooserAction, FileChooserDialog, ResponseType, Widget, Window}; +use crate::{ffi, prelude::*, FileChooserAction, FileChooserDialog, ResponseType, Widget, Window}; impl FileChooserDialog { #[doc(alias = "gtk_file_chooser_dialog_new")] diff --git a/gtk4/src/flow_box.rs b/gtk4/src/flow_box.rs index 62b80e736b7a..6722c96b834c 100644 --- a/gtk4/src/flow_box.rs +++ b/gtk4/src/flow_box.rs @@ -4,7 +4,7 @@ use std::{boxed::Box as Box_, ptr}; use glib::translate::*; -use crate::{FlowBox, FlowBoxChild, Ordering}; +use crate::{ffi, FlowBox, FlowBoxChild, Ordering}; impl FlowBox { #[doc(alias = "gtk_flow_box_bind_model")] diff --git a/gtk4/src/font_chooser.rs b/gtk4/src/font_chooser.rs index 14e903035fce..f5c8394c140c 100644 --- a/gtk4/src/font_chooser.rs +++ b/gtk4/src/font_chooser.rs @@ -19,7 +19,7 @@ pub trait FontChooserExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "set_filter_func")] fn unset_filter_func(&self) { unsafe { - ffi::gtk_font_chooser_set_filter_func( + crate::ffi::gtk_font_chooser_set_filter_func( self.as_ref().to_glib_none().0, None, std::ptr::null_mut(), diff --git a/gtk4/src/font_dialog.rs b/gtk4/src/font_dialog.rs index f6b21041e589..f2215642a39e 100644 --- a/gtk4/src/font_dialog.rs +++ b/gtk4/src/font_dialog.rs @@ -4,7 +4,7 @@ use std::{boxed::Box as Box_, pin::Pin, ptr}; use glib::translate::*; -use crate::{prelude::*, FontDialog, Window}; +use crate::{ffi, prelude::*, FontDialog, Window}; impl FontDialog { #[doc(alias = "gtk_font_dialog_choose_font_and_features")] diff --git a/gtk4/src/functions.rs b/gtk4/src/functions.rs index 3d22dec17cbe..ee226048ae27 100644 --- a/gtk4/src/functions.rs +++ b/gtk4/src/functions.rs @@ -5,7 +5,7 @@ use std::{boxed::Box as Box_, pin::Pin, sync::OnceLock}; use glib::{translate::*, Quark, Slice}; pub use crate::auto::functions::*; -use crate::{prelude::*, AboutDialog, StyleProvider, Window}; +use crate::{ffi, prelude::*, AboutDialog, StyleProvider, Window}; #[doc(alias = "gtk_accelerator_valid")] pub fn accelerator_valid(keyval: gdk::Key, modifiers: gdk::ModifierType) -> bool { diff --git a/gtk4/src/gesture_stylus.rs b/gtk4/src/gesture_stylus.rs index 67c29e4763b3..55a76c1b3ba7 100644 --- a/gtk4/src/gesture_stylus.rs +++ b/gtk4/src/gesture_stylus.rs @@ -3,7 +3,7 @@ use gdk::AxisUse; use glib::translate::*; -use crate::GestureStylus; +use crate::{ffi, GestureStylus}; impl GestureStylus { #[doc(alias = "gtk_gesture_stylus_get_axes")] diff --git a/gtk4/src/icon_theme.rs b/gtk4/src/icon_theme.rs index 716c5f5e48f2..293e4e919b18 100644 --- a/gtk4/src/icon_theme.rs +++ b/gtk4/src/icon_theme.rs @@ -10,7 +10,7 @@ impl IconTheme { pub fn icon_sizes(&self, icon_name: impl IntoGStr) -> Slice { unsafe { let sizes_ptr = icon_name.run_with_gstr(|icon_name| { - ffi::gtk_icon_theme_get_icon_sizes(self.to_glib_none().0, icon_name.as_ptr()) + crate::ffi::gtk_icon_theme_get_icon_sizes(self.to_glib_none().0, icon_name.as_ptr()) }); let mut len = 0; if !sizes_ptr.is_null() { diff --git a/gtk4/src/im_context_simple.rs b/gtk4/src/im_context_simple.rs index 4c22a44a07db..4792408795d0 100644 --- a/gtk4/src/im_context_simple.rs +++ b/gtk4/src/im_context_simple.rs @@ -11,7 +11,7 @@ impl IMContextSimple { pub fn add_compose_file(&self, compose_file: impl AsRef) { unsafe { let compose_file = compose_file.as_ref(); - ffi::gtk_im_context_simple_add_compose_file( + crate::ffi::gtk_im_context_simple_add_compose_file( self.to_glib_none().0, compose_file.to_glib_none().0, ); diff --git a/gtk4/src/keyval_trigger.rs b/gtk4/src/keyval_trigger.rs index 58bfe936e111..9ded0e31f2e7 100644 --- a/gtk4/src/keyval_trigger.rs +++ b/gtk4/src/keyval_trigger.rs @@ -5,7 +5,7 @@ use std::fmt; use gdk::Key; use glib::translate::*; -use crate::{prelude::*, ShortcutTrigger}; +use crate::{ffi, prelude::*, ShortcutTrigger}; glib::wrapper! { pub struct KeyvalTrigger(Object) @extends ShortcutTrigger; diff --git a/gtk4/src/label.rs b/gtk4/src/label.rs index dde59a2b347d..51d6ed11e53a 100644 --- a/gtk4/src/label.rs +++ b/gtk4/src/label.rs @@ -8,6 +8,10 @@ impl Label { #[doc(alias = "gtk_label_get_mnemonic_keyval")] #[doc(alias = "get_mnemonic_keyval")] pub fn mnemonic_keyval(&self) -> gdk::Key { - unsafe { from_glib(ffi::gtk_label_get_mnemonic_keyval(self.to_glib_none().0)) } + unsafe { + from_glib(crate::ffi::gtk_label_get_mnemonic_keyval( + self.to_glib_none().0, + )) + } } } diff --git a/gtk4/src/lib.rs b/gtk4/src/lib.rs index 70c16f29bf88..60536d7a5432 100644 --- a/gtk4/src/lib.rs +++ b/gtk4/src/lib.rs @@ -6,13 +6,13 @@ // Re-export gtk dependencies pub use cairo; -pub use ffi; pub use gdk; pub use gdk_pixbuf; pub use gio; pub use glib; pub use graphene; pub use gsk; +pub use gtk4_sys as ffi; pub use pango; #[macro_use] diff --git a/gtk4/src/list_box.rs b/gtk4/src/list_box.rs index 82c338bf5bec..9fd1cd546e45 100644 --- a/gtk4/src/list_box.rs +++ b/gtk4/src/list_box.rs @@ -4,7 +4,7 @@ use std::{boxed::Box as Box_, ptr}; use glib::translate::*; -use crate::{ListBox, ListBoxRow, Ordering}; +use crate::{ffi, ListBox, ListBoxRow, Ordering}; impl ListBox { #[doc(alias = "gtk_list_box_bind_model")] diff --git a/gtk4/src/list_store.rs b/gtk4/src/list_store.rs index bfc0bccc3e9f..a7d968e1fb74 100644 --- a/gtk4/src/list_store.rs +++ b/gtk4/src/list_store.rs @@ -3,7 +3,7 @@ use glib::{translate::*, Type, Value}; use libc::c_int; -use crate::{prelude::*, ListStore, TreeIter, TreeModel}; +use crate::{ffi, prelude::*, ListStore, TreeIter, TreeModel}; impl ListStore { #[doc(alias = "gtk_list_store_newv")] diff --git a/gtk4/src/map_list_model.rs b/gtk4/src/map_list_model.rs index 2e08dc2bb5be..b5bcadd7ea63 100644 --- a/gtk4/src/map_list_model.rs +++ b/gtk4/src/map_list_model.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, MapListModel}; +use crate::{ffi, prelude::*, MapListModel}; impl MapListModel { #[doc(alias = "gtk_map_list_model_new")] diff --git a/gtk4/src/media_stream.rs b/gtk4/src/media_stream.rs index a918606dd6d7..1566b7d88ee3 100644 --- a/gtk4/src/media_stream.rs +++ b/gtk4/src/media_stream.rs @@ -15,7 +15,7 @@ pub trait MediaStreamExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "gerror")] fn set_error(&self, error: glib::Error) { unsafe { - ffi::gtk_media_stream_gerror( + crate::ffi::gtk_media_stream_gerror( self.as_ref().to_glib_none().0, mut_override(error.into_glib_ptr()), ); diff --git a/gtk4/src/menu_button.rs b/gtk4/src/menu_button.rs index 8da37568676d..f4a818c09930 100644 --- a/gtk4/src/menu_button.rs +++ b/gtk4/src/menu_button.rs @@ -9,7 +9,7 @@ impl MenuButton { #[doc(alias = "set_create_popup_func")] pub fn unset_create_popup_func(&self) { unsafe { - ffi::gtk_menu_button_set_create_popup_func( + crate::ffi::gtk_menu_button_set_create_popup_func( self.to_glib_none().0, None, std::ptr::null_mut(), diff --git a/gtk4/src/message_dialog.rs b/gtk4/src/message_dialog.rs index 1fd0b7acf23e..b44731c39843 100644 --- a/gtk4/src/message_dialog.rs +++ b/gtk4/src/message_dialog.rs @@ -4,7 +4,9 @@ use std::ptr; use glib::translate::*; -use crate::{prelude::*, ButtonsType, DialogFlags, MessageDialog, MessageType, Widget, Window}; +use crate::{ + ffi, prelude::*, ButtonsType, DialogFlags, MessageDialog, MessageType, Widget, Window, +}; impl MessageDialog { #[doc(alias = "gtk_message_dialog_new")] diff --git a/gtk4/src/mnemonic_trigger.rs b/gtk4/src/mnemonic_trigger.rs index f51983252775..446b0fa69ed7 100644 --- a/gtk4/src/mnemonic_trigger.rs +++ b/gtk4/src/mnemonic_trigger.rs @@ -5,7 +5,7 @@ use std::fmt; use gdk::Key; use glib::translate::*; -use crate::ShortcutTrigger; +use crate::{ffi, ShortcutTrigger}; glib::wrapper! { pub struct MnemonicTrigger(Object) @extends ShortcutTrigger; diff --git a/gtk4/src/notebook.rs b/gtk4/src/notebook.rs index e75a337bc472..6eb2ffe555ab 100644 --- a/gtk4/src/notebook.rs +++ b/gtk4/src/notebook.rs @@ -3,7 +3,7 @@ use glib::translate::*; use libc::c_int; -use crate::{prelude::*, Notebook, Widget}; +use crate::{ffi, prelude::*, Notebook, Widget}; impl Notebook { #[doc(alias = "gtk_notebook_append_page")] diff --git a/gtk4/src/object_expression.rs b/gtk4/src/object_expression.rs index 5ce92e972169..2d455c8ba8ac 100644 --- a/gtk4/src/object_expression.rs +++ b/gtk4/src/object_expression.rs @@ -4,7 +4,7 @@ use glib::translate::*; use crate::ObjectExpression; -define_expression!(ObjectExpression, ffi::GtkObjectExpression); +define_expression!(ObjectExpression, crate::ffi::GtkObjectExpression); impl std::fmt::Debug for ObjectExpression { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/gtk4/src/overlay.rs b/gtk4/src/overlay.rs index f8221ccd9c46..3f02a849ded8 100644 --- a/gtk4/src/overlay.rs +++ b/gtk4/src/overlay.rs @@ -7,7 +7,7 @@ use glib::{ translate::*, }; -use crate::{prelude::*, Overlay, Widget}; +use crate::{ffi, prelude::*, Overlay, Widget}; impl Overlay { pub fn connect_get_child_position(&self, f: F) -> SignalHandlerId diff --git a/gtk4/src/pad_action_entry.rs b/gtk4/src/pad_action_entry.rs index a14da5314485..259b0272677b 100644 --- a/gtk4/src/pad_action_entry.rs +++ b/gtk4/src/pad_action_entry.rs @@ -4,7 +4,7 @@ use std::ffi::CStr; use glib::translate::*; -use crate::PadActionType; +use crate::{ffi, PadActionType}; glib::wrapper! { #[doc(alias = "GtkPadActionEntry")] diff --git a/gtk4/src/page_range.rs b/gtk4/src/page_range.rs index 8e1b2d23bb65..d5fa796784f8 100644 --- a/gtk4/src/page_range.rs +++ b/gtk4/src/page_range.rs @@ -2,6 +2,7 @@ use std::fmt; +use crate::ffi; use glib::translate::*; glib::wrapper! { diff --git a/gtk4/src/param_spec_expression.rs b/gtk4/src/param_spec_expression.rs index 878ba778a9d6..1911e5c099d7 100644 --- a/gtk4/src/param_spec_expression.rs +++ b/gtk4/src/param_spec_expression.rs @@ -4,7 +4,7 @@ use std::marker::PhantomData; use glib::{gobject_ffi, shared::Shared, translate::*, ParamSpec, Value}; -use crate::{prelude::*, Expression, ParamSpecExpression}; +use crate::{ffi, prelude::*, Expression, ParamSpecExpression}; impl HasParamSpec for Expression { type ParamSpec = ParamSpecExpression; diff --git a/gtk4/src/print_job.rs b/gtk4/src/print_job.rs index 1c8c6a0b207e..dd4500bb39ec 100644 --- a/gtk4/src/print_job.rs +++ b/gtk4/src/print_job.rs @@ -4,7 +4,7 @@ use std::boxed::Box as Box_; use glib::translate::*; -use crate::PrintJob; +use crate::{ffi, PrintJob}; impl PrintJob { #[doc(alias = "gtk_print_job_send")] diff --git a/gtk4/src/print_operation.rs b/gtk4/src/print_operation.rs index 3d56b3b20e33..38348167a2fd 100644 --- a/gtk4/src/print_operation.rs +++ b/gtk4/src/print_operation.rs @@ -10,7 +10,7 @@ impl PrintOperation { pub fn error(&self) -> Option { unsafe { let mut error = std::ptr::null_mut(); - ffi::gtk_print_operation_get_error(self.to_glib_none().0, &mut error); + crate::ffi::gtk_print_operation_get_error(self.to_glib_none().0, &mut error); if error.is_null() { None } else { diff --git a/gtk4/src/print_settings.rs b/gtk4/src/print_settings.rs index ef344def1a0c..fe93fe6e0a1a 100644 --- a/gtk4/src/print_settings.rs +++ b/gtk4/src/print_settings.rs @@ -9,7 +9,7 @@ impl PrintSettings { pub fn set_page_ranges(&self, page_ranges: &[PageRange]) { let num_ranges = page_ranges.len() as i32; unsafe { - ffi::gtk_print_settings_set_page_ranges( + crate::ffi::gtk_print_settings_set_page_ranges( self.to_glib_none().0, mut_override(page_ranges.to_glib_none().0), num_ranges, diff --git a/gtk4/src/property_expression.rs b/gtk4/src/property_expression.rs index de90fc60bbd8..64b89a173efb 100644 --- a/gtk4/src/property_expression.rs +++ b/gtk4/src/property_expression.rs @@ -4,7 +4,7 @@ use glib::translate::*; use crate::{prelude::*, PropertyExpression}; -define_expression!(PropertyExpression, ffi::GtkPropertyExpression); +define_expression!(PropertyExpression, crate::ffi::GtkPropertyExpression); impl std::fmt::Debug for PropertyExpression { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/gtk4/src/recent_data.rs b/gtk4/src/recent_data.rs index 3cf04f1da69f..ce0840aefd43 100644 --- a/gtk4/src/recent_data.rs +++ b/gtk4/src/recent_data.rs @@ -2,6 +2,7 @@ use std::ffi::CStr; +use crate::ffi; use glib::{collections::StrV, translate::*, GStringPtr}; glib::wrapper! { diff --git a/gtk4/src/response_type.rs b/gtk4/src/response_type.rs index e91f63204abb..3df4e9da2458 100644 --- a/gtk4/src/response_type.rs +++ b/gtk4/src/response_type.rs @@ -2,7 +2,7 @@ use std::fmt; -use crate::prelude::*; +use crate::{ffi, prelude::*}; use glib::{translate::*, value::FromValue, Type, Value}; #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] diff --git a/gtk4/src/rt.rs b/gtk4/src/rt.rs index 0c5e6b5af102..686ea290cca8 100644 --- a/gtk4/src/rt.rs +++ b/gtk4/src/rt.rs @@ -5,6 +5,7 @@ use std::{ sync::atomic::{AtomicBool, Ordering}, }; +use crate::ffi; use glib::translate::*; #[cfg(target_os = "macos")] diff --git a/gtk4/src/scale.rs b/gtk4/src/scale.rs index 1742063027ec..c1a8f7222c61 100644 --- a/gtk4/src/scale.rs +++ b/gtk4/src/scale.rs @@ -16,7 +16,7 @@ pub trait ScaleExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "set_format_value_func")] fn unset_format_value_func(&self) { unsafe { - ffi::gtk_scale_set_format_value_func( + crate::ffi::gtk_scale_set_format_value_func( self.as_ref().to_glib_none().0, None, std::ptr::null_mut(), diff --git a/gtk4/src/shortcut_trigger.rs b/gtk4/src/shortcut_trigger.rs index f922a9aaaa9d..1f59f7126492 100644 --- a/gtk4/src/shortcut_trigger.rs +++ b/gtk4/src/shortcut_trigger.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, ShortcutTrigger}; +use crate::{ffi, prelude::*, ShortcutTrigger}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/shortcuts_section.rs b/gtk4/src/shortcuts_section.rs index 06abc87d5ced..c75b9c95eddc 100644 --- a/gtk4/src/shortcuts_section.rs +++ b/gtk4/src/shortcuts_section.rs @@ -7,7 +7,7 @@ use glib::{ translate::*, }; -use crate::{prelude::*, ShortcutsSection}; +use crate::{ffi, prelude::*, ShortcutsSection}; impl ShortcutsSection { // todo: figure out what the bool return value here corresponds to diff --git a/gtk4/src/signal_list_item_factory.rs b/gtk4/src/signal_list_item_factory.rs index 78f4c42fd3fd..8d02c52c6857 100644 --- a/gtk4/src/signal_list_item_factory.rs +++ b/gtk4/src/signal_list_item_factory.rs @@ -11,7 +11,7 @@ use glib::{ use crate::SignalListItemFactory; #[cfg(not(feature = "v4_8"))] -use crate::{prelude::*, ListItem}; +use crate::{ffi, prelude::*, ListItem}; impl SignalListItemFactory { #[doc(alias = "bind")] diff --git a/gtk4/src/snapshot.rs b/gtk4/src/snapshot.rs index 1b3735d42445..17eff46cd529 100644 --- a/gtk4/src/snapshot.rs +++ b/gtk4/src/snapshot.rs @@ -4,7 +4,7 @@ use std::borrow::Borrow; use glib::translate::*; -use crate::{prelude::*, Snapshot}; +use crate::{ffi, prelude::*, Snapshot}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/spin_button.rs b/gtk4/src/spin_button.rs index 5998a37c82af..6eb1ed37f5ab 100644 --- a/gtk4/src/spin_button.rs +++ b/gtk4/src/spin_button.rs @@ -8,7 +8,7 @@ use glib::{ }; use libc::{c_double, c_int}; -use crate::{prelude::*, SpinButton}; +use crate::{ffi, prelude::*, SpinButton}; impl SpinButton { pub fn connect_input(&self, f: F) -> SignalHandlerId diff --git a/gtk4/src/style_context.rs b/gtk4/src/style_context.rs index 82ffbec97912..22c3110748f3 100644 --- a/gtk4/src/style_context.rs +++ b/gtk4/src/style_context.rs @@ -2,7 +2,7 @@ use glib::translate::*; -pub use crate::{prelude::*, StyleContext, StyleProvider}; +use crate::{ffi, prelude::*, StyleContext, StyleProvider}; impl StyleContext { #[deprecated(note = "Use gtk::style_context_add_provider_for_display instead.")] diff --git a/gtk4/src/subclass/accessible.rs b/gtk4/src/subclass/accessible.rs index 09e805126614..48ef5175f3de 100644 --- a/gtk4/src/subclass/accessible.rs +++ b/gtk4/src/subclass/accessible.rs @@ -8,7 +8,9 @@ use std::mem::MaybeUninit; use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, ATContext, Accessible, AccessiblePlatformState}; +use crate::{ + ffi, prelude::*, subclass::prelude::*, ATContext, Accessible, AccessiblePlatformState, +}; pub trait AccessibleImpl: ObjectImpl { #[doc(alias = "get_platform_state")] diff --git a/gtk4/src/subclass/accessible_range.rs b/gtk4/src/subclass/accessible_range.rs index 9b21f80a1836..c3cf121c7bc9 100644 --- a/gtk4/src/subclass/accessible_range.rs +++ b/gtk4/src/subclass/accessible_range.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, AccessibleRange}; +use crate::{ffi, prelude::*, subclass::prelude::*, AccessibleRange}; pub trait AccessibleRangeImpl: WidgetImpl { fn set_current_value(&self, value: f64) -> bool { diff --git a/gtk4/src/subclass/actionable.rs b/gtk4/src/subclass/actionable.rs index d1bfd8041f51..bb0980c99547 100644 --- a/gtk4/src/subclass/actionable.rs +++ b/gtk4/src/subclass/actionable.rs @@ -6,7 +6,7 @@ use glib::{translate::*, GString, Variant}; -use crate::{prelude::*, subclass::prelude::*, Actionable}; +use crate::{ffi, prelude::*, subclass::prelude::*, Actionable}; pub trait ActionableImpl: WidgetImpl { #[doc(alias = "get_action_name")] diff --git a/gtk4/src/subclass/adjustment.rs b/gtk4/src/subclass/adjustment.rs index 218d00f50a8b..a2cc814f12e6 100644 --- a/gtk4/src/subclass/adjustment.rs +++ b/gtk4/src/subclass/adjustment.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Adjustment}; +use crate::{ffi, prelude::*, subclass::prelude::*, Adjustment}; pub trait AdjustmentImpl: AdjustmentImplExt + ObjectImpl { fn changed(&self) { diff --git a/gtk4/src/subclass/application.rs b/gtk4/src/subclass/application.rs index c5569d44f769..9a9fa76997fd 100644 --- a/gtk4/src/subclass/application.rs +++ b/gtk4/src/subclass/application.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Application, Window}; +use crate::{ffi, prelude::*, subclass::prelude::*, Application, Window}; pub trait GtkApplicationImpl: GtkApplicationImplExt + ApplicationImpl { fn window_added(&self, window: &Window) { diff --git a/gtk4/src/subclass/buildable.rs b/gtk4/src/subclass/buildable.rs index 237b82583155..5e10e5142f7d 100644 --- a/gtk4/src/subclass/buildable.rs +++ b/gtk4/src/subclass/buildable.rs @@ -8,7 +8,7 @@ use std::sync::OnceLock; use glib::{translate::*, GString, Object, Quark, Value}; use super::PtrHolder; -use crate::{prelude::*, subclass::prelude::*, Buildable, Builder}; +use crate::{ffi, prelude::*, subclass::prelude::*, Buildable, Builder}; pub trait BuildableImpl: ObjectImpl { fn set_id(&self, id: &str) { diff --git a/gtk4/src/subclass/builder_scope.rs b/gtk4/src/subclass/builder_scope.rs index ca7717d65bac..6d49b3a7f373 100644 --- a/gtk4/src/subclass/builder_scope.rs +++ b/gtk4/src/subclass/builder_scope.rs @@ -7,7 +7,8 @@ use glib::{translate::*, GString}; use crate::{ - prelude::*, subclass::prelude::*, Builder, BuilderCScope, BuilderClosureFlags, BuilderScope, + ffi, prelude::*, subclass::prelude::*, Builder, BuilderCScope, BuilderClosureFlags, + BuilderScope, }; pub trait BuilderCScopeImpl: BuilderScopeImpl {} diff --git a/gtk4/src/subclass/button.rs b/gtk4/src/subclass/button.rs index c7bbd60735fd..68750d3da9c9 100644 --- a/gtk4/src/subclass/button.rs +++ b/gtk4/src/subclass/button.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Button}; +use crate::{ffi, prelude::*, subclass::prelude::*, Button}; pub trait ButtonImpl: ButtonImplExt + WidgetImpl { fn activate(&self) { diff --git a/gtk4/src/subclass/cell_area.rs b/gtk4/src/subclass/cell_area.rs index 6c33cc39e65b..8e50c3423a1f 100644 --- a/gtk4/src/subclass/cell_area.rs +++ b/gtk4/src/subclass/cell_area.rs @@ -8,8 +8,8 @@ use std::mem; use glib::{translate::*, ParamSpec, Value}; use crate::{ - prelude::*, subclass::prelude::*, CellArea, CellAreaContext, CellRenderer, CellRendererState, - DirectionType, SizeRequestMode, Snapshot, TreeIter, TreeModel, Widget, + ffi, prelude::*, subclass::prelude::*, CellArea, CellAreaContext, CellRenderer, + CellRendererState, DirectionType, SizeRequestMode, Snapshot, TreeIter, TreeModel, Widget, }; #[derive(Debug)] diff --git a/gtk4/src/subclass/cell_area_context.rs b/gtk4/src/subclass/cell_area_context.rs index 8d5f890afee2..a2b8c7bc3529 100644 --- a/gtk4/src/subclass/cell_area_context.rs +++ b/gtk4/src/subclass/cell_area_context.rs @@ -7,7 +7,7 @@ use std::mem::MaybeUninit; use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, CellAreaContext}; +use crate::{ffi, prelude::*, subclass::prelude::*, CellAreaContext}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/cell_editable.rs b/gtk4/src/subclass/cell_editable.rs index 7eb6aeeac2a5..7ec83693d62c 100644 --- a/gtk4/src/subclass/cell_editable.rs +++ b/gtk4/src/subclass/cell_editable.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, CellEditable}; +use crate::{ffi, prelude::*, subclass::prelude::*, CellEditable}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/cell_layout.rs b/gtk4/src/subclass/cell_layout.rs index ed40e3b5d1dd..427d48b3d039 100644 --- a/gtk4/src/subclass/cell_layout.rs +++ b/gtk4/src/subclass/cell_layout.rs @@ -8,7 +8,7 @@ use std::sync::OnceLock; use glib::{translate::*, Quark}; use crate::{ - prelude::*, subclass::prelude::*, CellArea, CellLayout, CellRenderer, TreeIter, TreeModel, + ffi, prelude::*, subclass::prelude::*, CellArea, CellLayout, CellRenderer, TreeIter, TreeModel, }; #[derive(Debug)] diff --git a/gtk4/src/subclass/cell_renderer.rs b/gtk4/src/subclass/cell_renderer.rs index 0e1cfc9c0bfa..9a8856b78647 100644 --- a/gtk4/src/subclass/cell_renderer.rs +++ b/gtk4/src/subclass/cell_renderer.rs @@ -9,7 +9,7 @@ use glib::{translate::*, GString}; use libc::{c_char, c_int}; use crate::{ - prelude::*, subclass::prelude::*, CellEditable, CellRenderer, CellRendererState, + ffi, prelude::*, subclass::prelude::*, CellEditable, CellRenderer, CellRendererState, SizeRequestMode, Snapshot, Widget, }; diff --git a/gtk4/src/subclass/cell_renderer_text.rs b/gtk4/src/subclass/cell_renderer_text.rs index 56799ac777eb..d85e8fa03305 100644 --- a/gtk4/src/subclass/cell_renderer_text.rs +++ b/gtk4/src/subclass/cell_renderer_text.rs @@ -6,7 +6,7 @@ use glib::{translate::*, GString}; -use crate::{prelude::*, subclass::prelude::*, CellRendererText}; +use crate::{ffi, prelude::*, subclass::prelude::*, CellRendererText}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/check_button.rs b/gtk4/src/subclass/check_button.rs index ef5ecbcd59e7..5b9e4d508e7d 100644 --- a/gtk4/src/subclass/check_button.rs +++ b/gtk4/src/subclass/check_button.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, CheckButton}; +use crate::{ffi, prelude::*, subclass::prelude::*, CheckButton}; pub trait CheckButtonImpl: CheckButtonImplExt + WidgetImpl { fn toggled(&self) { diff --git a/gtk4/src/subclass/color_chooser.rs b/gtk4/src/subclass/color_chooser.rs index fcf6ea825da0..00c836dbc114 100644 --- a/gtk4/src/subclass/color_chooser.rs +++ b/gtk4/src/subclass/color_chooser.rs @@ -7,7 +7,7 @@ use gdk::RGBA; use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, ColorChooser, Orientation}; +use crate::{ffi, prelude::*, subclass::prelude::*, ColorChooser, Orientation}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/combo_box.rs b/gtk4/src/subclass/combo_box.rs index ab152d6a2892..a88d7399e776 100644 --- a/gtk4/src/subclass/combo_box.rs +++ b/gtk4/src/subclass/combo_box.rs @@ -5,7 +5,7 @@ use glib::{translate::*, GString}; -use crate::{prelude::*, subclass::prelude::*, ComboBox}; +use crate::{ffi, prelude::*, subclass::prelude::*, ComboBox}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/dialog.rs b/gtk4/src/subclass/dialog.rs index e97a898d2337..2fb77162f9cd 100644 --- a/gtk4/src/subclass/dialog.rs +++ b/gtk4/src/subclass/dialog.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Dialog, ResponseType}; +use crate::{ffi, prelude::*, subclass::prelude::*, Dialog, ResponseType}; pub trait DialogImpl: DialogImplExt + WindowImpl { fn response(&self, response: ResponseType) { diff --git a/gtk4/src/subclass/drawing_area.rs b/gtk4/src/subclass/drawing_area.rs index 99a90fc73d8d..3d4ef8b293d5 100644 --- a/gtk4/src/subclass/drawing_area.rs +++ b/gtk4/src/subclass/drawing_area.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, DrawingArea}; +use crate::{ffi, prelude::*, subclass::prelude::*, DrawingArea}; pub trait DrawingAreaImpl: DrawingAreaImplExt + WidgetImpl { fn resize(&self, width: i32, height: i32) { diff --git a/gtk4/src/subclass/editable.rs b/gtk4/src/subclass/editable.rs index a3744f169dd2..6a418ab9291e 100644 --- a/gtk4/src/subclass/editable.rs +++ b/gtk4/src/subclass/editable.rs @@ -8,7 +8,7 @@ use std::sync::OnceLock; use glib::{translate::*, GString, Quark}; use libc::{c_char, c_int}; -use crate::{prelude::*, subclass::prelude::*, Editable}; +use crate::{ffi, prelude::*, subclass::prelude::*, Editable}; pub trait EditableImpl: WidgetImpl { fn insert_text(&self, text: &str, length: i32, position: &mut i32) { diff --git a/gtk4/src/subclass/entry.rs b/gtk4/src/subclass/entry.rs index 6936cbcd890f..321a087022f5 100644 --- a/gtk4/src/subclass/entry.rs +++ b/gtk4/src/subclass/entry.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Entry}; +use crate::{ffi, prelude::*, subclass::prelude::*, Entry}; pub trait EntryImpl: EntryImplExt + WidgetImpl { fn activate(&self) { diff --git a/gtk4/src/subclass/entry_buffer.rs b/gtk4/src/subclass/entry_buffer.rs index 48f513e21eda..b252566f5366 100644 --- a/gtk4/src/subclass/entry_buffer.rs +++ b/gtk4/src/subclass/entry_buffer.rs @@ -7,7 +7,7 @@ use std::sync::OnceLock; use glib::{translate::*, GString}; use super::PtrHolder; -use crate::{prelude::*, subclass::prelude::*, EntryBuffer}; +use crate::{ffi, prelude::*, subclass::prelude::*, EntryBuffer}; pub trait EntryBufferImpl: EntryBufferImplExt + ObjectImpl { fn delete_text(&self, position: u32, n_chars: Option) -> u32 { diff --git a/gtk4/src/subclass/filter.rs b/gtk4/src/subclass/filter.rs index d63ceb09f687..fac41809e392 100644 --- a/gtk4/src/subclass/filter.rs +++ b/gtk4/src/subclass/filter.rs @@ -5,7 +5,7 @@ use glib::{translate::*, Object}; -use crate::{prelude::*, subclass::prelude::*, Filter, FilterMatch}; +use crate::{ffi, prelude::*, subclass::prelude::*, Filter, FilterMatch}; pub trait FilterImpl: FilterImplExt + ObjectImpl { #[doc(alias = "get_strictness")] diff --git a/gtk4/src/subclass/flow_box_child.rs b/gtk4/src/subclass/flow_box_child.rs index 03e99545864a..dde047d4acaa 100644 --- a/gtk4/src/subclass/flow_box_child.rs +++ b/gtk4/src/subclass/flow_box_child.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, FlowBoxChild}; +use crate::{ffi, prelude::*, subclass::prelude::*, FlowBoxChild}; pub trait FlowBoxChildImpl: FlowBoxChildImplExt + WidgetImpl { fn activate(&self) { diff --git a/gtk4/src/subclass/font_chooser.rs b/gtk4/src/subclass/font_chooser.rs index 5055f22703da..c232860f5110 100644 --- a/gtk4/src/subclass/font_chooser.rs +++ b/gtk4/src/subclass/font_chooser.rs @@ -9,7 +9,7 @@ use glib::{translate::*, GString, Quark}; use pango::{FontFace, FontFamily, FontMap}; use super::PtrHolder; -use crate::{prelude::*, subclass::prelude::*, FontChooser}; +use crate::{ffi, prelude::*, subclass::prelude::*, FontChooser}; #[derive(Debug)] pub struct FilterCallback { diff --git a/gtk4/src/subclass/frame.rs b/gtk4/src/subclass/frame.rs index c68f4e0bf894..0eed42525de5 100644 --- a/gtk4/src/subclass/frame.rs +++ b/gtk4/src/subclass/frame.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Allocation, Frame}; +use crate::{ffi, prelude::*, subclass::prelude::*, Allocation, Frame}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/gl_area.rs b/gtk4/src/subclass/gl_area.rs index 7ff88db847e6..9c7e779285fd 100644 --- a/gtk4/src/subclass/gl_area.rs +++ b/gtk4/src/subclass/gl_area.rs @@ -6,7 +6,7 @@ use gdk::GLContext; use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, GLArea}; +use crate::{ffi, prelude::*, subclass::prelude::*, GLArea}; #[allow(clippy::upper_case_acronyms)] pub trait GLAreaImpl: GLAreaImplExt + WidgetImpl { diff --git a/gtk4/src/subclass/im_context.rs b/gtk4/src/subclass/im_context.rs index 24d4425619e9..979619aa850d 100644 --- a/gtk4/src/subclass/im_context.rs +++ b/gtk4/src/subclass/im_context.rs @@ -6,7 +6,7 @@ use glib::{translate::*, GString}; use pango::AttrList; -use crate::{prelude::*, subclass::prelude::*, IMContext, Widget}; +use crate::{ffi, prelude::*, subclass::prelude::*, IMContext, Widget}; #[allow(clippy::upper_case_acronyms)] pub trait IMContextImpl: IMContextImplExt + ObjectImpl { diff --git a/gtk4/src/subclass/layout_manager.rs b/gtk4/src/subclass/layout_manager.rs index 8d6244eeec9e..5d3e97b0658b 100644 --- a/gtk4/src/subclass/layout_manager.rs +++ b/gtk4/src/subclass/layout_manager.rs @@ -7,8 +7,8 @@ use glib::translate::*; use libc::c_int; use crate::{ - prelude::*, subclass::prelude::*, LayoutChild, LayoutManager, Orientation, SizeRequestMode, - Widget, + ffi, prelude::*, subclass::prelude::*, LayoutChild, LayoutManager, Orientation, + SizeRequestMode, Widget, }; pub trait LayoutManagerImpl: LayoutManagerImplExt + ObjectImpl { diff --git a/gtk4/src/subclass/list_box_row.rs b/gtk4/src/subclass/list_box_row.rs index c8f59001e098..241975274b94 100644 --- a/gtk4/src/subclass/list_box_row.rs +++ b/gtk4/src/subclass/list_box_row.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, ListBoxRow}; +use crate::{ffi, prelude::*, subclass::prelude::*, ListBoxRow}; pub trait ListBoxRowImpl: ListBoxRowImplExt + WidgetImpl { fn activate(&self) { diff --git a/gtk4/src/subclass/media_file.rs b/gtk4/src/subclass/media_file.rs index b9d1f175ee85..c97c2335af35 100644 --- a/gtk4/src/subclass/media_file.rs +++ b/gtk4/src/subclass/media_file.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, MediaFile}; +use crate::{ffi, prelude::*, subclass::prelude::*, MediaFile}; pub trait MediaFileImpl: MediaFileImplExt + MediaStreamImpl { fn close(&self) { diff --git a/gtk4/src/subclass/media_stream.rs b/gtk4/src/subclass/media_stream.rs index 145428a54c28..d0786b0c6da8 100644 --- a/gtk4/src/subclass/media_stream.rs +++ b/gtk4/src/subclass/media_stream.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, MediaStream}; +use crate::{ffi, prelude::*, subclass::prelude::*, MediaStream}; pub trait MediaStreamImpl: MediaStreamImplExt + ObjectImpl { fn pause(&self) { diff --git a/gtk4/src/subclass/native_dialog.rs b/gtk4/src/subclass/native_dialog.rs index 0d95109f1b98..5cda1e37efca 100644 --- a/gtk4/src/subclass/native_dialog.rs +++ b/gtk4/src/subclass/native_dialog.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, NativeDialog, ResponseType}; +use crate::{ffi, prelude::*, subclass::prelude::*, NativeDialog, ResponseType}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/popover.rs b/gtk4/src/subclass/popover.rs index bd680b1fc293..48d82a9a91b2 100644 --- a/gtk4/src/subclass/popover.rs +++ b/gtk4/src/subclass/popover.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Popover}; +use crate::{ffi, prelude::*, subclass::prelude::*, Popover}; pub trait PopoverImpl: PopoverImplExt + WidgetImpl { fn activate_default(&self) { diff --git a/gtk4/src/subclass/print_operation.rs b/gtk4/src/subclass/print_operation.rs index d7a915e3b107..45412fcde930 100644 --- a/gtk4/src/subclass/print_operation.rs +++ b/gtk4/src/subclass/print_operation.rs @@ -6,7 +6,7 @@ use glib::translate::*; use crate::{ - prelude::*, subclass::prelude::*, PageSetup, PrintContext, PrintOperation, + ffi, prelude::*, subclass::prelude::*, PageSetup, PrintContext, PrintOperation, PrintOperationPreview, PrintOperationResult, PrintSettings, Widget, Window, }; diff --git a/gtk4/src/subclass/print_operation_preview.rs b/gtk4/src/subclass/print_operation_preview.rs index 34e4063471c7..17896262dcfe 100644 --- a/gtk4/src/subclass/print_operation_preview.rs +++ b/gtk4/src/subclass/print_operation_preview.rs @@ -6,7 +6,9 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, PageSetup, PrintContext, PrintOperationPreview}; +use crate::{ + ffi, prelude::*, subclass::prelude::*, PageSetup, PrintContext, PrintOperationPreview, +}; pub trait PrintOperationPreviewImpl: ObjectImpl { fn ready(&self, context: &PrintContext) { diff --git a/gtk4/src/subclass/range.rs b/gtk4/src/subclass/range.rs index 6ee4a8149b8b..1f39c3708d96 100644 --- a/gtk4/src/subclass/range.rs +++ b/gtk4/src/subclass/range.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Border, Range, ScrollType}; +use crate::{ffi, prelude::*, subclass::prelude::*, Border, Range, ScrollType}; pub trait RangeImpl: RangeImplExt + WidgetImpl { fn adjust_bounds(&self, new_value: f64) { diff --git a/gtk4/src/subclass/recent_manager.rs b/gtk4/src/subclass/recent_manager.rs index 5ab617d1d3b3..a4fb70d57970 100644 --- a/gtk4/src/subclass/recent_manager.rs +++ b/gtk4/src/subclass/recent_manager.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, RecentManager}; +use crate::{ffi, prelude::*, subclass::prelude::*, RecentManager}; pub trait RecentManagerImpl: RecentManagerImplExt + ObjectImpl { fn changed(&self) { diff --git a/gtk4/src/subclass/scale.rs b/gtk4/src/subclass/scale.rs index d225126f0b16..f0df0a6c4306 100644 --- a/gtk4/src/subclass/scale.rs +++ b/gtk4/src/subclass/scale.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Scale}; +use crate::{ffi, prelude::*, subclass::prelude::*, Scale}; pub trait ScaleImpl: ScaleImplExt + RangeImpl { #[doc(alias = "get_layout_offsets")] diff --git a/gtk4/src/subclass/scale_button.rs b/gtk4/src/subclass/scale_button.rs index 9fc8a7ac23c5..9add7fbdd674 100644 --- a/gtk4/src/subclass/scale_button.rs +++ b/gtk4/src/subclass/scale_button.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, ScaleButton}; +use crate::{ffi, prelude::*, subclass::prelude::*, ScaleButton}; pub trait ScaleButtonImpl: ScaleButtonImplExt + WidgetImpl { fn value_changed(&self, new_value: f64) { diff --git a/gtk4/src/subclass/scrollable.rs b/gtk4/src/subclass/scrollable.rs index 33c410daabbc..71f26e283c55 100644 --- a/gtk4/src/subclass/scrollable.rs +++ b/gtk4/src/subclass/scrollable.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Border, Scrollable}; +use crate::{ffi, prelude::*, subclass::prelude::*, Border, Scrollable}; pub trait ScrollableImpl: WidgetImpl { #[doc(alias = "get_border")] diff --git a/gtk4/src/subclass/section_model.rs b/gtk4/src/subclass/section_model.rs index 4b9a308c0373..658554f627f1 100644 --- a/gtk4/src/subclass/section_model.rs +++ b/gtk4/src/subclass/section_model.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, SectionModel}; +use crate::{ffi, prelude::*, subclass::prelude::*, SectionModel}; pub trait SectionModelImpl: ListModelImpl { #[doc(alias = "get_section")] diff --git a/gtk4/src/subclass/selection_model.rs b/gtk4/src/subclass/selection_model.rs index 3217097345c9..1a6b7f8e924e 100644 --- a/gtk4/src/subclass/selection_model.rs +++ b/gtk4/src/subclass/selection_model.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Bitset, SelectionModel}; +use crate::{ffi, prelude::*, subclass::prelude::*, Bitset, SelectionModel}; pub trait SelectionModelImpl: ListModelImpl { #[doc(alias = "get_selection_in_range")] diff --git a/gtk4/src/subclass/shortcut_manager.rs b/gtk4/src/subclass/shortcut_manager.rs index 6fd8dab9af4c..7e7472df788e 100644 --- a/gtk4/src/subclass/shortcut_manager.rs +++ b/gtk4/src/subclass/shortcut_manager.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, ShortcutController, ShortcutManager}; +use crate::{ffi, prelude::*, subclass::prelude::*, ShortcutController, ShortcutManager}; pub trait ShortcutManagerImpl: ObjectImpl { fn add_controller(&self, controller: &ShortcutController) { diff --git a/gtk4/src/subclass/sorter.rs b/gtk4/src/subclass/sorter.rs index 5744f27b69f7..1537154fc724 100644 --- a/gtk4/src/subclass/sorter.rs +++ b/gtk4/src/subclass/sorter.rs @@ -5,7 +5,7 @@ use glib::{translate::*, Object}; -use crate::{prelude::*, subclass::prelude::*, Ordering, Sorter, SorterOrder}; +use crate::{ffi, prelude::*, subclass::prelude::*, Ordering, Sorter, SorterOrder}; pub trait SorterImpl: SorterImplExt + ObjectImpl { fn compare(&self, item1: &Object, item2: &Object) -> Ordering { diff --git a/gtk4/src/subclass/style_context.rs b/gtk4/src/subclass/style_context.rs index 7a4f76beee14..b327d9285375 100644 --- a/gtk4/src/subclass/style_context.rs +++ b/gtk4/src/subclass/style_context.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, StyleContext}; +use crate::{ffi, prelude::*, subclass::prelude::*, StyleContext}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/symbolic_paintable.rs b/gtk4/src/subclass/symbolic_paintable.rs index f63b3b00019b..e3d72c7fb668 100644 --- a/gtk4/src/subclass/symbolic_paintable.rs +++ b/gtk4/src/subclass/symbolic_paintable.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, SymbolicPaintable}; +use crate::{ffi, prelude::*, subclass::prelude::*, SymbolicPaintable}; pub trait SymbolicPaintableImpl: PaintableImpl { fn snapshot_symbolic( diff --git a/gtk4/src/subclass/text_buffer.rs b/gtk4/src/subclass/text_buffer.rs index 9f53b781c34a..4d883506aa3e 100644 --- a/gtk4/src/subclass/text_buffer.rs +++ b/gtk4/src/subclass/text_buffer.rs @@ -6,7 +6,7 @@ use glib::translate::*; use crate::{ - prelude::*, subclass::prelude::*, TextBuffer, TextChildAnchor, TextIter, TextMark, TextTag, + ffi, prelude::*, subclass::prelude::*, TextBuffer, TextChildAnchor, TextIter, TextMark, TextTag, }; pub trait TextBufferImpl: TextBufferImplExt + ObjectImpl { diff --git a/gtk4/src/subclass/text_view.rs b/gtk4/src/subclass/text_view.rs index 4cd6d9a80dec..59d505bc87bb 100644 --- a/gtk4/src/subclass/text_view.rs +++ b/gtk4/src/subclass/text_view.rs @@ -6,7 +6,7 @@ use glib::translate::*; use crate::{ - prelude::*, subclass::prelude::*, DeleteType, MovementStep, Snapshot, TextExtendSelection, + ffi, prelude::*, subclass::prelude::*, DeleteType, MovementStep, Snapshot, TextExtendSelection, TextIter, TextView, TextViewLayer, }; diff --git a/gtk4/src/subclass/toggle_button.rs b/gtk4/src/subclass/toggle_button.rs index 8128ee35fc08..ad25b62d55f0 100644 --- a/gtk4/src/subclass/toggle_button.rs +++ b/gtk4/src/subclass/toggle_button.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, ToggleButton}; +use crate::{ffi, prelude::*, subclass::prelude::*, ToggleButton}; pub trait ToggleButtonImpl: ToggleButtonImplExt + ButtonImpl { fn toggled(&self) { diff --git a/gtk4/src/subclass/tree_drag_dest.rs b/gtk4/src/subclass/tree_drag_dest.rs index 09dfe3b65179..872c94dda14b 100644 --- a/gtk4/src/subclass/tree_drag_dest.rs +++ b/gtk4/src/subclass/tree_drag_dest.rs @@ -6,7 +6,7 @@ use glib::{translate::*, Value}; -use crate::{prelude::*, subclass::prelude::*, TreeDragDest, TreePath}; +use crate::{ffi, prelude::*, subclass::prelude::*, TreeDragDest, TreePath}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/tree_drag_source.rs b/gtk4/src/subclass/tree_drag_source.rs index f27ae30147c9..162bf6c73825 100644 --- a/gtk4/src/subclass/tree_drag_source.rs +++ b/gtk4/src/subclass/tree_drag_source.rs @@ -6,7 +6,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, TreeDragSource, TreePath}; +use crate::{ffi, prelude::*, subclass::prelude::*, TreeDragSource, TreePath}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/tree_model_filter.rs b/gtk4/src/subclass/tree_model_filter.rs index d0a20e169574..366994170fc6 100644 --- a/gtk4/src/subclass/tree_model_filter.rs +++ b/gtk4/src/subclass/tree_model_filter.rs @@ -5,7 +5,7 @@ use glib::{translate::*, Value}; -use crate::{prelude::*, subclass::prelude::*, TreeIter, TreeModel, TreeModelFilter}; +use crate::{ffi, prelude::*, subclass::prelude::*, TreeIter, TreeModel, TreeModelFilter}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] diff --git a/gtk4/src/subclass/tree_view.rs b/gtk4/src/subclass/tree_view.rs index b23210f10a4a..1acf7f417a28 100644 --- a/gtk4/src/subclass/tree_view.rs +++ b/gtk4/src/subclass/tree_view.rs @@ -6,7 +6,8 @@ use glib::translate::*; use crate::{ - prelude::*, subclass::prelude::*, MovementStep, TreeIter, TreePath, TreeView, TreeViewColumn, + ffi, prelude::*, subclass::prelude::*, MovementStep, TreeIter, TreePath, TreeView, + TreeViewColumn, }; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] diff --git a/gtk4/src/subclass/widget.rs b/gtk4/src/subclass/widget.rs index 78947844d717..87c980319073 100644 --- a/gtk4/src/subclass/widget.rs +++ b/gtk4/src/subclass/widget.rs @@ -8,7 +8,7 @@ use std::{boxed::Box as Box_, collections::HashMap, fmt, future::Future}; use glib::{clone::Downgrade, subclass::SignalId, translate::*, GString, Variant}; use crate::{ - prelude::*, subclass::prelude::*, AccessibleRole, BuilderRustScope, BuilderScope, + ffi, prelude::*, subclass::prelude::*, AccessibleRole, BuilderRustScope, BuilderScope, DirectionType, LayoutManager, Orientation, Shortcut, SizeRequestMode, Snapshot, StateFlags, SystemSetting, TextDirection, Tooltip, Widget, }; diff --git a/gtk4/src/subclass/window.rs b/gtk4/src/subclass/window.rs index 39e4f480d4dd..76b2636a2ad5 100644 --- a/gtk4/src/subclass/window.rs +++ b/gtk4/src/subclass/window.rs @@ -5,7 +5,7 @@ use glib::translate::*; -use crate::{prelude::*, subclass::prelude::*, Window}; +use crate::{ffi, prelude::*, subclass::prelude::*, Window}; pub trait WindowImpl: WindowImplExt + WidgetImpl { fn activate_focus(&self) { diff --git a/gtk4/src/text.rs b/gtk4/src/text.rs index 39225adc6565..48f866598f33 100644 --- a/gtk4/src/text.rs +++ b/gtk4/src/text.rs @@ -8,7 +8,7 @@ use glib::{ GString, }; -use crate::{prelude::*, DeleteType, MovementStep, Text, Widget}; +use crate::{ffi, prelude::*, DeleteType, MovementStep, Text, Widget}; impl Text { pub fn connect_activate(&self, f: F) -> SignalHandlerId { diff --git a/gtk4/src/text_buffer.rs b/gtk4/src/text_buffer.rs index 4a8588be848c..319d8fba2fc0 100644 --- a/gtk4/src/text_buffer.rs +++ b/gtk4/src/text_buffer.rs @@ -8,7 +8,7 @@ use glib::{ }; use libc::{c_char, c_int}; -use crate::{prelude::*, TextBuffer, TextIter, TextTag}; +use crate::{ffi, prelude::*, TextBuffer, TextIter, TextTag}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/tree_model.rs b/gtk4/src/tree_model.rs index 9c8b68d97d4c..070ff5b06a44 100644 --- a/gtk4/src/tree_model.rs +++ b/gtk4/src/tree_model.rs @@ -2,7 +2,7 @@ use glib::{translate::*, value::FromValue}; -use crate::{prelude::*, TreeIter, TreeModel}; +use crate::{ffi, prelude::*, TreeIter, TreeModel}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/tree_model_filter.rs b/gtk4/src/tree_model_filter.rs index b3d042ceccdb..df985b2e1d79 100644 --- a/gtk4/src/tree_model_filter.rs +++ b/gtk4/src/tree_model_filter.rs @@ -4,7 +4,7 @@ use std::boxed::Box as Box_; use glib::translate::*; -use crate::{prelude::*, TreeIter, TreeModel, TreeModelFilter, TreePath}; +use crate::{ffi, prelude::*, TreeIter, TreeModel, TreeModelFilter, TreePath}; impl TreeModelFilter { #[doc(alias = "gtk_tree_model_filter_new")] diff --git a/gtk4/src/tree_path.rs b/gtk4/src/tree_path.rs index b45f2d6e5e13..a0eab6f11592 100644 --- a/gtk4/src/tree_path.rs +++ b/gtk4/src/tree_path.rs @@ -12,7 +12,7 @@ impl TreePath { pub fn indices(&self) -> Slice { unsafe { let mut count = 0; - let ptr = ffi::gtk_tree_path_get_indices_with_depth( + let ptr = crate::ffi::gtk_tree_path_get_indices_with_depth( mut_override(self.to_glib_none().0), &mut count, ); diff --git a/gtk4/src/tree_row_reference.rs b/gtk4/src/tree_row_reference.rs index f5a4d795e8aa..4282a20d57f1 100644 --- a/gtk4/src/tree_row_reference.rs +++ b/gtk4/src/tree_row_reference.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, TreeIter, TreePath, TreeRowReference}; +use crate::{ffi, prelude::*, TreeIter, TreePath, TreeRowReference}; impl TreeRowReference { #[doc(alias = "gtk_tree_row_reference_reordered")] diff --git a/gtk4/src/tree_selection.rs b/gtk4/src/tree_selection.rs index 3a39b4bfc0d7..f4c0ca2deb36 100644 --- a/gtk4/src/tree_selection.rs +++ b/gtk4/src/tree_selection.rs @@ -11,7 +11,7 @@ impl TreeSelection { #[allow(deprecated)] pub fn unset_select_function(&self) { unsafe { - ffi::gtk_tree_selection_set_select_function( + crate::ffi::gtk_tree_selection_set_select_function( self.to_glib_none().0, None, std::ptr::null_mut(), diff --git a/gtk4/src/tree_sortable.rs b/gtk4/src/tree_sortable.rs index b4cc80b453d0..44e8c0133f15 100644 --- a/gtk4/src/tree_sortable.rs +++ b/gtk4/src/tree_sortable.rs @@ -4,7 +4,7 @@ use std::{fmt, mem}; use glib::translate::*; -use crate::{prelude::*, Ordering, SortType, TreeIter, TreeModel, TreeSortable}; +use crate::{ffi, prelude::*, Ordering, SortType, TreeIter, TreeModel, TreeSortable}; #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] diff --git a/gtk4/src/tree_store.rs b/gtk4/src/tree_store.rs index 445479595521..1e1b56f420ca 100644 --- a/gtk4/src/tree_store.rs +++ b/gtk4/src/tree_store.rs @@ -3,7 +3,7 @@ use glib::{translate::*, Type, Value}; use libc::c_int; -use crate::{prelude::*, TreeIter, TreeModel, TreeStore}; +use crate::{ffi, prelude::*, TreeIter, TreeModel, TreeStore}; impl TreeStore { #[doc(alias = "gtk_tree_store_newv")] diff --git a/gtk4/src/tree_view.rs b/gtk4/src/tree_view.rs index c18703b4d7c1..1d3ae6eaf622 100644 --- a/gtk4/src/tree_view.rs +++ b/gtk4/src/tree_view.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, CellRenderer, TreeView, TreeViewColumn, TreeViewColumnSizing}; +use crate::{ffi, prelude::*, CellRenderer, TreeView, TreeViewColumn, TreeViewColumnSizing}; mod sealed { pub trait Sealed {} diff --git a/gtk4/src/tree_view_column.rs b/gtk4/src/tree_view_column.rs index 5215e0a1b94e..f43860a6adea 100644 --- a/gtk4/src/tree_view_column.rs +++ b/gtk4/src/tree_view_column.rs @@ -2,7 +2,7 @@ use glib::translate::*; -use crate::{prelude::*, CellRenderer, TreeViewColumn}; +use crate::{ffi, prelude::*, CellRenderer, TreeViewColumn}; impl TreeViewColumn { #[doc(alias = "gtk_tree_view_column_new_with_attributes")] diff --git a/gtk4/src/widget.rs b/gtk4/src/widget.rs index 88b0a1578163..79f3bb439cf8 100644 --- a/gtk4/src/widget.rs +++ b/gtk4/src/widget.rs @@ -2,7 +2,7 @@ use glib::{translate::*, ControlFlow, WeakRef}; -use crate::{prelude::*, Widget}; +use crate::{ffi, prelude::*, Widget}; mod sealed { pub trait Sealed {}