PageRenderTime 12ms CodeModel.GetById 9ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): Apache-2.0, BSD-3-Clause, GPL-2.0
  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. #import <AppKit/AppKit.h>
  21. #import "GTMDefines.h"
  22. @interface NSImage (GTMNSImageScaling)
  23. // Return an existing representation of a size
  24. - (NSImageRep *)gtm_representationOfSize:(NSSize)size;
  25. #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
  26. // Return the exact or next largest representation for a size
  27. // If you are on SnowLeopard use
  28. // -[NSImage bestRepresentationForRect:context:hints:]
  29. // Also, please see http://openradar.appspot.com/radar?id=394401
  30. // and read notes in GTMNSImage+ScalingTest.m. Search for "8052200".
  31. - (NSImageRep *)gtm_bestRepresentationForSize:(NSSize)size;
  32. #endif
  33. // Create a new represetation for a given size
  34. - (BOOL)gtm_createRepresentationOfSize:(NSSize)size;
  35. // Create 32 and 16px reps
  36. - (BOOL)gtm_createIconRepresentations;
  37. // Remove reps larger than a given size and create a new rep if needed
  38. - (void)gtm_shrinkToSize:(NSSize)size;
  39. // Remove reps larger than a given size
  40. - (void)gtm_removeRepresentationsLargerThanSize:(NSSize)size;
  41. // Return a dup shrunk to a given size
  42. - (NSImage *)gtm_duplicateOfSize:(NSSize)size;
  43. @end