1/* 2 NSStatusBar.m 3 4 The status bar class 5 6 Copyright (C) 2013 Free Software Foundation, Inc. 7 8 Author: Dr. H. Nikolaus Schaller 9 Date: 2013 10 11 This file is part of the GNUstep GUI Library. 12 13 This library is free software; you can redistribute it and/or 14 modify it under the terms of the GNU Lesser General Public 15 License as published by the Free Software Foundation; either 16 version 2 of the License, or (at your option) any later version. 17 18 This library is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 Lesser General Public License for more details. 22 23 You should have received a copy of the GNU Lesser General Public 24 License along with this library; see the file COPYING.LIB. 25 If not, see <http://www.gnu.org/licenses/> or write to the 26 Free Software Foundation, 51 Franklin Street, Fifth Floor, 27 Boston, MA 02110-1301, USA. 28*/ 29 30#import <Foundation/NSArray.h> 31#import <AppKit/NSStatusBar.h> 32#import <AppKit/NSStatusItem.h> 33 34@interface NSStatusItem (Private) 35- (id) _initForStatusBar: (NSStatusBar*)bar 36 withLength: (CGFloat)len; 37@end 38 39 40@implementation NSStatusBar 41 42- (id) init 43{ 44 self = [super init]; 45 if (self) 46 { 47 _items = [[NSMutableArray alloc] init]; 48 } 49 return self; 50} 51 52- (void) dealloc 53{ 54 RELEASE(_items); 55 [super dealloc]; 56} 57 58+ (NSStatusBar*) systemStatusBar 59{ 60 return nil; 61} 62 63- (BOOL) isVertical 64{ 65 return NO; 66} 67 68- (void) removeStatusItem: (NSStatusItem*)item 69{ 70 [_items removeObjectIdenticalTo: item]; 71} 72 73- (NSStatusItem*) statusItemWithLength: (CGFloat)length 74{ 75 NSStatusItem *item = [[NSStatusItem alloc] _initForStatusBar: self 76 withLength: length]; 77 [_items addObject: item]; 78 79 return AUTORELEASE(item); 80} 81 82- (CGFloat) thickness 83{ 84 return 22; 85} 86 87@end 88