mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
{true, false}->{YES, NO}
This commit is contained in:
@@ -7,7 +7,7 @@ use libc;
|
|||||||
|
|
||||||
use BuilderAttribs;
|
use BuilderAttribs;
|
||||||
|
|
||||||
use cocoa::base::{Class, id, NSUInteger, nil, objc_allocateClassPair, class, objc_registerClassPair};
|
use cocoa::base::{Class, id, YES, NO, NSUInteger, nil, objc_allocateClassPair, class, objc_registerClassPair};
|
||||||
use cocoa::base::{selector, msg_send, class_addMethod, class_addIvar};
|
use cocoa::base::{selector, msg_send, class_addMethod, class_addIvar};
|
||||||
use cocoa::base::{object_setInstanceVariable, object_getInstanceVariable};
|
use cocoa::base::{object_setInstanceVariable, object_getInstanceVariable};
|
||||||
use cocoa::appkit;
|
use cocoa::appkit;
|
||||||
@@ -190,7 +190,7 @@ impl WindowProxy {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
NSApp().postEvent_atStart_(event, true);
|
NSApp().postEvent_atStart_(event, YES);
|
||||||
pool.drain();
|
pool.drain();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ impl Window {
|
|||||||
};
|
};
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
app.activateIgnoringOtherApps_(true);
|
app.activateIgnoringOtherApps_(YES);
|
||||||
if builder.visible {
|
if builder.visible {
|
||||||
window.makeKeyAndOrderFront_(nil);
|
window.makeKeyAndOrderFront_(nil);
|
||||||
} else {
|
} else {
|
||||||
@@ -282,7 +282,7 @@ impl Window {
|
|||||||
frame,
|
frame,
|
||||||
masks,
|
masks,
|
||||||
NSBackingStoreBuffered,
|
NSBackingStoreBuffered,
|
||||||
false,
|
NO,
|
||||||
);
|
);
|
||||||
|
|
||||||
if window == nil {
|
if window == nil {
|
||||||
@@ -290,7 +290,7 @@ impl Window {
|
|||||||
} else {
|
} else {
|
||||||
let title = NSString::alloc(nil).init_str(title);
|
let title = NSString::alloc(nil).init_str(title);
|
||||||
window.setTitle_(title);
|
window.setTitle_(title);
|
||||||
window.setAcceptsMouseMovedEvents_(true);
|
window.setAcceptsMouseMovedEvents_(YES);
|
||||||
if monitor.is_some() {
|
if monitor.is_some() {
|
||||||
window.setLevel_(NSMainMenuWindowLevel as i64 + 1);
|
window.setLevel_(NSMainMenuWindowLevel as i64 + 1);
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ impl Window {
|
|||||||
if view == nil {
|
if view == nil {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
view.setWantsBestResolutionOpenGLSurface_(true);
|
view.setWantsBestResolutionOpenGLSurface_(YES);
|
||||||
window.setContentView_(view);
|
window.setContentView_(view);
|
||||||
Some(view)
|
Some(view)
|
||||||
}
|
}
|
||||||
@@ -403,7 +403,7 @@ impl Window {
|
|||||||
NSAnyEventMask as u64,
|
NSAnyEventMask as u64,
|
||||||
NSDate::distantPast(nil),
|
NSDate::distantPast(nil),
|
||||||
NSDefaultRunLoopMode,
|
NSDefaultRunLoopMode,
|
||||||
true);
|
YES);
|
||||||
if event == nil { break; }
|
if event == nil { break; }
|
||||||
{
|
{
|
||||||
// Create a temporary structure with state that delegates called internally
|
// Create a temporary structure with state that delegates called internally
|
||||||
@@ -512,7 +512,7 @@ impl Window {
|
|||||||
NSAnyEventMask as u64,
|
NSAnyEventMask as u64,
|
||||||
NSDate::distantFuture(nil),
|
NSDate::distantFuture(nil),
|
||||||
NSDefaultRunLoopMode,
|
NSDefaultRunLoopMode,
|
||||||
false);
|
NO);
|
||||||
NSApp().sendEvent_(event);
|
NSApp().sendEvent_(event);
|
||||||
|
|
||||||
self.poll_events()
|
self.poll_events()
|
||||||
|
|||||||
Reference in New Issue
Block a user