/core/externals/google-toolbox-for-mac/AppKit/GTMNSBezierPath+Shading.h

http://macfuse.googlecode.com/ · C++ Header · 121 lines · 19 code · 7 blank · 95 comment · 0 complexity · 6a50e70ba5083f9e9a6fe1c2f4a1f304 MD5 · raw file

  1. //
  2. // GTMNSBezierPath+Shading.h
  3. //
  4. // Category for radial and axial stroke and fill functions for NSBezierPaths
  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 <Cocoa/Cocoa.h>
  21. #import "GTMDefines.h"
  22. @protocol GTMShading;
  23. //
  24. /// Category for radial and axial stroke and fill functions for NSBezierPaths
  25. //
  26. @interface NSBezierPath (GTMBezierPathShadingAdditions)
  27. /// Stroke the path axially with a color blend defined by |shading|.
  28. //
  29. /// The fill will extend from |fromPoint| to |toPoint| and will extend
  30. /// indefinitely perpendicular to the axis of the line defined by the
  31. /// two points. You can extend beyond the |fromPoint|/|toPoint by setting
  32. /// |extendingStart|/|extendingEnd| respectively.
  33. //
  34. // Args:
  35. // fromPoint: point to start the shading at
  36. // toPoint: point to end the shading at
  37. // extendingStart: should we extend the shading before |fromPoint| using
  38. // the first color in our shading?
  39. // extendingEnd: should we extend the shading after |toPoint| using the
  40. // last color in our shading?
  41. // shading: the shading to use to take our colors from.
  42. //
  43. - (void)gtm_strokeAxiallyFrom:(NSPoint)fromPoint to:(NSPoint)toPoint
  44. extendingStart:(BOOL)extendingStart extendingEnd:(BOOL)extendingEnd
  45. shading:(id<GTMShading>)shading;
  46. /// Stroke the path radially with a color blend defined by |shading|.
  47. //
  48. /// The fill will extend from the circle with center |fromPoint|
  49. /// and radius |fromRadius| to the circle with center |toPoint|
  50. /// with radius |toRadius|.
  51. /// You can extend beyond the |fromPoint|/|toPoint| by setting
  52. /// |extendingStart|/|extendingEnd| respectively.
  53. //
  54. // Args:
  55. // fromPoint: center of the circle to start the shading at
  56. // fromRadius: radius of the circle to start the shading at
  57. // toPoint: center of the circle to to end the shading at
  58. // toRadius: raidus of the circle to end the shading at
  59. // extendingStart: should we extend the shading before |fromPoint| using
  60. // the first color in our shading?
  61. // extendingEnd: should we extend the shading after |toPoint| using the
  62. // last color in our shading?
  63. // shading: the shading to use to take our colors from.
  64. //
  65. - (void)gtm_strokeRadiallyFrom:(NSPoint)fromPoint fromRadius:(CGFloat)fromRadius
  66. to:(NSPoint)toPoint toRadius:(CGFloat)toRadius
  67. extendingStart:(BOOL)extendingStart extendingEnd:(BOOL)extendingEnd
  68. shading:(id<GTMShading>)shading;
  69. /// Fill the path radially with a color blend defined by |shading|.
  70. //
  71. /// The fill will extend from the circle with center |fromPoint|
  72. /// and radius |fromRadius| to the circle with center |toPoint|
  73. /// with radius |toRadius|.
  74. /// You can extend beyond the |fromPoint|/|toPoint by setting
  75. /// |extendingStart|/|extendingEnd| respectively.
  76. //
  77. // Args:
  78. // fromPoint: center of the circle to start the shading at
  79. // fromRadius: radius of the circle to start the shading at
  80. // toPoint: center of the circle to to end the shading at
  81. // toRadius: radius of the circle to end the shading at
  82. // extendingStart: should we extend the shading before |fromPoint| using
  83. // the first color in our shading?
  84. // extendingEnd: should we extend the shading after |toPoint| using the
  85. // last color in our shading?
  86. // shading: the shading to use to take our colors from.
  87. //
  88. - (void)gtm_fillAxiallyFrom:(NSPoint)fromPoint to:(NSPoint)toPoint
  89. extendingStart:(BOOL)extendingStart extendingEnd:(BOOL)extendingEnd
  90. shading:(id<GTMShading>)shading;
  91. /// Fill the path radially with a color blend defined by |shading|.
  92. //
  93. /// The fill will extend from the circle with center |fromPoint|
  94. /// and radius |fromRadius| to the circle with center |toPoint|
  95. /// with radius |toRadius|.
  96. /// You can extend beyond the |fromPoint|/|toPoint by setting
  97. /// |extendingStart|/|extendingEnd| respectively.
  98. //
  99. // Args:
  100. // fromPoint: center of the circle to start the shading at
  101. // fromRadius: radius of the circle to start the shading at
  102. // toPoint: center of the circle to to end the shading at
  103. // toRadius: radius of the circle to end the shading at
  104. // extendingStart: should we extend the shading before |fromPoint| using
  105. // the first color in our shading?
  106. // extendingEnd: should we extend the shading after |toPoint| using the
  107. // last color in our shading?
  108. // shading: the shading to use to take our colors from.
  109. //
  110. - (void)gtm_fillRadiallyFrom:(NSPoint)fromPoint fromRadius:(CGFloat)fromRadius
  111. to:(NSPoint)toPoint toRadius:(CGFloat)toRadius
  112. extendingStart:(BOOL)extendingStart extendingEnd:(BOOL)extendingEnd
  113. shading:(id<GTMShading>)shading;
  114. @end