Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 6d3b4bc567b87c88239dcbd32a6cacf5 > files > 37

flowcanvas-devel-0.7.1-2.fc15.i686.rpm

<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>FlowCanvas: flowcanvas/Connection.hpp 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.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">FlowCanvas&#160;<span id="projectnumber">0.7.1</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>flowcanvas/Connection.hpp</h1>  </div>
</div>
<div class="contents">
<a href="Connection_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* This file is part of FlowCanvas.</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2007-2009 David Robillard &lt;http://drobilla.net&gt;</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * FlowCanvas is free software; you can redistribute it and/or modify it under the</span>
<a name="l00005"></a>00005 <span class="comment"> * terms of the GNU General Public License as published by the Free Software</span>
<a name="l00006"></a>00006 <span class="comment"> * Foundation; either version 2 of the License, or (at your option) any later</span>
<a name="l00007"></a>00007 <span class="comment"> * version.</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> * FlowCanvas is distributed in the hope that it will be useful, but WITHOUT ANY</span>
<a name="l00010"></a>00010 <span class="comment"> * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
<a name="l00011"></a>00011 <span class="comment"> * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
<a name="l00014"></a>00014 <span class="comment"> * with this program; if not, write to the Free Software Foundation, Inc.,</span>
<a name="l00015"></a>00015 <span class="comment"> * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA</span>
<a name="l00016"></a>00016 <span class="comment"> */</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef FLOWCANVAS_CONNECTION_HPP</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define FLOWCANVAS_CONNECTION_HPP</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;list&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;boost/weak_ptr.hpp&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;libgnomecanvasmm.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;libgnomecanvasmm/bpath.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;libgnomecanvasmm/path-def.h&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="keyword">namespace </span>FlowCanvas {
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">class </span>Canvas;
<a name="l00035"></a>00035 <span class="keyword">class </span>Connectable;
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 
<a name="l00042"></a><a class="code" href="classFlowCanvas_1_1Connection.html">00042</a> <span class="keyword">class </span><a class="code" href="classFlowCanvas_1_1Connection.html" title="A connection (line) between two canvas objects.">Connection</a> : <span class="keyword">public</span> Gnome::<a class="code" href="classFlowCanvas_1_1Canvas.html" title="The &amp;#39;master&amp;#39; canvas widget which contains all other objects.">Canvas</a>::Group
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044 <span class="keyword">public</span>:
<a name="l00045"></a>00045     <a class="code" href="classFlowCanvas_1_1Connection.html#ae53a0cd38d0de8da68b42376b288367c">Connection</a>(boost::shared_ptr&lt;Canvas&gt;      canvas,
<a name="l00046"></a>00046                boost::shared_ptr&lt;Connectable&gt; <a class="code" href="classFlowCanvas_1_1Connection.html#a960908c3f58e3f7f48f870f2d7aeeecc">source</a>,
<a name="l00047"></a>00047                boost::shared_ptr&lt;Connectable&gt; <a class="code" href="classFlowCanvas_1_1Connection.html#a67f6b33da8419521f928de17d678059b">dest</a>,
<a name="l00048"></a>00048                uint32_t                       color,
<a name="l00049"></a>00049                <span class="keywordtype">bool</span>                           show_arrow_head = <span class="keyword">false</span>);
<a name="l00050"></a>00050 
<a name="l00051"></a>00051     <span class="keyword">virtual</span> <a class="code" href="classFlowCanvas_1_1Connection.html#afbbe136cbc809740bf99f20aa4f76198">~Connection</a>();
<a name="l00052"></a>00052 
<a name="l00053"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a4ed5369960ff576f69d0fd21cc45f438">00053</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a4ed5369960ff576f69d0fd21cc45f438">move</a>(<span class="keywordtype">double</span> <span class="comment">/*dx*/</span>, <span class="keywordtype">double</span> <span class="comment">/*dy*/</span>)
<a name="l00054"></a>00054     { <span class="comment">/* ignore, src/dst take care of it */</span> }
<a name="l00055"></a>00055 
<a name="l00056"></a>00056     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#ae6669de67b27876bfda64d041637369a">zoom</a>(<span class="keywordtype">double</span> z);
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="classFlowCanvas_1_1Connection.html#ae5c482ba043390036583c7b1a0adfd22">00058</a>     <span class="keywordtype">bool</span> <a class="code" href="classFlowCanvas_1_1Connection.html#ae5c482ba043390036583c7b1a0adfd22">selected</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a3daba779b24903962776cd01406dda8e">_selected</a>; }
<a name="l00059"></a>00059     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#aa63c7f45907592bbc9e35057bc3878ef">set_selected</a>(<span class="keywordtype">bool</span> b);
<a name="l00060"></a>00060 
<a name="l00061"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a66fedd0bd7045b88cd7019e906bb7edb">00061</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a66fedd0bd7045b88cd7019e906bb7edb">length_hint</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0.0; }
<a name="l00062"></a>00062 
<a name="l00063"></a>00063     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a398a715916ab41d5190a07198ddc6834">set_label</a>(<span class="keyword">const</span> std::string&amp; str);
<a name="l00064"></a>00064     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a881882ed1077d741c8eaf6ba4e33bf80">show_handle</a>(<span class="keywordtype">bool</span> show);
<a name="l00065"></a>00065 
<a name="l00066"></a>00066     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a1bc2db8f9ba66e4db50d82fc5a59d050">set_color</a>(uint32_t color);
<a name="l00067"></a>00067     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#ae41e31871178502fe63a2fd1304744a4">set_highlighted</a>(<span class="keywordtype">bool</span> b);
<a name="l00068"></a>00068     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a956a2cf003dda81006ccb66f9575ba37">raise_to_top</a>();
<a name="l00069"></a>00069 
<a name="l00070"></a>00070     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a2777a5f1b12a9c2f629055d9eea851f0">select_tick</a>();
<a name="l00071"></a>00071 
<a name="l00072"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a960908c3f58e3f7f48f870f2d7aeeecc">00072</a>     <span class="keyword">const</span> boost::weak_ptr&lt;Connectable&gt; <a class="code" href="classFlowCanvas_1_1Connection.html#a960908c3f58e3f7f48f870f2d7aeeecc">source</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a42c55278ba2339fe114388a7915fea35">_source</a>; }
<a name="l00073"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a67f6b33da8419521f928de17d678059b">00073</a>     <span class="keyword">const</span> boost::weak_ptr&lt;Connectable&gt; <a class="code" href="classFlowCanvas_1_1Connection.html#a67f6b33da8419521f928de17d678059b">dest</a>()<span class="keyword">   const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a29065b0cb7b2df409717fb663715c89c">_dest</a>; }
<a name="l00074"></a>00074 
<a name="l00075"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67">00075</a>     <span class="keyword">enum</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67">HandleStyle</a> {
<a name="l00076"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67a68ca0b937ef7c19b28f753cc7b87708c">00076</a>         <a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67a68ca0b937ef7c19b28f753cc7b87708c">HANDLE_NONE</a>,
<a name="l00077"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67a0f412989be8012b8b6af70cb70708499">00077</a>         <a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67a0f412989be8012b8b6af70cb70708499">HANDLE_RECT</a>,
<a name="l00078"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67a81c252702c9ac085e4560747333c6fd2">00078</a>         <a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67a81c252702c9ac085e4560747333c6fd2">HANDLE_CIRCLE</a>,
<a name="l00079"></a>00079     };
<a name="l00080"></a>00080 
<a name="l00081"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a02360cc3bb8550958ef962a5d2415f78">00081</a>     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a02360cc3bb8550958ef962a5d2415f78">set_handle_style</a>(<a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67">HandleStyle</a> s) { <a class="code" href="classFlowCanvas_1_1Connection.html#a3909960a326f37ce1527974aada568ae">_handle_style</a> = s; }
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="keyword">protected</span>:
<a name="l00084"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a9816083e25bae0b2f472e19382136687">00084</a>     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classFlowCanvas_1_1Canvas.html" title="The &amp;#39;master&amp;#39; canvas widget which contains all other objects.">Canvas</a>;
<a name="l00085"></a><a class="code" href="classFlowCanvas_1_1Connection.html#ae97fde05a8519c721c4db23aa44d72fc">00085</a>     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classFlowCanvas_1_1Connectable.html" title="An object a Connection can connect to.">Connectable</a>;
<a name="l00086"></a>00086     <span class="keywordtype">void</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a5541bd4f6400f8e7e3553f7c82319d73">update_location</a>();
<a name="l00087"></a>00087 
<a name="l00088"></a><a class="code" href="classFlowCanvas_1_1Connection.html#aac927fe52cbbb199569f8af1fd0f926d">00088</a>     <span class="keyword">const</span> boost::weak_ptr&lt;Canvas&gt;      <a class="code" href="classFlowCanvas_1_1Connection.html#aac927fe52cbbb199569f8af1fd0f926d">_canvas</a>;
<a name="l00089"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a42c55278ba2339fe114388a7915fea35">00089</a>     <span class="keyword">const</span> boost::weak_ptr&lt;Connectable&gt; <a class="code" href="classFlowCanvas_1_1Connection.html#a42c55278ba2339fe114388a7915fea35">_source</a>;
<a name="l00090"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a29065b0cb7b2df409717fb663715c89c">00090</a>     <span class="keyword">const</span> boost::weak_ptr&lt;Connectable&gt; <a class="code" href="classFlowCanvas_1_1Connection.html#a29065b0cb7b2df409717fb663715c89c">_dest</a>;
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a39bd0febf7d13608041135c5bae95dca">00092</a>     Gnome::Canvas::Bpath <a class="code" href="classFlowCanvas_1_1Connection.html#a39bd0febf7d13608041135c5bae95dca">_bpath</a>;
<a name="l00093"></a><a class="code" href="classFlowCanvas_1_1Connection.html#acf64f404682a077f00f4810a76125def">00093</a>     GnomeCanvasPathDef*  <a class="code" href="classFlowCanvas_1_1Connection.html#acf64f404682a077f00f4810a76125def">_path</a>;
<a name="l00094"></a>00094 
<a name="l00096"></a><a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html">00096</a>     <span class="keyword">struct </span><a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html" title="A handle on a connection line to allow mouse interaction.">Handle</a> : <span class="keyword">public</span> Gnome::<a class="code" href="classFlowCanvas_1_1Canvas.html" title="The &amp;#39;master&amp;#39; canvas widget which contains all other objects.">Canvas</a>::Group {
<a name="l00097"></a><a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#ac5fdb9f615b4457c7d01988df2eb3a60">00097</a>         <span class="keyword">explicit</span> <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#ac5fdb9f615b4457c7d01988df2eb3a60">Handle</a>(Gnome::Canvas::Group&amp; parent)
<a name="l00098"></a>00098             : Gnome::<a class="code" href="classFlowCanvas_1_1Canvas.html" title="The &amp;#39;master&amp;#39; canvas widget which contains all other objects.">Canvas</a>::Group(parent), <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#a1799fd60b45eeaeb509c370f6b27128d">shape</a>(NULL), <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#ac14524ea3ac95aa82bd68b2d09e4144c">text</a>(NULL) {}
<a name="l00099"></a><a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#a9025a221b911216d3ce376b441898198">00099</a>         <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#a9025a221b911216d3ce376b441898198">~Handle</a>() { <span class="keyword">delete</span> <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#a1799fd60b45eeaeb509c370f6b27128d">shape</a>; <span class="keyword">delete</span> <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#ac14524ea3ac95aa82bd68b2d09e4144c">text</a>; }
<a name="l00100"></a><a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#a1799fd60b45eeaeb509c370f6b27128d">00100</a>         Gnome::Canvas::Shape* <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#a1799fd60b45eeaeb509c370f6b27128d">shape</a>;
<a name="l00101"></a><a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#ac14524ea3ac95aa82bd68b2d09e4144c">00101</a>         Gnome::Canvas::Text*  <a class="code" href="structFlowCanvas_1_1Connection_1_1Handle.html#ac14524ea3ac95aa82bd68b2d09e4144c">text</a>;
<a name="l00102"></a>00102     }* <a class="code" href="classFlowCanvas_1_1Connection.html#ac5d40f94b2f6ab3fe41b4602cc96ed21">_handle</a>;
<a name="l00103"></a>00103 
<a name="l00104"></a><a class="code" href="classFlowCanvas_1_1Connection.html#ab19bb46ca880754dde24d19b09226380">00104</a>     uint32_t    <a class="code" href="classFlowCanvas_1_1Connection.html#ab19bb46ca880754dde24d19b09226380">_color</a>;
<a name="l00105"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a3909960a326f37ce1527974aada568ae">00105</a>     <a class="code" href="classFlowCanvas_1_1Connection.html#a4e33790022c4c0c4c3f6b64c651aba67">HandleStyle</a> <a class="code" href="classFlowCanvas_1_1Connection.html#a3909960a326f37ce1527974aada568ae">_handle_style</a>;
<a name="l00106"></a>00106 
<a name="l00107"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a3daba779b24903962776cd01406dda8e">00107</a>     <span class="keywordtype">bool</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a3daba779b24903962776cd01406dda8e">_selected</a>       :1;
<a name="l00108"></a><a class="code" href="classFlowCanvas_1_1Connection.html#a3d3202e1a20ee867192abc2f6e811ef7">00108</a>     <span class="keywordtype">bool</span> <a class="code" href="classFlowCanvas_1_1Connection.html#a3d3202e1a20ee867192abc2f6e811ef7">_show_arrowhead</a> :1;
<a name="l00109"></a>00109 };
<a name="l00110"></a>00110 
<a name="l00111"></a><a class="code" href="namespaceFlowCanvas.html#a95ded2c688bc4a98564a47ebb93a8c73">00111</a> <span class="keyword">typedef</span> std::list&lt;boost::shared_ptr&lt;Connection&gt; &gt; <a class="code" href="namespaceFlowCanvas.html#a95ded2c688bc4a98564a47ebb93a8c73">ConnectionList</a>;
<a name="l00112"></a>00112 
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 } <span class="comment">// namespace FlowCanvas</span>
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 <span class="preprocessor">#endif // FLOWCANVAS_CONNECTION_HPP</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Feb 8 2011 for FlowCanvas by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>