< prev index next >

src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m

Print this page




 325 }
 326 
 327 - (BOOL)usingDefaultNib {
 328     return sUsingDefaultNIB;
 329 }
 330 
 331 - (void)orderFrontStandardAboutPanelWithOptions:(NSDictionary *)optionsDictionary {
 332     if (!optionsDictionary) {
 333         optionsDictionary = [NSMutableDictionary dictionaryWithCapacity:2];
 334         [optionsDictionary setValue:[[[[[NSApp mainMenu] itemAtIndex:0] submenu] itemAtIndex:0] title] forKey:@"ApplicationName"];
 335         if (![NSImage imageNamed:@"NSApplicationIcon"]) {
 336             [optionsDictionary setValue:[NSApp applicationIconImage] forKey:@"ApplicationIcon"];
 337         }
 338     }
 339 
 340     [super orderFrontStandardAboutPanelWithOptions:optionsDictionary];
 341 }
 342 
 343 #define DRAGMASK (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSFlagsChangedMask | NSKeyDownMask)
 344 
 345 #if defined(MAC_OS_X_VERSION_10_12) && \
 346    MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12 && \
 347    __LP64__
 348    // 10.12 changed `mask` to NSEventMask (unsigned long long) for x86_64 builds.
 349 - (NSEvent *)nextEventMatchingMask:(NSEventMask)mask
 350 #else
 351 - (NSEvent *)nextEventMatchingMask:(NSUInteger)mask
 352 #endif
 353 untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
 354     if (mask == DRAGMASK && [((NSString *)kCFRunLoopDefaultMode) isEqual:mode]) {
 355         postEventDuringEventSynthesis = YES;
 356     }
 357 
 358     NSEvent *event = [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue: deqFlag];
 359     postEventDuringEventSynthesis = NO;
 360 
 361     return event;
 362 }
 363 
 364 // NSTimeInterval has microseconds precision
 365 #define TS_EQUAL(ts1, ts2) (fabs((ts1) - (ts2)) < 1e-6)
 366 
 367 - (void)sendEvent:(NSEvent *)event




 325 }
 326 
 327 - (BOOL)usingDefaultNib {
 328     return sUsingDefaultNIB;
 329 }
 330 
 331 - (void)orderFrontStandardAboutPanelWithOptions:(NSDictionary *)optionsDictionary {
 332     if (!optionsDictionary) {
 333         optionsDictionary = [NSMutableDictionary dictionaryWithCapacity:2];
 334         [optionsDictionary setValue:[[[[[NSApp mainMenu] itemAtIndex:0] submenu] itemAtIndex:0] title] forKey:@"ApplicationName"];
 335         if (![NSImage imageNamed:@"NSApplicationIcon"]) {
 336             [optionsDictionary setValue:[NSApp applicationIconImage] forKey:@"ApplicationIcon"];
 337         }
 338     }
 339 
 340     [super orderFrontStandardAboutPanelWithOptions:optionsDictionary];
 341 }
 342 
 343 #define DRAGMASK (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSFlagsChangedMask | NSKeyDownMask)
 344 
 345 #if defined(MAC_OS_X_VERSION_10_12) && __LP64__


 346    // 10.12 changed `mask` to NSEventMask (unsigned long long) for x86_64 builds.
 347 - (NSEvent *)nextEventMatchingMask:(NSEventMask)mask
 348 #else
 349 - (NSEvent *)nextEventMatchingMask:(NSUInteger)mask
 350 #endif
 351 untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
 352     if (mask == DRAGMASK && [((NSString *)kCFRunLoopDefaultMode) isEqual:mode]) {
 353         postEventDuringEventSynthesis = YES;
 354     }
 355 
 356     NSEvent *event = [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue: deqFlag];
 357     postEventDuringEventSynthesis = NO;
 358 
 359     return event;
 360 }
 361 
 362 // NSTimeInterval has microseconds precision
 363 #define TS_EQUAL(ts1, ts2) (fabs((ts1) - (ts2)) < 1e-6)
 364 
 365 - (void)sendEvent:(NSEvent *)event


< prev index next >