mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
* configure.ac: Try to improve the ICU detection.
* configure: regenerate * Headers/AppKit/NSTrackingArea.h * Source/NSTrackingArea.m: Remove compiler warnings. * Headers/AppKit/NSBrowser.h, * Source/NSBrowser.m: Add a few new Cocoa methods. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37399 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
26a36530a1
commit
dddd3f5e3b
7 changed files with 2254 additions and 4772 deletions
|
@ -1,3 +1,12 @@
|
|||
2013-11-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* configure.ac: Try to improve the ICU detection.
|
||||
* configure: regenerate
|
||||
* Headers/AppKit/NSTrackingArea.h
|
||||
* Source/NSTrackingArea.m: Remove compiler warnings.
|
||||
* Headers/AppKit/NSBrowser.h,
|
||||
* Source/NSBrowser.m: Add a few new Cocoa methods.
|
||||
|
||||
2013-11-22 German Arias <germanandre@gmx.es>
|
||||
|
||||
* NSWindow.m (-sendEvent:): Set _lastPoint only for mouse entered
|
||||
|
|
|
@ -35,8 +35,11 @@
|
|||
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
@class NSIndexPath;
|
||||
@class NSIndexSet;
|
||||
|
||||
@class NSCell;
|
||||
@class NSEvent;
|
||||
@class NSMatrix;
|
||||
@class NSScroller;
|
||||
//@class NSBox;
|
||||
|
@ -127,6 +130,17 @@ typedef NSUInteger NSBrowserColumnResizingType;
|
|||
- (void) setReusesColumns: (BOOL)flag;
|
||||
- (void) setTakesTitleFromPreviousColumn: (BOOL)flag;
|
||||
- (BOOL) takesTitleFromPreviousColumn;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
- (BOOL) autohidesScroller;
|
||||
- (void) setAutohidesScroller: (BOOL)flag;
|
||||
- (NSColor *) backgroundColor;
|
||||
- (void) setBackgroundColor: (NSColor *)backgroundColor;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
- (BOOL) canDragRowsWithIndexes: (NSIndexSet *)rowIndexes
|
||||
inColumn: (NSInteger)columnIndex
|
||||
withEvent: (NSEvent *)dragEvent;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Allowing Different Types of Selection
|
||||
|
@ -146,6 +160,11 @@ typedef NSUInteger NSBrowserColumnResizingType;
|
|||
- (void) setAcceptsArrowKeys: (BOOL)flag;
|
||||
- (void) setSendsActionOnArrowKeys: (BOOL)flag;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
- (BOOL) allowsTypeSelect;
|
||||
- (void) setAllowsTypeSelect: (BOOL)allowsTypeSelection;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Showing a Horizontal Scroller
|
||||
//
|
||||
|
@ -186,6 +205,12 @@ typedef NSUInteger NSBrowserColumnResizingType;
|
|||
- (NSInteger) selectedRowInColumn: (NSInteger)column;
|
||||
- (void) setLastColumn: (NSInteger)column;
|
||||
- (void) validateVisibleColumns;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
- (NSIndexPath *) selectionIndexPath;
|
||||
- (NSArray *) selectionIndexPaths;
|
||||
- (void) setSelectionIndexPath: (NSIndexPath *)path;
|
||||
- (void) setSelectionIndexPaths: (NSArray *)paths;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Manipulating Column Titles
|
||||
|
@ -222,6 +247,10 @@ typedef NSUInteger NSBrowserColumnResizingType;
|
|||
//
|
||||
- (void) doClick: (id)sender;
|
||||
- (void) doDoubleClick: (id)sender;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
- (NSInteger) clickedColumn;
|
||||
- (NSInteger) clickedRow;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Getting Matrices and Cells
|
||||
|
@ -277,7 +306,7 @@ typedef NSUInteger NSBrowserColumnResizingType;
|
|||
// Controlling the alphanumerical keys behaviour
|
||||
//
|
||||
@interface NSBrowser (GNUstepExtensions)
|
||||
- (BOOL)acceptsAlphaNumericalKeys;
|
||||
- (BOOL) acceptsAlphaNumericalKeys;
|
||||
- (void) setAcceptsAlphaNumericalKeys: (BOOL)flag;
|
||||
- (BOOL) sendsActionOnAlphaNumericalKeys;
|
||||
- (void) setSendsActionOnAlphaNumericalKeys: (BOOL)flag;
|
||||
|
@ -313,6 +342,12 @@ typedef NSUInteger NSBrowserColumnResizingType;
|
|||
sizeToFitWidthOfColumn: (NSInteger)column;
|
||||
- (void) browserColumnConfigurationDidChange: (NSNotification *)notification;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
- (BOOL) browser: (NSBrowser *)browser
|
||||
canDragRowsWithIndexes: (NSIndexSet *)rowIndexes
|
||||
inColumn: (NSInteger)column
|
||||
withEvent: (NSEvent *)event;
|
||||
#endif
|
||||
@end
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSCoder.h>
|
||||
#import "GNUstepGUI/GSTrackingRect.h"
|
||||
|
||||
/*
|
||||
* Options pulled from Cocoa documentation.
|
||||
|
@ -52,8 +51,9 @@ enum {
|
|||
typedef NSUInteger NSTrackingAreaOptions;
|
||||
|
||||
@class NSDictionary;
|
||||
@class GSTrackingRect;
|
||||
|
||||
@interface NSTrackingArea : NSObject <NSCoding, NSCopying, NSObject>
|
||||
@interface NSTrackingArea : NSObject <NSCoding, NSCopying>
|
||||
{
|
||||
NSDictionary *_userInfo;
|
||||
GSTrackingRect *_trackingRect;
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSIndexPath.h>
|
||||
#import <Foundation/NSNotification.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import "AppKit/NSBrowser.h"
|
||||
|
@ -457,6 +458,136 @@ static BOOL browserUseBezels;
|
|||
}
|
||||
}
|
||||
|
||||
/** <p>Returns the index path of the selected item, or nil if there is
|
||||
no selection.
|
||||
*/
|
||||
- (NSIndexPath *) selectionIndexPath
|
||||
{
|
||||
NSInteger columnNumber = 0;
|
||||
NSInteger selectedColumn = [self selectedColumn];
|
||||
|
||||
if (selectedColumn > -1)
|
||||
{
|
||||
NSUInteger rowIndexes[selectedColumn + 1];
|
||||
|
||||
for (columnNumber = 0; columnNumber <= selectedColumn; columnNumber++)
|
||||
{
|
||||
rowIndexes[columnNumber] = [self selectedRowInColumn: columnNumber];
|
||||
}
|
||||
|
||||
return [[NSIndexPath alloc] initWithIndexes: rowIndexes
|
||||
length: selectedColumn + 1];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) selectionIndexPaths
|
||||
{
|
||||
NSInteger selectedColumn = [self selectedColumn];
|
||||
|
||||
if (selectedColumn == -1)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSMutableArray *paths = AUTORELEASE([[NSMutableArray alloc] init]);
|
||||
NSMatrix *matrix;
|
||||
NSArray *selectedCells;
|
||||
NSUInteger count;
|
||||
|
||||
// FIXME: There should be a more efficent way to the the selected row numbers
|
||||
if (!(matrix = [self matrixInColumn: selectedColumn]))
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
selectedCells = [matrix selectedCells];
|
||||
if (selectedCells == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
count = [selectedCells count];
|
||||
NSInteger seletedRows[count];
|
||||
NSEnumerator *enumerator = [selectedCells objectEnumerator];
|
||||
NSCell *cell;
|
||||
int i = 0;
|
||||
|
||||
while ((cell = [enumerator nextObject]) != nil)
|
||||
{
|
||||
NSInteger row;
|
||||
NSInteger column;
|
||||
|
||||
[matrix getRow: &row
|
||||
column: &column
|
||||
ofCell: cell];
|
||||
seletedRows[i++] = row;
|
||||
}
|
||||
|
||||
if (selectedColumn > 0)
|
||||
{
|
||||
NSIndexPath *indexPath;
|
||||
NSUInteger rowIndexes[selectedColumn + 1];
|
||||
NSInteger columnNumber = 0;
|
||||
|
||||
for (columnNumber = 0; columnNumber <= selectedColumn; columnNumber++)
|
||||
{
|
||||
rowIndexes[columnNumber] = [self selectedRowInColumn: columnNumber];
|
||||
}
|
||||
|
||||
indexPath = [[NSIndexPath alloc] initWithIndexes: rowIndexes
|
||||
length: selectedColumn + 1];
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
[paths addObject: [indexPath indexPathByAddingIndex: seletedRows[i]]];
|
||||
}
|
||||
}
|
||||
if (selectedColumn == 0)
|
||||
{
|
||||
NSIndexPath *indexPath;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
indexPath = [[NSIndexPath alloc] initWithIndex: seletedRows[i]];
|
||||
[paths addObject: indexPath];
|
||||
RELEASE(indexPath);
|
||||
}
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) setSelectionIndexPath: (NSIndexPath *)path
|
||||
{
|
||||
NSInteger column;
|
||||
NSUInteger length;
|
||||
|
||||
length = [path length];
|
||||
for (column = 0; column < length; column++)
|
||||
{
|
||||
NSInteger row = [path indexAtPosition: column];
|
||||
|
||||
[self selectRow: row inColumn: column];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setSelectionIndexPaths: (NSArray *)paths
|
||||
{
|
||||
NSEnumerator *enumerator = [paths objectEnumerator];
|
||||
NSIndexPath *path;
|
||||
|
||||
while ((path = [enumerator nextObject]) != nil)
|
||||
{
|
||||
// FIXME
|
||||
[self setSelectionIndexPath: path];
|
||||
}
|
||||
}
|
||||
|
||||
/** Loads if necessary and returns the NSCell at row in column.
|
||||
if you change this code, you may want to look at the __performLoadOfColumn:
|
||||
method in which the following code is integrated (for speed)
|
||||
|
@ -1372,6 +1503,46 @@ static BOOL browserUseBezels;
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL) autohidesScroller
|
||||
{
|
||||
// FIXME
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) setAutohidesScroller: (BOOL)flag
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
- (NSColor *) backgroundColor
|
||||
{
|
||||
// FIXME
|
||||
return [NSColor controlColor];
|
||||
}
|
||||
|
||||
- (void) setBackgroundColor: (NSColor *)backgroundColor
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
- (BOOL) canDragRowsWithIndexes: (NSIndexSet *)rowIndexes
|
||||
inColumn: (NSInteger)columnIndex
|
||||
withEvent: (NSEvent *)dragEvent
|
||||
{
|
||||
if ([_browserDelegate respondsToSelector:
|
||||
@selector(browser:canDragRowsWithIndexes:inColumn:withEvent:)])
|
||||
{
|
||||
return [_browserDelegate browser: self
|
||||
canDragRowsWithIndexes: rowIndexes
|
||||
inColumn: columnIndex
|
||||
withEvent: dragEvent];
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Manipulating column titles
|
||||
|
@ -1747,6 +1918,17 @@ static BOOL browserUseBezels;
|
|||
_sendsActionOnArrowKeys = flag;
|
||||
}
|
||||
|
||||
- (BOOL) allowsTypeSelect
|
||||
{
|
||||
// FIXME
|
||||
return [self acceptsArrowKeys];
|
||||
}
|
||||
|
||||
- (void) setAllowsTypeSelect: (BOOL)allowsTypeSelection
|
||||
{
|
||||
// FIXME
|
||||
[self setAcceptsArrowKeys: allowsTypeSelection];
|
||||
}
|
||||
|
||||
/*
|
||||
* Getting column frames
|
||||
|
@ -2228,6 +2410,18 @@ static BOOL browserUseBezels;
|
|||
[self sendAction: _doubleAction to: [self target]];
|
||||
}
|
||||
|
||||
- (NSInteger) clickedColumn
|
||||
{
|
||||
// FIXME: Return column number from doClick:
|
||||
return -1;
|
||||
}
|
||||
|
||||
- (NSInteger) clickedRow
|
||||
{
|
||||
// FIXME: Return row number from doClick:
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ (void) _themeDidActivate: (NSNotification*)n
|
||||
{
|
||||
GSTheme *theme = [GSTheme theme];
|
||||
|
@ -3099,7 +3293,7 @@ static BOOL browserUseBezels;
|
|||
[matrix setAutoscroll: YES];
|
||||
|
||||
// Set up background colors.
|
||||
[matrix setBackgroundColor: [NSColor controlColor]];
|
||||
[matrix setBackgroundColor: [self backgroundColor]];
|
||||
[matrix setDrawsBackground: YES];
|
||||
|
||||
if (!_allowsMultipleSelection)
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#import <AppKit/NSTrackingArea.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import "AppKit/NSTrackingArea.h"
|
||||
#import "GNUstepGUI/GSTrackingRect.h"
|
||||
|
||||
@implementation NSTrackingArea
|
||||
|
||||
|
@ -36,7 +38,7 @@
|
|||
owner: (id)owner
|
||||
userInfo: (NSDictionary *)userInfo
|
||||
{
|
||||
if((self = [super init]) != nil)
|
||||
if ((self = [super init]) != nil)
|
||||
{
|
||||
BOOL flag = (BOOL)(options & NSTrackingAssumeInside);
|
||||
|
||||
|
@ -48,61 +50,60 @@
|
|||
userData:(void *)userInfo
|
||||
inside:flag];
|
||||
}
|
||||
return self;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[_userInfo release];
|
||||
[_trackingRect release];
|
||||
[super dealloc];
|
||||
[_userInfo release];
|
||||
[_trackingRect release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSTrackingAreaOptions) options
|
||||
{
|
||||
return _options;
|
||||
return _options;
|
||||
}
|
||||
|
||||
- (id) owner
|
||||
{
|
||||
return [_trackingRect owner];
|
||||
return [_trackingRect owner];
|
||||
}
|
||||
|
||||
- (NSRect) rect
|
||||
{
|
||||
return [_trackingRect rectangle];
|
||||
return [_trackingRect rectangle];
|
||||
}
|
||||
|
||||
- (NSDictionary *) userInfo
|
||||
{
|
||||
return _userInfo;
|
||||
return _userInfo;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
// [super encodeWithCoder:coder];
|
||||
// [super encodeWithCoder:coder];
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
//[super initWithCoder:coder];
|
||||
return self;
|
||||
//[super initWithCoder:coder];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
NSRect rect = [self rect];
|
||||
NSTrackingAreaOptions options = [self options];
|
||||
id owner = [self owner];
|
||||
id info = [self userInfo];
|
||||
NSTrackingArea *newArea = [[NSTrackingArea allocWithZone:zone]
|
||||
NSRect rect = [self rect];
|
||||
NSTrackingAreaOptions options = [self options];
|
||||
id owner = [self owner];
|
||||
id info = [self userInfo];
|
||||
NSTrackingArea *newArea = [[NSTrackingArea allocWithZone:zone]
|
||||
initWithRect: rect
|
||||
options: options
|
||||
owner: owner
|
||||
userInfo: info];
|
||||
|
||||
return newArea;
|
||||
return newArea;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
26
configure.ac
26
configure.ac
|
@ -385,8 +385,32 @@ AC_ARG_ENABLE(icu,
|
|||
[ --disable-icu Disable International Components for Unicode],,
|
||||
enable_icu=yes)
|
||||
|
||||
AC_ARG_ENABLE(icu-config,
|
||||
[ --disable-icu-config Do not use the icu-config script to check
|
||||
for ICU.],,
|
||||
enable_icu_config=yes)
|
||||
|
||||
AC_ARG_WITH(icu-library,
|
||||
[ --with-icu-library=PATH library path for ICU libraries (only checked
|
||||
if not using icu-config)],
|
||||
icu_libdir="$withval", icu_libdir="no")
|
||||
|
||||
if test $enable_icu = yes; then
|
||||
AC_CHECK_ICU(4.0, have_icu=yes, have_icu=no)
|
||||
if test "$enable_icu_config" = "yes"; then
|
||||
AC_CHECK_ICU(4.0, have_icu=yes, have_icu=no)
|
||||
else
|
||||
have_icu=no;
|
||||
AC_CHECKING([for libicu (icu-config disabled)])
|
||||
if test "$icu_libdir" != "no"; then
|
||||
ICU_LDFLAGS="-L$icu_libdir";
|
||||
fi
|
||||
saved_LDFLAGS="$LDFLAGS";
|
||||
LDFLAGS="$LDFLAGS $LIBS $ICU_LDFLAGS -licui18n -licuuc -licudata -lm"
|
||||
AC_TRY_LINK([],[], have_icu="yes", have_icu="no");
|
||||
LDFLAGS="$saved_LDFLAGS";
|
||||
ICU_LIBS="-licui18n -licuuc -licudata -lm"
|
||||
fi
|
||||
|
||||
if test "$have_icu" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_CHECK_HEADERS(unicode/uchar.h unicode/ustring.h)
|
||||
|
|
Loading…
Reference in a new issue