Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gdk4-macos/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4-macos/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4-wayland/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4-wayland/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4-win32/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4-win32/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4-x11/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4-x11/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 2 additions & 2 deletions gdk4/src/auto/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,9 @@ bitflags! {
#[doc(alias = "GdkPaintableFlags")]
pub struct PaintableFlags: u32 {
#[doc(alias = "GDK_PAINTABLE_STATIC_SIZE")]
const SIZE = ffi::GDK_PAINTABLE_STATIC_SIZE as _;
const STATIC_SIZE = ffi::GDK_PAINTABLE_STATIC_SIZE as _;
#[doc(alias = "GDK_PAINTABLE_STATIC_CONTENTS")]
const CONTENTS = ffi::GDK_PAINTABLE_STATIC_CONTENTS as _;
const STATIC_CONTENTS = ffi::GDK_PAINTABLE_STATIC_CONTENTS as _;
Comment on lines 630 to +633
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to manually implement this and mark the previous values as deprecated, or just not backport this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think either is OK. Deprecation would be more friendly to users as it simplifies the update next time.

}
}

Expand Down
10 changes: 10 additions & 0 deletions gdk4/src/auto/rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ impl RGBA {
unsafe { from_glib(ffi::gdk_rgba_is_opaque(self.to_glib_none().0)) }
}

#[doc(alias = "gdk_rgba_print")]
pub fn print(&self, string: &mut glib::String) -> glib::String {
unsafe {
from_glib_full(ffi::gdk_rgba_print(
self.to_glib_none().0,
string.to_glib_none_mut().0,
))
}
}

