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:
Alexander Malmberg 2005-01-21 20:39:18 +00:00
parent efe686d736
commit ad2419e484
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>
* Source/GSToolbarView.m:

View file

@ -150,7 +150,8 @@ APPKIT_EXPORT NSString * GSScreenNumber;
- (void) hidecursor;
- (void) showcursor;
- (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;
@end

View file

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

View file

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

View file

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

View file

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

View file

@ -49,7 +49,7 @@
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,
there have already been some) problems and confusion, this ivar is
private (iow, it can't be accidentally used in NSMenuView).
@ -144,7 +144,18 @@
- (BOOL) performMnemonic: (NSString*)aString;
- (void) flushBufferedKeyEvents;
- (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;
/*

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1870,7 +1870,7 @@ image.
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

View file

@ -56,13 +56,36 @@ static NSLineCapStyle default_line_cap_style = NSButtLineCapStyle;
static float default_miter_limit = 10.0;
@interface NSBezierPath (PrivateMethods)
- (void)_invalidateCache;
- (void)_recalculateBounds;
@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
@ -541,6 +564,10 @@ static float default_miter_limit = 10.0;
int i, count;
BOOL first = YES;
/* Silence compiler warnings. */
p = NSZeroPoint;
last_p = NSZeroPoint;
count = [self elementCount];
for(i = 0; i < count; i++)
{
@ -566,10 +593,10 @@ static float default_miter_limit = 10.0;
coeff[1] = pts[0];
coeff[2] = pts[1];
coeff[3] = pts[2];
flatten(coeff, [self flatness], path);
flatten(coeff, [self flatness], path);
p = pts[2];
if (first)
{
{
last_p = pts[2];
first = NO;
}
@ -595,6 +622,9 @@ static float default_miter_limit = 10.0;
int i, j, count;
BOOL closed = NO;
/* Silence compiler warnings. */
p = NSZeroPoint;
last_type = NSMoveToBezierPathElement;
count = [self elementCount];
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
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
- (id)init

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -688,6 +688,7 @@ static NSString *namePrefix = @"NSTypedFilenamesPboardType:";
* Locate the filter information needed, including the type we are
* converting from and the name of the filter to use.
*/
info = nil;
filters = [[GSServicesManager manager] filters];
count = [filters 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"];

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -674,7 +674,7 @@ that makes decoding and encoding compatible with the old code.
if ([aDecoder containsValueForKey: @"NSTVFlags"])
{
int vFlags = [aDecoder decodeIntForKey: @"NSTVFlags"];
//int vFlags = [aDecoder decodeIntForKey: @"NSTVFlags"];
// FIXME set the flags
}
if ([aDecoder containsValueForKey: @"NSSharedData"])
@ -1492,26 +1492,25 @@ incorrectly. */
if (!_layoutManager)
return;
size = _bounds.size;
if (_tf.is_horizontally_resizable || _tf.is_vertically_resizable)
{
NSRect r = [_layoutManager usedRectForTextContainer: _textContainer];
NSSize s2;
if (_textContainer == [_layoutManager extraLineFragmentTextContainer])
{
r = NSUnionRect(r, [_layoutManager extraLineFragmentUsedRect]);
}
size = NSMakeSize(NSMaxX(r), NSMaxY(r));
}
if (!_tf.is_horizontally_resizable)
size.width = _bounds.size.width;
else
size.width += 2 * _textContainerInset.width;
s2 = NSMakeSize(NSMaxX(r), NSMaxY(r));
if (!_tf.is_vertically_resizable)
size.height = _bounds.size.height;
else
size.height += 2 * _textContainerInset.height;
if (_tf.is_horizontally_resizable)
size.width = s2.width + 2 * _textContainerInset.width;
if (_tf.is_vertically_resizable)
size.height = s2.height + 2 * _textContainerInset.height;
}
[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
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.
*/
-(void) insertText: (NSString *)insertString
-(void) insertText: (id)insertString
{
NSRange insertRange = [self rangeForUserTextChange];
NSString *string;

View file

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

View file

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

View file

@ -69,8 +69,8 @@ extern TIFF* NSTiffOpenDataWrite(char **data, long *size);
extern int NSTiffClose(TIFF* image);
extern int NSTiffGetImageCount(TIFF* image);
extern int NSTiffWrite(TIFF* image, NSTiffInfo* info, char* data);
extern int NSTiffRead(TIFF* image, NSTiffInfo* info, char* data);
extern int NSTiffWrite(TIFF *image, NSTiffInfo *info, unsigned char *data);
extern int NSTiffRead(TIFF *image, NSTiffInfo *info, unsigned char *data);
extern NSTiffInfo* NSTiffGetInfo(int imageNumber, 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
enough to hold this information. */
int
NSTiffRead(TIFF* image, NSTiffInfo* info, char* data)
NSTiffRead(TIFF *image, NSTiffInfo *info, unsigned char *data)
{
int i;
unsigned int row, col;
@ -443,7 +443,7 @@ NSTiffRead(TIFF* image, NSTiffInfo* info, char* data)
}
int
NSTiffWrite(TIFF* image, NSTiffInfo* info, char* data)
NSTiffWrite(TIFF *image, NSTiffInfo *info, unsigned char *data)
{
tdata_t buf = (tdata_t)data;
uint16 sample_info[2];