2005-01-21 21:43 Alexander Malmberg <alexander@malmberg.org>

Various whitespace cleanups, comment type fixes, and changes
	to avoid warnings from recent versions of gcc.

	* Headers/Additions/GNUstepGUI/GSToolbar.h (-_toolbars): Declare.
	* Source/NSWindow+Toolbar.m: Remove conflicting declaration of
	[NSToolbar -_toolbars].

	* Headers/Additions/GNUstepGUI/GSServicesManager.h,
 	Source/GSServicesMananger.m (-item2title:, -validateMenuItem:):
	Adjust argument types.
	* Headers/AppKit/NSMenu.h (-validateMenuItem:): Adjust argument
	type.

	* Source/NSTextView.m (-sizeToFit): Don't use size uninitialized
	if neither resizable flags is set.
	(-insertText:): Adjust argument type.
	* Headers/AppKit/NSResponder.h, Source/NSResponder.m (-insertText:):
	Adjust argument type. Document.

	* Headers/AppKit/NSView.h: Change type of ivar _window to NSWindow *.

	* Source/GSTitleView.m (-mouseDown:): Always initialize
	startWindowOrigin.
	* Source/NSApplication.m (-setApplicationIconImage:): Add casts
	to avoid warnings.
	* Source/NSCell.m (-cellSize): Add default: case.
	* Source/NSPasteboard.m
	([GSFiltered -pasteboard:provideDataForType:]): Detect and warn if we
	can't find a filter that will get us the desired type.
	* Source/NSProgressIndicator.m: Comment out unused variable 'images'.
	* Source/NSBezierPath.m: Declare GSBezierPath fully before using it.
	(-bezierPathByFlatteningPath, -bezierPathByReversingPath): Make sure
	variables are always initialized.

	* Source/NSMenuView.m,
	* Source/NSPrintOperation.m,
	* Source/NSSplitView.m,
	* Source/NSTableHeaderView.m: Make sure variables are always
	initialized.

	* Source/NSBox.m,
	* Source/NSImageview.m,
	* Source/NSText.m,
	* Source/NSTextStorage.m: Add missing includes.

	* Source/GSKeyBindingTable.m,
	* Source/GSLayoutManager.m,
	* Source/NSBitmapImageRep+PNM.m,
	* Source/NSBundleAdditions.m,
	* Source/NSLayoutManager.m,
	* Source/nsimage-tiff.h,
	* Source/tiff.m,
	* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
	* Source/GSDisplayServer.m: Change signedness of various variables.

	* Source/NSPanel.m (-sendEvent:): Remove.
	* Source/NSWindow.m (-becomesKeyOnlyIfNeeded): New method.
	(-_sendEvent:becomesKeyOnlyIfNeeded:): Remove. Move code ...
	(-sendEvent:): ... here. Use -becomesKeyOnlyIfNeeded instead
	of the argument.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20590 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
alexm 2005-01-21 20:39:18 +00:00
parent bbf693d751
commit 8b0730a303
38 changed files with 199 additions and 116 deletions

View file

@ -1,3 +1,66 @@
2005-01-21 21:43 Alexander Malmberg <alexander@malmberg.org>
Various whitespace cleanups, comment type fixes, and changes
to avoid warnings from recent versions of gcc.
* Headers/Additions/GNUstepGUI/GSToolbar.h (-_toolbars): Declare.
* Source/NSWindow+Toolbar.m: Remove conflicting declaration of
[NSToolbar -_toolbars].
* Headers/Additions/GNUstepGUI/GSServicesManager.h,
Source/GSServicesMananger.m (-item2title:, -validateMenuItem:):
Adjust argument types.
* Headers/AppKit/NSMenu.h (-validateMenuItem:): Adjust argument
type.
* Source/NSTextView.m (-sizeToFit): Don't use size uninitialized
if neither resizable flags is set.
(-insertText:): Adjust argument type.
* Headers/AppKit/NSResponder.h, Source/NSResponder.m (-insertText:):
Adjust argument type. Document.
* Headers/AppKit/NSView.h: Change type of ivar _window to NSWindow *.
* Source/GSTitleView.m (-mouseDown:): Always initialize
startWindowOrigin.
* Source/NSApplication.m (-setApplicationIconImage:): Add casts
to avoid warnings.
* Source/NSCell.m (-cellSize): Add default: case.
* Source/NSPasteboard.m
([GSFiltered -pasteboard:provideDataForType:]): Detect and warn if we
can't find a filter that will get us the desired type.
* Source/NSProgressIndicator.m: Comment out unused variable 'images'.
* Source/NSBezierPath.m: Declare GSBezierPath fully before using it.
(-bezierPathByFlatteningPath, -bezierPathByReversingPath): Make sure
variables are always initialized.
* Source/NSMenuView.m,
* Source/NSPrintOperation.m,
* Source/NSSplitView.m,
* Source/NSTableHeaderView.m: Make sure variables are always
initialized.
* Source/NSBox.m,
* Source/NSImageview.m,
* Source/NSText.m,
* Source/NSTextStorage.m: Add missing includes.
* Source/GSKeyBindingTable.m,
* Source/GSLayoutManager.m,
* Source/NSBitmapImageRep+PNM.m,
* Source/NSBundleAdditions.m,
* Source/NSLayoutManager.m,
* Source/nsimage-tiff.h,
* Source/tiff.m,
* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
* Source/GSDisplayServer.m: Change signedness of various variables.
* Source/NSPanel.m (-sendEvent:): Remove.
* Source/NSWindow.m (-becomesKeyOnlyIfNeeded): New method.
(-_sendEvent:becomesKeyOnlyIfNeeded:): Remove. Move code ...
(-sendEvent:): ... here. Use -becomesKeyOnlyIfNeeded instead
of the argument.
2005-01-21 Quentin Mathe <qmathe@club-internet.fr> 2005-01-21 Quentin Mathe <qmathe@club-internet.fr>
* Source/GSToolbarView.m: * Source/GSToolbarView.m:

