1 //
2 //  CenteringClipView.h
3 //  avida/apps/viewer-macos
4 //
5 //  Created by David on 4/22/11.
6 //  Copyright 2011 Michigan State University. All rights reserved.
7 //  http://avida.devosoft.org/viewer-macos
8 //
9 //  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
10 //  following conditions are met:
11 //
12 //  1.  Redistributions of source code must retain the above copyright notice, this list of conditions and the
13 //      following disclaimer.
14 //  2.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
15 //      following disclaimer in the documentation and/or other materials provided with the distribution.
16 //  3.  Neither the name of Michigan State University, nor the names of contributors may be used to endorse or promote
17 //      products derived from this software without specific prior written permission.
18 //
19 //  THIS SOFTWARE IS PROVIDED BY MICHIGAN STATE UNIVERSITY AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 //  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 //  DISCLAIMED. IN NO EVENT SHALL MICHIGAN STATE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 //  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 //  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 //  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25 //  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 //
27 //  Authors: David M. Bryson <david@programerror.com>
28 //
29 
30 #import <Cocoa/Cocoa.h>
31 
32 
33 @interface CenteringClipView : NSClipView {
34   NSPoint viewPoint;
35 
36 	BOOL hasHScroll;
37 	BOOL hasVScroll;
38   BOOL adjustingScrollers;
39 }
40 
41 - (id) initWithFrame:(NSRect)frame;
42 
43 - (void) centerView;
44 
45 
46 // NSClipView Method Overrides
47 - (NSPoint) constrainScrollPoint:(NSPoint)proposedNewOrigin;
48 
49 - (BOOL) copiesOnScroll;
50 
51 - (void) viewBoundsChanged:(NSNotification*)notification;
52 - (void) viewFrameChanged:(NSNotification*)notification;
53 - (void) setFrame:(NSRect)frameRect;
54 - (void) setFrameOrigin:(NSPoint)newOrigin;
55 - (void) setFrameSize:(NSSize)newSize;
56 - (void) setFrameRotation:(CGFloat)angle;
57 - (void) setDocumentView:(NSView*)docView;
58 
59 @end
60