Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / lib / Wx / Api.pod
1 =head1 NAME
2
3 API - wxPerl extension API documentation
4
5 =head1 DESCRIPTION
6
7 =head2 WXPL_API_VERSION
8
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.
12
13 I<Introduced in wxPerl 0.15>
14
15 =head2 wxPli_create_evthandler
16
17   SV* wxPli_create_evthandler( pTHX_ wxEvtHandler* object,
18                                const char* classname );
19
20 Creates a new hash reference, blessed into C<classname>,
21 and bindsC<object> to it.
22
23 I<Introduced in wxPerl 0.16>
24
25 =head2 wxPli_evthandler_2_sv
26
27   SV* wxPli_evthandler_2_sv( pTHX_ SV* var, wxEvtHandler* evth );
28
29 Same as L<wxPli_object_2_sv>, but works with C<wxEvtHandler>-derived
30 classes, which includes all C<wxWindow>-derived classes.
31
32 I<Introduced in wxPerl 0.16>
33
34 =head2 wxPli_get_class
35
36   const char* wxPli_get_class( pTHX_ SV* ref );
37
38 The C++ equivalent of C<$class = ref( $obj ) || $obj>; the pointer
39 returned by the function is potentially temporary.
40
41 =head2 wxPli_non_object_2_sv
42
43   SV* wxPli_non_object_2_sv( pTHX_ SV* var, void* data, const char* package );
44
45 Binds a generic pointer to an C<SV*>, and returns it; the new binding
46 is blessed into the given C<package>.
47
48 I<Introduced before wxPerl 0.14>
49
50 =head2 wxPli_object_2_sv
51
52   SV* wxPli_object_2_sv( pTHX_ SV* var, wxObject* object );
53
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.
59
60 I<Introduced before wxPerl 0.14>
61
62 =head2 wxPli_push_arguments
63
64   void wxPli_push_arguments( pTHX_ SV*** stack, const char* argtypes, ... );
65
66   // example
67   wxPli_push_arguments( aTHX_ SP, "iP", 12, "foo" );
68
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:
74
75 =over 4
76
77 =item b
78
79 a C<bool> value
80
81 =item i
82
83 an C<int> value
84
85 =item l
86
87 a C<long> value
88
89 =item L
90
91 an C<unsigned long> value
92
93 =item d
94
95 a C<double> value
96
97 =item p
98
99 a C<char*> value
100
101 =item w
102
103 a C<wxChar*> value
104
105 =item P
106
107 a C<wxString*> value
108
109 =item S
110
111 a C<SV*>, a B<copy> of the SV is pushed on the stack
112
113 =item s
114
115 a C<SV*>, the pointer itself is pushed on the stack
116
117 =item O
118
119 a C<wxObject*>, the function will internally call C<wxPli_object_2_sv>
120 and push the result on the stack.
121
122 =item o
123
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.
127
128 =back
129
130 I<Introduced before wxPerl 0.14>
131
132 =head2 wxPli_sv_2_object
133
134   void* wxPli_sv_2_object( pTHX_ SV* scalar, const char* classname );
135
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.
139
140 I<Introduced before wxPerl 0.14>
141
142 =head2 wxPli_wxChar_2_sv
143
144   SV* wxPli_wxChar_2_sv( pTHX_ const wxChar* str, SV* out );
145
146 Stores a string into a C<SV*>, and returns the C<SV*>.
147
148 I<Introduced before wxPerl 0.14>
149
150 =head2 wxPli_wxString_2_sv
151
152   SV* wxPli_wxString_2_sv( pTHX_ const wxString& str, SV* out );
153
154 Stores a string into a C<SV*>, and returns the C<SV*>.
155
156 I<Introduced before wxPerl 0.14>
157
158 =head1 AUTHOR
159
160 Mattia Barbon <mbarbon at cpan dot org>
161
162 =cut