PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

C++ Header | 70 lines | 12 code | 10 blank | 48 comment | 0 complexity | 1b1341f72771cd2568f4ec5149ca0cd5 MD5 | raw file
 2//  GTMLargeTypeWindow.h
 4//  Copyright 2008 Google Inc.
 6//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 7//  use this file except in compliance with the License.  You may obtain a copy
 8//  of the License at
12//  Unless required by applicable law or agreed to in writing, software
13//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
15//  License for the specific language governing permissions and limitations under
16//  the License.
19#import <Cocoa/Cocoa.h>
21// GTMLargeTypeWindow displays a block of text in a large panel window much
22// like Address Book displays phone numbers. It will also display an image
23// so you can pop up "alerts" similar to the way BBEdit does when you attempt
24// to do a find and find nothing. It will fade in and out appropriately when
25// ordered forward or backward.
26// A typical fire-and-forget type usage would be:
27// GTMLargeTypeWindow *window
28//   = [[[GTMLargeTypeWindow alloc] initWithString:@"Foo"] autorelease];
29// [window makeKeyAndOrderFront:nil];
31// NB This class appears to have a problem with GC on 10.5.6 and below.
32// Radar 6137322 CIFilter crashing when run with GC enabled
33// This appears to be an Apple bug with GC.
34// We do a copy animation that causes things to crash, but only with GC
35// on. Currently I have left this enabled in GTMLargeTypeWindow pending
36// info from Apple on the bug. It's hard to reproduce, and only appears
37// at this time on our test machines. 
38// Dual-Core Intel Xeon with ATI Radeon X1300
40@interface GTMLargeTypeWindow : NSPanel
42// Setter and getter for the copy animation duration. Default value is .5s.
43// Note that this affects all windows.
44+ (NSTimeInterval)copyAnimationDuration;
45+ (void)setCopyAnimationDuration:(NSTimeInterval)duration;
47// Setter and getter for the fade animation duration. Default value is .3s.
48// Note that this affects all windows.
49+ (NSTimeInterval)fadeAnimationDuration;
50+ (void)setFadeAnimationDuration:(NSTimeInterval)duration;
52// Creates a display window with |string| displayed.
53// Formats |string| as best as possible to fill the screen.
54- (id)initWithString:(NSString *)string;
55// Creates a display window with |attrString| displayed.
56// Expects you to format it as you want it to appear.
57- (id)initWithAttributedString:(NSAttributedString *)attrString;
58// Creates a display window with |image| displayed.
59// Make sure you set the image size to what you want
60- (id)initWithImage:(NSImage*)image;
61// Creates a display window with |view| displayed.
62- (id)initWithContentView:(NSView *)view;
64// Copy the text out of the window if appropriate. This is normally called
65// as part of the responder chain so that the user can copy the displayed text
66// using cmd-c.
67- (void)copy:(id)sender;