From 8281fcdf287e4aba855a7336fb20bf81900cf374 Mon Sep 17 00:00:00 2001 From: FredKiefer Date: Wed, 8 Dec 2004 23:53:32 +0000 Subject: [PATCH] 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 --- ChangeLog | 11 +++++++++++ Images/GNUmakefile | 2 ++ Images/common_ClosedHandCursor.tiff | Bin 0 -> 1958 bytes Images/common_OpenHandCursor.tiff | Bin 0 -> 1958 bytes Images/nsmapping.strings | 2 ++ Source/NSCursor.m | 15 +++++++++++++-- 6 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 Images/common_ClosedHandCursor.tiff create mode 100644 Images/common_OpenHandCursor.tiff diff --git a/ChangeLog b/ChangeLog index 77d65e930..c63651de7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-12-09 Fred Kiefer + + * 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 . + * 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 * Source/GSDragView.m ([GSDragView -_setCursor]): Initialize variable. diff --git a/Images/GNUmakefile b/Images/GNUmakefile index 657c7c272..fdad33d97 100644 --- a/Images/GNUmakefile +++ b/Images/GNUmakefile @@ -117,6 +117,8 @@ common_ToolbarSeparatorItem.tiff \ common_ToolbarShowColorsItem.tiff \ common_ToolbarShowFontsItem.tiff \ common_ToolbarSpaceItem.tiff \ +common_ClosedHandCursor.tiff \ +common_OpenHandCursor.tiff \ page_landscape.tiff \ page_portrait.tiff diff --git a/Images/common_ClosedHandCursor.tiff b/Images/common_ClosedHandCursor.tiff new file mode 100644 index 0000000000000000000000000000000000000000..0b15f5d7e8d6fd1fbe8683e90f52f19c04aba620 GIT binary patch literal 1958 zcmeH@F%H5o3`M_NXb}<;3>6ZvgSblH!M^N{%Bmyphty zM^AwILZ$Z^rpoJr^$OhQSztzu_t~Mf_|=^@n08EkrR`VWXs0p{D)aR7d5)9)HGiIg I{Sv;u0nPg^l>h($ literal 0 HcmV?d00001 diff --git a/Images/common_OpenHandCursor.tiff b/Images/common_OpenHandCursor.tiff new file mode 100644 index 0000000000000000000000000000000000000000..e1cd4eb7952c61b94b084d6d7bcef9c1c5194194 GIT binary patch literal 1958 zcmeH^K~BRk5JhKNNGl>FkWy8mWDVjj-Sk8~0ZW$LEIXuZ*kxNO%n$x$Y=zcURaUri z{b%fX{+_JY@*+}v%K!M&4wPltW1e%VXF#`YJ51(J<&QDCuIn+Ys*3ozzR4s5v1d}# zE7xOu_(3h+OwBty6MIe5WcAv6t?PR4(`)ttcO3GHJ??vdeHf_6!0P#|N#Bn=zb|-* z$q2}3;T~#^F;R$f^bvuQ09@Rk`tvb+gi`uQFj0szzj;i#IXu7*z1uU{*T~RFkn?WO z^*tED4XIp@x!hAdrrfdKBA4@RJc}B2mtdlA;QE=>%Uczhnmd(+{i)NFL0^f?UUeGs zc36v`C#LVk_N`WAu8WYjj4qikKJ-DZzt7CxbhX#-`skR?j=A~CTb+@^?`F3ZdAgIZ FegSM#LofgU literal 0 HcmV?d00001 diff --git a/Images/nsmapping.strings b/Images/nsmapping.strings index 77adf9bac..2bcbde76d 100644 --- a/Images/nsmapping.strings +++ b/Images/nsmapping.strings @@ -11,3 +11,5 @@ NSMenuCheckmark = common_2DCheckMark; NSMenuArrow = common_3DArrowRight; NSMenuMixedState = common_2DDash; NSComboArrow = common_ComboBoxEllipsis; +GSClosedHandCursor = common_ClosedHandCursor; +GSOpenHandCursor = common_OpenHandCursor; \ No newline at end of file diff --git a/Source/NSCursor.m b/Source/NSCursor.m index 65f5e347c..54801964b 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -177,11 +177,22 @@ NSCursor *getStandardCursor(NSString *name, int style) if (cursor == nil) { - void *c; + void *c = NULL; cursor = [[NSCursor_class alloc] initWithImage: nil]; [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]; RELEASE(cursor); }