PageRenderTime 25ms CodeModel.GetById 12ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/core/externals/update-engine/externals/google-toolbox-for-mac/AppKit/GTMNSBezierPath+RoundRect.h

http://macfuse.googlecode.com/
C++ Header | 73 lines | 18 code | 6 blank | 49 comment | 0 complexity | 1efe0fbb86f89b393052fd07576a8be2 MD5 | raw file
 1//
 2//  GTMNSBezierPath+RoundRect.h
 3//
 4//  Category for adding utility functions for creating
 5//  round rectangles.
 6//
 7//  Copyright 2006-2008 Google Inc.
 8//
 9//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
10//  use this file except in compliance with the License.  You may obtain a copy
11//  of the License at
12// 
13//  http://www.apache.org/licenses/LICENSE-2.0
14// 
15//  Unless required by applicable law or agreed to in writing, software
16//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
18//  License for the specific language governing permissions and limitations under
19//  the License.
20//
21
22#import <Cocoa/Cocoa.h>
23#import "GTMDefines.h"
24
25///  Category for adding utility functions for creating round rectangles.
26@interface NSBezierPath (GMBezierPathRoundRectAdditions) 
27
28///  Inscribe a round rectangle inside of rectangle |rect| with a corner radius of |radius|
29//
30//  Args:
31//    rect: outer rectangle to inscribe into
32//    radius: radius of the corners. |radius| is clamped internally
33//            to be no larger than the smaller of half |rect|'s width or height
34//
35//  Returns:
36//    Auto released NSBezierPath
37+ (NSBezierPath *)gtm_bezierPathWithRoundRect:(NSRect)rect
38                                 cornerRadius:(CGFloat)radius;
39
40///  Inscribe a round rectangle inside of rectangle |rect| with corner radii specified
41//
42//  Args:
43//    rect: outer rectangle to inscribe into
44//    radius*: radii of the corners
45//
46//  Returns:
47//    Auto released NSBezierPath
48+ (NSBezierPath *)gtm_bezierPathWithRoundRect:(NSRect)rect
49                          topLeftCornerRadius:(CGFloat)radiusTL
50                         topRightCornerRadius:(CGFloat)radiusTR
51                       bottomLeftCornerRadius:(CGFloat)radiusBL
52                      bottomRightCornerRadius:(CGFloat)radiusBR;
53
54///  Adds a path which is a round rectangle inscribed inside of rectangle |rect| with a corner radius of |radius|
55//
56//  Args:
57//    rect: outer rectangle to inscribe into
58//    radius: radius of the corners. |radius| is clamped internally
59//            to be no larger than the smaller of half |rect|'s width or height
60- (void)gtm_appendBezierPathWithRoundRect:(NSRect)rect
61                             cornerRadius:(CGFloat)radius;
62
63///  Adds a path which is a round rectangle inscribed inside of rectangle |rect| with a corner radii specified
64//
65//  Args:
66//    rect: outer rectangle to inscribe into
67//    radius*: radii of the corners
68- (void)gtm_appendBezierPathWithRoundRect:(NSRect)rect
69                      topLeftCornerRadius:(CGFloat)radiusTL
70                     topRightCornerRadius:(CGFloat)radiusTR
71                   bottomLeftCornerRadius:(CGFloat)radiusBL
72                  bottomRightCornerRadius:(CGFloat)radiusBR;
73@end