PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/core/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
19#import <CoreGraphics/CoreGraphics.h>
20
21#include "GTMDefines.h"
22
23GTM_EXTERN_C_BEGIN
24
25//  Inscribe a round rectangle inside of rectangle |rect| with a corner radius
26//  of |radius|
27//
28//  Args:
29//    rect: outer rectangle to inscribe into
30//    radius: radius of the corners. |radius| is clamped internally
31//            to be no larger than the smaller of half |rect|'s width or height
32void GTMCGContextAddRoundRect(CGContextRef context,
33                              CGRect rect,
34                              CGFloat radius);
35
36//  Adds a path which is a round rectangle inscribed inside of rectangle |rect|
37//  with a corner radius of |radius|
38//
39//  Args:
40//    path: path to add the rounded rectangle to
41//       m: matrix modifying the round rect
42//    rect: outer rectangle to inscribe into
43//    radius: radius of the corners. |radius| is clamped internally
44//            to be no larger than the smaller of half |rect|'s width or height
45void GTMCGPathAddRoundRect(CGMutablePathRef path,
46                           const CGAffineTransform *m,
47                           CGRect rect,
48                           CGFloat radius);
49
50// Allocates a new rounded corner rectangle path.
51// DEPRECATED. Please use one of the above.
52CGPathRef GTMCreateRoundedRectPath(CGRect rect, CGFloat radius);
53
54GTM_EXTERN_C_END