Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / _c_p_d_o_m_display_server_8h_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_d_o_m_display_server_8h_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:42 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: AppKit/Platform/DOM/CPDOMDisplayServer.h 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/Platform/DOM/CPDOMDisplayServer.h</h1><a href="_c_p_d_o_m_display_server_8h.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"> * CPDOMDisplayServer.h</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><a class="code" href="_c_p_d_o_m_display_server_8h.html#a39fcafc87176380e911a7e863a41dc4f">00023</a> <span class="preprocessor">#define DOM_OPTIMIZATION 0</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#af092b501165b25659147d59130c34ad8">00025</a> <span class="preprocessor">#define SetStyleOrigin      0</span>
<a name="l00026"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#aa893b82b73074c3fe0e0422ebcb503cd">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define SetStyleLeftTop     0</span>
<a name="l00027"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a62826c71e13b704a2608091a52b8f0cb">00027</a> <span class="preprocessor"></span><span class="preprocessor">#define SetStyleRightTop    1</span>
<a name="l00028"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a30b3d88470190f1ea827c459a6ccea86">00028</a> <span class="preprocessor"></span><span class="preprocessor">#define SetStyleLeftBottom  2</span>
<a name="l00029"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#ac126a9a394dea9d91a6b5b6b758f6694">00029</a> <span class="preprocessor"></span><span class="preprocessor">#define SetStyleRightBottom 3</span>
<a name="l00030"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#ad92443c0f11977ba923b19f55a30dda2">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define SetStyleSize        4</span>
<a name="l00031"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a4dd04594926f50a20cbcf83eac8ac393">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define SetSize             5</span>
<a name="l00032"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a50e05dcafb644b34ff55b0fc20a461f0">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define AppendChild         6</span>
<a name="l00033"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a01eab20e68d3f8717577f95e044dbf00">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define InsertBefore        7</span>
<a name="l00034"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#ade6850873d7799f593a23483f9c2b187">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define RemoveChild         8</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#afa4ca6307032e932333b53300166a9ed">00036</a> <span class="preprocessor">#define CPDOMDisplayServerSetStyleOrigin(anInstruction, aDOMElement, aTransform, x, y)\</span>
<a name="l00037"></a>00037 <span class="preprocessor">    if (!aDOMElement.CPDOMDisplayContext)\</span>
<a name="l00038"></a>00038 <span class="preprocessor">        aDOMElement.CPDOMDisplayContext = [];\</span>
<a name="l00039"></a>00039 <span class="preprocessor">    var __index = aDOMElement.CPDOMDisplayContext[SetStyleOrigin];\</span>
<a name="l00040"></a>00040 <span class="preprocessor">    if (!(__index &gt;= 0))\</span>
<a name="l00041"></a>00041 <span class="preprocessor">    {\</span>
<a name="l00042"></a>00042 <span class="preprocessor">        __index = aDOMElement.CPDOMDisplayContext[SetStyleOrigin] = CPDOMDisplayServerInstructionCount;\</span>
<a name="l00043"></a>00043 <span class="preprocessor">        CPDOMDisplayServerInstructionCount += 5;\</span>
<a name="l00044"></a>00044 <span class="preprocessor">    }\</span>
<a name="l00045"></a>00045 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index] = anInstruction;\</span>
<a name="l00046"></a>00046 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 1] = aDOMElement;\</span>
<a name="l00047"></a>00047 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 2] = aTransform;\</span>
<a name="l00048"></a>00048 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 3] = x;\</span>
<a name="l00049"></a>00049 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 4] = y;</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#if !DOM_OPTIMIZATION</span>
<a name="l00051"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a75856b74f6280adbef51cd07108e12fa">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define CPDOMDisplayServerSetStyleLeftTop(aDOMElement, aTransform, aLeft, aTop) \</span>
<a name="l00052"></a>00052 <span class="preprocessor">if (aTransform) var ____p = _CGPointApplyAffineTransform(CGPointMake(aLeft, aTop), aTransform); \</span>
<a name="l00053"></a>00053 <span class="preprocessor">else var ____p = _CGPointMake(aLeft, aTop); \</span>
<a name="l00054"></a>00054 <span class="preprocessor">aDOMElement.style.left = ROUND(____p.x) + &quot;px&quot;;\</span>
<a name="l00055"></a>00055 <span class="preprocessor">aDOMElement.style.top = ROUND(____p.y) + &quot;px&quot;;</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span>
<a name="l00057"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a6a8f184ccedba8cf584fa13738dc8a24">00057</a> <span class="preprocessor">#define CPDOMDisplayServerSetStyleRightTop(aDOMElement, aTransform, aRight, aTop) \</span>
<a name="l00058"></a>00058 <span class="preprocessor">if (aTransform) var ____p = _CGPointApplyAffineTransform(CGPointMake(aRight, aTop), aTransform); \</span>
<a name="l00059"></a>00059 <span class="preprocessor">else var ____p = _CGPointMake(aRight, aTop); \</span>
<a name="l00060"></a>00060 <span class="preprocessor">aDOMElement.style.right = ROUND(____p.x) + &quot;px&quot;;\</span>
<a name="l00061"></a>00061 <span class="preprocessor">aDOMElement.style.top = ROUND(____p.y) + &quot;px&quot;;</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span>
<a name="l00063"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#aea260a7ed0a684da6aee093e415fb065">00063</a> <span class="preprocessor">#define CPDOMDisplayServerSetStyleLeftBottom(aDOMElement, aTransform, aLeft, aBottom) \</span>
<a name="l00064"></a>00064 <span class="preprocessor">if (aTransform) var ____p = _CGPointApplyAffineTransform(CGPointMake(aLeft, aBottom), aTransform); \</span>
<a name="l00065"></a>00065 <span class="preprocessor">else var ____p = _CGPointMake(aLeft, aBottom); \</span>
<a name="l00066"></a>00066 <span class="preprocessor">aDOMElement.style.left = ROUND(____p.x) + &quot;px&quot;;\</span>
<a name="l00067"></a>00067 <span class="preprocessor">aDOMElement.style.bottom = ROUND(____p.y) + &quot;px&quot;;</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a557b46bbca7435b7226a4c6dcbe622ed">00069</a> <span class="preprocessor">#define CPDOMDisplayServerSetStyleRightBottom(aDOMElement, aTransform, aRight, aBottom) \</span>
<a name="l00070"></a>00070 <span class="preprocessor">if (aTransform) var ____p = _CGPointApplyAffineTransform(CGPointMake(aRight, aBottom), aTransform); \</span>
<a name="l00071"></a>00071 <span class="preprocessor">else var ____p = _CGPointMake(aRight, aBottom); \</span>
<a name="l00072"></a>00072 <span class="preprocessor">aDOMElement.style.right = ROUND(____p.x) + &quot;px&quot;;\</span>
<a name="l00073"></a>00073 <span class="preprocessor">aDOMElement.style.bottom = ROUND(____p.y) + &quot;px&quot;;</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span>
<a name="l00075"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#adb3fd88967e3b3b1a999c5dbb5aa7068">00075</a> <span class="preprocessor">#define CPDOMDisplayServerSetStyleSize(aDOMElement, aWidth, aHeight) \</span>
<a name="l00076"></a>00076 <span class="preprocessor">    aDOMElement.style.width = MAX(0.0, ROUND(aWidth)) + &quot;px&quot;;\</span>
<a name="l00077"></a>00077 <span class="preprocessor">    aDOMElement.style.height = MAX(0.0, ROUND(aHeight)) + &quot;px&quot;;</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span>
<a name="l00079"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#ad8b484cc0c87e172a5a659d970d61621">00079</a> <span class="preprocessor">#define CPDOMDisplayServerSetSize(aDOMElement, aWidth, aHeight) \</span>
<a name="l00080"></a>00080 <span class="preprocessor">    aDOMElement.width = MAX(0.0, ROUND(aWidth));\</span>
<a name="l00081"></a>00081 <span class="preprocessor">    aDOMElement.height = MAX(0.0, ROUND(aHeight));</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>
<a name="l00083"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a7674b6a309595bfd6886e83b5a7df3b2">00083</a> <span class="preprocessor">#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement) aParentElement.appendChild(aChildElement)</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>
<a name="l00085"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a1aa00c9df58c03e393d941e22b99b576">00085</a> <span class="preprocessor">#define CPDOMDisplayServerInsertBefore(aParentElement, aChildElement, aBeforeElement) aParentElement.insertBefore(aChildElement, aBeforeElement)</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span>
<a name="l00087"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#a516e8fe3a142194da3a9aa3cc9da1130">00087</a> <span class="preprocessor">#define CPDOMDisplayServerRemoveChild(aParentElement, aChildElement) aParentElement.removeChild(aChildElement)</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span>
<a name="l00089"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#aeabf1da3bedf182943e611cf9d32de1f">00089</a> <span class="preprocessor">#define PREPARE_DOM_OPTIMIZATION()</span>
<a name="l00090"></a><a class="code" href="_c_p_d_o_m_display_server_8h.html#acc38712642455ff9e2388b1ca9f2d30b">00090</a> <span class="preprocessor"></span><span class="preprocessor">#define EXECUTE_DOM_INSTRUCTIONS()</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span>
<a name="l00092"></a>00092 <span class="preprocessor">#else</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#define CPDOMDisplayServerSetStyleLeftTop(aDOMElement, aTransform, aLeft, aTop) CPDOMDisplayServerSetStyleOrigin(SetStyleLeftTop, aDOMElement, aTransform, aLeft, aTop)</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span>
<a name="l00095"></a>00095 <span class="preprocessor">#define CPDOMDisplayServerSetStyleRightTop(aDOMElement, aTransform, aRight, aTop) CPDOMDisplayServerSetStyleOrigin(SetStyleRightTop, aDOMElement, aTransform, aRight, aTop)</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span>
<a name="l00097"></a>00097 <span class="preprocessor">#define CPDOMDisplayServerSetStyleLeftBottom(aDOMElement, aTransform, aLeft, aBottom) CPDOMDisplayServerSetStyleOrigin(SetStyleLeftBottom, aDOMElement, aTransform, aLeft, aBottom)</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span>
<a name="l00099"></a>00099 <span class="preprocessor">#define CPDOMDisplayServerSetStyleRightBottom(aDOMElement, aTransform, aRight, aBottom) CPDOMDisplayServerSetStyleOrigin(SetStyleRightBottom, aDOMElement, aTransform, aRight, aBottom)</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>
<a name="l00101"></a>00101 <span class="preprocessor">#define CPDOMDisplayServerSetStyleSize(aDOMElement, aWidth, aHeight)\</span>
<a name="l00102"></a>00102 <span class="preprocessor">    if (!aDOMElement.CPDOMDisplayContext)\</span>
<a name="l00103"></a>00103 <span class="preprocessor">        aDOMElement.CPDOMDisplayContext = [];\</span>
<a name="l00104"></a>00104 <span class="preprocessor">    var __index = aDOMElement.CPDOMDisplayContext[SetStyleSize];\</span>
<a name="l00105"></a>00105 <span class="preprocessor">    if (!(__index &gt;= 0))\</span>
<a name="l00106"></a>00106 <span class="preprocessor">    {\</span>
<a name="l00107"></a>00107 <span class="preprocessor">        __index = aDOMElement.CPDOMDisplayContext[SetStyleSize] = CPDOMDisplayServerInstructionCount;\</span>
<a name="l00108"></a>00108 <span class="preprocessor">        CPDOMDisplayServerInstructionCount += 4;\</span>
<a name="l00109"></a>00109 <span class="preprocessor">    }\</span>
<a name="l00110"></a>00110 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index] = SetStyleSize;\</span>
<a name="l00111"></a>00111 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 1] = aDOMElement;\</span>
<a name="l00112"></a>00112 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 2] = aWidth;\</span>
<a name="l00113"></a>00113 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 3] = aHeight;</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span>
<a name="l00115"></a>00115 <span class="preprocessor">#define CPDOMDisplayServerSetSize(aDOMElement, aWidth, aHeight)\</span>
<a name="l00116"></a>00116 <span class="preprocessor">    if (!aDOMElement.CPDOMDisplayContext)\</span>
<a name="l00117"></a>00117 <span class="preprocessor">        aDOMElement.CPDOMDisplayContext = [];\</span>
<a name="l00118"></a>00118 <span class="preprocessor">    var __index = aDOMElement.CPDOMDisplayContext[SetSize];\</span>
<a name="l00119"></a>00119 <span class="preprocessor">    if (!(__index &gt;= 0))\</span>
<a name="l00120"></a>00120 <span class="preprocessor">    {\</span>
<a name="l00121"></a>00121 <span class="preprocessor">        __index = aDOMElement.CPDOMDisplayContext[SetSize] = CPDOMDisplayServerInstructionCount;\</span>
<a name="l00122"></a>00122 <span class="preprocessor">        CPDOMDisplayServerInstructionCount += 4;\</span>
<a name="l00123"></a>00123 <span class="preprocessor">    }\</span>
<a name="l00124"></a>00124 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index] = SetSize;\</span>
<a name="l00125"></a>00125 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 1] = aDOMElement;\</span>
<a name="l00126"></a>00126 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 2] = aWidth;\</span>
<a name="l00127"></a>00127 <span class="preprocessor">    CPDOMDisplayServerInstructions[__index + 3] = aHeight;</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span>
<a name="l00129"></a>00129 <span class="preprocessor">#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement)\</span>
<a name="l00130"></a>00130 <span class="preprocessor">    if (aChildElement.CPDOMDisplayContext) aChildElement.CPDOMDisplayContext[SetStyleOrigin] = -1;\</span>
<a name="l00131"></a>00131 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = AppendChild;\</span>
<a name="l00132"></a>00132 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aParentElement;\</span>
<a name="l00133"></a>00133 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aChildElement;</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>
<a name="l00135"></a>00135 <span class="preprocessor">#define CPDOMDisplayServerInsertBefore(aParentElement, aChildElement, aBeforeElement)\</span>
<a name="l00136"></a>00136 <span class="preprocessor">    if (aChildElement.CPDOMDisplayContext) aChildElement.CPDOMDisplayContext[SetStyleOrigin] = -1;\</span>
<a name="l00137"></a>00137 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = InsertBefore;\</span>
<a name="l00138"></a>00138 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aParentElement;\</span>
<a name="l00139"></a>00139 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aChildElement;\</span>
<a name="l00140"></a>00140 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aBeforeElement;</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span>
<a name="l00142"></a>00142 <span class="preprocessor">#define CPDOMDisplayServerRemoveChild(aParentElement, aChildElement)\</span>
<a name="l00143"></a>00143 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = RemoveChild;\</span>
<a name="l00144"></a>00144 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aParentElement;\</span>
<a name="l00145"></a>00145 <span class="preprocessor">    CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aChildElement;</span>
<a name="l00146"></a>00146 <span class="preprocessor"></span>
<a name="l00147"></a>00147 <span class="preprocessor">#define PREPARE_DOM_OPTIMIZATION()\</span>
<a name="l00148"></a>00148 <span class="preprocessor">CPDOMDisplayServerInstructions = [];\</span>
<a name="l00149"></a>00149 <span class="preprocessor">CPDOMDisplayServerInstructionCount = 0;</span>
<a name="l00150"></a>00150 <span class="preprocessor"></span><span class="preprocessor">#define EXECUTE_DOM_INSTRUCTIONS()\</span>
<a name="l00151"></a>00151 <span class="preprocessor">    var index = 0;\</span>
<a name="l00152"></a>00152 <span class="preprocessor">    while (index &lt; CPDOMDisplayServerInstructionCount)\</span>
<a name="l00153"></a>00153 <span class="preprocessor">    {\</span>
<a name="l00154"></a>00154 <span class="preprocessor">        var instruction = CPDOMDisplayServerInstructions[index++];\</span>
<a name="l00155"></a>00155 <span class="preprocessor">        try{\</span>
<a name="l00156"></a>00156 <span class="preprocessor">            switch (instruction)\</span>
<a name="l00157"></a>00157 <span class="preprocessor">            {\</span>
<a name="l00158"></a>00158 <span class="preprocessor">                case SetStyleLeftTop:\</span>
<a name="l00159"></a>00159 <span class="preprocessor">                case SetStyleRightTop:\</span>
<a name="l00160"></a>00160 <span class="preprocessor">                case SetStyleLeftBottom:\</span>
<a name="l00161"></a>00161 <span class="preprocessor">                case SetStyleRightBottom:   var element = CPDOMDisplayServerInstructions[index],\</span>
<a name="l00162"></a>00162 <span class="preprocessor">                                                style = element.style,\</span>
<a name="l00163"></a>00163 <span class="preprocessor">                                                x = (instruction == SetStyleLeftTop || instruction == SetStyleLeftBottom) ? &quot;left&quot; : &quot;right&quot;,\</span>
<a name="l00164"></a>00164 <span class="preprocessor">                                                y = (instruction == SetStyleLeftTop || instruction == SetStyleRightTop) ? &quot;top&quot; : &quot;bottom&quot;;\</span>
<a name="l00165"></a>00165 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00166"></a>00166 <span class="preprocessor">                                            var transform = CPDOMDisplayServerInstructions[index++];\</span>
<a name="l00167"></a>00167 <span class="preprocessor">                                            if (transform)\</span>
<a name="l00168"></a>00168 <span class="preprocessor">                                            {\</span>
<a name="l00169"></a>00169 <span class="preprocessor">                                                var point = _CGPointMake(CPDOMDisplayServerInstructions[index++], CPDOMDisplayServerInstructions[index++]),\</span>
<a name="l00170"></a>00170 <span class="preprocessor">                                                    transformed = _CGPointApplyAffineTransform(point, transform);\</span>
<a name="l00171"></a>00171 <span class="preprocessor">                                                style[x] = ROUND(transformed.x) + &quot;px&quot;;\</span>
<a name="l00172"></a>00172 <span class="preprocessor">                                                style[y] = ROUND(transformed.y) + &quot;px&quot;;\</span>
<a name="l00173"></a>00173 <span class="preprocessor">                                            }\</span>
<a name="l00174"></a>00174 <span class="preprocessor">                                            else\</span>
<a name="l00175"></a>00175 <span class="preprocessor">                                            {\</span>
<a name="l00176"></a>00176 <span class="preprocessor">                                                style[x] = ROUND(CPDOMDisplayServerInstructions[index++]) + &quot;px&quot;;\</span>
<a name="l00177"></a>00177 <span class="preprocessor">                                                style[y] = ROUND(CPDOMDisplayServerInstructions[index++]) + &quot;px&quot;;\</span>
<a name="l00178"></a>00178 <span class="preprocessor">                                            }\</span>
<a name="l00179"></a>00179 <span class="preprocessor">                                            element.CPDOMDisplayContext[SetStyleOrigin] = -1;\</span>
<a name="l00180"></a>00180 <span class="preprocessor">                                            break;\</span>
<a name="l00181"></a>00181 <span class="preprocessor">                case SetStyleSize:          var element = CPDOMDisplayServerInstructions[index],\</span>
<a name="l00182"></a>00182 <span class="preprocessor">                                                style = element.style;\</span>
<a name="l00183"></a>00183 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00184"></a>00184 <span class="preprocessor">                                            element.CPDOMDisplayContext[SetStyleSize] = -1;\</span>
<a name="l00185"></a>00185 <span class="preprocessor">                                            style.width = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++])) + &quot;px&quot;;\</span>
<a name="l00186"></a>00186 <span class="preprocessor">                                            style.height = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++])) + &quot;px&quot;;\</span>
<a name="l00187"></a>00187 <span class="preprocessor">                                            break;\</span>
<a name="l00188"></a>00188 <span class="preprocessor">                case SetSize:               var element = CPDOMDisplayServerInstructions[index];\</span>
<a name="l00189"></a>00189 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00190"></a>00190 <span class="preprocessor">                                            element.CPDOMDisplayContext[SetSize] = -1;\</span>
<a name="l00191"></a>00191 <span class="preprocessor">                                            element.width = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++]));\</span>
<a name="l00192"></a>00192 <span class="preprocessor">                                            element.height = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++]));\</span>
<a name="l00193"></a>00193 <span class="preprocessor">                                            break;\</span>
<a name="l00194"></a>00194 <span class="preprocessor">                case AppendChild:           CPDOMDisplayServerInstructions[index].appendChild(CPDOMDisplayServerInstructions[index + 1]);\</span>
<a name="l00195"></a>00195 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00196"></a>00196 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00197"></a>00197 <span class="preprocessor">                                            break;\</span>
<a name="l00198"></a>00198 <span class="preprocessor">                case InsertBefore:          CPDOMDisplayServerInstructions[index].insertBefore(CPDOMDisplayServerInstructions[index + 1], CPDOMDisplayServerInstructions[index + 2]);\</span>
<a name="l00199"></a>00199 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00200"></a>00200 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00201"></a>00201 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00202"></a>00202 <span class="preprocessor">                                            break;\</span>
<a name="l00203"></a>00203 <span class="preprocessor">                case RemoveChild:           CPDOMDisplayServerInstructions[index].removeChild(CPDOMDisplayServerInstructions[index + 1]);\</span>
<a name="l00204"></a>00204 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00205"></a>00205 <span class="preprocessor">                                            CPDOMDisplayServerInstructions[index++] = nil;\</span>
<a name="l00206"></a>00206 <span class="preprocessor">                                            break;\</span>
<a name="l00207"></a>00207 <span class="preprocessor">                }\</span>
<a name="l00208"></a>00208 <span class="preprocessor">            }\</span>
<a name="l00209"></a>00209 <span class="preprocessor">            catch(e) { CPLog(&quot;e &quot; + e + &quot; &quot; + instruction); }\</span>
<a name="l00210"></a>00210 <span class="preprocessor">        }\</span>
<a name="l00211"></a>00211 <span class="preprocessor">        CPDOMDisplayServerInstructionCount = 0;</span>
<a name="l00212"></a>00212 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:32:56 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_d_o_m_display_server_8h_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:42 GMT -->
</html>