Extended NSCursor to handle missing standard cursor.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20428 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2004-12-08 23:53:32 +00:00
parent 25ff6e9629
commit 8281fcdf28
6 changed files with 28 additions and 2 deletions

View file

@ -1,3 +1,14 @@
2004-12-09 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSCursor.m (getStandardCursor()): If not standard cursor
is available, try an image cursor with an image of the same name.
* Images/common_OpenHandCursor.tiff
* Images/common_ClosedHandCursor.tiff: New cursor image files by
Fabien Vallon <fabien@sonappart.net>.
* Images/GNUmakefile: Install the new files.
* Images/nsmapping.strings: Register the new cursor files for the
names used in NSCursor.m.
2004-11-11 Adam Fedor <fedor@gnu.org> 2004-11-11 Adam Fedor <fedor@gnu.org>
* Source/GSDragView.m ([GSDragView -_setCursor]): Initialize variable. * Source/GSDragView.m ([GSDragView -_setCursor]): Initialize variable.

View file

@ -117,6 +117,8 @@ common_ToolbarSeparatorItem.tiff \
common_ToolbarShowColorsItem.tiff \ common_ToolbarShowColorsItem.tiff \
common_ToolbarShowFontsItem.tiff \ common_ToolbarShowFontsItem.tiff \
common_ToolbarSpaceItem.tiff \ common_ToolbarSpaceItem.tiff \
common_ClosedHandCursor.tiff \
common_OpenHandCursor.tiff \
page_landscape.tiff \ page_landscape.tiff \
page_portrait.tiff page_portrait.tiff

Binary file not shown.

Binary file not shown.

View file

@ -11,3 +11,5 @@ NSMenuCheckmark = common_2DCheckMark;
NSMenuArrow = common_3DArrowRight; NSMenuArrow = common_3DArrowRight;
NSMenuMixedState = common_2DDash; NSMenuMixedState = common_2DDash;
NSComboArrow = common_ComboBoxEllipsis; NSComboArrow = common_ComboBoxEllipsis;
GSClosedHandCursor = common_ClosedHandCursor;
GSOpenHandCursor = common_OpenHandCursor;

View file

@ -177,11 +177,22 @@ NSCursor *getStandardCursor(NSString *name, int style)
if (cursor == nil) if (cursor == nil)
{ {
void *c; void *c = NULL;
cursor = [[NSCursor_class alloc] initWithImage: nil]; cursor = [[NSCursor_class alloc] initWithImage: nil];
[GSCurrentServer() standardcursor: style : &c]; [GSCurrentServer() standardcursor: style : &c];
[cursor _setCid: c]; if (c == NULL)
{
/*
There is no standard cursor with this name defined in the
backend, so try an image with this name.
*/
[cursor setImage: [NSImage imageNamed: name]];
}
else
{
[cursor _setCid: c];
}
[cursorDict setObject: cursor forKey: name]; [cursorDict setObject: cursor forKey: name];
RELEASE(cursor); RELEASE(cursor);
} }