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

8240487: Cleanup whitespace in .cc, .hh, .m, and .mm files #172

Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -108,7 +108,7 @@ - (void) setBounds:(CGRect)rect {
CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
}];

JNF_COCOA_EXIT(env);

return ptr_to_jlong(surfaceLayers);
@@ -125,7 +125,7 @@ - (void) setBounds:(CGRect)rect {
JNF_COCOA_ENTER(env);

AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);

[ThreadUtilities performOnMainThreadWaiting:NO block:^(){

CGRect rect = CGRectMake(x, y, width, height);
@@ -548,11 +548,11 @@ -(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint {
if ((codePoint == 0x0024) || (codePoint == 0x00A3) ||
(codePoint == 0x00A5) ||
((codePoint >= 0x20A3) && (codePoint <= 0x20BF)) ||
((codePoint >= 0x3000) && (codePoint <= 0x303F)) ||
((codePoint >= 0x3000) && (codePoint <= 0x303F)) ||
((codePoint >= 0xFF00) && (codePoint <= 0xFFEF))) {
// Code point is in 'CJK Symbols and Punctuation' or
// 'Halfwidth and Fullwidth Forms' Unicode block or
// currency symbols unicode
// currency symbols unicode
return YES;
}
return NO;
@@ -25,7 +25,7 @@

#import "CDataTransferer.h"
#import "ThreadUtilities.h"
#import "jni_util.h"
#import "jni_util.h"
#import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>

@@ -79,10 +79,10 @@ - (void)declareTypes:(NSArray*)types withOwner:(jobject)owner jniEnv:(JNIEnv*)en
- (void)checkPasteboard:(id)sender {

// This is called via NSApplicationDidBecomeActiveNotification.

// If the change count on the general pasteboard is different than when we set it
// someone else put data on the clipboard. That means the current owner lost ownership.

NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];

if (self.changeCount != newChangeCount) {
@@ -109,11 +109,11 @@ - (void)checkPasteboard:(id)sender {

- (BOOL) checkPasteboardWithoutNotification:(id)application {
AWT_ASSERT_APPKIT_THREAD;

NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];

if (self.changeCount != newChangeCount) {
self.changeCount = newChangeCount;
self.changeCount = newChangeCount;
return YES;
} else {
return NO;
@@ -189,7 +189,7 @@ - (BOOL) checkPasteboardWithoutNotification:(id)application {
dataTypes = [[[NSPasteboard generalPasteboard] types] retain];
}];
[dataTypes autorelease];

NSUInteger nFormats = [dataTypes count];
NSUInteger knownFormats = 0;
NSUInteger i;
@@ -250,7 +250,7 @@ - (BOOL) checkPasteboardWithoutNotification:(id)application {
[ThreadUtilities performOnMainThreadWaiting:YES block:^() {
clipData = [[[NSPasteboard generalPasteboard] dataForType:formatAsString] retain];
}];

if (clipData == NULL) {
[JNFException raise:env as:"java/io/IOException" reason:"Font transform has NaN position"];
return NULL;
@@ -273,20 +273,20 @@ - (BOOL) checkPasteboardWithoutNotification:(id)application {
return returnValue;
}

/*
* Class: sun_lwawt_macosx_CClipboard
* Method: checkPasteboard
* Signature: ()V
*/
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: checkPasteboard
* Signature: ()V
*/
JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboardWithoutNotification
(JNIEnv *env, jobject inObject)
{
__block BOOL ret = NO;
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
}];
JNF_COCOA_EXIT(env);
return ret;
}
(JNIEnv *env, jobject inObject)
{
__block BOOL ret = NO;
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
}];

JNF_COCOA_EXIT(env);
return ret;
}
@@ -611,7 +611,7 @@ - (void)draggingExited:(id<NSDraggingInfo>)sender
JNF_MEMBER_CACHE(handleExitMessageMethod, jc_CDropTargetContextPeer, "handleExitMessage", "(Ljava/awt/Component;J)V");
if (sDraggingError == FALSE) {
DLog3(@" - dragExit: loc native %f, %f\n", sDraggingLocation.x, sDraggingLocation.y);
// AWT_THREADING Safe (CToolkitThreadBlockedHandler)
// AWT_THREADING Safe (CToolkitThreadBlockedHandler)
JNFCallVoidMethod(env, fDropTargetContextPeer,
handleExitMessageMethod, fComponent, ptr_to_jlong(self));
}
@@ -39,7 +39,7 @@
{
if (releaseOnAppKitThread) {
// Releasing resources on the main AppKit message loop only
// Releasing resources on the nested loops may cause dangling
// Releasing resources on the nested loops may cause dangling
// pointers after the nested loop is exited
if ([NSApp respondsToSelector:@selector(postRunnableEvent:)]) {
[NSApp postRunnableEvent:^() {
@@ -112,7 +112,7 @@
jlong result = 0L;

JNF_COCOA_ENTER(env);

NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height);
if (imageRep) {
NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(width, height)];
@@ -325,16 +325,16 @@
{
if (!image) return;
NSImage *i = (NSImage *)jlong_to_ptr(image);

JNF_COCOA_ENTER(env);

NSImageRep *imageRep = nil;
NSArray *imageRepresentations = [i representations];
NSEnumerator *imageEnumerator = [imageRepresentations objectEnumerator];
while ((imageRep = [imageEnumerator nextObject]) != nil) {
[imageRep setSize:NSMakeSize(w, h)];
}

JNF_COCOA_EXIT(env);
}

@@ -356,20 +356,20 @@ NSComparisonResult getOrder(BOOL order){
NSImage *img = (NSImage *)jlong_to_ptr(image);

JNF_COCOA_ENTER(env);

NSArray *imageRepresentations = [img representations];
if([imageRepresentations count] == 0){
return NULL;
}

NSArray *sortedImageRepresentations = [imageRepresentations
sortedArrayUsingComparator: ^(id obj1, id obj2) {

NSImageRep *imageRep1 = (NSImageRep *) obj1;
NSImageRep *imageRep2 = (NSImageRep *) obj2;
NSSize size1 = [imageRep1 size];
NSSize size2 = [imageRep2 size];

if (NSEqualSizes(size1, size2)) {
return getOrder([imageRep1 pixelsWide] <= [imageRep2 pixelsWide] &&
[imageRep1 pixelsHigh] <= [imageRep2 pixelsHigh]);
@@ -380,7 +380,7 @@ NSComparisonResult getOrder(BOOL order){

NSMutableArray *sortedPixelSizes = [[[NSMutableArray alloc] init] autorelease];
NSSize lastSize = [[sortedImageRepresentations lastObject] size];

NSUInteger i = [sortedImageRepresentations indexOfObjectPassingTest:
^BOOL(id obj, NSUInteger idx, BOOL *stop) {
NSSize imageRepSize = [obj size];