Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
RBSplitViewPrivateDefines.h
Go to the documentation of this file.
1//
2// RBSplitViewPrivateDefines.h version 1.2
3// RBSplitView
4//
5// Created by Rainer Brockerhoff on 19/11/2004.
6// Copyright 2004-2009 Rainer Brockerhoff.
7// Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.
8//
9
10// These defines are used only locally; no sense exporting them in the main header file where they might
11// conflict with something...
12
13// This is the hysteresis value for collapsing/expanding subviews with the mouse. 0.05 (5%) works well.
14#define HYSTERESIS (0.05)
15
16// This selects the main horizontal or vertical coordinate according to the split view's orientation.
17// It can be used as an lvalue, too. You need to have BOOL ishor declared to use it.
18#define DIM(x) (((CGFloat*)&(x))[ishor])
19
20// This selects the other coordinate. You need to have BOOL ishor declared to use it.
21#define OTHER(x) (((CGFloat*)&(x))[!ishor])
22
23// This value for the view offsets is guaranteed to be out of view for quite some time and is used
24// to mark the view as collapsed.
25#define WAYOUT (1000000.0)
26
27// This is the default framerate for collapse/expand animation.
28#define FRAMETIME (1.0/60.0)
29
30// This struct is used internally for speeding up adjustSubviews.
31typedef struct subviewCache {
32 NSRect rect; // the subview's frame
33 double fraction; // fractional extra
34 RBSplitSubview* sub; // points at the subview
35 CGFloat size; // current dimension
36 BOOL constrain; // set if constrained
38
39// This struct is used internally for doing collapse/expand animation.
40typedef struct animationData {
41 RBSplitSubview* owner; // the subview being animated
42 CGFloat dimension; // the subview's starting or ending dimension
43 int stepsDone; // counts already done animation steps
44 NSTimeInterval elapsedTime; // time already spent in resizing and adjusting subviews
45 NSTimeInterval finishTime; // the animation should be finished at this time
46 NSTimeInterval totalTime; // total time the animation should take
47 BOOL collapsing; // YES if we're collapsing, NO if we're expanding
48 BOOL resizing; // YES if we're resizing, NO if we're frozen
50
51// The following methods are for internal use, and you should never call or override them.
52// They'll probably vary wildy from version to version, too.
53
54@interface RBSplitSubview (RB___SubviewAdditions)
55
56- (void)RB___setHidden:(BOOL)flag;
57- (animationData*)RB___animationData:(BOOL)start resize:(BOOL)resize;
58- (void)RB___stepAnimation;
59- (BOOL)RB___stopAnimation;
60- (CGFloat)RB___visibleDimension;
61- (CGFloat)RB___setMinAndMaxTo:(CGFloat)value savingMin:(CGFloat*)oldmin andMax:(CGFloat*)oldmax;
62- (CGFloat)RB___collapse;
63- (CGFloat)RB___expandAndSetToMinimum:(BOOL)setToMinimum;
64- (void)RB___finishCollapse:(NSRect)rect withFraction:(double)value;
65- (void)RB___finishExpand:(NSRect)rect withFraction:(double)value;
66- (void)RB___setFrameSize:(NSSize)size withFraction:(double)value;
67- (void)RB___setFrame:(NSRect)rect withFraction:(double)value notify:(BOOL)notify;
68- (double)RB___fraction;
69- (void)RB___copyIntoCache:(subviewCache*)cache;
70- (void)RB___updateFromCache:(subviewCache*)cache withTotalDimension:(CGFloat)value;
72
73@end
74
75@interface RBSplitView (RB___ViewAdditions)
76
77- (void)RB___adjustOutermostIfNeeded;
78- (void)RB___setDragging:(BOOL)flag;
79- (CGFloat)RB___dividerOrigin:(NSUInteger)indx;
80- (NSArray*)RB___subviews;
81- (NSUInteger)RB___numberOfSubviews;
82- (void)RB___adjustSubviewsExcepting:(RBSplitSubview*)excepting;
83- (CGFloat)RB___dimensionWithoutDividers;
84- (CGFloat)RB___dividerThickness;
85- (NSRect)RB___dividerRect:(NSUInteger)indx relativeToView:(RBSplitView*)view;
86- (void)RB___setMustClearFractions;
87- (BOOL)RB___shouldResizeWindowForDivider:(NSUInteger)indx betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing willGrow:(BOOL)grow;
88- (void)RB___tryToExpandLeading:(RBSplitSubview*)leading divider:(NSUInteger)indx trailing:(RBSplitSubview*)trailing delta:(CGFloat)delta;
89- (void)RB___tryToShortenLeading:(RBSplitSubview*)leading divider:(NSUInteger)indx trailing:(RBSplitSubview*)trailing delta:(CGFloat)delta always:(BOOL)always;
90- (void)RB___tryToExpandTrailing:(RBSplitSubview*)trailing leading:(RBSplitSubview*)leading delta:(CGFloat)delta;
91- (void)RB___tryToShortenTrailing:(RBSplitSubview*)trailing divider:(NSUInteger)indx leading:(RBSplitSubview*)leading delta:(CGFloat)delta always:(BOOL)always;
92- (void)RB___trackMouseEvent:(NSEvent*)theEvent from:(NSPoint)where withBase:(NSPoint)base inDivider:(NSUInteger)indx;
93- (void)RB___addCursorRectsTo:(RBSplitView*)masterView forDividerRect:(NSRect)rect thickness:(CGFloat)delta;
94- (NSUInteger)RB___dividerHitBy:(NSPoint)point relativeToView:(RBSplitView*)view thickness:(CGFloat)delta;
95- (void)RB___drawDividersIn:(RBSplitView*)masterView forDividerRect:(NSRect)rect thickness:(CGFloat)delta;
96
97@end
98
struct animationData animationData
struct subviewCache subviewCache