Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to bitflags2 #1413

Merged
merged 5 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2021"

[dependencies]
chrono = "0.4"
once_cell = "1.0"

femtovg = { version = "0.7", optional = true, default-features = false }
glium = { version = "0.32", optional = true, default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions examples/clock/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ fn build_ui(application: &Application) {
let tick = move || {
let time = current_time();
label.set_text(&time);
// we could return gtk::Continue(false) to stop our clock after this tick
glib::Continue(true)
// we could return glib::ControlFlow::Break to stop our clock after this tick
glib::ControlFlow::Continue
};

// executes the closure once every second
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl AnimatedExplosion {
imp.lastupdate.replace(time);
imp.duration.replace(duration);
}
// Returns glib::source::Continue(false) if the animation is finished
pub(super) fn update(&self, clock: &gdk::FrameClock) -> Continue {
// Returns glib::ControlFlow::Break if the animation is finished
pub(super) fn update(&self, clock: &gdk::FrameClock) -> glib::ControlFlow {
let imp = self.imp();

// Time tracking to correctly update the physics simulation.
Expand All @@ -41,7 +41,7 @@ impl AnimatedExplosion {
if !imp.finished.get() && time - imp.start.get() >= imp.duration.get() {
imp.finished.replace(true);
}
Continue(!imp.finished.get())
glib::ControlFlow::from(!imp.finished.get())
}

pub(super) fn draw(&self, snapshot: &gtk::Snapshot) {
Expand Down
6 changes: 3 additions & 3 deletions examples/confetti_snapshot_animation/confetti_widget/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mod imp;

use crate::{AnimatedExplosion, ExplosionParameters};
use glib::clone;
use glib::subclass::prelude::*;
use glib::{clone, ControlFlow};
use gtk::glib;
use gtk::prelude::*;

Expand Down Expand Up @@ -30,10 +30,10 @@ impl ConfettiWidget {

frame_clock.connect_update(clone!(@weak self as this, @weak exp => move |clock| {
match exp.update(clock) {
Continue(true) => {
ControlFlow::Continue => {
this.queue_draw();
},
Continue(false) => {
ControlFlow::Break => {
this.imp().explosions.borrow_mut().remove(&exp);
clock.end_updating();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_editable/custom_tag/imp.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use glib::clone;
use glib::once_cell::sync::Lazy;
use glib::subclass::Signal;
use glib::{ParamSpec, Properties};
use gtk::glib;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use once_cell::sync::Lazy;
use std::cell::{Cell, RefCell};

#[derive(Debug, Properties)]
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_layout_manager/simple_widget/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl SimpleWidget {
imp.tick_id.replace(Some(tick_id));
}

pub fn transition(&self) -> glib::Continue {
pub fn transition(&self) -> glib::ControlFlow {
let imp = self.imp();
let now = std::time::Instant::now();
self.queue_allocate();
Expand Down Expand Up @@ -73,9 +73,9 @@ impl SimpleWidget {
layout_manager.set_position(0.0);
}
let _ = imp.tick_id.borrow_mut().take();
return glib::Continue(false);
return glib::ControlFlow::Break;
}

glib::Continue(true)
glib::ControlFlow::Continue
}
}
2 changes: 1 addition & 1 deletion examples/expressions/note/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use glib::prelude::*;
use glib::subclass::prelude::*;
use gtk::glib::{self, Properties};

use once_cell::unsync::OnceCell;
use glib::once_cell::unsync::OnceCell;

use super::Metadata;

Expand Down
2 changes: 1 addition & 1 deletion examples/femtovg_area/femtovg_area/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl ObjectImpl for FemtoVGArea {
area.set_has_stencil_buffer(true);
area.add_tick_callback(|area, _| {
area.queue_render();
glib::Continue(true)
glib::ControlFlow::Continue
});
let click = gtk::GestureClick::new();
let a = area.clone();
Expand Down
2 changes: 1 addition & 1 deletion 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 @ 3a2fdae0a42b)
Generated by gir (https://github.com/gtk-rs/gir @ c659c2b21954)
from gir-files (https://github.com/gtk-rs/gir-files @ 744be9fbbbed)
2 changes: 1 addition & 1 deletion 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 @ 3a2fdae0a42b)
Generated by gir (https://github.com/gtk-rs/gir @ c659c2b21954)
from gir-files (https://github.com/gtk-rs/gir-files @ 744be9fbbbed)
2 changes: 1 addition & 1 deletion 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 @ 3a2fdae0a42b)
Generated by gir (https://github.com/gtk-rs/gir @ c659c2b21954)
from gir-files (https://github.com/gtk-rs/gir-files @ 744be9fbbbed)
4 changes: 2 additions & 2 deletions gdk4-win32/src/auto/win32_hcursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::{prelude::*, translate::*};

Check warning on line 5 in gdk4-win32/src/auto/win32_hcursor.rs

View workflow job for this annotation

GitHub Actions / Windows MSVC

unused import: `translate`

Check warning on line 5 in gdk4-win32/src/auto/win32_hcursor.rs

View workflow job for this annotation

GitHub Actions / Windows MSVC

unused import: `translate`

Check warning on line 5 in gdk4-win32/src/auto/win32_hcursor.rs

View workflow job for this annotation

GitHub Actions / Windows MSVC

unused import: `translate`
use std::fmt;

glib::wrapper! {
Expand All @@ -16,11 +16,11 @@

impl Win32HCursor {
pub fn is_destroyable(&self) -> bool {
glib::ObjectExt::property(self, "destroyable")
ObjectExt::property(self, "destroyable")
}

pub fn display(&self) -> Option<gdk::Display> {
glib::ObjectExt::property(self, "display")
ObjectExt::property(self, "display")
}
}

Expand Down
2 changes: 1 addition & 1 deletion gdk4-win32/sys/tests/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#![cfg(target_os = "linux")]
#![cfg(unix)]

use gdk4_win32_sys::*;
use std::env;
Expand Down
2 changes: 1 addition & 1 deletion 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 @ 3a2fdae0a42b)
Generated by gir (https://github.com/gtk-rs/gir @ c659c2b21954)
from gir-files (https://github.com/gtk-rs/gir-files @ 744be9fbbbed)
2 changes: 1 addition & 1 deletion 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 @ 3a2fdae0a42b)
Generated by gir (https://github.com/gtk-rs/gir @ c659c2b21954)
from gir-files (https://github.com/gtk-rs/gir-files @ 744be9fbbbed)
8 changes: 4 additions & 4 deletions gdk4-x11/src/auto/x11_device_manager_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ impl X11DeviceManagerXI2 {
}

pub fn display(&self) -> Option<gdk::Display> {
glib::ObjectExt::property(self, "display")
ObjectExt::property(self, "display")
}

pub fn major(&self) -> i32 {
glib::ObjectExt::property(self, "major")
ObjectExt::property(self, "major")
}

pub fn minor(&self) -> i32 {
glib::ObjectExt::property(self, "minor")
ObjectExt::property(self, "minor")
}

pub fn opcode(&self) -> i32 {
glib::ObjectExt::property(self, "opcode")
ObjectExt::property(self, "opcode")
}
}

Expand Down
2 changes: 1 addition & 1 deletion gdk4-x11/src/auto/x11_device_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl X11DeviceXI2 {

#[doc(alias = "device-id")]
pub fn device_id(&self) -> i32 {
glib::ObjectExt::property(self, "device-id")
ObjectExt::property(self, "device-id")
}
}

Expand Down
4 changes: 2 additions & 2 deletions gdk4-x11/src/x11_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ impl X11Display {
#[cfg(any(feature = "xlib", docsrs))]
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
#[doc(alias = "xevent")]
pub unsafe fn connect_xevent<F: Fn(&Self, *mut xlib::XEvent) -> glib::Continue + 'static>(
pub unsafe fn connect_xevent<F: Fn(&Self, *mut xlib::XEvent) -> glib::ControlFlow + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn xevent_trampoline<
F: Fn(&X11Display, *mut xlib::XEvent) -> glib::Continue + 'static,
F: Fn(&X11Display, *mut xlib::XEvent) -> glib::ControlFlow + 'static,
>(
this: *mut ffi::GdkX11Display,
xevent: glib::ffi::gpointer,
Expand Down
2 changes: 1 addition & 1 deletion gdk4-x11/sys/tests/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#![cfg(target_os = "linux")]
#![cfg(unix)]

use gdk4_x11_sys::*;
use std::env;
Expand Down
2 changes: 1 addition & 1 deletion 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 @ 3a2fdae0a42b)
Generated by gir (https://github.com/gtk-rs/gir @ c659c2b21954)
from gir-files (https://github.com/gtk-rs/gir-files @ 744be9fbbbed)
1 change: 0 additions & 1 deletion gdk4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
bitflags = "1.0"
cairo-rs = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.18"}
ffi = {package = "gdk4-sys", path = "./sys", version = "0.7"}
gdk-pixbuf = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.18"}
Expand Down
4 changes: 2 additions & 2 deletions gdk4/src/auto/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ pub trait DeviceExt: IsA<Device> + sealed::Sealed + 'static {

#[doc(alias = "n-axes")]
fn n_axes(&self) -> u32 {
glib::ObjectExt::property(self.as_ref(), "n-axes")
ObjectExt::property(self.as_ref(), "n-axes")
}

fn set_seat<P: IsA<Seat>>(&self, seat: Option<&P>) {
glib::ObjectExt::set_property(self.as_ref(), "seat", seat)
ObjectExt::set_property(self.as_ref(), "seat", seat)
}

#[doc(alias = "changed")]
Expand Down
2 changes: 1 addition & 1 deletion gdk4/src/auto/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub trait DisplayExt: IsA<Display> + sealed::Sealed + 'static {

#[doc(alias = "input-shapes")]
fn is_input_shapes(&self) -> bool {
glib::ObjectExt::property(self.as_ref(), "input-shapes")
ObjectExt::property(self.as_ref(), "input-shapes")
}

#[doc(alias = "closed")]
Expand Down
4 changes: 2 additions & 2 deletions gdk4/src/auto/drag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ pub trait DragExt: IsA<Drag> + sealed::Sealed + 'static {
}

fn set_actions(&self, actions: DragAction) {
glib::ObjectExt::set_property(self.as_ref(), "actions", actions)
ObjectExt::set_property(self.as_ref(), "actions", actions)
}

#[doc(alias = "selected-action")]
fn set_selected_action(&self, selected_action: DragAction) {
glib::ObjectExt::set_property(self.as_ref(), "selected-action", selected_action)
ObjectExt::set_property(self.as_ref(), "selected-action", selected_action)
}

#[doc(alias = "cancel")]
Expand Down