PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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