Author: mlytwyn
Date: Fri Jun 26 21:19:59 2015
New Revision: 38709
URL: http://svn.gna.org/viewcvs/gnustep?rev=38709&view=rev
Log:
NSCursor and NSDocument merges
Modified:
libs/gui/branches/gnustep_testplant_branch/Source/NSCursor.m
libs/gui/branches/gnustep_testplant_branch/Source/NSDocument.m
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSCursor.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSCursor.m?rev=38709&r1=38708&r2=38709&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSCursor.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSCursor.m Fri Jun
26 21:19:59 2015
@@ -70,11 +70,20 @@
}
}
+#ifdef WIN32
++ (NSUInteger) count
+{
+ return [gnustep_gui_cursor_stack count];
+}
+#endif
+
+// Testplant-MAL-2015-06-26: Keeping testplant fixes...
+ (NSMutableArray *) stack
{
return gnustep_gui_cursor_stack;
}
+// Testplant-MAL-2015-06-26: Keeping testplant fixes...
+ (void) resetStack
{
[gnustep_gui_cursor_stack removeAllObjects];
@@ -287,6 +296,7 @@
return getStandardCursor(@"GSResizeUpDownCursor", GSResizeUpDownCursor);
}
+// Testplant-MAL-2015-06-26: Keeping testplant fixes...
+ (NSCursor*) resizeNWSECursor
{
return getStandardCursor(@"GSResizeNWSECursor", GSResizeNWSECursor);
@@ -454,6 +464,8 @@
*/
- (void) mouseEntered: (NSEvent*)theEvent
{
+ NSDebugLLog(@"NSCursor", @"Cursor mouseEntered:enter %d exit %d",
+ _cursor_flags.is_set_on_mouse_entered,
_cursor_flags.is_set_on_mouse_exited);
if (_cursor_flags.is_set_on_mouse_entered == YES)
{
[self set];
@@ -474,7 +486,8 @@
*/
- (void) mouseExited: (NSEvent*)theEvent
{
- NSDebugLLog(@"NSCursor", @"Cursor mouseExited:");
+ NSDebugLLog(@"NSCursor", @"Cursor mouseExited: enter %d exit %d",
+ _cursor_flags.is_set_on_mouse_entered,
_cursor_flags.is_set_on_mouse_exited);
if (_cursor_flags.is_set_on_mouse_exited == YES)
{
[self set];
@@ -668,7 +681,7 @@
image = [aDecoder decodeObjectForKey: @"NSImage"];
}
-
+ // Testplant-MAL-2015-06-26: Keeping testplant fixes...
if ([[image name]
isEqualToString:@"file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff"])
{
NSDebugLog(@"An NSCursor object was encoded with the
image "
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSDocument.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSDocument.m?rev=38709&r1=38708&r2=38709&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSDocument.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSDocument.m Fri Jun
26 21:19:59 2015
@@ -29,6 +29,7 @@
*/
#import <Foundation/NSData.h>
+#import <Foundation/NSError.h>
#import <Foundation/NSException.h>
#import <Foundation/NSFileManager.h>
#import <Foundation/NSNotification.h>
@@ -47,6 +48,16 @@
#import "NSDocumentFrameworkPrivate.h"
#import "GSGuiPrivate.h"
+
+static inline NSError*
+create_error(int code, NSString* desc)
+{
+ return [NSError errorWithDomain: @"NSDocument"
+ code: code
+ userInfo: [NSDictionary
+ dictionaryWithObjectsAndKeys: desc,
+ NSLocalizedDescriptionKey, nil]];
+}
@implementation NSDocument
@@ -629,8 +640,12 @@
data = [self dataOfType: type error: error];
if (data == nil)
- return nil;
-
+ {
+ if (error && !(*error))
+ *error = create_error(0, NSLocalizedString(@"Could not create data
for type.",
+ @"Error description"));
+ return nil;
+ }
return AUTORELEASE([[NSFileWrapper alloc] initRegularFileWithContents:
data]);
}
@@ -730,9 +745,11 @@
error: error];
}
- // FIXME: Set error
if (error)
- *error = nil;
+ {
+ *error = create_error(0, NSLocalizedString(@"File wrapper is no file.",
+ @"Error description"));
+ }
return NO;
}
@@ -894,6 +911,11 @@
ofType: type
saveOperation: op])
{
+ if (error)
+ {
+ *error = create_error(0, NSLocalizedString(@"Could not write
backup file.",
+ @"Error
description"));
+ }
return NO;
}
@@ -907,9 +929,11 @@
if (!isNativeType || (url == nil))
{
- // FIXME: Set error
if (error)
- *error = nil;
+ {
+ *error = create_error(0, NSLocalizedString(@"Not a writable type or
no URL given.",
+ @"Error description"));
+ }
return NO;
}
@@ -927,9 +951,11 @@
if (![self _writeBackupForFile: fileName
toFile: backupFilename])
{
- // FIXME: Set error.
if (error)
- *error = nil;
+ {
+ *error = create_error(0, NSLocalizedString(@"Could not
write backup file.",
+ @"Error
description"));
+ }
return NO;
}
}
@@ -997,9 +1023,11 @@
error: error];
if (wrapper == nil)
{
- // FIXME: Set error
- if (error)
- *error = nil;
+ if (error && !(*error))
+ {
+ *error = create_error(0, NSLocalizedString(@"Could not write
file wrapper.",
+ @"Error
description"));
+ }
return NO;
}
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs