Author: mlytwyn
Date: Fri Aug 1 22:46:33 2014
New Revision: 38022
URL: http://svn.gna.org/viewcvs/gnustep?rev=38022&view=rev
Log:
Use windows-like spinning images for GNUstep (currently windows AND linux
platforms)
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_1.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_10.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_11.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_12.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_2.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_3.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_4.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_5.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_6.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_7.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_8.png
(with props)
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_9.png
(with props)
Modified:
libs/gui/branches/gnustep_testplant_branch/Images/GNUmakefile
libs/gui/branches/gnustep_testplant_branch/Source/GSThemeDrawing.m
libs/gui/branches/gnustep_testplant_branch/Source/NSProgressIndicator.m
Modified: libs/gui/branches/gnustep_testplant_branch/Images/GNUmakefile
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/GNUmakefile?rev=38022&r1=38021&r2=38022&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Images/GNUmakefile
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Images/GNUmakefile Fri Aug
1 22:46:33 2014
@@ -152,6 +152,18 @@
common_ProgressSpinning_6.tiff \
common_ProgressSpinning_7.tiff \
common_ProgressSpinning_8.tiff \
+ common_ProgressSpinning2_1.png \
+ common_ProgressSpinning2_2.png \
+ common_ProgressSpinning2_3.png \
+ common_ProgressSpinning2_4.png \
+ common_ProgressSpinning2_5.png \
+ common_ProgressSpinning2_6.png \
+ common_ProgressSpinning2_7.png \
+ common_ProgressSpinning2_8.png \
+ common_ProgressSpinning2_9.png \
+ common_ProgressSpinning2_10.png \
+ common_ProgressSpinning2_11.png \
+ common_ProgressSpinning2_12.png \
nsmapping.strings \
page_landscape.tiff \
page_portrait.tiff
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_1.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_1.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_1.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_10.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_10.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_10.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_11.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_11.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_11.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_12.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_12.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_12.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_2.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_2.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_2.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_3.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_3.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_3.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_4.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_4.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_4.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_5.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_5.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_5.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_6.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_6.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_6.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_7.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_7.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_7.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_8.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_8.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_8.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_9.png
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_9.png?rev=38022&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
libs/gui/branches/gnustep_testplant_branch/Images/common_ProgressSpinning2_9.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: libs/gui/branches/gnustep_testplant_branch/Source/GSThemeDrawing.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSThemeDrawing.m?rev=38022&r1=38021&r2=38022&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/GSThemeDrawing.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/GSThemeDrawing.m Fri Aug
1 22:46:33 2014
@@ -61,6 +61,10 @@
#import "GNUstepGUI/GSToolbarView.h"
#import "GNUstepGUI/GSTitleView.h"
+
+
+#define USE_SPINNING_DOTS
+
/* a border width of 5 gives a reasonable compromise between Cocoa metrics and
looking good */
/* 7.0 gives us the NeXT Look (which is 8 pix wide including the shadow) */
@@ -1136,11 +1140,17 @@
return aRect;
}
+// TODO: Add linux type spinning image(s)???
// progress indicator drawing methods
static NSColor *fillColour = nil;
-#define MaxCount 10
-static int indeterminateMaxCount = MaxCount;
-static int spinningMaxCount = MaxCount;
+#define MaxCount 12
+#if defined(USE_SPINNING_DOTS)
+static int indeterminateMaxCount = 10;
+static int spinningMaxCount = 12;
+#else
+static int indeterminateMaxCount = 10;
+static int spinningMaxCount = 10;
+#endif
static NSColor *indeterminateColors[MaxCount];
static NSImage *spinningImages[MaxCount];
@@ -1153,7 +1163,7 @@
fillColour = RETAIN([NSColor controlShadowColor]);
// Load images for indeterminate style
- for (i = 0; i < MaxCount; i++)
+ for (i = 0; i < indeterminateMaxCount; i++)
{
NSString *imgName = [NSString stringWithFormat:
@"common_ProgressIndeterminate_%d", i + 1];
NSImage *image = [NSImage imageNamed: imgName];
@@ -1167,10 +1177,15 @@
}
// Load images for spinning style
- for (i = 0; i < MaxCount; i++)
- {
- NSString *imgName = [NSString stringWithFormat:
@"common_ProgressSpinning_%d", i + 1];
- NSImage *image = [NSImage imageNamed: imgName];
+#if defined(USE_SPINNING_DOTS)
+ NSString *baseName = @"common_ProgressSpinning2_";
+#else
+ NSString *baseName = @"common_ProgressSpinning_";
+#endif
+ for (i = 0; i < spinningMaxCount; i++)
+ {
+ NSString *imgName = [NSString stringWithFormat: @"%@%d", baseName, i +
1];
+ NSImage *image = [NSImage imageNamed: imgName];
if (image == nil)
{
@@ -1210,14 +1225,16 @@
NSRect imgBox = {{0,0}, {0,0}};
if (spinningMaxCount != 0)
- {
- count = count % spinningMaxCount;
- imgBox.size = [spinningImages[count] size];
- [spinningImages[count] drawInRect: r
- fromRect: imgBox
- operation: NSCompositeSourceOver
- fraction: 1.0];
- }
+ {
+ count = count % spinningMaxCount;
+ imgBox.size = [spinningImages[count] size];
+ [spinningImages[count] drawInRect: r
+ fromRect: imgBox
+ operation: NSCompositeSourceOver
+ fraction: 1.0
+ respectFlipped: YES
+ hints: nil];
+ }
}
else
{
Modified:
libs/gui/branches/gnustep_testplant_branch/Source/NSProgressIndicator.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSProgressIndicator.m?rev=38022&r1=38021&r2=38022&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSProgressIndicator.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSProgressIndicator.m
Fri Aug 1 22:46:33 2014
@@ -126,6 +126,7 @@
&& (_style == NSProgressIndicatorBarStyle)))
return;
+ [self setHidden:NO];
_isRunning = YES;
if (!_usesThreadedAnimation)
{
@@ -160,6 +161,8 @@
// Done automatically
}
+ if (_isDisplayedWhenStopped == NO)
+ [self setHidden:YES];
_isRunning = NO;
}
@@ -247,6 +250,7 @@
- (void) setBezeled: (BOOL)flag
{
+ NSLog(@"%s:flag: %ld", __PRETTY_FUNCTION__, (long)flag);
if (_isBezeled != flag)
{
_isBezeled = flag;
@@ -295,7 +299,8 @@
{
_style = style;
_count = 0;
- [self setDisplayedWhenStopped: (style == NSProgressIndicatorBarStyle)];
+ [self setDisplayedWhenStopped:(style == NSProgressIndicatorBarStyle)];
+ [self setBezeled:(style == NSProgressIndicatorBarStyle)];
[self sizeToFit];
[self setNeedsDisplay: YES];
}
@@ -334,7 +339,7 @@
if (!_isRunning && !_isDisplayedWhenStopped)
return;
-
+
if (_doubleValue < _minValue)
val = 0.0;
else if (_doubleValue > _maxValue)
@@ -419,6 +424,54 @@
if ([aDecoder allowsKeyedCoding])
{
+ // things which Gorm encodes, but IB doesn't care about.
+ // process Gorm encodings that IB doesn't care about first
+ // otherwise we overwrite settings read in from XIB...
+ if ([aDecoder containsValueForKey: @"GSDoubleValue"])
+ {
+ _doubleValue = [aDecoder decodeDoubleForKey: @"GSDoubleValue"];
+ }
+ else
+ {
+ _doubleValue = _minValue;
+ }
+
+ if ([aDecoder containsValueForKey: @"GSIsBezeled"])
+ {
+ _isBezeled = [aDecoder decodeBoolForKey: @"GSIsBezeled"];
+ }
+ else
+ {
+ _isBezeled = YES;
+ }
+
+ if ([aDecoder containsValueForKey: @"GSIsVertical"])
+ {
+ _isVertical = [aDecoder decodeBoolForKey: @"GSIsVertical"];
+ }
+ else
+ {
+ _isVertical = NO;
+ }
+
+ if ([aDecoder containsValueForKey: @"GSUsesThreadAnimation"])
+ {
+ _usesThreadedAnimation = [aDecoder decodeBoolForKey:
@"GSUsesThreadAnimation"];
+ }
+ else
+ {
+ _usesThreadedAnimation = NO;
+ }
+
+ if ([aDecoder containsValueForKey: @"GSAnimationDelay"])
+ {
+ _animationDelay = [aDecoder decodeDoubleForKey: @"GSAnimationDelay"];
+ }
+ else
+ {
+ _animationDelay = 5.0 / 60.0; // 1 twelfth a a second
+ }
+
// id matrix = [aDecoder decodeObjectForKey: @"NSDrawMatrix"];
if ([aDecoder containsValueForKey: @"NSMaxValue"])
{
@@ -444,6 +497,7 @@
if ([aDecoder containsValueForKey: @"NSpiFlags"])
{
int flags = [aDecoder decodeIntForKey: @"NSpiFlags"];
+ NSLog(@"%s:flags: %p", __PRETTY_FUNCTION__, flags);
_isIndeterminate = ((flags & 2) == 2);
_controlTint = NSDefaultControlTint;
@@ -461,52 +515,6 @@
_controlSize = NSRegularControlSize;
[self setStyle: NSProgressIndicatorBarStyle];
}
-
- // things which Gorm encodes, but IB doesn't care about.
- if ([aDecoder containsValueForKey: @"GSDoubleValue"])
- {
- _doubleValue = [aDecoder decodeDoubleForKey: @"GSDoubleValue"];
- }
- else
- {
- _doubleValue = _minValue;
- }
-
- if ([aDecoder containsValueForKey: @"GSIsBezeled"])
- {
- _isBezeled = [aDecoder decodeBoolForKey: @"GSIsBezeled"];
- }
- else
- {
- _isBezeled = YES;
- }
-
- if ([aDecoder containsValueForKey: @"GSIsVertical"])
- {
- _isVertical = [aDecoder decodeBoolForKey: @"GSIsVertical"];
- }
- else
- {
- _isVertical = NO;
- }
-
- if ([aDecoder containsValueForKey: @"GSUsesThreadAnimation"])
- {
- _usesThreadedAnimation = [aDecoder decodeBoolForKey:
@"GSUsesThreadAnimation"];
- }
- else
- {
- _usesThreadedAnimation = NO;
- }
-
- if ([aDecoder containsValueForKey: @"GSAnimationDelay"])
- {
- _animationDelay = [aDecoder decodeDoubleForKey: @"GSAnimationDelay"];
- }
- else
- {
- _animationDelay = 5.0 / 60.0; // 1 twelfth a a second
- }
}
else
{
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs