Merged Trunk changes from rev 35219 to TestPlant branch.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36953 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Frank Le Grand 2013-08-09 14:24:48 +00:00
parent 343da32c8c
commit 4b27157a46
215 changed files with 13994 additions and 8840 deletions

View file

@ -49,6 +49,7 @@
#import "AppKit/NSMatrix.h"
#import "AppKit/NSApplication.h"
#import "AppKit/NSCursor.h"
#import "AppKit/NSWindow.h"
#import "AppKit/NSEvent.h"
#import "AppKit/NSFont.h"
@ -265,7 +266,12 @@ static BOOL menuBarVisible = YES;
NSMenu *appMenu;
id <NSMenuItem> appItem;
appTitle = [[NSProcessInfo processInfo] processName];
appTitle = [[[NSBundle mainBundle] localizedInfoDictionary]
objectForKey: @"ApplicationName"];
if (nil == appTitle)
{
appTitle = [[NSProcessInfo processInfo] processName];
}
appItem = [self itemWithTitle: appTitle];
appMenu = [appItem submenu];
@ -710,7 +716,7 @@ static BOOL menuBarVisible = YES;
}
- (void) insertItem: (id <NSMenuItem>)newItem
atIndex: (int)index
atIndex: (NSInteger)index
{
NSNotification *inserted;
NSDictionary *d;
@ -757,7 +763,7 @@ static BOOL menuBarVisible = YES;
- (id <NSMenuItem>) insertItemWithTitle: (NSString*)aString
action: (SEL)aSelector
keyEquivalent: (NSString*)charCode
atIndex: (unsigned int)index
atIndex: (NSInteger)index
{
NSMenuItem *anItem = [[NSMenuItem alloc] initWithTitle: aString
action: aSelector
@ -795,7 +801,7 @@ static BOOL menuBarVisible = YES;
[self removeItemAtIndex: index];
}
- (void) removeItemAtIndex: (int)index
- (void) removeItemAtIndex: (NSInteger)index
{
NSNotification *removed;
NSDictionary *d;
@ -827,7 +833,7 @@ static BOOL menuBarVisible = YES;
{
NSNotification *changed;
NSDictionary *d;
int index = [self indexOfItem: anObject];
NSInteger index = [self indexOfItem: anObject];
if (-1 == index)
return;
@ -855,7 +861,7 @@ static BOOL menuBarVisible = YES;
/*
* Finding Menu Items
*/
- (id <NSMenuItem>) itemWithTag: (int)aTag
- (id <NSMenuItem>) itemWithTag: (NSInteger)aTag
{
unsigned i;
unsigned count = [_items count];
@ -885,16 +891,16 @@ static BOOL menuBarVisible = YES;
return nil;
}
- (id <NSMenuItem>) itemAtIndex: (int)index
- (id <NSMenuItem>) itemAtIndex: (NSInteger)index
{
if (index >= (int)[_items count] || index < 0)
if (index >= [_items count] || index < 0)
[NSException raise: NSRangeException
format: @"Range error in method -itemAtIndex: "];
return [_items objectAtIndex: index];
}
- (int) numberOfItems
- (NSInteger) numberOfItems
{
return [_items count];
}
@ -907,7 +913,7 @@ static BOOL menuBarVisible = YES;
/*
* Finding Indices of Menu Items
*/
- (int) indexOfItem: (id <NSMenuItem>)anObject
- (NSInteger) indexOfItem: (id <NSMenuItem>)anObject
{
NSUInteger index;
@ -919,7 +925,7 @@ static BOOL menuBarVisible = YES;
return index;
}
- (int) indexOfItemWithTitle: (NSString*)aTitle
- (NSInteger) indexOfItemWithTitle: (NSString*)aTitle
{
id anItem;
@ -929,7 +935,7 @@ static BOOL menuBarVisible = YES;
return -1;
}
- (int) indexOfItemWithTag: (int)aTag
- (NSInteger) indexOfItemWithTag: (NSInteger)aTag
{
id anItem;
@ -939,7 +945,7 @@ static BOOL menuBarVisible = YES;
return -1;
}
- (int) indexOfItemWithTarget: (id)anObject
- (NSInteger) indexOfItemWithTarget: (id)anObject
andAction: (SEL)actionSelector
{
unsigned i;
@ -962,9 +968,9 @@ static BOOL menuBarVisible = YES;
return -1;
}
- (int) indexOfItemWithRepresentedObject: (id)anObject
- (NSInteger) indexOfItemWithRepresentedObject: (id)anObject
{
int i, count = [_items count];
NSInteger i, count = [_items count];
for (i = 0; i < count; i++)
{
@ -978,9 +984,9 @@ static BOOL menuBarVisible = YES;
return -1;
}
- (int) indexOfItemWithSubmenu: (NSMenu *)anObject
- (NSInteger) indexOfItemWithSubmenu: (NSMenu *)anObject
{
int i, count = [_items count];
NSInteger i, count = [_items count];
for (i = 0; i < count; i++)
{
@ -1084,14 +1090,14 @@ static BOOL menuBarVisible = YES;
}
else if ([_delegate respondsToSelector:@selector(numberOfItemsInMenu:)])
{
int num;
NSInteger num;
num = [_delegate numberOfItemsInMenu: self];
if (num > 0)
{
BOOL cont = YES;
int i = 0;
int curr = [self numberOfItems];
NSInteger i = 0;
NSInteger curr = [self numberOfItems];
while (num < curr)
{
@ -1288,7 +1294,7 @@ static BOOL menuBarVisible = YES;
//
// Simulating Mouse Clicks
//
- (void) performActionForItemAtIndex: (int)index
- (void) performActionForItemAtIndex: (NSInteger)index
{
id<NSMenuItem> item = [_items objectAtIndex: index];
NSDictionary *d;
@ -1913,8 +1919,17 @@ static BOOL menuBarVisible = YES;
[contentView addSubview: _view];
[_view update];
[_bWindow orderFront: self];
/* Right mouse buttons which display transient menus don't update
* the cursor. So, the current cursor is displayed over the
* contextual menu (for example an I beam). However, when menu is
* closed the cursor pop, this can set a wrong cursor. We push here
* an arrow cursor, the cursor we want at menus. Being sure that
* this will pop when menu closes.
*/
[[NSCursor arrowCursor] push];
}
- (void) close