diff options
Diffstat (limited to 'frontends/cocoa/PSMTabBarControl/PSMTabBarControl.h')
-rw-r--r-- | frontends/cocoa/PSMTabBarControl/PSMTabBarControl.h | 168 |
1 files changed, 83 insertions, 85 deletions
diff --git a/frontends/cocoa/PSMTabBarControl/PSMTabBarControl.h b/frontends/cocoa/PSMTabBarControl/PSMTabBarControl.h index 980c43d38..26f11de7a 100644 --- a/frontends/cocoa/PSMTabBarControl/PSMTabBarControl.h +++ b/frontends/cocoa/PSMTabBarControl/PSMTabBarControl.h @@ -12,26 +12,26 @@ #import <Cocoa/Cocoa.h> -#define PSMTabDragDidEndNotification @ "PSMTabDragDidEndNotification" -#define PSMTabDragDidBeginNotification @ "PSMTabDragDidBeginNotification" +#define PSMTabDragDidEndNotification @"PSMTabDragDidEndNotification" +#define PSMTabDragDidBeginNotification @"PSMTabDragDidBeginNotification" -#define kPSMTabBarControlHeight 22 +#define kPSMTabBarControlHeight 22 // internal cell border -#define MARGIN_X 6 -#define MARGIN_Y 3 +#define MARGIN_X 6 +#define MARGIN_Y 3 // padding between objects -#define kPSMTabBarCellPadding 4 +#define kPSMTabBarCellPadding 4 // fixed size objects -#define kPSMMinimumTitleWidth 30 -#define kPSMTabBarIndicatorWidth 16.0 -#define kPSMTabBarIconWidth 16.0 -#define kPSMHideAnimationSteps 3.0 +#define kPSMMinimumTitleWidth 30 +#define kPSMTabBarIndicatorWidth 16.0 +#define kPSMTabBarIconWidth 16.0 +#define kPSMHideAnimationSteps 3.0 // Value used in _currentStep to indicate that resizing operation is not in progress -#define kPSMIsNotBeingResized -1 +#define kPSMIsNotBeingResized -1 // Value used in _currentStep when a resizing operation has just been started -#define kPSMStartResizeAnimation 0 +#define kPSMStartResizeAnimation 0 @class PSMOverflowPopUpButton; @class PSMRolloverButton; @@ -40,82 +40,82 @@ @protocol PSMTabStyle; typedef enum { - PSMTabBarHorizontalOrientation, - PSMTabBarVerticalOrientation + PSMTabBarHorizontalOrientation, + PSMTabBarVerticalOrientation } PSMTabBarOrientation; typedef enum { - PSMTabBarTearOffAlphaWindow, - PSMTabBarTearOffMiniwindow + PSMTabBarTearOffAlphaWindow, + PSMTabBarTearOffMiniwindow } PSMTabBarTearOffStyle; enum { - PSMTab_SelectedMask = 1 << 1, - PSMTab_LeftIsSelectedMask = 1 << 2, - PSMTab_RightIsSelectedMask = 1 << 3, - PSMTab_PositionLeftMask = 1 << 4, - PSMTab_PositionMiddleMask = 1 << 5, - PSMTab_PositionRightMask = 1 << 6, - PSMTab_PositionSingleMask = 1 << 7, + PSMTab_SelectedMask = 1 << 1, + PSMTab_LeftIsSelectedMask = 1 << 2, + PSMTab_RightIsSelectedMask = 1 << 3, + PSMTab_PositionLeftMask = 1 << 4, + PSMTab_PositionMiddleMask = 1 << 5, + PSMTab_PositionRightMask = 1 << 6, + PSMTab_PositionSingleMask = 1 << 7, }; @interface PSMTabBarControl : NSControl { - - // control basics - NSMutableArray *_cells; // the cells that draw the tabs - IBOutlet NSTabView *tabView; // the tab view being navigated - PSMOverflowPopUpButton *_overflowPopUpButton; // for too many tabs - PSMRolloverButton *_addTabButton; - PSMTabBarController *_controller; - - // Spring-loading. - NSTimer *_springTimer; - NSTabViewItem *_tabViewItemWithSpring; - - // drawing style - id<PSMTabStyle> style; - BOOL _canCloseOnlyTab; - BOOL _disableTabClose; - BOOL _hideForSingleTab; - BOOL _showAddTabButton; - BOOL _sizeCellsToFit; - BOOL _useOverflowMenu; - BOOL _alwaysShowActiveTab; - BOOL _allowsScrubbing; - NSInteger _resizeAreaCompensation; - PSMTabBarOrientation _orientation; - BOOL _automaticallyAnimates; - NSTimer *_animationTimer; - PSMTabBarTearOffStyle _tearOffStyle; - - // behavior - BOOL _allowsBackgroundTabClosing; - BOOL _selectsTabsOnMouseDown; - - // vertical tab resizing - BOOL _allowsResizing; - BOOL _resizing; - - // cell width - NSInteger _cellMinWidth; - NSInteger _cellMaxWidth; - NSInteger _cellOptimumWidth; - - // animation for hide/show - NSInteger _currentStep; - BOOL _isHidden; - IBOutlet id partnerView; // gets resized when hide/show - BOOL _awakenedFromNib; - NSInteger _tabBarWidth; - NSTimer *_showHideAnimationTimer; - - // drag and drop - NSEvent *_lastMouseDownEvent; // keep this for dragging reference - BOOL _didDrag; - BOOL _closeClicked; - - // MVC help - IBOutlet id delegate; + + // control basics + NSMutableArray *_cells; // the cells that draw the tabs + IBOutlet NSTabView *tabView; // the tab view being navigated + PSMOverflowPopUpButton *_overflowPopUpButton; // for too many tabs + PSMRolloverButton *_addTabButton; + PSMTabBarController *_controller; + + // Spring-loading. + NSTimer *_springTimer; + NSTabViewItem *_tabViewItemWithSpring; + + // drawing style + id<PSMTabStyle> style; + BOOL _canCloseOnlyTab; + BOOL _disableTabClose; + BOOL _hideForSingleTab; + BOOL _showAddTabButton; + BOOL _sizeCellsToFit; + BOOL _useOverflowMenu; + BOOL _alwaysShowActiveTab; + BOOL _allowsScrubbing; + NSInteger _resizeAreaCompensation; + PSMTabBarOrientation _orientation; + BOOL _automaticallyAnimates; + NSTimer *_animationTimer; + PSMTabBarTearOffStyle _tearOffStyle; + + // behavior + BOOL _allowsBackgroundTabClosing; + BOOL _selectsTabsOnMouseDown; + + // vertical tab resizing + BOOL _allowsResizing; + BOOL _resizing; + + // cell width + NSInteger _cellMinWidth; + NSInteger _cellMaxWidth; + NSInteger _cellOptimumWidth; + + // animation for hide/show + NSInteger _currentStep; + BOOL _isHidden; + IBOutlet id partnerView; // gets resized when hide/show + BOOL _awakenedFromNib; + NSInteger _tabBarWidth; + NSTimer *_showHideAnimationTimer; + + // drag and drop + NSEvent *_lastMouseDownEvent; // keep this for dragging reference + BOOL _didDrag; + BOOL _closeClicked; + + // MVC help + IBOutlet id delegate; } // control characteristics @@ -131,7 +131,7 @@ enum { - (BOOL)disableTabClose; - (void)setDisableTabClose:(BOOL)value; - (id<PSMTabStyle>)style; -- (void)setStyle:(id <PSMTabStyle>)newStyle; +- (void)setStyle:(id<PSMTabStyle>)newStyle; - (NSString *)styleName; - (void)setStyleNamed:(NSString *)name; - (BOOL)hideForSingleTab; @@ -184,7 +184,7 @@ enum { - (PSMTabBarCell *)lastVisibleTab; // special effects -- (void)hideTabBar:(BOOL) hide animate:(BOOL)animate; +- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate; - (BOOL)isTabBarHidden; - (BOOL)isAnimating; @@ -194,7 +194,6 @@ enum { @end - @interface NSObject (TabBarControlDelegateMethods) //Standard NSTabView methods @@ -203,7 +202,7 @@ enum { //"Spring-loaded" tabs methods - (NSArray *)allowedDraggedTypesForTabView:(NSTabView *)aTabView; -- (void)tabView:(NSTabView *)aTabView acceptedDraggingInfo:(id <NSDraggingInfo>) draggingInfo onTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)tabView:(NSTabView *)aTabView acceptedDraggingInfo:(id<NSDraggingInfo>)draggingInfo onTabViewItem:(NSTabViewItem *)tabViewItem; //Contextual menu method - (NSMenu *)tabView:(NSTabView *)aTabView menuForTabViewItem:(NSTabViewItem *)tabViewItem; @@ -212,8 +211,7 @@ enum { - (BOOL)tabView:(NSTabView *)aTabView shouldDragTabViewItem:(NSTabViewItem *)tabViewItem fromTabBar:(PSMTabBarControl *)tabBarControl; - (BOOL)tabView:(NSTabView *)aTabView shouldDropTabViewItem:(NSTabViewItem *)tabViewItem inTabBar:(PSMTabBarControl *)tabBarControl; - (BOOL)tabView:(NSTabView *)aTabView shouldAllowTabViewItem:(NSTabViewItem *)tabViewItem toLeaveTabBar:(PSMTabBarControl *)tabBarControl; -- (void)tabView:(NSTabView*)aTabView didDropTabViewItem:(NSTabViewItem *)tabViewItem inTabBar:(PSMTabBarControl *)tabBarControl; - +- (void)tabView:(NSTabView *)aTabView didDropTabViewItem:(NSTabViewItem *)tabViewItem inTabBar:(PSMTabBarControl *)tabBarControl; //Tear-off tabs methods - (NSImage *)tabView:(NSTabView *)aTabView imageForTabViewItem:(NSTabViewItem *)tabViewItem offset:(NSSize *)offset styleMask:(NSUInteger *)styleMask; |