Changeset 33
- Timestamp:
- 08/10/06 02:21:27 (2 years ago)
- Files:
-
- trunk/html_doc/celerid.html (added)
- trunk/html_doc/class_wrap.html (modified) (12 diffs)
- trunk/html_doc/class_wrapping.html (added)
- trunk/html_doc/conversion.html (added)
- trunk/html_doc/ctor_wrap.html (modified) (1 diff)
- trunk/html_doc/def.html (modified) (2 diffs)
- trunk/html_doc/dg_convert.html (modified) (3 diffs)
- trunk/html_doc/dpyobject.html (added)
- trunk/html_doc/except_wrapping.html (added)
- trunk/html_doc/exception.html (modified) (2 diffs)
- trunk/html_doc/ftype.html (modified) (4 diffs)
- trunk/html_doc/func_wrapping.html (added)
- trunk/html_doc/index.html (modified) (1 diff)
- trunk/html_doc/make_object.html (modified) (5 diffs)
- trunk/html_doc/object.html (deleted)
- trunk/html_doc/pyd.css (modified) (1 diff)
- trunk/html_doc/pyd.html (modified) (2 diffs)
- trunk/infrastructure/build_wiki_ddoc.bat (modified) (1 diff)
- trunk/infrastructure/pyd/wiki_doc/class_wrap.html (modified) (12 diffs)
- trunk/infrastructure/pyd/wiki_doc/ctor_wrap.html (modified) (1 diff)
- trunk/infrastructure/pyd/wiki_doc/def.html (modified) (2 diffs)
- trunk/infrastructure/pyd/wiki_doc/dg_convert.html (modified) (3 diffs)
- trunk/infrastructure/pyd/wiki_doc/dpyobject.html (added)
- trunk/infrastructure/pyd/wiki_doc/exception.html (modified) (2 diffs)
- trunk/infrastructure/pyd/wiki_doc/ftype.html (modified) (4 diffs)
- trunk/infrastructure/pyd/wiki_doc/make_object.html (modified) (5 diffs)
- trunk/infrastructure/pyd/wiki_doc/object.html (deleted)
- trunk/infrastructure/pyd/wiki_doc/pyd.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/html_doc/class_wrap.html
r31 r33 1 <h1>pyd.class_wrap</h1> 2 <!-- Generated by Ddoc from pyd\class_wrap.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.class_wrap</title> 4 </head><body> 5 <h1>pyd.class_wrap</h1> 6 <!-- Generated by Ddoc from pyd\class_wrap.d --> 3 7 <br><br> 4 <dl><dt><big>struct <u> <u>wrapped_class_object</u></u>;8 <dl><dt><big>struct <u>wrapped_class_object</u>; 5 9 </big></dt> 6 10 <dd>The class object, a subtype of PyObject … … 9 13 <dl></dl> 10 14 </dd> 11 <dt><big>template <u>wrapped_class_type</u>(T)</big></dt>15 <dt><big>template wrapped_class_type(T)</big></dt> 12 16 <dd><br><br> 13 17 <dl><dt><big>PyTypeObject <u>wrapped_class_type</u>; … … 19 23 </dl> 20 24 </dd> 21 <dt><big>template <u>wrapped_methods</u>(T)</big></dt>25 <dt><big>template wrapped_methods(T)</big></dt> 22 26 <dd>Various wrapped methods 23 27 <br><br> … … 35 39 36 40 </dd> 37 <dt><big>PyObject* <u>wrapped_repr</u>(PyObject* <i>_self</i>);38 </big></dt>39 <dd>The default repr method calls the class's toString.40 <br><br>41 42 </dd>43 41 </dl> 44 42 </dd> 45 <dt><big>template <u>wrapped_init</u>(T)</big></dt>43 <dt><big>template wrapped_init(T)</big></dt> 46 44 <dd><br><br> 47 45 <dl><dt><big>int <u>init</u>(PyObject* <i>self</i>, PyObject* <i>args</i>, PyObject* <i>kwds</i>); … … 53 51 </dl> 54 52 </dd> 55 <dt><big>template <u>wrapped_get</u>(T,alias Fn)</big></dt>53 <dt><big>template wrapped_get(T,alias Fn)</big></dt> 56 54 <dd><br><br> 57 55 <dl><dt><big>PyObject* <u>func</u>(PyObject* <i>self</i>, void* <i>closure</i>); … … 63 61 </dl> 64 62 </dd> 65 <dt><big>template <u>wrapped_set</u>(T,alias Fn)</big></dt>63 <dt><big>template wrapped_set(T,alias Fn)</big></dt> 66 64 <dd><br><br> 67 65 <dl><dt><big>int <u>func</u>(PyObject* <i>self</i>, PyObject* <i>value</i>, void* <i>closure</i>); … … 73 71 </dl> 74 72 </dd> 75 <dt><big>template <u>is_wrapped</u>(T)</big></dt>73 <dt><big>template is_wrapped(T)</big></dt> 76 74 <dd>A useful check for whether a given class has been wrapped. Mainly used by 77 75 the conversion functions (see make_object.d), but possibly useful elsewhere. … … 81 79 <dl></dl> 82 80 </dd> 83 <dt><big>struct <u> <u>wrapped_class</u></u>;81 <dt><big>struct <u>wrapped_class</u>; 84 82 </big></dt> 85 83 <dd>This struct wraps a D class. Its member functions are the primary way of … … 88 86 <br><br> 89 87 90 <dl><dt><big>template <u>def</u>(char[] name,alias fn,uint MIN_ARGS = NumberOfArgs!(typeof(&fn)),fn_t = typeof(&fn))</big></dt>88 <dl><dt><big>template def(alias fn,char[] name,fn_t = typeof(&fn),uint MIN_ARGS = MIN_ARGS!(fn))</big></dt> 91 89 <dd>Wraps a member function of the class. 92 90 <br><br> … … 105 103 <dl></dl> 106 104 </dd> 107 <dt><big>template <u>prop</u>(char[] name,alias fn,bool RO = false)</big></dt>105 <dt><big>template prop(alias fn,char[] name,bool RO = false)</big></dt> 108 106 <dd>Wraps a property of the class. 109 107 <br><br> … … 119 117 <dl></dl> 120 118 </dd> 121 <dt><big>template <u>init</u>(alias C1 = undefined,alias C2 = undefined,alias C3 = undefined,alias C4 = undefined,alias C5 = undefined,alias C6 = undefined,alias C7 = undefined,alias C8 = undefined,alias C9 = undefined,alias C10 = undefined)</big></dt>119 <dt><big>template init(C1 = Void,C2 = Void,C3 = Void,C4 = Void,C5 = Void,C6 = Void,C7 = Void,C8 = Void,C9 = Void,C10 = Void)</big></dt> 122 120 <dd>Wraps the constructors of the class. 123 121 <br><br> … … 140 138 </dl> 141 139 140 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 141 </body></html> trunk/html_doc/ctor_wrap.html
r31 r33 1 <h1>pyd.ctor_wrap</h1> 2 <!-- Generated by Ddoc from pyd\ctor_wrap.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.ctor_wrap</title> 4 </head><body> 5 <h1>pyd.ctor_wrap</h1> 6 <!-- Generated by Ddoc from pyd\ctor_wrap.d --> 3 7 <br><br> 4 <dl><dt><big>template <u>ctor</u>(T1 = void,T2 = void,T3 = void,T4 = void,T5 = void,T6 = void,T7 = void,T8 = void,T9 = void,T10 = void)</big></dt> 5 <dd>This template defines the footprint of an individual constructor. 6 7 <br><br> 8 <dl></dl> 8 9 9 <dl></dl> 10 </dd> 11 </dl> 12 10 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 11 </body></html> trunk/html_doc/def.html
r31 r33 1 <h1>pyd.def</h1> 2 <!-- Generated by Ddoc from pyd\def.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.def</title> 4 </head><body> 5 <h1>pyd.def</h1> 6 <!-- Generated by Ddoc from pyd\def.d --> 3 7 <br><br> 4 <dl><dt><big>template <u>def</u>(char[] name,alias fn,uint MIN_ARGS = NumberOfArgs!(typeof(&fn)),fn_t = typeof(&fn))</big></dt>8 <dl><dt><big>template def(alias fn,char[] name,fn_t = typeof(&fn),uint MIN_ARGS = MIN_ARGS!(fn))</big></dt> 5 9 <dd>Wraps a D function, making it callable from Python. 6 10 <br><br> … … 51 55 </dl> 52 56 57 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 58 </body></html> trunk/html_doc/dg_convert.html
r31 r33 1 <h1>pyd.dg_convert</h1> 2 <!-- Generated by Ddoc from pyd\dg_convert.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.dg_convert</title> 4 </head><body> 5 <h1>pyd.dg_convert</h1> 6 <!-- Generated by Ddoc from pyd\dg_convert.d --> 3 7 This module contains some more or less dirty hacks for converting between 4 8 function and delegate types. Its contents are strictly for internal use … … 7 11 <br><br> 8 12 9 <dl><dt><big>template <u>fn_to_dg</u>(Fn)</big></dt>13 <dl><dt><big>template fn_to_dg(Fn)</big></dt> 10 14 <dd>This template converts a function type into an equivalent delegate type. 11 15 … … 16 20 </dl> 17 21 22 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 23 </body></html> trunk/html_doc/exception.html
r31 r33 1 <h1>pyd.exception</h1> 2 <!-- Generated by Ddoc from pyd\exception.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.exception</title> 4 </head><body> 5 <h1>pyd.exception</h1> 6 <!-- Generated by Ddoc from pyd\exception.d --> 3 7 <br><br> 4 8 <dl><dt><big>void <u>handle_exception</u>(); … … 24 28 </dl> 25 29 30 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 31 </body></html> trunk/html_doc/ftype.html
r31 r33 1 <h1>pyd.ftype</h1> 2 <!-- Generated by Ddoc from pyd\ftype.d --> 3 This module contains templates for inferring the number of arguments, 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.ftype</title> 4 </head><body> 5 <h1>pyd.ftype</h1> 6 <!-- Generated by Ddoc from pyd\ftype.d --> 7 This module contains template for inferring the number of arguments, 4 8 the return type, and argument types of an arbitrary function pointer. 5 9 <br><br> 6 Portions of this module were automatically generated by Python modules. 10 This module was automatically generated by <u>ftype</u>.py 11 <br><br> 7 12 8 <br><br> 9 <b>Authors:</b><br> 10 Daniel Keep, Tomasz Stachowiak 11 <br><br> 12 <b>Date:</b><br> 13 Sat Jul 1 22:15:08 2006 14 13 Written by Daniel Keep. 14 Released to public domainâshare and enjoy (just leave my name in it, 15 pretty please). 15 16 16 17 <br><br> 17 18 18 <dl><dt><big>template <u>NumberOfArgs</u>(Tf)</big></dt> 19 <dd>Derives the number of arguments the passed function type accepts. It only 20 works on functions with 10 or fewer arguments. 19 <dl><dt><big>template NumberOfArgs(Tf)</big></dt> 20 <dd>This template will attempt to determine the number of arguments the 21 supplied function pointer or delegate type takes. It supports a maximum of 22 10 arguments. 23 <br><br> 24 <b>Example:</b><br> 25 <pre class="d_code"> <font color=blue>void</font> fnWithThreeArgs(<font color=blue>byte</font> a, <font color=blue>short</font> b, <font color=blue>int</font> c) {} 26 <font color=blue>const</font> <font color=blue>uint</font> numArgs = <u>NumberOfArgs</u>!(<font color=blue>typeof</font>(&fnWithThreeArgs)); 27 </pre> 21 28 22 29 <br><br> … … 24 31 <dl></dl> 25 32 </dd> 26 <dt><big>template <u>ReturnType</u>(T)</big></dt> 27 <dd>Derives the return type of the passed function type. 33 <dt><big>template ReturnType(Tf)</big></dt> 34 <dd>This template will attempt to discern the return type of the supplied 35 function pointer or delegate type. It supports callables with a maximum of 36 10 arguments. 37 <br><br> 38 <b>Example:</b><br> 39 <pre class="d_code"> <font color=blue>uint</font> returnsANumber() { <font color=blue>return</font> 42; } 40 <font color=blue>alias</font> <u>ReturnType</u>!(<font color=blue>typeof</font>(&returnsANumber)) RType; <font color=green>// RType == uint 41 </font></pre> 28 42 29 43 <br><br> … … 31 45 <dl></dl> 32 46 </dd> 33 <dt><big>template <u>ArgType</u>(Tf,uint n)</big></dt> 34 <dd>Derives the type of an individual argument of function Tf. 47 <dt><big>template ArgType(Tf,uint n)</big></dt> 48 <dd>This template will attempt to extract the type of the nth argument of the 49 given function pointer or delegate type. It supports callables with up to 50 10 arguments. 35 51 <br><br> 36 <b>Params:</b><br> 37 <table><tr><td>Tf</td> 38 <td>A function pointer type</td></tr> 39 <tr><td>n</td> 40 <td>The 1-indexed function argument to get the type of, e.g.: 41 <pre class="d_code">int func(int, char, real); 42 static assert( is(char == ArgType(&func, 2)) );</pre></td></tr> 43 </table><br> 52 <b>Example:</b><br> 53 <pre class="d_code"> <font color=blue>void</font> intShortBool(<font color=blue>int</font> a, <font color=blue>short</font> b, <font color=blue>bool</font> c) {} 54 <font color=blue>alias</font> <u>ArgType</u>!(<font color=blue>typeof</font>(&intShortBool), 2) TArg2; <font color=green>// TArg2 == short 55 </font></pre> 56 57 <br><br> 58 59 <dl></dl> 60 </dd> 61 <dt><big>template MIN_ARGS(alias fn)</big></dt> 62 <dd>This template will attempt to determine the minimum number of arguments a 63 function can accept. Note that this accepts an alias parameter rather than a 64 function pointer type, as the function and delegate types contain no 65 information about default arguments. 66 <br><br> 67 (Written by Kirk McDonald.) 68 69 <br><br> 44 70 45 71 <dl></dl> … … 47 73 </dl> 48 74 75 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 76 </body></html> trunk/html_doc/index.html
r32 r33 3 3 <head> 4 4 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 5 <title>Pyd</title> 5 <link href="pyd.css" rel="stylesheet" type="text/css"> 6 <title>Pyd: Connecting D and Python</title> 6 7 </head> 7 8 8 9 <body> 9 <p>This is a test. This is only a test.</p> 10 <div class="nav"><a class="navcur" href="index.html">Main</a> | <a class="nav" href="celerid.html">CeleriD</a> | <a class="nav" href="conversion.html">Type conversion</a> | <a class="nav" href="func_wrapping.html">Function wrapping</a> | <a class="nav" href="class_wrapping.html">Class wrapping</a> | <a class="nav" href="except_wrapping.html">Exception wrapping</a></div> 11 12 <h1>Pyd</h1> 13 <p>Pyd is a library for D that wraps the raw <a href="http://docs.python.org/api/api.html">Python/C API</a> with a cleaner, simpler interface. It makes exposing raw D functions and classes to Python almost trivially simple. It bears certain similarities to <a href="http://www.boost.org/libs/python/doc/">Boost.Python</a>, and indeed Boost.Python is a major influence on Pyd.</p> 14 15 <p>Pyd also comes with its own extension to Python's <a href="http://docs.python.org/dist/dist.html">distutils</a>, called <a href="celerid.html">CeleriD</a>, making the building of extension modules quite easy.</p> 16 17 <p>A simple "hello, world" module might look like this:</p> 18 19 <pre class="code"><span class="keyword">import</span> pyd.pyd; 20 <span class="keyword">import</span> std.stdio; 21 22 <span class="keyword">void</span> hello_func() { 23 writefln(<span class="string">"Hello, world!"</span>); 24 } 25 26 <span class="keyword">extern</span> (C) 27 <span class="keyword">export void</span> inittestdll() { 28 def!(hello_func, <span class="string">"hello_func"</span>); 29 30 module_init(<span class="string">"testdll"</span>); 31 }</pre> 32 33 <p>When <a href="celerid.html">compiled</a>, the module can be loaded and used from Python like any other module:</p> 34 35 <pre class="code">>>> import testdll 36 >>> testdll.hello_func() 37 Hello, world!</pre> 10 38 </body> 11 39 </html> trunk/html_doc/make_object.html
r31 r33 1 <h1>pyd.make_object</h1> 2 <!-- Generated by Ddoc from pyd\make_object.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.make_object</title> 4 </head><body> 5 <h1>pyd.make_object</h1> 6 <!-- Generated by Ddoc from pyd\make_object.d --> 3 7 This module contains some useful type conversion functions. There are two 4 8 interesting operations involved here: … … 16 20 <br><br> 17 21 18 <dl><dt><big>template <u>_py</u>(T)</big></dt>22 <dl><dt><big>template _py(T)</big></dt> 19 23 <dd><br><br> 20 24 <dl><dt><big>PyObject* <u>_py</u>(T <i>t</i>); … … 34 38 </dl> 35 39 </dd> 36 <dt><big>template <u>py</u>(T)</big></dt>40 <dt><big>template py(T)</big></dt> 37 41 <dd><br><br> 38 42 <dl><dt><big>DPyObject <u>py</u>(T <i>t</i>); … … 62 66 <dl></dl> 63 67 </dd> 64 <dt><big>template <u>d_type</u>(T)</big></dt>68 <dt><big>template d_type(T)</big></dt> 65 69 <dd><br><br> 66 70 <dl><dt><big>T <u>d_type</u>(PyObject* <i>o</i>); … … 84 88 </dl> 85 89 90 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 91 </body></html> trunk/html_doc/pyd.css
r31 r33 1 body { 2 background-color: #d8d8d8; 3 font-size: 90%; 4 font-family: Geneva, Arial, Helvetica, sans-serif; 5 } 6 h1 { 7 text-align: center; 8 font-size: 160%; 9 } 10 hr { 11 background-color: #305880; 12 } 13 div.nav { 14 width: 100%; 15 color: #d8d8d8; 16 background-color: #305880; 17 text-align: center; 18 margin: 2px; 19 padding: 2px; 20 line-height: 140%; 21 } 22 a.nav { 23 text-decoration: none; 24 font-weight: bold; 25 color: #f0f0f0; 26 } 27 a.nav:visited { 28 text-decoration: none; 29 font-weight: bold; 30 color: #f0f0f0; 31 } 32 a.nav:hover { 33 text-decoration: none; 34 color: black; 35 background-color: #d8d8d8; 36 } 37 a.navcur { 38 text-decoration: none; 39 font-weight: bold; 40 color: black; 41 background-color: #d8d8d8; 42 } 43 a.navcur:visited { 44 text-decoration: none; 45 font-weight: bold; 46 color: black; 47 } 48 a.navcur:hover { 49 text-decoration: none; 50 color: #f0f0f0; 51 background-color: #305880; 52 } 53 a { 54 color: #103860; 55 } 56 a:visited { 57 color: #808080; 58 } 59 a:active { 60 color: #ffd000; 61 } 62 a:hover { 63 text-decoration: none; 64 background-color: #f0f0f0; 65 } 66 pre { 67 /*border: 1px dashed cyan;*/ 68 padding: 1ex; 69 margin-left: 3em; 70 margin-right: 3em; 71 background-color: #f0f0f0; 72 font-size: 10pt; 73 } 74 code { 75 font-size: 10pt; 76 } 77 pre.code { 78 background-color: black; 79 color: white; 80 } 81 .comment { 82 color: green; 83 } 84 .keyword { 85 color: #5555FF; 86 } 87 .string { 88 color: cyan; 89 } 90 .number { 91 color: #FFFF44; 92 } 93 .t_arg { 94 font-weight: bold; 95 } 96 .arg { 97 font-style: italic; 98 } trunk/html_doc/pyd.html
r31 r33 1 <h1>pyd.pyd</h1> 2 <!-- Generated by Ddoc from pyd\pyd.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.pyd</title> 4 </head><body> 5 <h1>pyd.pyd</h1> 6 <!-- Generated by Ddoc from pyd\pyd.d --> 3 7 This module simply publicly imports all of the other components of the Pyd 4 8 package, making them all available from a single point. … … 8 12 <dl></dl> 9 13 14 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 15 </body></html> trunk/infrastructure/build_wiki_ddoc.bat
r29 r33 1 C:\dmd\dmd\bin\dmd.exe -o- -Ddpyd\wiki_doc pyd\class_wrap.d pyd\ctor_wrap.d pyd\def.d pyd\dg_convert.d pyd\exception.d pyd\ftype.d pyd\make_object.d pyd\dpyobject.d pyd\pyd.d pyd\wiki_doc\wiki_doc\wikidoc.ddoc1 C:\dmd\dmd\bin\dmd.exe -o- -Ddpyd\wiki_doc pyd\class_wrap.d pyd\ctor_wrap.d pyd\def.d pyd\dg_convert.d pyd\exception.d pyd\ftype.d pyd\make_object.d pyd\dpyobject.d pyd\pyd.d -Ipython\headers 2 2 3 3 pause trunk/infrastructure/pyd/wiki_doc/class_wrap.html
r25 r33 1 <h1>pyd.class_wrap</h1> 2 <!-- Generated by Ddoc from pyd\class_wrap.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.class_wrap</title> 4 </head><body> 5 <h1>pyd.class_wrap</h1> 6 <!-- Generated by Ddoc from pyd\class_wrap.d --> 3 7 <br><br> 4 <dl><dt><big>struct <u> <u>wrapped_class_object</u></u>;8 <dl><dt><big>struct <u>wrapped_class_object</u>; 5 9 </big></dt> 6 10 <dd>The class object, a subtype of PyObject … … 9 13 <dl></dl> 10 14 </dd> 11 <dt><big>template <u>wrapped_class_type</u>(T)</big></dt>15 <dt><big>template wrapped_class_type(T)</big></dt> 12 16 <dd><br><br> 13 17 <dl><dt><big>PyTypeObject <u>wrapped_class_type</u>; … … 19 23 </dl> 20 24 </dd> 21 <dt><big>template <u>wrapped_methods</u>(T)</big></dt>25 <dt><big>template wrapped_methods(T)</big></dt> 22 26 <dd>Various wrapped methods 23 27 <br><br> … … 35 39 36 40 </dd> 37 <dt><big>PyObject* <u>wrapped_repr</u>(PyObject* <i>_self</i>);38 </big></dt>39 <dd>The default repr method calls the class's toString.40 <br><br>41 42 </dd>43 41 </dl> 44 42 </dd> 45 <dt><big>template <u>wrapped_init</u>(T)</big></dt>43 <dt><big>template wrapped_init(T)</big></dt> 46 44 <dd><br><br> 47 45 <dl><dt><big>int <u>init</u>(PyObject* <i>self</i>, PyObject* <i>args</i>, PyObject* <i>kwds</i>); … … 53 51 </dl> 54 52 </dd> 55 <dt><big>template <u>wrapped_get</u>(T,alias Fn)</big></dt>53 <dt><big>template wrapped_get(T,alias Fn)</big></dt> 56 54 <dd><br><br> 57 55 <dl><dt><big>PyObject* <u>func</u>(PyObject* <i>self</i>, void* <i>closure</i>); … … 63 61 </dl> 64 62 </dd> 65 <dt><big>template <u>wrapped_set</u>(T,alias Fn)</big></dt>63 <dt><big>template wrapped_set(T,alias Fn)</big></dt> 66 64 <dd><br><br> 67 65 <dl><dt><big>int <u>func</u>(PyObject* <i>self</i>, PyObject* <i>value</i>, void* <i>closure</i>); … … 73 71 </dl> 74 72 </dd> 75 <dt><big>template <u>is_wrapped</u>(T)</big></dt>73 <dt><big>template is_wrapped(T)</big></dt> 76 74 <dd>A useful check for whether a given class has been wrapped. Mainly used by 77 75 the conversion functions (see make_object.d), but possibly useful elsewhere. … … 81 79 <dl></dl> 82 80 </dd> 83 <dt><big>struct <u> <u>wrapped_class</u></u>;81 <dt><big>struct <u>wrapped_class</u>; 84 82 </big></dt> 85 83 <dd>This struct wraps a D class. Its member functions are the primary way of … … 88 86 <br><br> 89 87 90 <dl><dt><big>template <u>def</u>(char[] name,alias fn,uint MIN_ARGS = NumberOfArgs!(typeof(&fn)),fn_t = typeof(&fn))</big></dt>88 <dl><dt><big>template def(alias fn,char[] name,fn_t = typeof(&fn),uint MIN_ARGS = MIN_ARGS!(fn))</big></dt> 91 89 <dd>Wraps a member function of the class. 92 90 <br><br> … … 105 103 <dl></dl> 106 104 </dd> 107 <dt><big>template <u>prop</u>(char[] name,alias fn,bool RO = false)</big></dt>105 <dt><big>template prop(alias fn,char[] name,bool RO = false)</big></dt> 108 106 <dd>Wraps a property of the class. 109 107 <br><br> … … 119 117 <dl></dl> 120 118 </dd> 121 <dt><big>template <u>init</u>(alias C1 = undefined,alias C2 = undefined,alias C3 = undefined,alias C4 = undefined,alias C5 = undefined,alias C6 = undefined,alias C7 = undefined,alias C8 = undefined,alias C9 = undefined,alias C10 = undefined)</big></dt>119 <dt><big>template init(C1 = Void,C2 = Void,C3 = Void,C4 = Void,C5 = Void,C6 = Void,C7 = Void,C8 = Void,C9 = Void,C10 = Void)</big></dt> 122 120 <dd>Wraps the constructors of the class. 123 121 <br><br> … … 140 138 </dl> 141 139 140 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 141 </body></html> trunk/infrastructure/pyd/wiki_doc/ctor_wrap.html
r25 r33 1 <h1>pyd.ctor_wrap</h1> 2 <!-- Generated by Ddoc from pyd\ctor_wrap.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.ctor_wrap</title> 4 </head><body> 5 <h1>pyd.ctor_wrap</h1> 6 <!-- Generated by Ddoc from pyd\ctor_wrap.d --> 3 7 <br><br> 4 <dl><dt><big>template <u>ctor</u>(T1 = void,T2 = void,T3 = void,T4 = void,T5 = void,T6 = void,T7 = void,T8 = void,T9 = void,T10 = void)</big></dt> 5 <dd>This template defines the footprint of an individual constructor. 6 7 <br><br> 8 <dl></dl> 8 9 9 <dl></dl> 10 </dd> 11 </dl> 12 10 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 11 </body></html> trunk/infrastructure/pyd/wiki_doc/def.html
r25 r33 1 <h1>pyd.def</h1> 2 <!-- Generated by Ddoc from pyd\def.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.def</title> 4 </head><body> 5 <h1>pyd.def</h1> 6 <!-- Generated by Ddoc from pyd\def.d --> 3 7 <br><br> 4 <dl><dt><big>template <u>def</u>(char[] name,alias fn,uint MIN_ARGS = NumberOfArgs!(typeof(&fn)),fn_t = typeof(&fn))</big></dt>8 <dl><dt><big>template def(alias fn,char[] name,fn_t = typeof(&fn),uint MIN_ARGS = MIN_ARGS!(fn))</big></dt> 5 9 <dd>Wraps a D function, making it callable from Python. 6 10 <br><br> … … 51 55 </dl> 52 56 57 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 58 </body></html> trunk/infrastructure/pyd/wiki_doc/dg_convert.html
r25 r33 1 <h1>pyd.dg_convert</h1> 2 <!-- Generated by Ddoc from pyd\dg_convert.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.dg_convert</title> 4 </head><body> 5 <h1>pyd.dg_convert</h1> 6 <!-- Generated by Ddoc from pyd\dg_convert.d --> 3 7 This module contains some more or less dirty hacks for converting between 4 8 function and delegate types. Its contents are strictly for internal use … … 7 11 <br><br> 8 12 9 <dl><dt><big>template <u>fn_to_dg</u>(Fn)</big></dt>13 <dl><dt><big>template fn_to_dg(Fn)</big></dt> 10 14 <dd>This template converts a function type into an equivalent delegate type. 11 15 … … 16 20 </dl> 17 21 22 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 23 </body></html> trunk/infrastructure/pyd/wiki_doc/exception.html
r24 r33 1 <h1>pyd.exception</h1> 2 <!-- Generated by Ddoc from pyd\exception.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.exception</title> 4 </head><body> 5 <h1>pyd.exception</h1> 6 <!-- Generated by Ddoc from pyd\exception.d --> 3 7 <br><br> 4 8 <dl><dt><big>void <u>handle_exception</u>(); … … 24 28 </dl> 25 29 30 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 31 </body></html> trunk/infrastructure/pyd/wiki_doc/ftype.html
r25 r33 1 <h1>pyd.ftype</h1> 2 <!-- Generated by Ddoc from pyd\ftype.d --> 3 This module contains templates for inferring the number of arguments, 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.ftype</title> 4 </head><body> 5 <h1>pyd.ftype</h1> 6 <!-- Generated by Ddoc from pyd\ftype.d --> 7 This module contains template for inferring the number of arguments, 4 8 the return type, and argument types of an arbitrary function pointer. 5 9 <br><br> 6 Portions of this module were automatically generated by Python modules. 10 This module was automatically generated by <u>ftype</u>.py 11 <br><br> 7 12 8 <br><br> 9 <b>Authors:</b><br> 10 Daniel Keep, Tomasz Stachowiak 11 <br><br> 12 <b>Date:</b><br> 13 Sat Jul 1 22:15:08 2006 14 13 Written by Daniel Keep. 14 Released to public domainâshare and enjoy (just leave my name in it, 15 pretty please). 15 16 16 17 <br><br> 17 18 18 <dl><dt><big>template <u>NumberOfArgs</u>(Tf)</big></dt> 19 <dd>Derives the number of arguments the passed function type accepts. It only 20 works on functions with 10 or fewer arguments. 19 <dl><dt><big>template NumberOfArgs(Tf)</big></dt> 20 <dd>This template will attempt to determine the number of arguments the 21 supplied function pointer or delegate type takes. It supports a maximum of 22 10 arguments. 23 <br><br> 24 <b>Example:</b><br> 25 <pre class="d_code"> <font color=blue>void</font> fnWithThreeArgs(<font color=blue>byte</font> a, <font color=blue>short</font> b, <font color=blue>int</font> c) {} 26 <font color=blue>const</font> <font color=blue>uint</font> numArgs = <u>NumberOfArgs</u>!(<font color=blue>typeof</font>(&fnWithThreeArgs)); 27 </pre> 21 28 22 29 <br><br> … … 24 31 <dl></dl> 25 32 </dd> 26 <dt><big>template <u>ReturnType</u>(T)</big></dt> 27 <dd>Derives the return type of the passed function type. 33 <dt><big>template ReturnType(Tf)</big></dt> 34 <dd>This template will attempt to discern the return type of the supplied 35 function pointer or delegate type. It supports callables with a maximum of 36 10 arguments. 37 <br><br> 38 <b>Example:</b><br> 39 <pre class="d_code"> <font color=blue>uint</font> returnsANumber() { <font color=blue>return</font> 42; } 40 <font color=blue>alias</font> <u>ReturnType</u>!(<font color=blue>typeof</font>(&returnsANumber)) RType; <font color=green>// RType == uint 41 </font></pre> 28 42 29 43 <br><br> … … 31 45 <dl></dl> 32 46 </dd> 33 <dt><big>template <u>ArgType</u>(Tf,uint n)</big></dt> 34 <dd>Derives the type of an individual argument of function Tf. 47 <dt><big>template ArgType(Tf,uint n)</big></dt> 48 <dd>This template will attempt to extract the type of the nth argument of the 49 given function pointer or delegate type. It supports callables with up to 50 10 arguments. 35 51 <br><br> 36 <b>Params:</b><br> 37 <table><tr><td>Tf</td> 38 <td>A function pointer type</td></tr> 39 <tr><td>n</td> 40 <td>The 1-indexed function argument to get the type of, e.g.: 41 <pre class="d_code">int func(int, char, real); 42 static assert( is(char == ArgType(&func, 2)) );</pre></td></tr> 43 </table><br> 52 <b>Example:</b><br> 53 <pre class="d_code"> <font color=blue>void</font> intShortBool(<font color=blue>int</font> a, <font color=blue>short</font> b, <font color=blue>bool</font> c) {} 54 <font color=blue>alias</font> <u>ArgType</u>!(<font color=blue>typeof</font>(&intShortBool), 2) TArg2; <font color=green>// TArg2 == short 55 </font></pre> 56 57 <br><br> 58 59 <dl></dl> 60 </dd> 61 <dt><big>template MIN_ARGS(alias fn)</big></dt> 62 <dd>This template will attempt to determine the minimum number of arguments a 63 function can accept. Note that this accepts an alias parameter rather than a 64 function pointer type, as the function and delegate types contain no 65 information about default arguments. 66 <br><br> 67 (Written by Kirk McDonald.) 68 69 <br><br> 44 70 45 71 <dl></dl> … … 47 73 </dl> 48 74 75 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 76 </body></html> trunk/infrastructure/pyd/wiki_doc/make_object.html
r24 r33 1 <h1>pyd.make_object</h1> 2 <!-- Generated by Ddoc from pyd\make_object.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.make_object</title> 4 </head><body> 5 <h1>pyd.make_object</h1> 6 <!-- Generated by Ddoc from pyd\make_object.d --> 3 7 This module contains some useful type conversion functions. There are two 4 8 interesting operations involved here: … … 16 20 <br><br> 17 21 18 <dl><dt><big>template <u>_py</u>(T)</big></dt>22 <dl><dt><big>template _py(T)</big></dt> 19 23 <dd><br><br> 20 24 <dl><dt><big>PyObject* <u>_py</u>(T <i>t</i>); … … 34 38 </dl> 35 39 </dd> 36 <dt><big>template <u>py</u>(T)</big></dt>40 <dt><big>template py(T)</big></dt> 37 41 <dd><br><br> 38 42 <dl><dt><big>DPyObject <u>py</u>(T <i>t</i>); … … 62 66 <dl></dl> 63 67 </dd> 64 <dt><big>template <u>d_type</u>(T)</big></dt>68 <dt><big>template d_type(T)</big></dt> 65 69 <dd><br><br> 66 70 <dl><dt><big>T <u>d_type</u>(PyObject* <i>o</i>); … … 84 88 </dl> 85 89 90 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 91 </body></html> trunk/infrastructure/pyd/wiki_doc/pyd.html
r24 r33 1 <h1>pyd.pyd</h1> 2 <!-- Generated by Ddoc from pyd\pyd.d --> 1 <html><head> 2 <META http-equiv="content-type" content="text/html; charset=utf-8"> 3 <title>pyd.pyd</title> 4 </head><body> 5 <h1>pyd.pyd</h1> 6 <!-- Generated by Ddoc from pyd\pyd.d --> 3 7 This module simply publicly imports all of the other components of the Pyd 4 8 package, making them all available from a single point. … … 8 12 <dl></dl> 9 13 14 <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> 15 </body></html>
