Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / _c_p_shadow_view_8j_source.html

Full commit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Mirrored from cappuccino.org/learn/documentation/_c_p_shadow_view_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:31 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: AppKit/CPShadowView.j Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>AppKit/CPShadowView.j</h1><a href="_c_p_shadow_view_8j.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * CPShadowView.j</span>
<a name="l00003"></a>00003 <span class="comment"> * AppKit</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Created by Francisco Tolmasky.</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright 2008, 280 North, Inc.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00009"></a>00009 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00010"></a>00010 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00011"></a>00011 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00016"></a>00016 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00019"></a>00019 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 @<span class="keyword">import</span> &lt;Foundation/<a class="code" href="class_c_p_bundle.html" title="Groups information about an application&amp;#39;s code &amp;amp; resources.">CPBundle</a>.j&gt;
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 @<span class="keyword">import</span> <span class="stringliteral">&quot;CGGeometry.j&quot;</span>
<a name="l00026"></a>00026 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPImage.j&quot;</span>
<a name="l00027"></a>00027 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPImageView.j&quot;</span>
<a name="l00028"></a>00028 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPView.j&quot;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="_c_g_geometry_8h.html">CoreGraphics/CGGeometry.h</a>&quot;</span>
<a name="l00032"></a>00032 
<a name="l00033"></a><a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">00033</a> <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a>   = 0;
<a name="l00034"></a><a class="code" href="_c_p_shadow_view_8j.html#a64a71983c88aee8b179cf03e77ea47f8">00034</a> <a class="code" href="_c_p_shadow_view_8j.html#a64a71983c88aee8b179cf03e77ea47f8">CPHeavyShadow</a>   = 1;
<a name="l00035"></a>00035 
<a name="l00036"></a><a class="code" href="_c_p_shadow_view_8j.html#a9286ec04eac9242e53bbb9050557a2ff">00036</a> var <a class="code" href="_c_p_shadow_view_8j.html#a9286ec04eac9242e53bbb9050557a2ff">CPShadowViewLightBackgroundColor</a>    = nil,
<a name="l00037"></a><a class="code" href="_c_p_shadow_view_8j.html#afa51f2e785cfa215122f6ef87aec72be">00037</a>     <a class="code" href="_c_p_shadow_view_8j.html#afa51f2e785cfa215122f6ef87aec72be">CPShadowViewHeavyBackgroundColor</a>    = nil;
<a name="l00038"></a>00038     
<a name="l00039"></a><a class="code" href="_c_p_shadow_view_8j.html#a44d24602f1e6504dbf5c81367a448ec9">00039</a> var <a class="code" href="_c_p_shadow_view_8j.html#a44d24602f1e6504dbf5c81367a448ec9">LIGHT_LEFT_INSET</a>    = 3.0,
<a name="l00040"></a><a class="code" href="_c_p_shadow_view_8j.html#a312b296066a3b77368a25c19c00dea18">00040</a>     <a class="code" href="_c_p_shadow_view_8j.html#a312b296066a3b77368a25c19c00dea18">LIGHT_RIGHT_INSET</a>   = 3.0,
<a name="l00041"></a><a class="code" href="_c_p_shadow_view_8j.html#adbb62ac5316e9885a1d58d7dff47d676">00041</a>     <a class="code" href="_c_p_shadow_view_8j.html#adbb62ac5316e9885a1d58d7dff47d676">LIGHT_TOP_INSET</a>     = 3.0,
<a name="l00042"></a><a class="code" href="_c_p_shadow_view_8j.html#acaefb47bee5944c946d6688f2a5110cc">00042</a>     <a class="code" href="_c_p_shadow_view_8j.html#acaefb47bee5944c946d6688f2a5110cc">LIGHT_BOTTOM_INSET</a>  = 5.0,
<a name="l00043"></a>00043     
<a name="l00044"></a><a class="code" href="_c_p_shadow_view_8j.html#a863d1f74d784c712c63070a4c09a0f63">00044</a>     <a class="code" href="_c_p_shadow_view_8j.html#a863d1f74d784c712c63070a4c09a0f63">HEAVY_LEFT_INSET</a>    = 7.0,
<a name="l00045"></a><a class="code" href="_c_p_shadow_view_8j.html#ad92351bc59e1cc87a7a1624a87553994">00045</a>     <a class="code" href="_c_p_shadow_view_8j.html#ad92351bc59e1cc87a7a1624a87553994">HEAVY_RIGHT_INSET</a>   = 7.0,
<a name="l00046"></a><a class="code" href="_c_p_shadow_view_8j.html#aeb249fa3aedff8254f4323105ee3c54c">00046</a>     <a class="code" href="_c_p_shadow_view_8j.html#aeb249fa3aedff8254f4323105ee3c54c">HEAVY_TOP_INSET</a>     = 5.0,
<a name="l00047"></a><a class="code" href="_c_p_shadow_view_8j.html#aba3a65be72352ae2832b870e9b300405">00047</a>     <a class="code" href="_c_p_shadow_view_8j.html#aba3a65be72352ae2832b870e9b300405">HEAVY_BOTTOM_INSET</a>  = 5.0;
<a name="l00048"></a>00048 
<a name="l00053"></a><a class="code" href="class_c_p_shadow_view.html">00053</a> <span class="keyword">@implementation </span><a class="code" href="class_c_p_shadow_view.html">CPShadowView</a> : <a class="code" href="class_c_p_view.html">CPView</a>
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055     CPShadowWeight  _weight;
<a name="l00056"></a>00056 }
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="class_c_p_shadow_view.html#aa27063877e7105c41141b9a5cb22e52e">00058</a> + (void)initialize
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060     <span class="keywordflow">if</span> (<span class="keyword">self</span> != [<a class="code" href="class_c_p_shadow_view.html">CPShadowView</a> <span class="keyword">class</span>])
<a name="l00061"></a>00061         <span class="keywordflow">return</span>;
<a name="l00062"></a>00062 
<a name="l00063"></a>00063     var bundle = [<a class="code" href="class_c_p_bundle.html" title="Groups information about an application&amp;#39;s code &amp;amp; resources.">CPBundle</a> <a class="code" href="class_c_p_bundle.html#a6b2401dce4d84d49261126169d966567">bundleForClass</a>:[<span class="keyword">self</span> class]];
<a name="l00064"></a>00064     
<a name="l00065"></a>00065     <a class="code" href="_c_p_shadow_view_8j.html#a9286ec04eac9242e53bbb9050557a2ff">CPShadowViewLightBackgroundColor</a> = [<a class="code" href="class_c_p_color.html">CPColor</a> colorWithPatternImage:[[<a class="code" href="class_c_p_nine_part_image.html">CPNinePartImage</a> alloc] initWithImageSlices:
<a name="l00066"></a>00066         [
<a name="l00067"></a>00067             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightTopLeft.png&quot;] size:CGSizeMake(9.0, 9.0)],
<a name="l00068"></a>00068             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightTop.png&quot;] size:CGSizeMake(1.0, 9.0)],
<a name="l00069"></a>00069             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightTopRight.png&quot;] size:CGSizeMake(9.0, 9.0)],
<a name="l00070"></a>00070             
<a name="l00071"></a>00071             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightLeft.png&quot;] size:CGSizeMake(9.0, 1.0)],
<a name="l00072"></a>00072             nil,
<a name="l00073"></a>00073             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightRight.png&quot;] size:CGSizeMake(9.0, 1.0)],
<a name="l00074"></a>00074             
<a name="l00075"></a>00075             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightBottomLeft.png&quot;] size:CGSizeMake(9.0, 9.0)],
<a name="l00076"></a>00076             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightBottom.png&quot;] size:CGSizeMake(1.0, 9.0)],
<a name="l00077"></a>00077             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewLightBottomRight.png&quot;] size:CGSizeMake(9.0, 9.0)]
<a name="l00078"></a>00078         ]]];
<a name="l00079"></a>00079         
<a name="l00080"></a>00080     <a class="code" href="_c_p_shadow_view_8j.html#afa51f2e785cfa215122f6ef87aec72be">CPShadowViewHeavyBackgroundColor</a> = [<a class="code" href="class_c_p_color.html">CPColor</a> colorWithPatternImage:[[<a class="code" href="class_c_p_nine_part_image.html">CPNinePartImage</a> alloc] initWithImageSlices:
<a name="l00081"></a>00081         [
<a name="l00082"></a>00082             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyTopLeft.png&quot;] size:CGSizeMake(17.0, 17.0)],
<a name="l00083"></a>00083             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyTop.png&quot;] size:CGSizeMake(1.0, 17.0)],
<a name="l00084"></a>00084             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyTopRight.png&quot;] size:CGSizeMake(17.0, 17.0)],
<a name="l00085"></a>00085             
<a name="l00086"></a>00086             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyLeft.png&quot;] size:CGSizeMake(17.0, 1.0)],
<a name="l00087"></a>00087             nil,
<a name="l00088"></a>00088             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyRight.png&quot;] size:CGSizeMake(17.0, 1.0)],
<a name="l00089"></a>00089             
<a name="l00090"></a>00090             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyBottomLeft.png&quot;] size:CGSizeMake(17.0, 17.0)],
<a name="l00091"></a>00091             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyBottom.png&quot;] size:CGSizeMake(1.0, 17.0)],
<a name="l00092"></a>00092             [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPShadowView/CPShadowViewHeavyBottomRight.png&quot;] size:CGSizeMake(17.0, 17.0)]
<a name="l00093"></a>00093         ]]];
<a name="l00094"></a>00094 }
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="class_c_p_shadow_view.html#aa40e836db3e78837fe9ae363313ca34a">00096</a> - (id)initWithFrame:(CGRect)aFrame
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098     <span class="keyword">self</span> = [<span class="keyword">super</span> initWithFrame:aFrame];
<a name="l00099"></a>00099     
<a name="l00100"></a>00100     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00101"></a>00101     {
<a name="l00102"></a>00102         _weight = <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a>;
<a name="l00103"></a>00103         
<a name="l00104"></a>00104         [<span class="keyword">self</span> setBackgroundColor:CPShadowViewLightBackgroundColor];
<a name="l00105"></a>00105         
<a name="l00106"></a>00106         [<span class="keyword">self</span> setHitTests:NO];
<a name="l00107"></a>00107     }
<a name="l00108"></a>00108     
<a name="l00109"></a>00109     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00110"></a>00110 }
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="class_c_p_shadow_view.html#a2e0a90c624a554446ba27c8e0143c5c0">00112</a> - (void)setWeight:(CPShadowWeight)aWeight
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114     <span class="keywordflow">if</span> (_weight == aWeight)
<a name="l00115"></a>00115         <span class="keywordflow">return</span>;
<a name="l00116"></a>00116     
<a name="l00117"></a>00117     _weight = aWeight;
<a name="l00118"></a>00118     
<a name="l00119"></a>00119     <span class="keywordflow">if</span> (_weight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a>)
<a name="l00120"></a>00120         [<span class="keyword">self</span> setBackgroundColor:CPShadowViewLightBackgroundColor];
<a name="l00121"></a>00121 
<a name="l00122"></a>00122     <span class="keywordflow">else</span>
<a name="l00123"></a>00123         [<span class="keyword">self</span> setBackgroundColor:CPShadowViewHeavyBackgroundColor];
<a name="l00124"></a>00124 }
<a name="l00125"></a>00125 
<a name="l00126"></a><a class="code" href="class_c_p_shadow_view.html#a8c225187a6c3ce1c2d3a779ad098ed12">00126</a> - (float)leftInset
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128     <span class="keywordflow">return</span> _weight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a> ? <a class="code" href="_c_p_shadow_view_8j.html#a44d24602f1e6504dbf5c81367a448ec9">LIGHT_LEFT_INSET</a> : <a class="code" href="_c_p_shadow_view_8j.html#a863d1f74d784c712c63070a4c09a0f63">HEAVY_LEFT_INSET</a>;
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 
<a name="l00131"></a><a class="code" href="class_c_p_shadow_view.html#a2a2bf03d24e3431e7c85646134307de5">00131</a> - (float)rightInset
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133     <span class="keywordflow">return</span> _weight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a> ? <a class="code" href="_c_p_shadow_view_8j.html#a312b296066a3b77368a25c19c00dea18">LIGHT_RIGHT_INSET</a> : <a class="code" href="_c_p_shadow_view_8j.html#ad92351bc59e1cc87a7a1624a87553994">HEAVY_RIGHT_INSET</a>;
<a name="l00134"></a>00134 }
<a name="l00135"></a>00135 
<a name="l00136"></a><a class="code" href="class_c_p_shadow_view.html#a3a8fab9b0574a5a1b4573752b3f91a8c">00136</a> - (float)topInset
<a name="l00137"></a>00137 {
<a name="l00138"></a>00138     <span class="keywordflow">return</span> _weight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a> ? <a class="code" href="_c_p_shadow_view_8j.html#adbb62ac5316e9885a1d58d7dff47d676">LIGHT_TOP_INSET</a> : <a class="code" href="_c_p_shadow_view_8j.html#aeb249fa3aedff8254f4323105ee3c54c">HEAVY_TOP_INSET</a>;
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140 
<a name="l00141"></a><a class="code" href="class_c_p_shadow_view.html#a30293170e7a727215ea27b3c989fa0f3">00141</a> - (float)bottomInset
<a name="l00142"></a>00142 {
<a name="l00143"></a>00143     <span class="keywordflow">return</span> _weight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a> ? <a class="code" href="_c_p_shadow_view_8j.html#acaefb47bee5944c946d6688f2a5110cc">LIGHT_BOTTOM_INSET</a> : <a class="code" href="_c_p_shadow_view_8j.html#aba3a65be72352ae2832b870e9b300405">HEAVY_BOTTOM_INSET</a>;
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 
<a name="l00146"></a><a class="code" href="class_c_p_shadow_view.html#abfaf6fa01415c6156f4d8ddef350c7de">00146</a> - (float)horizontalInset
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148     <span class="keywordflow">if</span> (_weight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a>)
<a name="l00149"></a>00149         <span class="keywordflow">return</span> <a class="code" href="_c_p_shadow_view_8j.html#a44d24602f1e6504dbf5c81367a448ec9">LIGHT_LEFT_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#a312b296066a3b77368a25c19c00dea18">LIGHT_RIGHT_INSET</a>;
<a name="l00150"></a>00150     
<a name="l00151"></a>00151     <span class="keywordflow">return</span> <a class="code" href="_c_p_shadow_view_8j.html#a863d1f74d784c712c63070a4c09a0f63">HEAVY_LEFT_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#ad92351bc59e1cc87a7a1624a87553994">HEAVY_RIGHT_INSET</a>;
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153 
<a name="l00154"></a><a class="code" href="class_c_p_shadow_view.html#aee8fb50fd3e7ae2fcd4c5c264f2fa6fc">00154</a> - (float)verticalInset
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156     <span class="keywordflow">if</span> (_weight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a>)
<a name="l00157"></a>00157         <span class="keywordflow">return</span> <a class="code" href="_c_p_shadow_view_8j.html#adbb62ac5316e9885a1d58d7dff47d676">LIGHT_TOP_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#acaefb47bee5944c946d6688f2a5110cc">LIGHT_BOTTOM_INSET</a>;
<a name="l00158"></a>00158     
<a name="l00159"></a>00159     <span class="keywordflow">return</span> <a class="code" href="_c_p_shadow_view_8j.html#aeb249fa3aedff8254f4323105ee3c54c">HEAVY_TOP_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#aba3a65be72352ae2832b870e9b300405">HEAVY_BOTTOM_INSET</a>;
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 
<a name="l00162"></a><a class="code" href="class_c_p_shadow_view.html#a672f952380af7063761427ec0ee67433">00162</a> + (CGRect)frameForContentFrame:(CGRect)aFrame withWeight:(CPShadowWeight)aWeight
<a name="l00163"></a>00163 {
<a name="l00164"></a>00164     <span class="keywordflow">if</span> (aWeight == <a class="code" href="_c_p_shadow_view_8j.html#aca24f79b5f3062ad24ec9fa44d3d31f2">CPLightShadow</a>)
<a name="l00165"></a>00165         <span class="keywordflow">return</span> <a class="code" href="_c_g_geometry_8j.html#aca150c0049e24797c6271bad7bc90610">CGRectMake</a>(_CGRectGetMinX(aFrame) - <a class="code" href="_c_p_shadow_view_8j.html#a44d24602f1e6504dbf5c81367a448ec9">LIGHT_LEFT_INSET</a>, _CGRectGetMinY(aFrame) - <a class="code" href="_c_p_shadow_view_8j.html#adbb62ac5316e9885a1d58d7dff47d676">LIGHT_TOP_INSET</a>, _CGRectGetWidth(aFrame) + <a class="code" href="_c_p_shadow_view_8j.html#a44d24602f1e6504dbf5c81367a448ec9">LIGHT_LEFT_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#a312b296066a3b77368a25c19c00dea18">LIGHT_RIGHT_INSET</a>, _CGRectGetHeight(aFrame) + <a class="code" href="_c_p_shadow_view_8j.html#adbb62ac5316e9885a1d58d7dff47d676">LIGHT_TOP_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#acaefb47bee5944c946d6688f2a5110cc">LIGHT_BOTTOM_INSET</a>);
<a name="l00166"></a>00166     <span class="keywordflow">else</span>
<a name="l00167"></a>00167         <span class="keywordflow">return</span> <a class="code" href="_c_g_geometry_8j.html#aca150c0049e24797c6271bad7bc90610">CGRectMake</a>(_CGRectGetMinX(aFrame) - <a class="code" href="_c_p_shadow_view_8j.html#a863d1f74d784c712c63070a4c09a0f63">HEAVY_LEFT_INSET</a>, _CGRectGetMinY(aFrame) - <a class="code" href="_c_p_shadow_view_8j.html#aeb249fa3aedff8254f4323105ee3c54c">HEAVY_TOP_INSET</a>, _CGRectGetWidth(aFrame) + <a class="code" href="_c_p_shadow_view_8j.html#a863d1f74d784c712c63070a4c09a0f63">HEAVY_LEFT_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#ad92351bc59e1cc87a7a1624a87553994">HEAVY_RIGHT_INSET</a>, _CGRectGetHeight(aFrame) + <a class="code" href="_c_p_shadow_view_8j.html#aeb249fa3aedff8254f4323105ee3c54c">HEAVY_TOP_INSET</a> + <a class="code" href="_c_p_shadow_view_8j.html#aba3a65be72352ae2832b870e9b300405">HEAVY_BOTTOM_INSET</a>);
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169 
<a name="l00170"></a><a class="code" href="class_c_p_shadow_view.html#a1089971574e0060b0a44991a6b456924">00170</a> - (CGRect)frameForContentFrame:(CGRect)aFrame
<a name="l00171"></a>00171 {
<a name="l00172"></a>00172     <span class="keywordflow">return</span> [[<span class="keyword">self</span> class] frameForContentFrame:aFrame withWeight:_weight];
<a name="l00173"></a>00173 }
<a name="l00174"></a>00174 
<a name="l00175"></a><a class="code" href="class_c_p_shadow_view.html#abe8f6bf9471d05986011814b02267293">00175</a> - (void)setFrameForContentFrame:(CGRect)aFrame
<a name="l00176"></a>00176 {
<a name="l00177"></a>00177     [<span class="keyword">self</span> setFrame:[<span class="keyword">self</span> <a class="code" href="class_c_p_shadow_view.html#a1089971574e0060b0a44991a6b456924">frameForContentFrame</a>:aFrame]];
<a name="l00178"></a>00178 }
<a name="l00179"></a>00179 
<a name="l00180"></a>00180 <span class="keyword">@end</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:32:55 2010 for Cappuccino API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>

<!-- Mirrored from cappuccino.org/learn/documentation/_c_p_shadow_view_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:31 GMT -->
</html>