#[doc(alias = "gdk_rgba_to_string")]
#[doc(alias = "to_string")]
pub fn to_str(&self) -> glib::GString {
Expand Down
12 changes: 6 additions & 6 deletions gdk4/src/auto/scroll_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#[cfg(feature = "v4_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
use crate::ScrollRelativeDirection;
#[cfg(feature = "v4_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
use crate::ScrollUnit;
use crate::{ffi, ScrollDirection};
#[cfg(feature = "v4_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
use crate::{Event, ScrollRelativeDirection};
use glib::{prelude::*, translate::*};

glib::wrapper! {
Expand Down Expand Up @@ -66,11 +66,11 @@ impl ScrollEvent {
#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
#[doc(alias = "gdk_scroll_event_get_relative_direction")]
#[doc(alias = "get_relative_direction")]
pub fn relative_direction(event: impl AsRef<Event>) -> ScrollRelativeDirection {
skip_assert_initialized!();
pub fn relative_direction(event: ScrollRelativeDirection) -> ScrollRelativeDirection {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gdk_scroll_event_get_relative_direction(
event.as_ref().to_glib_none().0,
event.into_glib(),
))
}
}
Expand Down
4 changes: 2 additions & 2 deletions gdk4/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
9 changes: 4 additions & 5 deletions gdk4/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4609,6 +4609,7 @@ extern "C" {
pub fn gdk_rgba_is_clear(rgba: *const GdkRGBA) -> gboolean;
pub fn gdk_rgba_is_opaque(rgba: *const GdkRGBA) -> gboolean;
pub fn gdk_rgba_parse(rgba: *mut GdkRGBA, spec: *const c_char) -> gboolean;
pub fn gdk_rgba_print(rgba: *const GdkRGBA, string: *mut glib::GString) -> *mut glib::GString;
pub fn gdk_rgba_to_string(rgba: *const GdkRGBA) -> *mut c_char;

//=========================================================================
Expand Down Expand Up @@ -5893,11 +5894,9 @@ extern "C" {
// GdkScrollEvent
//=========================================================================
pub fn gdk_scroll_event_get_type() -> GType;
#[cfg(feature = "v4_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
pub fn gdk_scroll_event_get_relative_direction(
event: *mut GdkEvent,
) -> GdkScrollRelativeDirection;
//#[cfg(feature = "v4_20")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
//pub fn gdk_scroll_event_get_relative_direction(event: /*Metadata mismatch*/*mut [c:type mismatch GdkEvent != GdkScrollRelativeDirection of ScrollRelativeDirection]) -> GdkScrollRelativeDirection;
pub fn gdk_scroll_event_get_deltas(
event: *mut GdkScrollEvent,
delta_x: *mut c_double,
Expand Down
4 changes: 2 additions & 2 deletions gdk4/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
2 changes: 1 addition & 1 deletion gir
2 changes: 1 addition & 1 deletion gir-files
27 changes: 26 additions & 1 deletion gsk4/src/auto/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{ffi, FillRule, PathPoint, Stroke};
use glib::translate::*;

glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Debug, PartialOrd, Ord, Hash)]
pub struct Path(Shared<ffi::GskPath>);

match fn {
Expand All @@ -17,6 +17,18 @@ glib::wrapper! {
}

impl Path {
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "gsk_path_equal")]
fn equal(&self, path2: &Path) -> bool {
unsafe {
from_glib(ffi::gsk_path_equal(
self.to_glib_none().0,
path2.to_glib_none().0,
))
}
}

#[doc(alias = "gsk_path_get_bounds")]
#[doc(alias = "get_bounds")]
pub fn bounds(&self) -> Option<graphene::Rect> {
Expand Down Expand Up @@ -155,6 +167,19 @@ impl Path {
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
impl PartialEq for Path {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.equal(other)
}
}
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]

impl Eq for Path {}

impl std::fmt::Display for Path {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions gsk4/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
4 changes: 4 additions & 0 deletions gsk4/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ version = "4.18"
[package.metadata.system-deps.gtk4.v4_20]
version = "4.19"

[package.metadata.system-deps.gtk4.v4_22]
version = "4.22"

[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
Expand All @@ -76,6 +79,7 @@ v4_14 = ["v4_10"]
v4_16 = ["v4_14"]
v4_18 = ["v4_16"]
v4_20 = ["v4_18"]
v4_22 = ["v4_20"]

[dependencies]
libc = "0.2"
Expand Down
3 changes: 3 additions & 0 deletions gsk4/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,9 @@ extern "C" {
#[cfg(feature = "v4_14")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
pub fn gsk_path_get_type() -> GType;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_path_equal(path1: *const GskPath, path2: *const GskPath) -> gboolean;
#[cfg(feature = "v4_14")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
pub fn gsk_path_foreach(
Expand Down
4 changes: 2 additions & 2 deletions gsk4/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c)
from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84)
Generated by gir (https://github.com/gtk-rs/gir @ 85fe8474df07)
from gir-files (https://github.com/gtk-rs/gir-files @ 7f4d93e87b6e)
97 changes: 93 additions & 4 deletions gtk4/src/auto/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,21 @@ impl ApplicationBuilder {
}
}

#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
#[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")]
pub fn register_session(self, register_session: bool) -> Self {
Self {
builder: self.builder.property("register-session", register_session),
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn support_save(self, support_save: bool) -> Self {
Self {
builder: self.builder.property("support-save", support_save),
}
}

pub fn application_id(self, application_id: impl Into<glib::GString>) -> Self {
Self {
builder: self
Expand Down Expand Up @@ -122,6 +130,15 @@ pub trait GtkApplicationExt: IsA<Application> + 'static {
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "gtk_application_forget")]
fn forget(&self) {
unsafe {
ffi::gtk_application_forget(self.as_ref().to_glib_none().0);
}
}

#[doc(alias = "gtk_application_get_accels_for_action")]
#[doc(alias = "get_accels_for_action")]
fn accels_for_action(&self, detailed_action_name: &str) -> Vec<glib::GString> {
Expand Down Expand Up @@ -233,6 +250,15 @@ pub trait GtkApplicationExt: IsA<Application> + 'static {
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "gtk_application_save")]
fn save(&self) {
unsafe {
ffi::gtk_application_save(self.as_ref().to_glib_none().0);
}
}

#[doc(alias = "gtk_application_set_accels_for_action")]
fn set_accels_for_action(&self, detailed_action_name: &str, accels: &[&str]) {
unsafe {
Expand Down Expand Up @@ -262,13 +288,13 @@ pub trait GtkApplicationExt: IsA<Application> + 'static {
}
}

#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
#[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")]
#[doc(alias = "register-session")]
fn is_register_session(&self) -> bool {
ObjectExt::property(self.as_ref(), "register-session")
}

#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
#[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")]
#[doc(alias = "register-session")]
fn set_register_session(&self, register_session: bool) {
ObjectExt::set_property(self.as_ref(), "register-session", register_session)
Expand All @@ -279,6 +305,20 @@ pub trait GtkApplicationExt: IsA<Application> + 'static {
ObjectExt::property(self.as_ref(), "screensaver-active")
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "support-save")]
fn supports_save(&self) -> bool {
ObjectExt::property(self.as_ref(), "support-save")
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "support-save")]
fn set_support_save(&self, support_save: bool) {
ObjectExt::set_property(self.as_ref(), "support-save", support_save)
}

#[doc(alias = "query-end")]
fn connect_query_end<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn query_end_trampoline<P: IsA<Application>, F: Fn(&P) + 'static>(
Expand All @@ -301,6 +341,27 @@ pub trait GtkApplicationExt: IsA<Application> + 'static {
}
}

//#[cfg(feature = "v4_22")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
//#[doc(alias = "restore-state")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This signal lacks a Since annotation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//fn connect_restore_state<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored reason: Gtk.RestoreReason
//}

//#[cfg(feature = "v4_22")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
//#[doc(alias = "restore-window")]
//fn connect_restore_window<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored reason: Gtk.RestoreReason
//}

//#[cfg(feature = "v4_22")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
//#[doc(alias = "save-state")]
//fn connect_save_state<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored dict: GLib.VariantDict
//}

#[doc(alias = "window-added")]
fn connect_window_added<F: Fn(&Self, &Window) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn window_added_trampoline<
Expand Down Expand Up @@ -408,7 +469,7 @@ pub trait GtkApplicationExt: IsA<Application> + 'static {
}
}

#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
#[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")]
#[doc(alias = "register-session")]
fn connect_register_session_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_register_session_trampoline<
Expand Down Expand Up @@ -460,6 +521,34 @@ pub trait GtkApplicationExt: IsA<Application> + 'static {
)
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "support-save")]
fn connect_support_save_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_support_save_trampoline<
P: IsA<Application>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::GtkApplication,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Application::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::support-save".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_support_save_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

impl<O: IsA<Application>> GtkApplicationExt for O {}
Loading