View file

@ -150,7 +150,8 @@ APPKIT_EXPORT NSString * GSScreenNumber;
- (void) hidecursor; - (void) hidecursor;
- (void) showcursor; - (void) showcursor;
- (void) standardcursor: (int) style : (void**) cid; - (void) standardcursor: (int) style : (void**) cid;
- (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors : (const char*) image : (void**) cid; - (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors
: (const unsigned char *) image : (void**) cid;
- (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid; - (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid;
@end @end

View file

@ -39,6 +39,7 @@
@class NSMutableSet; @class NSMutableSet;
@class NSString; @class NSString;
@class NSTimer; @class NSTimer;
@protocol NSMenuItem;
@interface GSServicesManager : NSObject @interface GSServicesManager : NSObject
{ {
@ -70,7 +71,7 @@
- (void) doService: (NSMenuItem*)item; - (void) doService: (NSMenuItem*)item;
- (NSArray*) filters; - (NSArray*) filters;
- (BOOL) hasRegisteredTypes: (NSDictionary*)service; - (BOOL) hasRegisteredTypes: (NSDictionary*)service;
- (NSString*) item2title: (NSMenuItem*)item; - (NSString*) item2title: (id<NSMenuItem>)item;
- (void) loadServices; - (void) loadServices;
- (NSDictionary*) menuServices; - (NSDictionary*) menuServices;
- (void) rebuildServices; - (void) rebuildServices;
@ -84,7 +85,7 @@
- (void) setServicesProvider: (id)anObject; - (void) setServicesProvider: (id)anObject;
- (int) setShowsServicesMenuItem: (NSString*)item to: (BOOL)enable; - (int) setShowsServicesMenuItem: (NSString*)item to: (BOOL)enable;
- (BOOL) showsServicesMenuItem: (NSString*)item; - (BOOL) showsServicesMenuItem: (NSString*)item;
- (BOOL) validateMenuItem: (NSMenuItem*)item; - (BOOL) validateMenuItem: (id<NSMenuItem>)item;
- (void) updateServicesMenu; - (void) updateServicesMenu;
@end @end

View file

@ -112,6 +112,11 @@ APPKIT_EXPORT NSString *NSToolbarWillAddItemNotification;
- (void) setUsesStandardBackgroundColor: (BOOL)standard; - (void) setUsesStandardBackgroundColor: (BOOL)standard;
- (NSToolbarSizeMode) sizeMode; - (NSToolbarSizeMode) sizeMode;
// Private class method
+ (NSMutableArray *) _toolbars;
@end /* interface of NSToolbar */ @end /* interface of NSToolbar */
/* /*

View file

@ -192,14 +192,14 @@ enum {
+ (NSPoint)mouseLocation; + (NSPoint)mouseLocation;
+ (NSEvent*) otherEventWithType: (NSEventType)type + (NSEvent*) otherEventWithType: (NSEventType)type
location: (NSPoint)location location: (NSPoint)location
modifierFlags: (unsigned int)flags modifierFlags: (unsigned int)flags
timestamp: (NSTimeInterval)time timestamp: (NSTimeInterval)time
windowNumber: (int)windowNum windowNumber: (int)windowNum
context: (NSGraphicsContext*)context context: (NSGraphicsContext*)context
subtype: (short)subType subtype: (short)subType
data1: (int)data1 data1: (int)data1
data2: (int)data2; data2: (int)data2;
+ (void) startPeriodicEventsAfterDelay: (NSTimeInterval)delaySeconds + (void) startPeriodicEventsAfterDelay: (NSTimeInterval)delaySeconds

View file

@ -564,7 +564,7 @@ The displayed menus on the screen have the following structure:
#ifndef NO_GNUSTEP #ifndef NO_GNUSTEP
@interface NSObject (NSMenuActionResponder) @interface NSObject (NSMenuActionResponder)
- (BOOL) validateMenuItem: (NSMenuItem*)aMenuItem; - (BOOL) validateMenuItem: (id<NSMenuItem>)aMenuItem;
@end @end
/** /**

View file

@ -49,7 +49,7 @@
NSResponder *_next_responder; NSResponder *_next_responder;
/* /*
Due to interface brain-damage, but NSResponder and NSMenuView have -menu Due to interface brain-damage, both NSResponder and NSMenuView have -menu
and -setMenu: methods, but for different menus. Thus, to prevent (future, and -setMenu: methods, but for different menus. Thus, to prevent (future,
there have already been some) problems and confusion, this ivar is there have already been some) problems and confusion, this ivar is
private (iow, it can't be accidentally used in NSMenuView). private (iow, it can't be accidentally used in NSMenuView).
@ -144,7 +144,18 @@
- (BOOL) performMnemonic: (NSString*)aString; - (BOOL) performMnemonic: (NSString*)aString;
- (void) flushBufferedKeyEvents; - (void) flushBufferedKeyEvents;
- (void) doCommandBySelector: (SEL)aSelector; - (void) doCommandBySelector: (SEL)aSelector;
- (void) insertText: (NSString*)aString;
/** <p>Tells the receiver to insert the given string. In a text view
the text is typically inserted at the insertion point, and replaces
any selection.
</p><p>
Subclasses should override this method. The implementation in
NSResponder just sends the message on to the next responder.
</p><p>
Normally, aString will be an NSString, but in some cases, it might
be an NSAttributedString.
</p> */
- (void) insertText: (id)aString;
- (NSUndoManager*) undoManager; - (NSUndoManager*) undoManager;
/* /*

View file

@ -98,7 +98,7 @@ typedef enum _NSFocusRingType {
NSView* _super_view; NSView* _super_view;
NSMutableArray *_sub_views; NSMutableArray *_sub_views;
id _window; NSWindow *_window;
NSMutableArray *_tracking_rects; NSMutableArray *_tracking_rects;
NSMutableArray *_cursor_rects; NSMutableArray *_cursor_rects;
NSRect _invalidRect; NSRect _invalidRect;

View file

@ -767,7 +767,7 @@ GSCurrentServer(void)
device representation that can be used later to make this cursor device representation that can be used later to make this cursor
the current one */ the current one */
- (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors - (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors
: (const char*) image : (void**) cid : (const unsigned char *) image : (void**) cid
{ {
[self subclassResponsibility: _cmd]; [self subclassResponsibility: _cmd];
} }

View file

@ -45,7 +45,7 @@
- (void) bindKey: (id)key toAction: (id)action - (void) bindKey: (id)key toAction: (id)action
{ {
unichar character; unichar character;
int modifiers; unsigned int modifiers;
GSKeyBindingAction *a = nil; GSKeyBindingAction *a = nil;
GSKeyBindingTable *t = nil; GSKeyBindingTable *t = nil;
BOOL isTable = NO; BOOL isTable = NO;

View file

@ -691,7 +691,7 @@ not completely accurate).
isValidIndex: (BOOL *)isValidIndex isValidIndex: (BOOL *)isValidIndex
{ {
glyph_run_t *r; glyph_run_t *r;
int pos; unsigned int pos;
*isValidIndex = NO; *isValidIndex = NO;
@ -803,7 +803,7 @@ not completely accurate).
- (unsigned int) characterIndexForGlyphAtIndex: (unsigned int)glyphIndex - (unsigned int) characterIndexForGlyphAtIndex: (unsigned int)glyphIndex
{ {
glyph_run_t *r; glyph_run_t *r;
int pos, cpos; unsigned int pos, cpos;
if (glyphs->glyph_length <= glyphIndex) if (glyphs->glyph_length <= glyphIndex)
{ {
@ -1421,7 +1421,7 @@ places where we switch.
#define GET_GLYPH \ #define GET_GLYPH \
glyph_run_t *r; \ glyph_run_t *r; \
int pos, cpos; \ unsigned int pos, cpos; \
\ \
if (glyphs->glyph_length <= idx) \ if (glyphs->glyph_length <= idx) \
{ \ { \

View file

@ -672,7 +672,7 @@ static NSString *disabledName = @".GNUstepDisabled";
* contains the full title of the service. * contains the full title of the service.
* Return nil if this is not one of our service menu items. * Return nil if this is not one of our service menu items.
*/ */
- (NSString*) item2title: (NSMenuItem*)item - (NSString*) item2title: (id<NSMenuItem>)item
{ {
unsigned pos; unsigned pos;
@ -1132,7 +1132,7 @@ static NSString *disabledName = @".GNUstepDisabled";
return NO; return NO;
} }
- (BOOL) validateMenuItem: (NSMenuItem*)item - (BOOL) validateMenuItem: (id<NSMenuItem>)item
{ {
NSString *title = [self item2title: item]; NSString *title = [self item2title: item];
NSDictionary *info = [_title2info objectForKey: title]; NSDictionary *info = [_title2info objectForKey: title];

View file

@ -281,10 +281,7 @@
NSDebugLLog (@"NSMenu", @"Mouse down in title!"); NSDebugLLog (@"NSMenu", @"Mouse down in title!");
// Remember start position of window // Remember start position of window
if (_ownedByMenu) startWindowOrigin = [_window frame].origin;
{
startWindowOrigin = [_window frame].origin;
}
// Remember start location of cursor in window // Remember start location of cursor in window
lastLocation = [theEvent locationInWindow]; lastLocation = [theEvent locationInWindow];

View file

@ -1870,7 +1870,7 @@ image.
if (_app_icon_window != nil) if (_app_icon_window != nil)
{ {
[[_app_icon_window contentView] setImage: anImage]; [(NSAppIconView *)[_app_icon_window contentView] setImage: anImage];
} }
// Swap the old image for the new one wherever it's used // Swap the old image for the new one wherever it's used

View file

@ -56,13 +56,36 @@ static NSLineCapStyle default_line_cap_style = NSButtLineCapStyle;
static float default_miter_limit = 10.0; static float default_miter_limit = 10.0;
@interface NSBezierPath (PrivateMethods) @interface NSBezierPath (PrivateMethods)
- (void)_invalidateCache; - (void)_invalidateCache;
- (void)_recalculateBounds; - (void)_recalculateBounds;
@end @end
@class GSBezierPath;
typedef struct _PathElement
{
NSBezierPathElement type;
NSPoint points[3];
} PathElement;
//#define GSUNION_TYPES GSUNION_OBJ
#define GSI_ARRAY_TYPES 0
#define GSI_ARRAY_TYPE PathElement
#define GSI_ARRAY_NO_RETAIN
#define GSI_ARRAY_NO_RELEASE
#ifdef GSIArray
#undef GSIArray
#endif
#include <GNUstepBase/GSIArray.h>
@interface GSBezierPath : NSBezierPath
{
GSIArray pathElements;
BOOL flat;
}
@end
@implementation NSBezierPath @implementation NSBezierPath
@ -541,6 +564,10 @@ static float default_miter_limit = 10.0;
int i, count; int i, count;
BOOL first = YES; BOOL first = YES;
/* Silence compiler warnings. */
p = NSZeroPoint;
last_p = NSZeroPoint;
count = [self elementCount]; count = [self elementCount];
for(i = 0; i < count; i++) for(i = 0; i < count; i++)
{ {
@ -566,10 +593,10 @@ static float default_miter_limit = 10.0;
coeff[1] = pts[0]; coeff[1] = pts[0];
coeff[2] = pts[1]; coeff[2] = pts[1];
coeff[3] = pts[2]; coeff[3] = pts[2];
flatten(coeff, [self flatness], path); flatten(coeff, [self flatness], path);
p = pts[2]; p = pts[2];
if (first) if (first)
{ {
last_p = pts[2]; last_p = pts[2];
first = NO; first = NO;
} }
@ -595,6 +622,9 @@ static float default_miter_limit = 10.0;
int i, j, count; int i, j, count;
BOOL closed = NO; BOOL closed = NO;
/* Silence compiler warnings. */
p = NSZeroPoint;
last_type = NSMoveToBezierPathElement; last_type = NSMoveToBezierPathElement;
count = [self elementCount]; count = [self elementCount];
for(i = count - 1; i >= 0; i--) for(i = count - 1; i >= 0; i--)
@ -1778,32 +1808,6 @@ static NSPoint point_on_curve(double t, NSPoint a, NSPoint b, NSPoint c,
@end @end
typedef struct _PathElement
{
NSBezierPathElement type;
NSPoint points[3];
} PathElement;
//#define GSUNION_TYPES GSUNION_OBJ
#define GSI_ARRAY_TYPES 0
#define GSI_ARRAY_TYPE PathElement
#define GSI_ARRAY_NO_RETAIN
#define GSI_ARRAY_NO_RELEASE
#ifdef GSIArray
#undef GSIArray
#endif
#include <GNUstepBase/GSIArray.h>
@interface GSBezierPath : NSBezierPath
{
GSIArray pathElements;
BOOL flat;
}
@end
@implementation GSBezierPath @implementation GSBezierPath
- (id)init - (id)init

View file

@ -76,7 +76,8 @@
{ {
int num, xsize, ysize, levels; int num, xsize, ysize, levels;
char ptype; char ptype;
char buffer[256], *pchar; char buffer[256];
unsigned char *pchar;
unsigned length; unsigned length;
id colorspace; id colorspace;
const char *ptr; const char *ptr;

View file

@ -36,6 +36,7 @@
#include "AppKit/NSColor.h" #include "AppKit/NSColor.h"
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/NSTextFieldCell.h" #include "AppKit/NSTextFieldCell.h"
#include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSDrawFunctions.h"
#include <math.h> #include <math.h>

View file

@ -168,7 +168,7 @@
const char *nam = [_tag cString]; const char *nam = [_tag cString];
const char *type; const char *type;
unsigned int size; unsigned int size;
unsigned int offset; int offset;
/* /*
* Use the GNUstep additional function to set the instance * Use the GNUstep additional function to set the instance

View file

@ -1556,6 +1556,7 @@ static NSColor *shadowCol;
} }
break; break;
default:
case NSNullCellType: case NSNullCellType:
// macosx instead returns a 'very big size' here; we return NSZeroSize // macosx instead returns a 'very big size' here; we return NSZeroSize
s = NSZeroSize; s = NSZeroSize;

View file

@ -30,6 +30,7 @@
#include "AppKit/NSImageCell.h" #include "AppKit/NSImageCell.h"
#include "AppKit/NSImageView.h" #include "AppKit/NSImageView.h"
#include "AppKit/NSPasteboard.h" #include "AppKit/NSPasteboard.h"
#include "AppKit/NSWindow.h"
/* /*
* Class variables * Class variables

View file

@ -419,7 +419,7 @@ container? necessary? */
{ {
NSRect *r; NSRect *r;
NSRect result; NSRect result;
int i, c; unsigned int i, c;
/* TODO: This isn't correct. Need to handle glyphs that extend outside the /* TODO: This isn't correct. Need to handle glyphs that extend outside the
line frag rect. */ line frag rect. */
@ -1139,7 +1139,7 @@ container
unsigned int glyph_pos, char_pos, first_char_pos; unsigned int glyph_pos, char_pos, first_char_pos;
int i, j; int i, j;
NSRect *rects; NSRect *rects;
int count; unsigned int count;
NSColor *color, *last_color; NSColor *color, *last_color;
NSGraphicsContext *ctxt = GSCurrentContext(); NSGraphicsContext *ctxt = GSCurrentContext();
@ -1303,7 +1303,7 @@ container
#define GBUF_SIZE 16 /* TODO: tweak */ #define GBUF_SIZE 16 /* TODO: tweak */
NSGlyph gbuf[GBUF_SIZE]; NSGlyph gbuf[GBUF_SIZE];
int gbuf_len, gbuf_size; int gbuf_len, gbuf_size;
NSPoint gbuf_point; NSPoint gbuf_point = NSZeroPoint;
NSView *controlView = nil; NSView *controlView = nil;
@ -2158,7 +2158,7 @@ no_soft_invalidation:
{ /* before before */ { /* before before */
} }
/* If there are text views attached to use, let them handle the /* If there are text views attached to us, let them handle the
change. */ change. */
if ([self firstTextView]) if ([self firstTextView])
[[self firstTextView] setSelectedRange: newRange]; [[self firstTextView] setSelectedRange: newRange];

View file

@ -1284,7 +1284,7 @@ _addLeftBorderOffsetToRect(NSRect aRect)
NSRect currentFrame; NSRect currentFrame;
NSRect originalFrame; NSRect originalFrame;
NSPoint currentTopLeft; NSPoint currentTopLeft;
NSPoint originalTopLeft; NSPoint originalTopLeft = NSZeroPoint; /* Silence compiler. */
BOOL restorePosition; BOOL restorePosition;
/* /*
* Only for non transient menus do we want * Only for non transient menus do we want

View file

@ -164,11 +164,5 @@
return self; return self;
} }
- (void) sendEvent: (NSEvent*)theEvent
{
[self _sendEvent: theEvent
becomesKeyOnlyIfNeeded: _becomesKeyOnlyIfNeeded];
}
@end /* NSPanel */ @end /* NSPanel */

View file

@ -688,6 +688,7 @@ static NSString *namePrefix = @"NSTypedFilenamesPboardType:";
* Locate the filter information needed, including the type we are * Locate the filter information needed, including the type we are
* converting from and the name of the filter to use. * converting from and the name of the filter to use.
*/ */
info = nil;
filters = [[GSServicesManager manager] filters]; filters = [[GSServicesManager manager] filters];
count = [filters count]; count = [filters count];
while (fromType == nil && filterNumber < count) while (fromType == nil && filterNumber < count)
@ -713,6 +714,11 @@ static NSString *namePrefix = @"NSTypedFilenamesPboardType:";
} }
} }
} }
if (!info)
{
NSWarnMLog(@"Unable to provide data of type '%@'.", type);
return;
}
} }
mechanism = [info objectForKey: @"NSInputMechanism"]; mechanism = [info objectForKey: @"NSInputMechanism"];

View file

@ -94,8 +94,8 @@ typedef struct _page_info_t {
xpage: (int *)xptr xpage: (int *)xptr
ypage: (int *)yptr; ypage: (int *)yptr;
- (NSRect) _adjustPagesFirst: (int)first - (NSRect) _adjustPagesFirst: (int)first
last: (int)last last: (int)last
info: (page_info_t *)info; info: (page_info_t *)info;
- (void) _print; - (void) _print;
@end @end
@ -832,7 +832,7 @@ scaleRect(NSRect rect, double scale)
{ {
int i, xpage, ypage; int i, xpage, ypage;
double hlimit, wlimit; double hlimit, wlimit;
NSRect pageRect; NSRect pageRect = NSZeroRect; /* Silence compiler warning. */
hlimit = [_view heightAdjustLimit]; hlimit = [_view heightAdjustLimit];
wlimit = [_view widthAdjustLimit]; wlimit = [_view widthAdjustLimit];
for (i = first; i <= last; i++) for (i = first; i <= last; i++)

View file

@ -33,7 +33,7 @@
static NSColor *fillColour = nil; static NSColor *fillColour = nil;
#define maxCount 1 #define maxCount 1
static NSImage *images[maxCount]; //static NSImage *images[maxCount];
+ (void) initialize + (void) initialize
{ {

View file

@ -156,7 +156,7 @@
} }
} }
- (void) insertText: (NSString*)aString - (void) insertText: (id)aString
{ {
if (_next_responder) if (_next_responder)
[_next_responder insertText: aString]; [_next_responder insertText: aString];

View file

@ -32,7 +32,7 @@
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "AppKit/NSApplication.h" #include "AppKit/NSApplication.h"
static inline static inline
float _floatValueForMousePoint (NSPoint point, NSRect knobRect, float _floatValueForMousePoint (NSPoint point, NSRect knobRect,
NSRect slotRect, BOOL isVertical, NSRect slotRect, BOOL isVertical,
float minValue, float maxValue, float minValue, float maxValue,

View file

@ -325,7 +325,7 @@ static int __documentTag = 0;
ignoredWords: nil ignoredWords: nil
wordCount: &count wordCount: &count
countOnly: YES]; countOnly: YES];
return count; return count;
} }

View file

@ -126,6 +126,10 @@ static NSNotificationCenter *nc = nil;
return; return;
} }
/* Silence compiler warnings. */
r1 = NSZeroRect;
bigRect = NSZeroRect;
vis = [self visibleRect]; vis = [self visibleRect];
/* find out which divider it is */ /* find out which divider it is */

View file

@ -547,7 +547,7 @@
NSDate *distantFuture = [NSDate distantFuture]; NSDate *distantFuture = [NSDate distantFuture];
NSRect visibleRect = [self visibleRect]; NSRect visibleRect = [self visibleRect];
NSRect tvRect; NSRect tvRect;
NSRect highlightRect, oldRect; NSRect highlightRect = NSZeroRect, oldRect = NSZeroRect;
BOOL outside = NO; BOOL outside = NO;
BOOL lit = NO; BOOL lit = NO;

View file

@ -36,10 +36,10 @@
*/ */
#include "AppKit/NSText.h" #include "AppKit/NSText.h"
//#include "AppKit/NSTextView.h"
@class NSTextView;
#include "AppKit/NSSpellChecker.h"
#include "AppKit/NSPanel.h" #include "AppKit/NSPanel.h"
#include "AppKit/NSSpellChecker.h"
#include "AppKit/NSTextView.h"
static Class abstract; static Class abstract;

View file

@ -29,11 +29,10 @@
#include "AppKit/NSAttributedString.h" #include "AppKit/NSAttributedString.h"
#include "AppKit/NSTextStorage.h" #include "AppKit/NSTextStorage.h"
#include "GNUstepGUI/GSLayoutManager.h" #include "GNUstepGUI/GSLayoutManager.h"
#include "GSTextStorage.h"
@implementation NSTextStorage @implementation NSTextStorage
@class GSTextStorage;
static Class abstract; static Class abstract;
static Class concrete; static Class concrete;

View file

@ -674,7 +674,7 @@ that makes decoding and encoding compatible with the old code.
if ([aDecoder containsValueForKey: @"NSTVFlags"]) if ([aDecoder containsValueForKey: @"NSTVFlags"])
{ {
int vFlags = [aDecoder decodeIntForKey: @"NSTVFlags"]; //int vFlags = [aDecoder decodeIntForKey: @"NSTVFlags"];
// FIXME set the flags // FIXME set the flags
} }
if ([aDecoder containsValueForKey: @"NSSharedData"]) if ([aDecoder containsValueForKey: @"NSSharedData"])
@ -1492,26 +1492,25 @@ incorrectly. */
if (!_layoutManager) if (!_layoutManager)
return; return;
size = _bounds.size;
if (_tf.is_horizontally_resizable || _tf.is_vertically_resizable) if (_tf.is_horizontally_resizable || _tf.is_vertically_resizable)
{ {
NSRect r = [_layoutManager usedRectForTextContainer: _textContainer]; NSRect r = [_layoutManager usedRectForTextContainer: _textContainer];
NSSize s2;
if (_textContainer == [_layoutManager extraLineFragmentTextContainer]) if (_textContainer == [_layoutManager extraLineFragmentTextContainer])
{ {
r = NSUnionRect(r, [_layoutManager extraLineFragmentUsedRect]); r = NSUnionRect(r, [_layoutManager extraLineFragmentUsedRect]);
} }
size = NSMakeSize(NSMaxX(r), NSMaxY(r)); s2 = NSMakeSize(NSMaxX(r), NSMaxY(r));
}
if (!_tf.is_horizontally_resizable)
size.width = _bounds.size.width;
else
size.width += 2 * _textContainerInset.width;
if (!_tf.is_vertically_resizable) if (_tf.is_horizontally_resizable)
size.height = _bounds.size.height; size.width = s2.width + 2 * _textContainerInset.width;
else
size.height += 2 * _textContainerInset.height; if (_tf.is_vertically_resizable)
size.height = s2.height + 2 * _textContainerInset.height;
}
[self setConstrainedFrameSize: size]; [self setConstrainedFrameSize: size];
} }
@ -1728,11 +1727,11 @@ chain if we can't handle it. */
/* insertString may actually be an NSAttributedString. If it is, and the /* insertString may actually be an NSAttributedString. If it is, and the
text view isn't rich-text, we ignore the attributes and use the typing text view isn't rich-text, we ignore the attributes and use the typing
attributed. attributes.
This method is for user changes; see NSTextView_actions.m. This method is for user changes; see NSTextView_actions.m.
*/ */
-(void) insertText: (NSString *)insertString -(void) insertText: (id)insertString
{ {
NSRange insertRange = [self rangeForUserTextChange]; NSRange insertRange = [self rangeForUserTextChange];
NSString *string; NSString *string;

View file

@ -35,7 +35,6 @@
@interface NSToolbar (GNUstepPrivate) @interface NSToolbar (GNUstepPrivate)
+ (NSArray *) _toolbars;
- (GSToolbarView *) _toolbarView; - (GSToolbarView *) _toolbarView;
- (void) _setWindow: (NSWindow *)window; - (void) _setWindow: (NSWindow *)window;
- (NSWindow *) _window; - (NSWindow *) _window;

View file

@ -2915,11 +2915,15 @@ resetCursorRectsForView(NSView *theView)
// Quietly discard an unused mouse down. // Quietly discard an unused mouse down.
} }
- (BOOL) becomesKeyOnlyIfNeeded
{
return NO;
}
/** Handles mouse and other events sent to the receiver by NSApplication. /** Handles mouse and other events sent to the receiver by NSApplication.
Do not invoke this method directly. Do not invoke this method directly.
*/ */
- (void) _sendEvent: (NSEvent*)theEvent - (void) sendEvent: (NSEvent*)theEvent
becomesKeyOnlyIfNeeded: (BOOL)becomesKeyOnlyIfNeeded
{ {
NSView *v; NSView *v;
NSEventType type; NSEventType type;
@ -2955,7 +2959,8 @@ resetCursorRectsForView(NSView *theView)
if (_f.is_key == NO && _windowLevel != NSDesktopWindowLevel) if (_f.is_key == NO && _windowLevel != NSDesktopWindowLevel)
{ {
/* NSPanel modification: check becomesKeyOnlyIfNeeded. */ /* NSPanel modification: check becomesKeyOnlyIfNeeded. */
if (!becomesKeyOnlyIfNeeded || [v needsPanelToBecomeKey]) if (![self becomesKeyOnlyIfNeeded]
|| [v needsPanelToBecomeKey])
[self makeKeyAndOrderFront: self]; [self makeKeyAndOrderFront: self];
} }
/* Activate the app *after* making the receiver key, as app /* Activate the app *after* making the receiver key, as app
@ -3035,13 +3040,13 @@ resetCursorRectsForView(NSView *theView)
switch (type) switch (type)
{ {
case NSLeftMouseDragged: case NSLeftMouseDragged:
[_lastView mouseDragged: theEvent]; [_lastView mouseDragged: theEvent];
break; break;
case NSOtherMouseDragged: case NSOtherMouseDragged:
[_lastView otherMouseDragged: theEvent]; [_lastView otherMouseDragged: theEvent];
break; break;
case NSRightMouseDragged: case NSRightMouseDragged:
[_lastView rightMouseDragged: theEvent]; [_lastView rightMouseDragged: theEvent];
break; break;
default: default:
if (_f.accepts_mouse_moved) if (_f.accepts_mouse_moved)
@ -3417,15 +3422,6 @@ resetCursorRectsForView(NSView *theView)
} }
} }
/** Handles mouse and other events sent to the receiver by NSApplication.
Do not invoke this method directly.
*/
- (void) sendEvent: (NSEvent*)theEvent
{
[self _sendEvent: theEvent
becomesKeyOnlyIfNeeded: NO];
}
- (BOOL) tryToPerform: (SEL)anAction with: (id)anObject - (BOOL) tryToPerform: (SEL)anAction with: (id)anObject
{ {

View file

@ -69,8 +69,8 @@ extern TIFF* NSTiffOpenDataWrite(char **data, long *size);
extern int NSTiffClose(TIFF* image); extern int NSTiffClose(TIFF* image);
extern int NSTiffGetImageCount(TIFF* image); extern int NSTiffGetImageCount(TIFF* image);
extern int NSTiffWrite(TIFF* image, NSTiffInfo* info, char* data); extern int NSTiffWrite(TIFF *image, NSTiffInfo *info, unsigned char *data);
extern int NSTiffRead(TIFF* image, NSTiffInfo* info, char* data); extern int NSTiffRead(TIFF *image, NSTiffInfo *info, unsigned char *data);
extern NSTiffInfo* NSTiffGetInfo(int imageNumber, TIFF* image); extern NSTiffInfo* NSTiffGetInfo(int imageNumber, TIFF* image);
extern NSTiffColormap* NSTiffGetColormap(TIFF* image); extern NSTiffColormap* NSTiffGetColormap(TIFF* image);

View file

@ -334,7 +334,7 @@ NSTiffGetInfo(int imageNumber, TIFF* image)
direct color images. Thus the data array should be large direct color images. Thus the data array should be large
enough to hold this information. */ enough to hold this information. */
int int
NSTiffRead(TIFF* image, NSTiffInfo* info, char* data) NSTiffRead(TIFF *image, NSTiffInfo *info, unsigned char *data)
{ {
int i; int i;
unsigned int row, col; unsigned int row, col;
@ -443,7 +443,7 @@ NSTiffRead(TIFF* image, NSTiffInfo* info, char* data)
} }
int int
NSTiffWrite(TIFF* image, NSTiffInfo* info, char* data) NSTiffWrite(TIFF *image, NSTiffInfo *info, unsigned char *data)
{ {
tdata_t buf = (tdata_t)data; tdata_t buf = (tdata_t)data;
uint16 sample_info[2]; uint16 sample_info[2];