3 API - wxPerl extension API documentation
7 =head2 WXPL_API_VERSION
9 An integer value used to differentiate wxPerl versions, it is guaranteed to
10 be non-decreasing. wxPerl 0.15 value is 0150; wxPerl 1.00 value will be
11 1000, wxPerl 2.12 value will be 2120.
13 I<Introduced in wxPerl 0.15>
15 =head2 wxPli_create_evthandler
17 SV* wxPli_create_evthandler( pTHX_ wxEvtHandler* object,
18 const char* classname );
20 Creates a new hash reference, blessed into C<classname>,
21 and bindsC<object> to it.
23 I<Introduced in wxPerl 0.16>
25 =head2 wxPli_evthandler_2_sv
27 SV* wxPli_evthandler_2_sv( pTHX_ SV* var, wxEvtHandler* evth );
29 Same as L<wxPli_object_2_sv>, but works with C<wxEvtHandler>-derived
30 classes, which includes all C<wxWindow>-derived classes.
32 I<Introduced in wxPerl 0.16>
34 =head2 wxPli_get_class
36 const char* wxPli_get_class( pTHX_ SV* ref );
38 The C++ equivalent of C<$class = ref( $obj ) || $obj>; the pointer
39 returned by the function is potentially temporary.
41 =head2 wxPli_non_object_2_sv
43 SV* wxPli_non_object_2_sv( pTHX_ SV* var, void* data, const char* package );
45 Binds a generic pointer to an C<SV*>, and returns it; the new binding
46 is blessed into the given C<package>.
48 I<Introduced before wxPerl 0.14>
50 =head2 wxPli_object_2_sv
52 SV* wxPli_object_2_sv( pTHX_ SV* var, wxObject* object );
54 Binds a C<wxObject*> pointer to an C<SV*>, and returns it. If the
55 object is already bound to an C<SV*>, returns a reference to the
56 existing C<SV*>, otherwise, it creates a new binding; in the latter
57 case, the new C<SV*> is blessed into a package obtained through the
58 wxWidgets RTTI system.
60 I<Introduced before wxPerl 0.14>
62 =head2 wxPli_push_arguments
64 void wxPli_push_arguments( pTHX_ SV*** stack, const char* argtypes, ... );
67 wxPli_push_arguments( aTHX_ SP, "iP", 12, "foo" );
69 Pushes a variable number of arguments on the perl stack,
70 it is useful for passing parameters to a Perl function. The
71 C<argtypes> string describes the types of subsequent arguments, each
72 character of the string specifying the type of a single
73 argument. Possible values are:
91 an C<unsigned long> value
111 a C<SV*>, a B<copy> of the SV is pushed on the stack
115 a C<SV*>, the pointer itself is pushed on the stack
119 a C<wxObject*>, the function will internally call C<wxPli_object_2_sv>
120 and push the result on the stack.
124 this is the only type that uses 2 parameters: the first is a C<void*>,
125 the second a C<char*>; the function will internally call
126 C<wxPli_non_object_2_sv> and push the result on the stack.
130 I<Introduced before wxPerl 0.14>
132 =head2 wxPli_sv_2_object
134 void* wxPli_sv_2_object( pTHX_ SV* scalar, const char* classname );
136 Extracts a bound pointer from a perl reference, checking that
137 the reference belongs to the correct class (die()s on failure),
138 and returns it. If C<classname> is C<NULL>, the check is not done.
140 I<Introduced before wxPerl 0.14>
142 =head2 wxPli_wxChar_2_sv
144 SV* wxPli_wxChar_2_sv( pTHX_ const wxChar* str, SV* out );
146 Stores a string into a C<SV*>, and returns the C<SV*>.
148 I<Introduced before wxPerl 0.14>
150 =head2 wxPli_wxString_2_sv
152 SV* wxPli_wxString_2_sv( pTHX_ const wxString& str, SV* out );
154 Stores a string into a C<SV*>, and returns the C<SV*>.
156 I<Introduced before wxPerl 0.14>
160 Mattia Barbon <mbarbon at cpan dot org>