diff --git a/Headers/gnustep/gui/NSCursor.h b/Headers/gnustep/gui/NSCursor.h index 5acf3cba7..ae12d5d1f 100644 --- a/Headers/gnustep/gui/NSCursor.h +++ b/Headers/gnustep/gui/NSCursor.h @@ -35,7 +35,6 @@ @class NSEvent; @interface NSCursor : NSObject - { // Attributes NSImage *cursor_image; diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index b53806b2b..3a069fb10 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -76,7 +76,7 @@ - initTextCell:(NSString *)aString { [super initTextCell:aString]; - altContents = @"Button"; + altContents = nil; [self setButtonType:NSMomentaryPushButton]; [self setEnabled:YES]; [self setTransparent:NO]; @@ -264,9 +264,20 @@ [self setShowsStateBy:NSContentsCellMask]; break; case NSSwitchButton: + [self setHighlightsBy:NSContentsCellMask]; + [self setShowsStateBy:NSContentsCellMask]; + [self setImage:[NSImage imageNamed:@"common_SwitchOff"]]; + [self setAlternateImage:[NSImage imageNamed:@"common_SwitchOn"]]; + [self setImagePosition:NSImageLeft]; + [self setAlignment:NSLeftTextAlignment]; + break; case NSRadioButton: [self setHighlightsBy:NSContentsCellMask]; [self setShowsStateBy:NSContentsCellMask]; + [self setImage:[NSImage imageNamed:@"common_RadioOff"]]; + [self setAlternateImage:[NSImage imageNamed:@"common_RadioOn"]]; + [self setImagePosition:NSImageLeft]; + [self setAlignment:NSLeftTextAlignment]; break; } diff --git a/Source/NSCell.m b/Source/NSCell.m index c6194d49e..19bd076cb 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -124,7 +124,7 @@ cell_font = [[NSFont userFontOfSize:12] retain]; contents = aString; cell_type = NSTextCellType; - text_align = NSLeftTextAlignment; + text_align = NSCenterTextAlignment; cell_image = nil; image_position = NSNoImage; cell_state = NO; diff --git a/Source/NSCursor.m b/Source/NSCursor.m index 7a21eb79e..c260ebff4 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -26,11 +26,11 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include -#include // Class variables -static Stack *gnustep_gui_cursor_stack; +static NSMutableArray *gnustep_gui_cursor_stack; static NSCursor *gnustep_gui_current_cursor; static BOOL gnustep_gui_hidden_until_move; @@ -47,7 +47,7 @@ static BOOL gnustep_gui_hidden_until_move; [self setVersion:1]; // Initialize class variables - gnustep_gui_cursor_stack = [[Stack alloc] initWithCapacity: 2]; + gnustep_gui_cursor_stack = [[NSMutableArray alloc] initWithCapacity: 2]; gnustep_gui_hidden_until_move = YES; gnustep_gui_current_cursor = [NSCursor arrowCursor]; } @@ -63,13 +63,15 @@ static BOOL gnustep_gui_hidden_until_move; + (void)pop { // The object we pop is the current cursor - if (![gnustep_gui_cursor_stack isEmpty]) - gnustep_gui_current_cursor = [gnustep_gui_cursor_stack popObject]; + if ([gnustep_gui_cursor_stack count]) { + gnustep_gui_current_cursor = [gnustep_gui_cursor_stack lastObject]; + [gnustep_gui_cursor_stack removeLastObject]; + } // If the stack isn't empty then get the new current cursor // Otherwise the cursor will stay the same - if (![gnustep_gui_cursor_stack isEmpty]) - gnustep_gui_current_cursor = [gnustep_gui_cursor_stack topObject]; + if ([gnustep_gui_cursor_stack count]) + gnustep_gui_current_cursor = [gnustep_gui_cursor_stack lastObject]; [self currentCursorHasChanged]; } @@ -188,7 +190,7 @@ static BOOL gnustep_gui_hidden_until_move; - (void)push { - [gnustep_gui_cursor_stack pushObject: self]; + [gnustep_gui_cursor_stack addObject: self]; gnustep_gui_current_cursor = self; [NSCursor currentCursorHasChanged]; } @@ -214,13 +216,10 @@ static BOOL gnustep_gui_hidden_until_move; // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - return self; } diff --git a/Source/NSImage.m b/Source/NSImage.m index c9d312d5d..adf04c6e5 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -161,8 +161,8 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) main = [NSBundle mainBundle]; ext = extension(aName); - NSLog(@"search locally\n"); - NSLog(@"extension is %s\n", [ext cString]); + NSDebugLog(@"search locally\n"); + NSDebugLog(@"extension is %s\n", [ext cString]); /* First search locally */ if (ext) path = [main pathForResource: aName ofType: ext]; @@ -173,11 +173,11 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) array = [self imageFileTypes]; if (!array) - NSLog(@"array is nil\n"); + NSDebugLog(@"array is nil\n"); e = [array objectEnumerator]; while ((o = [e nextObject])) { - NSLog(@"extension %s\n", [o cString]); + NSDebugLog(@"extension %s\n", [o cString]); path = [main pathForResource:aName ofType: o]; if ([path length] != 0) @@ -201,11 +201,11 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) array = [self imageFileTypes]; if (!array) - NSLog(@"array is nil\n"); + NSDebugLog(@"array is nil\n"); e = [array objectEnumerator]; while ((o = [e nextObject])) { - NSLog(@"extension %s, array = %@\n", [o cString], dirsArray); + NSDebugLog(@"extension %s, array = %@\n", [o cString], dirsArray); path = [NSBundle pathForResource: aName ofType: o inDirectories:dirsArray]; diff --git a/Source/tiff.m b/Source/tiff.m index e9e0585e5..56cdaae28 100644 --- a/Source/tiff.m +++ b/Source/tiff.m @@ -55,9 +55,10 @@ */ //#include -#include #include #include +#include +#include #include #include @@ -80,7 +81,7 @@ static tsize_t TiffHandleRead(thandle_t handle, tdata_t buf, toff_t count) { chandle_t* chand = (chandle_t *)handle; - printf("TiffHandleRead\n"); + NSDebugLog (@"TiffHandleRead\n"); if (chand->position >= chand->size) return 0; if (chand->position + count > chand->size) @@ -93,7 +94,7 @@ static tsize_t TiffHandleWrite(thandle_t handle, tdata_t buf, toff_t count) { chandle_t* chand = (chandle_t *)handle; - printf("TiffHandleWrite\n"); + NSDebugLog (@"TiffHandleWrite\n"); if (chand->mode == "r") return 0; if (chand->position + count > chand->size) @@ -113,7 +114,7 @@ static toff_t TiffHandleSeek(thandle_t handle, toff_t offset, int mode) { chandle_t* chand = (chandle_t *)handle; - printf("TiffHandleSeek\n"); + NSDebugLog (@"TiffHandleSeek\n"); switch(mode) { case SEEK_SET: chand->position = offset; break; @@ -132,7 +133,7 @@ TiffHandleClose(thandle_t handle) { chandle_t* chand = (chandle_t *)handle; - printf("TiffHandleClose\n"); + NSDebugLog (@"TiffHandleClose\n"); /* Presumably, we don't need the handle anymore */ OBJC_FREE(chand); return 0; @@ -142,7 +143,7 @@ static toff_t TiffHandleSize(thandle_t handle) { chandle_t* chand = (chandle_t *)handle; - printf("TiffHandleSize\n"); + NSDebugLog (@"TiffHandleSize\n"); return chand->size; } @@ -151,7 +152,7 @@ TiffHandleMap(thandle_t handle, tdata_t* data, toff_t* size) { chandle_t* chand = (chandle_t *)handle; - printf("TiffHandleMap\n"); + NSDebugLog (@"TiffHandleMap\n"); *data = chand->data; *size = chand->size; @@ -161,7 +162,7 @@ TiffHandleMap(thandle_t handle, tdata_t* data, toff_t* size) static void TiffHandleUnmap(thandle_t handle, tdata_t data, toff_t size) { - printf("TiffHandleUnmap\n"); + NSDebugLog (@"TiffHandleUnmap\n"); /* Nothing to unmap. */ } @@ -171,7 +172,7 @@ NSTiffOpenData(char* data, long size, const char* mode, realloc_data_callback* realloc_data) { chandle_t* handle; - printf("NSTiffOpenData\n"); + NSDebugLog (@"NSTiffOpenData\n"); OBJC_MALLOC(handle, chandle_t, 1); handle->data = data; handle->position = 0;