1
0
Fork 0

Fix warnings on macos (#155)

This commit is contained in:
Micah Johnston 2023-12-12 11:40:45 -06:00 committed by GitHub
parent df0e3928a2
commit 3ecc88f9fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View file

@ -2,11 +2,16 @@ mod keyboard;
mod view;
mod window;
use cocoa::foundation::NSUInteger;
pub use window::*;
const NSDragOperationNone: NSUInteger = 0;
const NSDragOperationCopy: NSUInteger = 1;
const NSDragOperationLink: NSUInteger = 2;
const NSDragOperationGeneric: NSUInteger = 4;
const NSDragOperationMove: NSUInteger = 16;
#[allow(non_upper_case_globals)]
mod consts {
use cocoa::foundation::NSUInteger;
pub const NSDragOperationNone: NSUInteger = 0;
pub const NSDragOperationCopy: NSUInteger = 1;
pub const NSDragOperationLink: NSUInteger = 2;
pub const NSDragOperationGeneric: NSUInteger = 4;
pub const NSDragOperationMove: NSUInteger = 16;
}
use consts::*;

View file

@ -467,7 +467,7 @@ extern "C" fn dragging_updated(this: &Object, _sel: Sel, sender: id) -> NSUInteg
on_event(state, event)
}
extern "C" fn prepare_for_drag_operation(_this: &Object, _sel: Sel, sender: id) -> BOOL {
extern "C" fn prepare_for_drag_operation(_this: &Object, _sel: Sel, _sender: id) -> BOOL {
// Always accept drag operation if we get this far
// This function won't be called unless dragging_entered/updated
// has returned an acceptable operation
@ -492,10 +492,8 @@ extern "C" fn perform_drag_operation(this: &Object, _sel: Sel, sender: id) -> BO
}
}
extern "C" fn dragging_exited(this: &Object, _sel: Sel, sender: id) {
extern "C" fn dragging_exited(this: &Object, _sel: Sel, _sender: id) {
let state: &mut WindowState = unsafe { WindowState::from_field(this) };
let modifiers = state.keyboard_state().last_mods();
let drop_data = get_drop_data(sender);
on_event(state, MouseEvent::DragLeft);
}