Skip to content
This repository was archived by the owner on Nov 19, 2019. It is now read-only.

Commit bc35922

Browse files
author
Michael Ehrmann
committed
[FIX] deprecations and bad API overrides, returning different object types as defined in superclass is not allowed.
1 parent 05f146d commit bc35922

File tree

6 files changed

+37
-48
lines changed

6 files changed

+37
-48
lines changed

Source/PSMAdiumTabStyle.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ - (NSRect)closeButtonRectForBounds:(NSRect)theRect ofTabCell:(PSMTabBarCell *)ce
257257
return NSZeroRect;
258258
}
259259

260-
PSMTabBarControl *tabBarControl = [cell controlView];
260+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[cell controlView];
261261
PSMTabBarOrientation orientation = [tabBarControl orientation];
262262

263263
// ask style for image
@@ -304,7 +304,7 @@ - (NSRect)iconRectForBounds:(NSRect)theRect ofTabCell:(PSMTabBarCell *)cell {
304304
if (!icon)
305305
return NSZeroRect;
306306

307-
PSMTabBarControl *tabBarControl = [cell controlView];
307+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[cell controlView];
308308
PSMTabBarOrientation orientation = [tabBarControl orientation];
309309

310310
// calculate rect
@@ -348,7 +348,7 @@ - (NSRect)titleRectForBounds:(NSRect)theRect ofTabCell:(PSMTabBarCell *)cell {
348348
if ([attrString length] == 0)
349349
return NSZeroRect;
350350

351-
PSMTabBarControl *tabBarControl = [cell controlView];
351+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[cell controlView];
352352
PSMTabBarOrientation orientation = [tabBarControl orientation];
353353

354354
NSRect drawingRect = [cell drawingRectForBounds:theRect];

Source/PSMAquaTabStyle.m

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,11 @@ - (id) init {
3333
- (void) loadImages {
3434
// Aqua Tabs Images
3535
aquaTabBg = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsBackground"]];
36-
[aquaTabBg setFlipped:YES];
37-
3836
aquaTabBgDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsDown"]];
39-
[aquaTabBgDown setFlipped:YES];
40-
4137
aquaTabBgDownGraphite = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsDownGraphite"]];
42-
[aquaTabBgDown setFlipped:YES];
43-
4438
aquaTabBgDownNonKey = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsDownNonKey"]];
45-
[aquaTabBgDown setFlipped:YES];
46-
4739
aquaDividerDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsSeparatorDown"]];
48-
[aquaDivider setFlipped:NO];
49-
5040
aquaDivider = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsSeparator"]];
51-
[aquaDivider setFlipped:NO];
5241

5342
aquaCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front"]];
5443
aquaCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Pressed"]];

Source/PSMLiveChatTabStyle.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ - (NSRect)iconRectForBounds:(NSRect)theRect ofTabCell:(PSMTabBarCell *)cell {
140140
if (!icon)
141141
return NSZeroRect;
142142

143-
PSMTabBarControl *tabBarControl = [cell controlView];
143+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[cell controlView];
144144
PSMTabBarOrientation orientation = [tabBarControl orientation];
145145

146146
if ([cell hasLargeImage] && orientation == PSMTabBarVerticalOrientation)

Source/PSMTabBarCell.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ typedef enum PSMTabBarCellTrackingAreaType : NSUInteger
6464
- (void)dealloc;
6565

6666
#pragma mark Accessors
67-
- (PSMTabBarControl *)controlView;
68-
- (void)setControlView:(PSMTabBarControl *)newControl;
67+
//- (PSMTabBarControl *)controlView;
68+
//- (void)setControlView:(PSMTabBarControl *)newControl;
6969
- (CGFloat)width;
7070
- (NSRect)frame;
7171
- (void)setFrame:(NSRect)rect;

Source/PSMTabBarCell.m

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ - (void)dealloc {
120120
#pragma mark -
121121
#pragma mark Accessors
122122

123-
- (PSMTabBarControl *)controlView {
124-
return (PSMTabBarControl *)[super controlView];
125-
}
126-
127-
- (void)setControlView:(PSMTabBarControl *)newControl {
128-
[super setControlView:newControl];
129-
}
130-
123+
//- (PSMTabBarControl *)controlView {
124+
// return (PSMTabBarControl *)[super controlView];
125+
//}
126+
//
127+
//- (void)setControlView:(PSMTabBarControl *)newControl {
128+
// [super setControlView:newControl];
129+
//}
130+
//
131131
- (CGFloat)width {
132132
return _frame.size.width;
133133
}
@@ -139,7 +139,7 @@ - (NSRect)frame {
139139
- (void)setFrame:(NSRect)rect {
140140
_frame = rect;
141141

142-
PSMTabBarControl *tabBarControl = [self controlView];
142+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[self controlView];
143143

144144
//move the status indicator along with the rest of the cell
145145
if(![[self indicator] isHidden] && ![tabBarControl isTabBarHidden]) {
@@ -152,7 +152,7 @@ - (void)setTitle:(NSString *)aString {
152152
[super setTitle:aString];
153153
_attributedStringSize = [[self attributedStringValue] size];
154154
// need to redisplay now - binding observation was too quick.
155-
[[self controlView] update];
155+
[(PSMTabBarControl *)[self controlView] update];
156156
}
157157

158158
- (NSSize)attributedStringSize {
@@ -191,7 +191,7 @@ - (void)setIsInOverflowMenu:(BOOL)value {
191191
if(_isInOverflowMenu != value) {
192192
_isInOverflowMenu = value;
193193

194-
PSMTabBarControl *tabBarControl = [self controlView];
194+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[self controlView];
195195

196196
if([[tabBarControl delegate] respondsToSelector:@selector(tabView:tabViewItem:isInOverflowMenu:)]) {
197197
[[tabBarControl delegate] tabView:[tabBarControl tabView] tabViewItem:[self representedObject] isInOverflowMenu:_isInOverflowMenu];
@@ -200,7 +200,7 @@ - (void)setIsInOverflowMenu:(BOOL)value {
200200
}
201201

202202
- (BOOL)closeButtonOver {
203-
return(_closeButtonOver && ([[self controlView] allowsBackgroundTabClosing] || ([self tabState] & PSMTab_SelectedMask) || [[NSApp currentEvent] modifierFlags] & NSCommandKeyMask));
203+
return(_closeButtonOver && ([(PSMTabBarControl *)[self controlView] allowsBackgroundTabClosing] || ([self tabState] & PSMTab_SelectedMask) || [[NSApp currentEvent] modifierFlags] & NSCommandKeyMask));
204204
}
205205

206206
- (void)setCloseButtonOver:(BOOL)value {
@@ -248,7 +248,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
248248

249249
- (NSImage *)closeButtonImageOfType:(PSMCloseButtonImageType)type {
250250

251-
id <PSMTabStyle> tabStyle = [[self controlView] style];
251+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
252252

253253
if ([tabStyle respondsToSelector:@selector(closeButtonImageOfType:forTabCell:)]) {
254254
return [tabStyle closeButtonImageOfType:type forTabCell:self];
@@ -263,7 +263,7 @@ - (NSImage *)closeButtonImageOfType:(PSMCloseButtonImageType)type {
263263
#pragma mark Determining Cell Size
264264

265265
- (NSRect)drawingRectForBounds:(NSRect)theRect {
266-
id <PSMTabStyle> tabStyle = [[self controlView] style];
266+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
267267
if ([tabStyle respondsToSelector:@selector(drawingRectForBounds:ofTabCell:)])
268268
return [tabStyle drawingRectForBounds:theRect ofTabCell:self];
269269
else
@@ -272,7 +272,7 @@ - (NSRect)drawingRectForBounds:(NSRect)theRect {
272272

273273
- (NSRect)titleRectForBounds:(NSRect)theRect {
274274

275-
id <PSMTabStyle> tabStyle = [[self controlView] style];
275+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
276276
if ([tabStyle respondsToSelector:@selector(titleRectForBounds:ofTabCell:)])
277277
return [tabStyle titleRectForBounds:theRect ofTabCell:self];
278278
else {
@@ -282,7 +282,7 @@ - (NSRect)titleRectForBounds:(NSRect)theRect {
282282

283283
- (NSRect)iconRectForBounds:(NSRect)theRect {
284284

285-
id <PSMTabStyle> tabStyle = [[self controlView] style];
285+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
286286
if ([tabStyle respondsToSelector:@selector(iconRectForBounds:ofTabCell:)]) {
287287
return [tabStyle iconRectForBounds:theRect ofTabCell:self];
288288
} else {
@@ -296,7 +296,7 @@ - (NSRect)largeImageRectForBounds:(NSRect)theRect {
296296
if ([(PSMTabBarControl *)[self controlView] orientation] == PSMTabBarHorizontalOrientation)
297297
return NSZeroRect;
298298

299-
id <PSMTabStyle> tabStyle = [[self controlView] style];
299+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
300300
if ([tabStyle respondsToSelector:@selector(largeImageRectForBounds:ofTabCell:)]) {
301301
return [tabStyle largeImageRectForBounds:theRect ofTabCell:self];
302302
} else {
@@ -306,7 +306,7 @@ - (NSRect)largeImageRectForBounds:(NSRect)theRect {
306306

307307
- (NSRect)indicatorRectForBounds:(NSRect)theRect {
308308

309-
id <PSMTabStyle> tabStyle = [[self controlView] style];
309+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
310310
if ([tabStyle respondsToSelector:@selector(indicatorRectForBounds:ofTabCell:)])
311311
return [tabStyle indicatorRectForBounds:theRect ofTabCell:self];
312312
else {
@@ -329,7 +329,7 @@ - (NSSize)objectCounterSize
329329

330330
- (NSRect)objectCounterRectForBounds:(NSRect)theRect {
331331

332-
id <PSMTabStyle> tabStyle = [[self controlView] style];
332+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
333333
if ([tabStyle respondsToSelector:@selector(objectCounterRectForBounds:ofTabCell:)]) {
334334
return [tabStyle objectCounterRectForBounds:theRect ofTabCell:self];
335335
} else {
@@ -339,7 +339,7 @@ - (NSRect)objectCounterRectForBounds:(NSRect)theRect {
339339

340340
- (NSRect)closeButtonRectForBounds:(NSRect)theRect {
341341

342-
id <PSMTabStyle> tabStyle = [[self controlView] style];
342+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
343343

344344
// ask style for rect if available
345345
if ([tabStyle respondsToSelector:@selector(closeButtonRectForBounds:ofTabCell:)]) {
@@ -352,7 +352,7 @@ - (NSRect)closeButtonRectForBounds:(NSRect)theRect {
352352

353353
- (CGFloat)minimumWidthOfCell {
354354

355-
id < PSMTabStyle > style = [[self controlView] style];
355+
id < PSMTabStyle > style = [(PSMTabBarControl *)[self controlView] style];
356356
if ([style respondsToSelector:@selector(minimumWidthOfTabCell:)]) {
357357
return [style minimumWidthOfTabCell:self];
358358
} else {
@@ -362,7 +362,7 @@ - (CGFloat)minimumWidthOfCell {
362362

363363
- (CGFloat)desiredWidthOfCell {
364364

365-
id < PSMTabStyle > style = [[self controlView] style];
365+
id < PSMTabStyle > style = [(PSMTabBarControl *)[self controlView] style];
366366
if ([style respondsToSelector:@selector(desiredWidthOfTabCell:)]) {
367367
return [style desiredWidthOfTabCell:self];
368368
} else {
@@ -581,7 +581,7 @@ - (void)addTrackingAreasForView:(NSView *)controlView inRect:(NSRect)cellFrame w
581581

582582
- (void)mouseEntered:(NSEvent *)theEvent {
583583

584-
PSMTabBarControl *tabBarControl = [self controlView];
584+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[self controlView];
585585
NSDictionary *userInfo = [theEvent userData];
586586

587587
NSUInteger type = [[userInfo objectForKey:@"type"] unsignedIntegerValue];
@@ -609,7 +609,7 @@ - (void)mouseEntered:(NSEvent *)theEvent {
609609

610610
- (void)mouseExited:(NSEvent *)theEvent {
611611

612-
PSMTabBarControl *tabBarControl = [self controlView];
612+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[self controlView];
613613
NSDictionary *userInfo = [theEvent userData];
614614

615615
NSUInteger type = [[userInfo objectForKey:@"type"] unsignedIntegerValue];
@@ -635,9 +635,9 @@ - (void)mouseExited:(NSEvent *)theEvent {
635635
#pragma mark Drag Support
636636

637637
- (NSRect)draggingRect {
638-
id <PSMTabStyle> tabStyle = [[self controlView] style];
638+
id <PSMTabStyle> tabStyle = [(PSMTabBarControl *)[self controlView] style];
639639
if ([tabStyle respondsToSelector:@selector(dragRectForTabCell:ofTabBarControl:)])
640-
return [tabStyle dragRectForTabCell:self ofTabBarControl:[self controlView]];
640+
return [tabStyle dragRectForTabCell:self ofTabBarControl:(PSMTabBarControl *)[self controlView]];
641641
else
642642
return [self _draggingRect];
643643
}
@@ -646,7 +646,7 @@ - (NSImage *)dragImage {
646646

647647
NSRect cellFrame = [self draggingRect];
648648

649-
PSMTabBarControl *tabBarControl = [self controlView];
649+
PSMTabBarControl *tabBarControl = (PSMTabBarControl *)[self controlView];
650650

651651
[tabBarControl lockFocus];
652652
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:cellFrame] autorelease];
@@ -733,10 +733,10 @@ - (id)accessibilityAttributeValue:(NSString *)attribute {
733733
} else if([attribute isEqualToString: NSAccessibilityTitleAttribute]) {
734734
attributeValue = [self title];
735735
} else if([attribute isEqualToString: NSAccessibilityHelpAttribute]) {
736-
if([[[self controlView] delegate] respondsToSelector:@selector(accessibilityStringForTabView:objectCount:)]) {
736+
if([[(PSMTabBarControl *)[self controlView] delegate] respondsToSelector:@selector(accessibilityStringForTabView:objectCount:)]) {
737737
attributeValue = [NSString stringWithFormat:@"%@, %lu %@", [self title],
738738
(unsigned long)[self count],
739-
[[[self controlView] delegate] accessibilityStringForTabView:[[self controlView] tabView] objectCount:[self count]]];
739+
[[(PSMTabBarControl *)[self controlView] delegate] accessibilityStringForTabView:[(PSMTabBarControl *)[self controlView] tabView] objectCount:[self count]]];
740740
} else {
741741
attributeValue = [self stringValue];
742742
}

Source/PSMTabDragAssistant.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ - (void)draggingExitedTabBarControl:(PSMTabBarControl *)tabBarControl {
279279
}
280280

281281
imageSize = [image size];
282-
[image setScalesWhenResized:YES];
282+
// [image setScalesWhenResized:YES]; // not needed 10.6 and higher
283283

284284
if(imageSize.width > imageSize.height) {
285285
[image setSize:NSMakeSize(125, 125 * (imageSize.height / imageSize.width))];
@@ -571,7 +571,7 @@ - (void)fadeOutDragWindow:(NSTimer *)timer {
571571
#pragma mark Private
572572

573573
- (NSImage *)_imageForViewOfCell:(PSMTabBarCell *)cell styleMask:(NSUInteger *)outMask {
574-
PSMTabBarControl *control = [cell controlView];
574+
PSMTabBarControl *control = (PSMTabBarControl *)[cell controlView];
575575
NSImage *viewImage = nil;
576576

577577
if(outMask) {

0 commit comments

Comments
 (0)