/core/externals/update-engine/externals/google-toolbox-for-mac/iPhone/GTMRoundedRectPath.h

http://macfuse.googlecode.com/ · C++ Header · 54 lines · 12 code · 7 blank · 35 comment · 0 complexity · 9248df8abfcc0704b7c60d71b13b835b MD5 · raw file

  1. //
  2. // GTMRoundedRectPath.h
  3. //
  4. // Copyright 2010 Google Inc.
  5. //
  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
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  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.
  17. //
  18. #import <CoreGraphics/CoreGraphics.h>
  19. #include "GTMDefines.h"
  20. GTM_EXTERN_C_BEGIN
  21. // Inscribe a round rectangle inside of rectangle |rect| with a corner radius
  22. // of |radius|
  23. //
  24. // Args:
  25. // rect: outer rectangle to inscribe into
  26. // radius: radius of the corners. |radius| is clamped internally
  27. // to be no larger than the smaller of half |rect|'s width or height
  28. void GTMCGContextAddRoundRect(CGContextRef context,
  29. CGRect rect,
  30. CGFloat radius);
  31. // Adds a path which is a round rectangle inscribed inside of rectangle |rect|
  32. // with a corner radius of |radius|
  33. //
  34. // Args:
  35. // path: path to add the rounded rectangle to
  36. // m: matrix modifying the round rect
  37. // rect: outer rectangle to inscribe into
  38. // radius: radius of the corners. |radius| is clamped internally
  39. // to be no larger than the smaller of half |rect|'s width or height
  40. void GTMCGPathAddRoundRect(CGMutablePathRef path,
  41. const CGAffineTransform *m,
  42. CGRect rect,
  43. CGFloat radius);
  44. // Allocates a new rounded corner rectangle path.
  45. // DEPRECATED. Please use one of the above.
  46. CGPathRef GTMCreateRoundedRectPath(CGRect rect, CGFloat radius);
  47. GTM_EXTERN_C_END