luaforwindows/files/docs/wxlua/doxygen/html/wxldefs_8h_source.html

188 lines
19 KiB
HTML

<!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>wxLua: /mnt/share/devel/lua/wxLua/modules/wxlua/include/wxldefs.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.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</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>
<li><a href="dirs.html"><span>Directories</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>
<div class="navpath"><a class="el" href="dir_15d5a205ad383328522db6a6be296af1.html">modules</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_b59b58daa92d206701e75411b2cef894.html">wxlua</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_a9b43b959fc4efc3ae9ddc99e98c5750.html">include</a>
</div>
</div>
<div class="contents">
<h1>wxldefs.h</h1><a href="wxldefs_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"></span><span class="comment">// Name: wxldefs.h</span>
<a name="l00003"></a>00003 <span class="comment">// Purpose: wxLua common defines</span>
<a name="l00004"></a>00004 <span class="comment">// Author: John Labenski</span>
<a name="l00005"></a>00005 <span class="comment">// Created: 5/28/2005</span>
<a name="l00006"></a>00006 <span class="comment">// Copyright: (c) John Labenski</span>
<a name="l00007"></a>00007 <span class="comment">// Licence: wxWidgets licence</span><span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef __WX_WXLDEFS_H__</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define __WX_WXLDEFS_H__</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00014"></a>00014 <span class="comment">// Include the Lua headers</span>
<a name="l00015"></a>00015 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span>
<a name="l00018"></a>00018 {
<a name="l00019"></a>00019 <span class="preprocessor"> #include &quot;lua.h&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor"> #include &quot;lualib.h&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor"> #include &quot;lauxlib.h&quot;</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="comment">// To not include &quot;lua.h&quot; use these</span>
<a name="l00024"></a>00024 <span class="comment">//typedef struct lua_State lua_State;</span>
<a name="l00025"></a>00025 <span class="comment">//typedef struct lua_Debug lua_Debug;</span>
<a name="l00026"></a>00026 <span class="comment">//typedef int (*lua_CFunction)(lua_State *);</span>
<a name="l00027"></a>00027 }
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;wx/defs.h&quot;</span>
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00032"></a>00032 <span class="comment">// The version of wxLua - for convenience we use the current version of</span>
<a name="l00033"></a>00033 <span class="comment">// wxWidgets which wxLua is most compatible with.</span>
<a name="l00034"></a>00034 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00035"></a>00035
<a name="l00036"></a><a class="code" href="wxldefs_8h.html#af060da4316901d6a4cfd64dea594c432">00036</a> <span class="preprocessor">#define wxLUA_MAJOR_VERSION 2</span>
<a name="l00037"></a><a class="code" href="wxldefs_8h.html#a3856e8c6d4d552795342d573dc039961">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define wxLUA_MINOR_VERSION 8</span>
<a name="l00038"></a><a class="code" href="wxldefs_8h.html#a5ef4d2631b6d2bc939d0c443c9759f49">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define wxLUA_RELEASE_NUMBER 10</span>
<a name="l00039"></a><a class="code" href="wxldefs_8h.html#ac5522b3457d53c6f007514d414554c92">00039</a> <span class="preprocessor"></span><span class="preprocessor">#define wxLUA_SUBRELEASE_NUMBER 0</span>
<a name="l00040"></a><a class="code" href="wxldefs_8h.html#aa288a8a0f0c8a542e2ec2e6897503856">00040</a> <span class="preprocessor"></span><span class="preprocessor">#define wxLUA_VERSION_STRING wxT(&quot;wxLua 2.8.10.0&quot;)</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span>
<a name="l00042"></a>00042 <span class="comment">// For non-Unix systems (i.e. when building without a configure script),</span>
<a name="l00043"></a>00043 <span class="comment">// users of this component can use the following macro to check if the</span>
<a name="l00044"></a>00044 <span class="comment">// current version is at least major.minor.release</span>
<a name="l00045"></a><a class="code" href="wxldefs_8h.html#a3ac6fc6cac60eb98812d138e838ea632">00045</a> <span class="preprocessor">#define wxLUA_CHECK_VERSION(major,minor,release) \</span>
<a name="l00046"></a>00046 <span class="preprocessor"> (wxLUA_MAJOR_VERSION &gt; (major) || \</span>
<a name="l00047"></a>00047 <span class="preprocessor"> (wxLUA_MAJOR_VERSION == (major) &amp;&amp; wxLUA_MINOR_VERSION &gt; (minor)) || \</span>
<a name="l00048"></a>00048 <span class="preprocessor"> (wxLUA_MAJOR_VERSION == (major) &amp;&amp; wxLUA_MINOR_VERSION == (minor) &amp;&amp; wxLUA_RELEASE_NUMBER &gt;= (release)))</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span>
<a name="l00050"></a>00050 <span class="comment">// the same but check the subrelease also</span>
<a name="l00051"></a><a class="code" href="wxldefs_8h.html#a16f33770221d3c35ce5fd3884cfc0d7e">00051</a> <span class="preprocessor">#define wxLUA_CHECK_VERSION_FULL(major,minor,release,subrel) \</span>
<a name="l00052"></a>00052 <span class="preprocessor"> (wxLUA_CHECK_VERSION(major, minor, release) &amp;&amp; \</span>
<a name="l00053"></a>00053 <span class="preprocessor"> ((major) != wxLUA_MAJOR_VERSION || \</span>
<a name="l00054"></a>00054 <span class="preprocessor"> (minor) != wxLUA_MINOR_VERSION || \</span>
<a name="l00055"></a>00055 <span class="preprocessor"> (release) != wxLUA_RELEASE_NUMBER || \</span>
<a name="l00056"></a>00056 <span class="preprocessor"> (subrel) &lt;= wxLUA_SUBRELEASE_NUMBER))</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span>
<a name="l00058"></a>00058 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00059"></a>00059 <span class="comment">// This is an internal use binding generator version whos number is</span>
<a name="l00060"></a>00060 <span class="comment">// incremented every time something changes that requires a regeneration</span>
<a name="l00061"></a>00061 <span class="comment">// of the bindings. The check is written into the generated bindings to</span>
<a name="l00062"></a>00062 <span class="comment">// give a compile time error.</span>
<a name="l00063"></a>00063 <span class="comment">// If this number is incremented the variable by the same name must be updated</span>
<a name="l00064"></a>00064 <span class="comment">// in genwxbind.lua must be updated as well.</span>
<a name="l00065"></a>00065 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00066"></a>00066
<a name="l00067"></a><a class="code" href="wxldefs_8h.html#ae2eaf1a4aaea28c85a3b6ce6ea1a7b3c">00067</a> <span class="preprocessor">#define WXLUA_BINDING_VERSION 27</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a>00069 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00070"></a>00070 <span class="comment">// If you&#39;re using stdcall in Lua, then override this with</span>
<a name="l00071"></a>00071 <span class="comment">// &quot;LUACALL = __stdcall&quot; in your makefile or project.</span>
<a name="l00072"></a>00072 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00073"></a>00073
<a name="l00074"></a>00074 <span class="preprocessor">#ifndef LUACALL</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor"> #define LUACALL</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>
<a name="l00078"></a>00078 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00079"></a>00079 <span class="comment">// WXDLLIMPEXP macros</span>
<a name="l00080"></a>00080 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="comment">// These are our DLL macros (see the contrib libs like wxPlot)</span>
<a name="l00083"></a>00083 <span class="preprocessor">#ifdef WXMAKINGDLL_WXLUA</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor"> #define WXDLLIMPEXP_WXLUA WXEXPORT</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor"> #define WXDLLIMPEXP_DATA_WXLUA(type) WXEXPORT type</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">#elif defined(WXUSINGDLL)</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor"> #define WXDLLIMPEXP_WXLUA WXIMPORT</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor"> #define WXDLLIMPEXP_DATA_WXLUA(type) WXIMPORT type</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#else // not making nor using DLL</span>
<a name="l00090"></a><a class="code" href="wxldefs_8h.html#ad8b07fc8dd8f30300e284b64f734b026">00090</a> <span class="preprocessor"></span><span class="preprocessor"> #define WXDLLIMPEXP_WXLUA</span>
<a name="l00091"></a><a class="code" href="wxldefs_8h.html#acafd4cb79bea822563bac70e088c38ca">00091</a> <span class="preprocessor"></span><span class="preprocessor"> #define WXDLLIMPEXP_DATA_WXLUA(type) type</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span>
<a name="l00094"></a>00094 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00095"></a>00095 <span class="comment">// Useful macros to make coding easier</span>
<a name="l00096"></a>00096 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00097"></a>00097
<a name="l00098"></a>00098 <span class="preprocessor">#if wxUSE_UNICODE</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor"> #define wxLUA_UNICODE_ONLY(x) x</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* !Unicode */</span>
<a name="l00101"></a><a class="code" href="wxldefs_8h.html#a8b866331c104bad29e0e711e5279f717">00101</a> <span class="preprocessor"> #define wxLUA_UNICODE_ONLY(x)</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span><span class="preprocessor">#endif // wxUSE_UNICODE</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span>
<a name="l00104"></a>00104
<a name="l00105"></a><a class="code" href="wxldefs_8h.html#a94d4432b789ed04ce0ed6845cb97c1c6">00105</a> <span class="preprocessor">#define WXLUA_HASBIT(value, bit) (((value) &amp; (bit)) != 0)</span>
<a name="l00106"></a><a class="code" href="wxldefs_8h.html#a1712957fa7ad1a61ec844cbfcc92a768">00106</a> <span class="preprocessor"></span><span class="preprocessor">#define WXLUA_SETBIT(value, bit, set) ((set) ? (value)|(bit) : (value)&amp;(~(bit)))</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span>
<a name="l00108"></a>00108 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00109"></a>00109 <span class="comment">// Lua defines for making the code more readable</span>
<a name="l00110"></a>00110 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00111"></a>00111
<a name="l00112"></a>00112 <span class="comment">// initializes a lua_debug by nulling everything before use since the</span>
<a name="l00113"></a>00113 <span class="comment">// functions that take it do not initialize it properly</span>
<a name="l00114"></a><a class="code" href="wxldefs_8h.html#a2fecae24d4d9e2f9551226b5e1389f8f">00114</a> <span class="preprocessor">#define INIT_LUA_DEBUG { 0, 0, 0, 0, 0, 0, 0, 0, 0, {0}, 0 }</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span>
<a name="l00116"></a>00116 <span class="comment">// Create a wxString from the lua_Debug struct for debugging</span>
<a name="l00117"></a><a class="code" href="wxldefs_8h.html#a38f57d1d4e009615c7e4e61705c44028">00117</a> <span class="preprocessor">#define lua_Debug_to_wxString(ld) \</span>
<a name="l00118"></a>00118 <span class="preprocessor"> wxString::Format(wxT(&quot;%p event=%d name=&#39;%s&#39; namewhat=&#39;%s&#39; what=&#39;%s&#39; source=&#39;%s&#39; currentline=%d nups=%d linedefined=%d lastlinedefined=%d short_src=&#39;%s&#39; i_ci=%d&quot;), \</span>
<a name="l00119"></a>00119 <span class="preprocessor"> &amp;ld, ld.event, lua2wx(ld.name).c_str(), lua2wx(ld.namewhat).c_str(), lua2wx(ld.what).c_str(), lua2wx(ld.source).c_str(), ld.currentline, ld.nups, ld.linedefined, ld.lastlinedefined, lua2wx(ld.short_src).c_str(), ld.i_ci)</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span>
<a name="l00121"></a>00121 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00122"></a>00122 <span class="comment">// Convert from wxWidgets wxT(&#39;&#39;) to wxT(&quot;&quot;), a string. Copied from wx/filefn.h</span>
<a name="l00123"></a>00123
<a name="l00124"></a>00124 <span class="comment">// platform independent versions</span>
<a name="l00125"></a>00125 <span class="preprocessor">#if defined(__UNIX__) &amp;&amp; !defined(__OS2__)</span>
<a name="l00126"></a>00126 <span class="preprocessor"></span> <span class="comment">// CYGWIN also uses UNIX settings</span>
<a name="l00127"></a>00127 <span class="preprocessor"> #define wxLua_FILE_SEP_PATH wxT(&quot;/&quot;)</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__MAC__)</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor"> #define wxLua_FILE_SEP_PATH wxT(&quot;:&quot;)</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">#else // Windows and OS/2</span>
<a name="l00131"></a><a class="code" href="wxldefs_8h.html#a4f6d9d86d9b4bcf59494a0cc2dceb05f">00131</a> <span class="preprocessor"></span><span class="preprocessor"> #define wxLua_FILE_SEP_PATH wxT(&quot;\\&quot;)</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#endif // Unix/Windows</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
<a name="l00134"></a>00134 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00135"></a>00135 <span class="comment">// wxWidgets compatibility defines</span>
<a name="l00136"></a>00136 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="preprocessor">#ifndef wxUSE_WAVE</span>
<a name="l00139"></a><a class="code" href="wxldefs_8h.html#ab320a6f889e6e1e9f0ee3311d739cd38">00139</a> <span class="preprocessor"></span><span class="preprocessor"> #define wxUSE_WAVE 0</span>
<a name="l00140"></a>00140 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">#ifndef wxUSE_SOUND</span>
<a name="l00142"></a><a class="code" href="wxldefs_8h.html#a2ad949a997ff10875d6f8dffe7e5eaf9">00142</a> <span class="preprocessor"></span><span class="preprocessor"> #define wxUSE_SOUND 0</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span>
<a name="l00145"></a>00145 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00146"></a>00146 <span class="comment">// Forward declared classes</span>
<a name="l00147"></a>00147 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00148"></a>00148
<a name="l00149"></a>00149 <span class="keyword">class </span><a class="code" href="wxldefs_8h.html#ad8b07fc8dd8f30300e284b64f734b026">WXDLLIMPEXP_WXLUA</a> <a class="code" href="classwxLuaState.html">wxLuaState</a>;
<a name="l00150"></a>00150
<a name="l00151"></a>00151
<a name="l00152"></a>00152 <span class="preprocessor">#endif // __WX_WXLDEFS_H__</span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 13 10:30:39 2010 for wxLua by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>