Changeset 25

Show
Ignore:
Timestamp:
07/02/06 01:27:18 (2 years ago)
Author:
KirkMcDonald
Message:

Fleshed out the docs a little.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/infrastructure/pyd/class_wrap.d

    r24 r25  
    2929private import std.string; 
    3030 
    31 // The class object, a subtype of PyObject 
     31/// The class object, a subtype of PyObject 
    3232template wrapped_class_object(T) { 
    3333    extern(C) 
     
    3838} 
    3939 
    40 // The type object, an instance of PyType_Type 
     40/// 
    4141template wrapped_class_type(T) { 
     42/// The type object, an instance of PyType_Type 
    4243    static PyTypeObject wrapped_class_type = { 
    4344        1, 
     
    9293} 
    9394 
    94 // Various wrapped methods 
     95/// Various wrapped methods 
    9596template wrapped_methods(T) { 
    9697    alias wrapped_class_object!(T) wrap_object; 
     98    /// The generic "__new__" method 
    9799    extern(C) 
    98100    PyObject* wrapped_new(PyTypeObject* type, PyObject* args, PyObject* kwds) { 
     
    107109    } 
    108110 
     111    /// The generic dealloc method. 
    109112    extern(C) 
    110113    void wrapped_dealloc(PyObject* _self) { 
     
    119122    } 
    120123 
     124    /// The default repr method calls the class's toString. 
    121125    extern(C) 
    122126    PyObject* wrapped_repr(PyObject* _self) { 
     
    127131} 
    128132 
     133/// 
    129134template wrapped_init(T) { 
    130135    alias wrapped_class_object!(T) wrap_object; 
     136    /// The default _init method calls the class's zero-argument constructor. 
    131137    extern(C) 
    132138    int init(PyObject* self, PyObject* args, PyObject* kwds) { 
     
    157163} 
    158164 
     165/// 
    159166template wrapped_get(T, alias Fn) { 
     167    /// A generic wrapper around a "getter" property. 
    160168    extern(C) 
    161169    PyObject* func(PyObject* self, void* closure) { 
     
    164172} 
    165173 
    166 private import std.stdio; 
    167  
     174/// 
    168175template wrapped_set(T, alias Fn) { 
     176    /// A generic wrapper around a "setter" property. 
    169177    extern(C) 
    170178    int func(PyObject* self, PyObject* value, void* closure) { 
     
    189197} 
    190198 
    191 // A useful check for whether a given class has been wrapped. Mainly used by 
    192 // the conversion functions (see make_object.d), but possibly useful elsewhere. 
     199/** 
     200 * A useful check for whether a given class has been wrapped. Mainly used by 
     201 * the conversion functions (see make_object.d), but possibly useful elsewhere. 
     202 */ 
    193203template is_wrapped(T) { 
    194204    bool is_wrapped = false; 
     
    209219} 
    210220 
    211 // This struct is returned by wrap_class. Its member functions are the primary 
    212 // way of wrapping the specific parts of the class. Note that the struct has no 
    213 // members. The only information it carries are its template arguments. 
     221/** 
     222 * This struct wraps a D class. Its member functions are the primary way of 
     223 * wrapping the specific parts of the class. 
     224 */ 
    214225template wrapped_class(char[] classname, T) { 
    215226    struct wrapped_class { 
    216227        static const char[] _name = classname; 
    217228        T t = null; 
     229        /** 
     230         * Wraps a member function of the class. 
     231         * 
     232         * Params: 
     233         * name = The name of the function as it will appear in Python. 
     234         * fn = The member function to wrap. 
     235         * MIN_ARGS = The minimum number of arguments this function can accept. 
     236         * fn_t = The type of the function. It is only useful to specify this 
     237         *        if more than one function has the same name as this one. 
     238         */ 
    218239        template def(char[] name, alias fn, uint MIN_ARGS = NumberOfArgs!(typeof(&fn)), fn_t=typeof(&fn)) { 
    219             void def() { 
     240            static void def() { 
    220241                static PyMethodDef empty = { null, null, 0, null }; 
    221242                wrapped_method_list!(T)[length-1].ml_name = name ~ \0; 
     
    232253        } 
    233254 
     255        /** 
     256         * Wraps a property of the class. 
     257         * 
     258         * Params: 
     259         * name = The name of the property as it will appear in Python. 
     260         * fn = The property to wrap. 
     261         * RO = Whether this is a read-only property. 
     262         */ 
    234263        template prop(char[] name, alias fn, bool RO=false) { 
    235             void prop() { 
     264            static void prop() { 
    236265                static PyGetSetDef empty = { null, null, null, null, null }; 
    237266                wrapped_prop_list!(T)[length-1].name = name ~ \0; 
     
    252281        } 
    253282 
     283        /** 
     284         * Wraps the constructors of the class. 
     285         * 
     286         * This template takes a series of specializations of the ctor template 
     287         * (see ctor_wrap.d), each of which describes a different constructor 
     288         * that the class supports. The default constructor need not be 
     289         * specified, and will always be available if the class supports it. 
     290         * 
     291         * Bugs: 
     292         * This currently does not support having multiple constructors with 
     293         * the same number of arguments. 
     294         */ 
    254295        template init(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) { 
    255             void init() { 
     296            static void init() { 
    256297                wrapped_class_type!(T).tp_init = 
    257298                    &wrapped_ctors!(T, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10).init_func; 
     
    261302} 
    262303 
     304/** 
     305 * Finalize the wrapping of the class. It is neccessary to call this after all 
     306 * calls to the wrapped_class member functions. 
     307 */ 
    263308void finalize_class(CLS) (CLS cls) { 
    264309    alias typeof(cls.t) T; 
  • trunk/infrastructure/pyd/ctor_wrap.d

    r24 r25  
    2727private import pyd.make_object; 
    2828 
    29 // This template defines the footprint of an individual constructor. 
     29/** 
     30 * This template defines the footprint of an individual constructor. 
     31 */ 
    3032template ctor(T1=void, T2=void, T3=void, T4=void, T5=void, T6=void, T7=void, T8=void, T9=void, T10=void) { 
    3133    static if (!is(T10 == void)) 
     
    182184} 
    183185 
    184 // This template accepts a list of "ctor" templates and uses them to wrap a Pyhton __init__ function. 
     186// This template accepts a list of "ctor" templates and uses them to wrap a Python __init__ function. 
    185187template wrapped_ctors(T, alias C1, alias C2, alias C3, alias C4, alias C5, alias C6, alias C7, alias C8, alias C9, alias C10) { 
    186188    alias wrapped_class_object!(T) wrap_object; 
  • trunk/infrastructure/pyd/def.d

    r24 r25  
    5252 *                 For use with functions with default arguments. Defaults to 
    5353 *                 the maximum number of arguments this function supports. 
     54 *      fn_t = The function type of the function to wrap. This must be 
     55 *             specified if more than one function shares the same name, 
     56 *             otherwise the first one defined lexically will be used. 
    5457 * 
    5558 * Examples: 
  • trunk/infrastructure/pyd/dg_convert.d

    r24 r25  
    2020SOFTWARE. 
    2121*/ 
     22 
     23/** 
     24 * This module contains some more or less dirty hacks for converting between 
     25 * function and delegate types. Its contents are strictly for internal use 
     26 * within Pyd. 
     27 */ 
    2228module pyd.dg_convert; 
    2329 
  • trunk/infrastructure/pyd/doc/class_wrap.html

    r24 r25  
    1717 
    1818<script>explorer.outline.incSymbolLevel();</script> 
     19<dl> 
     20<script>explorer.outline.writeEnabled = true;</script> 
     21<dt><span class="decl">struct  
     22<span class="currsymbol"> 
     23<span class="currsymbol">wrapped_class_object</span> 
     24<script>explorer.outline.addDecl('wrapped_class_object');</script> 
     25 
     26</span> 
     27<script>explorer.outline.addDecl(' 
     28<span class="currsymbol">wrapped_class_object</span> 
     29<script>explorer.outline.addDecl('wrapped_class_object');</script> 
     30 
     31');</script> 
     32 
     33; 
     34</span></dt> 
     35<script>explorer.outline.writeEnabled = false;</script> 
     36 
     37 
     38<dd>The class object, a subtype of PyObject 
     39<br><br> 
     40 
     41 
     42<script>explorer.outline.incSymbolLevel();</script> 
    1943<dl></dl> 
     44<script>explorer.outline.decSymbolLevel();</script> 
     45 
     46 
     47</dd> 
     48 
     49<script>explorer.outline.writeEnabled = true;</script> 
     50<dt><span class="decl">template  
     51<span class="currsymbol">wrapped_class_type</span> 
     52<script>explorer.outline.addDecl('wrapped_class_type');</script> 
     53 
     54(T)</span></dt> 
     55<script>explorer.outline.writeEnabled = false;</script> 
     56 
     57 
     58<dd><br><br> 
     59 
     60<script>explorer.outline.incSymbolLevel();</script> 
     61<dl> 
     62<script>explorer.outline.writeEnabled = true;</script> 
     63<dt><span class="decl">PyTypeObject  
     64<span class="currsymbol">wrapped_class_type</span> 
     65<script>explorer.outline.addDecl('wrapped_class_type');</script> 
     66 
     67; 
     68</span></dt> 
     69<script>explorer.outline.writeEnabled = false;</script> 
     70 
     71 
     72<dd>The type object, an instance of PyType_Type 
     73<br><br> 
     74 
     75</dd> 
     76</dl> 
     77<script>explorer.outline.decSymbolLevel();</script> 
     78 
     79 
     80</dd> 
     81 
     82<script>explorer.outline.writeEnabled = true;</script> 
     83<dt><span class="decl">template  
     84<span class="currsymbol">wrapped_methods</span> 
     85<script>explorer.outline.addDecl('wrapped_methods');</script> 
     86 
     87(T)</span></dt> 
     88<script>explorer.outline.writeEnabled = false;</script> 
     89 
     90 
     91<dd>Various wrapped methods 
     92<br><br> 
     93 
     94 
     95<script>explorer.outline.incSymbolLevel();</script> 
     96<dl> 
     97<script>explorer.outline.writeEnabled = true;</script> 
     98<dt><span class="decl">PyObject*  
     99<span class="currsymbol">wrapped_new</span> 
     100<script>explorer.outline.addDecl('wrapped_new');</script> 
     101 
     102(PyTypeObject* <span class="funcparam">type</span>, PyObject* <span class="funcparam">args</span>, PyObject* <span class="funcparam">kwds</span>); 
     103</span></dt> 
     104<script>explorer.outline.writeEnabled = false;</script> 
     105 
     106 
     107<dd>The generic "_new__" method 
     108<br><br> 
     109 
     110</dd> 
     111 
     112<script>explorer.outline.writeEnabled = true;</script> 
     113<dt><span class="decl">void  
     114<span class="currsymbol">wrapped_dealloc</span> 
     115<script>explorer.outline.addDecl('wrapped_dealloc');</script> 
     116 
     117(PyObject* <span class="funcparam">_self</span>); 
     118</span></dt> 
     119<script>explorer.outline.writeEnabled = false;</script> 
     120 
     121 
     122<dd>The generic dealloc method. 
     123<br><br> 
     124 
     125</dd> 
     126 
     127<script>explorer.outline.writeEnabled = true;</script> 
     128<dt><span class="decl">PyObject*  
     129<span class="currsymbol">wrapped_repr</span> 
     130<script>explorer.outline.addDecl('wrapped_repr');</script> 
     131 
     132(PyObject* <span class="funcparam">_self</span>); 
     133</span></dt> 
     134<script>explorer.outline.writeEnabled = false;</script> 
     135 
     136 
     137<dd>The default repr method calls the class's toString. 
     138<br><br> 
     139 
     140</dd> 
     141</dl> 
     142<script>explorer.outline.decSymbolLevel();</script> 
     143 
     144 
     145</dd> 
     146 
     147<script>explorer.outline.writeEnabled = true;</script> 
     148<dt><span class="decl">template  
     149<span class="currsymbol">wrapped_init</span> 
     150<script>explorer.outline.addDecl('wrapped_init');</script> 
     151 
     152(T)</span></dt> 
     153<script>explorer.outline.writeEnabled = false;</script> 
     154 
     155 
     156<dd><br><br> 
     157 
     158<script>explorer.outline.incSymbolLevel();</script> 
     159<dl> 
     160<script>explorer.outline.writeEnabled = true;</script> 
     161<dt><span class="decl">int  
     162<span class="currsymbol">init</span> 
     163<script>explorer.outline.addDecl('init');</script> 
     164 
     165(PyObject* <span class="funcparam">self</span>, PyObject* <span class="funcparam">args</span>, PyObject* <span class="funcparam">kwds</span>); 
     166</span></dt> 
     167<script>explorer.outline.writeEnabled = false;</script> 
     168 
     169 
     170<dd>The default init method calls the class's zero-argument constructor. 
     171<br><br> 
     172 
     173</dd> 
     174</dl> 
     175<script>explorer.outline.decSymbolLevel();</script> 
     176 
     177 
     178</dd> 
     179 
     180<script>explorer.outline.writeEnabled = true;</script> 
     181<dt><span class="decl">template  
     182<span class="currsymbol">wrapped_get</span> 
     183<script>explorer.outline.addDecl('wrapped_get');</script> 
     184 
     185(T,alias Fn)</span></dt> 
     186<script>explorer.outline.writeEnabled = false;</script> 
     187 
     188 
     189<dd><br><br> 
     190 
     191<script>explorer.outline.incSymbolLevel();</script> 
     192<dl> 
     193<script>explorer.outline.writeEnabled = true;</script> 
     194<dt><span class="decl">PyObject*  
     195<span class="currsymbol">func</span> 
     196<script>explorer.outline.addDecl('func');</script> 
     197 
     198(PyObject* <span class="funcparam">self</span>, void* <span class="funcparam">closure</span>); 
     199</span></dt> 
     200<script>explorer.outline.writeEnabled = false;</script> 
     201 
     202 
     203<dd>A generic wrapper around a "getter" property. 
     204<br><br> 
     205 
     206</dd> 
     207</dl> 
     208<script>explorer.outline.decSymbolLevel();</script> 
     209 
     210 
     211</dd> 
     212 
     213<script>explorer.outline.writeEnabled = true;</script> 
     214<dt><span class="decl">template  
     215<span class="currsymbol">wrapped_set</span> 
     216<script>explorer.outline.addDecl('wrapped_set');</script> 
     217 
     218(T,alias Fn)</span></dt> 
     219<script>explorer.outline.writeEnabled = false;</script> 
     220 
     221 
     222<dd><br><br> 
     223 
     224<script>explorer.outline.incSymbolLevel();</script> 
     225<dl> 
     226<script>explorer.outline.writeEnabled = true;</script> 
     227<dt><span class="decl">int  
     228<span class="currsymbol">func</span> 
     229<script>explorer.outline.addDecl('func');</script> 
     230 
     231(PyObject* <span class="funcparam">self</span>, PyObject* <span class="funcparam">value</span>, void* <span class="funcparam">closure</span>); 
     232</span></dt> 
     233<script>explorer.outline.writeEnabled = false;</script> 
     234 
     235 
     236<dd>A generic wrapper around a "setter" property. 
     237<br><br> 
     238 
     239</dd> 
     240</dl> 
     241<script>explorer.outline.decSymbolLevel();</script> 
     242 
     243 
     244</dd> 
     245 
     246<script>explorer.outline.writeEnabled = true;</script> 
     247<dt><span class="decl">template  
     248<span class="currsymbol">is_wrapped</span> 
     249<script>explorer.outline.addDecl('is_wrapped');</script> 
     250 
     251(T)</span></dt> 
     252<script>explorer.outline.writeEnabled = false;</script> 
     253 
     254 
     255<dd>A useful check for whether a given class has been wrapped. Mainly used by 
     256 the conversion functions (see make_object.d), but possibly useful elsewhere. 
     257  
     258<br><br> 
     259 
     260 
     261<script>explorer.outline.incSymbolLevel();</script> 
     262<dl></dl> 
     263<script>explorer.outline.decSymbolLevel();</script> 
     264 
     265 
     266</dd> 
     267 
     268<script>explorer.outline.writeEnabled = true;</script> 
     269<dt><span class="decl">struct  
     270<span class="currsymbol"> 
     271<span class="currsymbol">wrapped_class</span> 
     272<script>explorer.outline.addDecl('wrapped_class');</script> 
     273 
     274</span> 
     275<script>explorer.outline.addDecl(' 
     276<span class="currsymbol">wrapped_class</span> 
     277<script>explorer.outline.addDecl('wrapped_class');</script> 
     278 
     279');</script> 
     280 
     281; 
     282</span></dt> 
     283<script>explorer.outline.writeEnabled = false;</script> 
     284 
     285 
     286<dd>This struct wraps a D class. Its member functions are the primary way of 
     287 wrapping the specific parts of the class. 
     288  
     289<br><br> 
     290 
     291 
     292<script>explorer.outline.incSymbolLevel();</script> 
     293<dl> 
     294<script>explorer.outline.writeEnabled = true;</script> 
     295<dt><span class="decl">template  
     296<span class="currsymbol">def</span> 
     297<script>explorer.outline.addDecl('def');</script> 
     298 
     299(char[] name,alias fn,uint MIN_ARGS = NumberOfArgs!(typeof(&amp;fn)),fn_t = typeof(&amp;fn))</span></dt> 
     300<script>explorer.outline.writeEnabled = false;</script> 
     301 
     302 
     303<dd>Wraps a member function of the class. 
     304<br><br> 
     305<b>Params:</b><br> 
     306<table><tr> 
     307<td nowrap valign="top" style="padding-right: 8px">name</td> 
     308 
     309                
     310<td>The name of the function as it will appear in Python.</td></tr> 
     311<tr> 
     312<td nowrap valign="top" style="padding-right: 8px">fn</td> 
     313 
     314                
     315<td>The member function to wrap.</td></tr> 
     316<tr> 
     317<td nowrap valign="top" style="padding-right: 8px">MIN_ARGS</td> 
     318 
     319                
     320<td>The minimum number of arguments this function can accept.</td></tr> 
     321<tr> 
     322<td nowrap valign="top" style="padding-right: 8px">fn_t</td> 
     323 
     324                
     325<td>The type of the function. It is only useful to specify this 
     326        if more than one function has the same name as this one.</td></tr> 
     327</table><br> 
     328 
     329 
     330<script>explorer.outline.incSymbolLevel();</script> 
     331<dl></dl> 
     332<script>explorer.outline.decSymbolLevel();</script> 
     333 
     334 
     335</dd> 
     336 
     337<script>explorer.outline.writeEnabled = true;</script> 
     338<dt><span class="decl">template  
     339<span class="currsymbol">prop</span> 
     340<script>explorer.outline.addDecl('prop');</script> 
     341 
     342(char[] name,alias fn,bool RO = false)</span></dt> 
     343<script>explorer.outline.writeEnabled = false;</script> 
     344 
     345 
     346<dd>Wraps a property of the class. 
     347<br><br> 
     348<b>Params:</b><br> 
     349<table><tr> 
     350<td nowrap valign="top" style="padding-right: 8px">name</td> 
     351 
     352                
     353<td>The name of the property as it will appear in Python.</td></tr> 
     354<tr> 
     355<td nowrap valign="top" style="padding-right: 8px">fn</td> 
     356 
     357                
     358<td>The property to wrap.</td></tr> 
     359<tr> 
     360<td nowrap valign="top" style="padding-right: 8px">RO</td> 
     361 
     362                
     363<td>Whether this is a read-only property.</td></tr> 
     364</table><br> 
     365 
     366 
     367<script>explorer.outline.incSymbolLevel();</script> 
     368<dl></dl> 
     369<script>explorer.outline.decSymbolLevel();</script> 
     370 
     371 
     372</dd> 
     373 
     374<script>explorer.outline.writeEnabled = true;</script> 
     375<dt><span class="decl">template  
     376<span class="currsymbol">init</span> 
     377<script>explorer.outline.addDecl('init');</script> 
     378 
     379(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)</span></dt> 
     380<script>explorer.outline.writeEnabled = false;</script> 
     381 
     382 
     383<dd>Wraps the constructors of the class. 
     384<br><br> 
     385This template takes a series of specializations of the ctor template 
     386 (see ctor_wrap.d), each of which describes a different constructor 
     387 that the class supports. The default constructor need not be 
     388 specified, and will always be available if the class supports it. 
     389 
     390<br><br> 
     391<font color=red>BUGS:</font><br> 
     392This currently does not support having multiple constructors with 
     393 the same number of arguments. 
     394          
     395<br><br> 
     396 
     397 
     398<script>explorer.outline.incSymbolLevel();</script> 
     399<dl></dl> 
     400<script>explorer.outline.decSymbolLevel();</script> 
     401 
     402 
     403</dd> 
     404</dl> 
     405<script>explorer.outline.decSymbolLevel();</script> 
     406 
     407 
     408</dd> 
     409</dl> 
    20410<script>explorer.outline.decSymbolLevel();</script> 
    21411 
     
    25415            Page was generated with 
    26416            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    27             on Sat Jul  1 17:20:37 2006 
     417            on Sat Jul  1 22:14:02 2006 
    28418 
    29419        </td></tr> 
  • trunk/infrastructure/pyd/doc/ctor_wrap.html

    r24 r25  
    1717 
    1818<script>explorer.outline.incSymbolLevel();</script> 
     19<dl> 
     20<script>explorer.outline.writeEnabled = true;</script> 
     21<dt><span class="decl">template  
     22<span class="currsymbol">ctor</span> 
     23<script>explorer.outline.addDecl('ctor');</script> 
     24 
     25(T1 = void,T2 = void,T3 = void,T4 = void,T5 = void,T6 = void,T7 = void,T8 = void,T9 = void,T10 = void)</span></dt> 
     26<script>explorer.outline.writeEnabled = false;</script> 
     27 
     28 
     29<dd>This template defines the footprint of an individual constructor. 
     30  
     31<br><br> 
     32 
     33 
     34<script>explorer.outline.incSymbolLevel();</script> 
    1935<dl></dl> 
     36<script>explorer.outline.decSymbolLevel();</script> 
     37 
     38 
     39</dd> 
     40</dl> 
    2041<script>explorer.outline.decSymbolLevel();</script> 
    2142 
     
    2546            Page was generated with 
    2647            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    27             on Sat Jul  1 17:20:37 2006 
     48            on Sat Jul  1 22:14:02 2006 
    2849 
    2950        </td></tr> 
  • trunk/infrastructure/pyd/doc/def.html

    r24 r25  
    4747                 For use with functions with default arguments. Defaults to 
    4848                 the maximum number of arguments this function supports.</td></tr> 
     49<tr> 
     50<td nowrap valign="top" style="padding-right: 8px">fn_t</td> 
     51 
     52                
     53<td>The function type of the function to wrap. This must be 
     54             specified if more than one function shares the same name, 
     55             otherwise the first one defined lexically will be used.</td></tr> 
    4956</table><br> 
    5057<b>Examples:</b><br> 
     
    100107            Page was generated with 
    101108            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    102             on Sat Jul  1 17:20:37 2006 
     109            on Sat Jul  1 22:14:02 2006 
    103110 
    104111        </td></tr> 
  • trunk/infrastructure/pyd/doc/dg_convert.html

    r24 r25  
    1414    <table class="content"> 
    1515        <tr><td id="docbody"><h1>pyd.dg_convert</h1><!-- Generated by Ddoc from pyd\dg_convert.d --> 
     16This module contains some more or less dirty hacks for converting between 
     17 function and delegate types. Its contents are strictly for internal use 
     18 within Pyd. 
     19  
    1620<br><br> 
     21 
    1722 
    1823<script>explorer.outline.incSymbolLevel();</script> 
     
    4651            Page was generated with 
    4752            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    48             on Sat Jul  1 17:20:37 2006 
     53            on Sat Jul  1 22:14:02 2006 
    4954 
    5055        </td></tr> 
  • trunk/infrastructure/pyd/doc/exception.html

    r24 r25  
    6868            Page was generated with 
    6969            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    70             on Sat Jul  1 17:20:37 2006 
     70            on Sat Jul  1 22:14:02 2006 
    7171 
    7272        </td></tr> 
  • trunk/infrastructure/pyd/doc/ftype.html

    r24 r25  
    2424<br><br> 
    2525<b>Date:</b><br> 
    26 Sat Jul  1 17:20:37 2006 
     26Sat Jul  1 22:14:02 2006 
    2727 
    2828  
     
    116116            Page was generated with 
    117117            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    118             on Sat Jul  1 17:20:37 2006 
     118            on Sat Jul  1 22:14:02 2006 
    119119 
    120120        </td></tr> 
  • trunk/infrastructure/pyd/doc/make_object.html

    r24 r25  
    192192            Page was generated with 
    193193            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    194             on Sat Jul  1 17:20:37 2006 
     194            on Sat Jul  1 22:14:02 2006 
    195195 
    196196        </td></tr> 
  • trunk/infrastructure/pyd/doc/object.html

    r24 r25  
    15121512            Page was generated with 
    15131513            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    1514             on Sat Jul  1 17:20:37 2006 
     1514            on Sat Jul  1 22:14:02 2006 
    15151515 
    15161516        </td></tr> 
  • trunk/infrastructure/pyd/doc/pyd.html

    r24 r25  
    2929            Page was generated with 
    3030            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    31             on Sat Jul  1 17:20:37 2006 
     31            on Sat Jul  1 22:14:02 2006 
    3232 
    3333        </td></tr> 
  • trunk/infrastructure/pyd/wiki_doc/class_wrap.html

    r24 r25  
    22<!-- Generated by Ddoc from pyd\class_wrap.d --> 
    33<br><br> 
     4<dl><dt><big>struct <u><u>wrapped_class_object</u></u>; 
     5</big></dt> 
     6<dd>The class object, a subtype of PyObject 
     7<br><br> 
     8 
    49<dl></dl> 
     10</dd> 
     11<dt><big>template <u>wrapped_class_type</u>(T)</big></dt> 
     12<dd><br><br> 
     13<dl><dt><big>PyTypeObject <u>wrapped_class_type</u>; 
     14</big></dt> 
     15<dd>The type object, an instance of PyType_Type 
     16<br><br> 
    517 
     18</dd> 
     19</dl> 
     20</dd> 
     21<dt><big>template <u>wrapped_methods</u>(T)</big></dt> 
     22<dd>Various wrapped methods 
     23<br><br> 
     24 
     25<dl><dt><big>PyObject* <u>wrapped_new</u>(PyTypeObject* <i>type</i>, PyObject* <i>args</i>, PyObject* <i>kwds</i>); 
     26</big></dt> 
     27<dd>The generic "_new__" method 
     28<br><br> 
     29 
     30</dd> 
     31<dt><big>void <u>wrapped_dealloc</u>(PyObject* <i>_self</i>); 
     32</big></dt> 
     33<dd>The generic dealloc method. 
     34<br><br> 
     35 
     36</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</dl> 
     44</dd> 
     45<dt><big>template <u>wrapped_init</u>(T)</big></dt> 
     46<dd><br><br> 
     47<dl><dt><big>int <u>init</u>(PyObject* <i>self</i>, PyObject* <i>args</i>, PyObject* <i>kwds</i>); 
     48</big></dt> 
     49<dd>The default init method calls the class's zero-argument constructor. 
     50<br><br> 
     51 
     52</dd> 
     53</dl> 
     54</dd> 
     55<dt><big>template <u>wrapped_get</u>(T,alias Fn)</big></dt> 
     56<dd><br><br> 
     57<dl><dt><big>PyObject* <u>func</u>(PyObject* <i>self</i>, void* <i>closure</i>); 
     58</big></dt> 
     59<dd>A generic wrapper around a "getter" property. 
     60<br><br> 
     61 
     62</dd> 
     63</dl> 
     64</dd> 
     65<dt><big>template <u>wrapped_set</u>(T,alias Fn)</big></dt> 
     66<dd><br><br> 
     67<dl><dt><big>int <u>func</u>(PyObject* <i>self</i>, PyObject* <i>value</i>, void* <i>closure</i>); 
     68</big></dt> 
     69<dd>A generic wrapper around a "setter" property. 
     70<br><br> 
     71 
     72</dd> 
     73</dl> 
     74</dd> 
     75<dt><big>template <u>is_wrapped</u>(T)</big></dt> 
     76<dd>A useful check for whether a given class has been wrapped. Mainly used by 
     77 the conversion functions (see make_object.d), but possibly useful elsewhere. 
     78  
     79<br><br> 
     80 
     81<dl></dl> 
     82</dd> 
     83<dt><big>struct <u><u>wrapped_class</u></u>; 
     84</big></dt> 
     85<dd>This struct wraps a D class. Its member functions are the primary way of 
     86 wrapping the specific parts of the class. 
     87  
     88<br><br> 
     89 
     90<dl><dt><big>template <u>def</u>(char[] name,alias fn,uint MIN_ARGS = NumberOfArgs!(typeof(&amp;fn)),fn_t = typeof(&amp;fn))</big></dt> 
     91<dd>Wraps a member function of the class. 
     92<br><br> 
     93<b>Params:</b><br> 
     94<table><tr><td>name</td> 
     95<td>The name of the function as it will appear in Python.</td></tr> 
     96<tr><td>fn</td> 
     97<td>The member function to wrap.</td></tr> 
     98<tr><td>MIN_ARGS</td> 
     99<td>The minimum number of arguments this function can accept.</td></tr> 
     100<tr><td>fn_t</td> 
     101<td>The type of the function. It is only useful to specify this 
     102        if more than one function has the same name as this one.</td></tr> 
     103</table><br> 
     104 
     105<dl></dl> 
     106</dd> 
     107<dt><big>template <u>prop</u>(char[] name,alias fn,bool RO = false)</big></dt> 
     108<dd>Wraps a property of the class. 
     109<br><br> 
     110<b>Params:</b><br> 
     111<table><tr><td>name</td> 
     112<td>The name of the property as it will appear in Python.</td></tr> 
     113<tr><td>fn</td> 
     114<td>The property to wrap.</td></tr> 
     115<tr><td>RO</td> 
     116<td>Whether this is a read-only property.</td></tr> 
     117</table><br> 
     118 
     119<dl></dl> 
     120</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> 
     122<dd>Wraps the constructors of the class. 
     123<br><br> 
     124This template takes a series of specializations of the ctor template 
     125 (see ctor_wrap.d), each of which describes a different constructor 
     126 that the class supports. The default constructor need not be 
     127 specified, and will always be available if the class supports it. 
     128 
     129<br><br> 
     130<font color=red>BUGS:</font><br> 
     131This currently does not support having multiple constructors with 
     132 the same number of arguments. 
     133          
     134<br><br> 
     135 
     136<dl></dl> 
     137</dd> 
     138</dl> 
     139</dd> 
     140</dl> 
     141 
  • trunk/infrastructure/pyd/wiki_doc/ctor_wrap.html

    r24 r25  
    22<!-- Generated by Ddoc from pyd\ctor_wrap.d --> 
    33<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 
    49<dl></dl> 
     10</dd> 
     11</dl> 
    512 
  • trunk/infrastructure/pyd/wiki_doc/def.html

    r24 r25  
    1414                 For use with functions with default arguments. Defaults to 
    1515                 the maximum number of arguments this function supports.</td></tr> 
     16<tr><td>fn_t</td> 
     17<td>The function type of the function to wrap. This must be 
     18             specified if more than one function shares the same name, 
     19             otherwise the first one defined lexically will be used.</td></tr> 
    1620</table><br> 
    1721<b>Examples:</b><br> 
  • trunk/infrastructure/pyd/wiki_doc/dg_convert.html

    r24 r25  
    11<h1>pyd.dg_convert</h1> 
    22<!-- Generated by Ddoc from pyd\dg_convert.d --> 
     3This module contains some more or less dirty hacks for converting between 
     4 function and delegate types. Its contents are strictly for internal use 
     5 within Pyd. 
     6  
    37<br><br> 
     8 
    49<dl><dt><big>template <u>fn_to_dg</u>(Fn)</big></dt> 
    510<dd>This template converts a function type into an equivalent delegate type. 
  • trunk/infrastructure/pyd/wiki_doc/ftype.html

    r24 r25  
    1111<br><br> 
    1212<b>Date:</b><br> 
    13 Sat Jul  1 17:18:42 2006 
     13Sat Jul  1 22:15:08 2006 
    1414 
    1515