PageRenderTime 33ms CodeModel.GetById 23ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/core/externals/update-engine/externals/google-toolbox-for-mac/AppKit/GTMNSImage+Scaling.h

http://macfuse.googlecode.com/
C++ Header | 53 lines | 13 code | 10 blank | 30 comment | 0 complexity | a1b13064ec381ddfeae9108c37637757 MD5 | raw file
 1//
 2//  GTMNSImage+Scaling.h
 3//
 4//  Scales NSImages to a variety of sizes for drawing
 5//
 6//  Copyright 2006-2008 Google Inc.
 7//
 8//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 9//  use this file except in compliance with the License.  You may obtain a copy
10//  of the License at
11// 
12//  http://www.apache.org/licenses/LICENSE-2.0
13// 
14//  Unless required by applicable law or agreed to in writing, software
15//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
17//  License for the specific language governing permissions and limitations under
18//  the License.
19//
20
21
22#import <AppKit/AppKit.h>
23#import "GTMDefines.h"
24
25@interface NSImage (GTMNSImageScaling)
26
27// Return an existing representation of a size
28- (NSImageRep *)gtm_representationOfSize:(NSSize)size;
29
30#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
31// Return the exact or next largest representation for a size
32// If you are on SnowLeopard use 
33// -[NSImage bestRepresentationForRect:context:hints:]
34// Also, please see http://openradar.appspot.com/radar?id=394401
35// and read notes in GTMNSImage+ScalingTest.m. Search for "8052200".
36- (NSImageRep *)gtm_bestRepresentationForSize:(NSSize)size;
37#endif
38
39// Create a new represetation for a given size
40- (BOOL)gtm_createRepresentationOfSize:(NSSize)size;
41
42// Create 32 and 16px reps
43- (BOOL)gtm_createIconRepresentations;
44
45// Remove reps larger than a given size and create a new rep if needed
46- (void)gtm_shrinkToSize:(NSSize)size;
47
48// Remove reps larger than a given size
49- (void)gtm_removeRepresentationsLargerThanSize:(NSSize)size;
50
51// Return a dup shrunk to a given size
52- (NSImage *)gtm_duplicateOfSize:(NSSize)size;
53@end