Wx::Api(3pm)
π NAME π
API β the wxPerl extension API docs, bestie!! this is where the C++/XS girlies meet the Perl girlies π«Ά
β¨ DESCRIPTION β¨
okay so this whole page is the API you get when you're writing a wxPerl extension β like, the C-level stuff. every function here is a little bridge between Perl land and wxWidgets land π
π WXPL_API_VERSION π
it's giving version number but make it an integer, and the whole point is you can compare them: it is guaranteed to be non-decreasing π like it will never go backwards on you, periodt.
the math is: wxPerl 0.15 value is 0150; wxPerl 1.00 value will be 1000, wxPerl 2.12 value will be 2120.
lowkey a glow-up scale: drop the dot, pad to four digits, slay β¨
Introduced in wxPerl 0.15
π¦ wxPli_create_evthandler π¦
SV* wxPli_create_evthandler( pTHX_ wxEvtHandler* object,
const char* classname );
it creates a new hash reference, blesses it into classname, and then binds object to it. bffs for life fr fr π
Introduced in wxPerl 0.16
πΈ wxPli_evthandler_2_sv πΈ
SV* wxPli_evthandler_2_sv( pTHX_ SV* var, wxEvtHandler* evth );
same energy as wxPli_object_2_sv, except it's built for wxEvtHandler-derived classes β and bestie guess what, that includes all wxWindow-derived classes. iconic inheritance moment π
Introduced in wxPerl 0.16
π wxPli_get_class π
const char* wxPli_get_class( pTHX_ SV* ref );
the C++ equivalent of $class = ref( $obj ) || $obj β no cap, that's literally it.
β οΈ heads up: the pointer this function hands you back is potentially temporary. don't be out here storing it forever, it might ghost you π
π wxPli_non_object_2_sv π
SV* wxPli_non_object_2_sv( pTHX_ SV* var, void* data, const char* package );
binds a generic pointer to an SV* and returns it β and the new binding gets blessed into whatever package you passed in. cute, tidy, done π
Introduced before wxPerl 0.14
π wxPli_object_2_sv π
SV* wxPli_object_2_sv( pTHX_ SV* var, wxObject* object );
binds a wxObject* pointer to an SV* and returns it. the vibe check here:
- if the object is already bound to an
SV*, you just get a reference to the existingSV*β no duplicates, we don't do that here π - otherwise it creates a new binding, and in that case the new
SV*is blessed into a package that it gets from the wxWidgets RTTI system β¨
Introduced before wxPerl 0.14
π§ wxPli_push_arguments π§
void wxPli_push_arguments( pTHX_ SV*** stack, const char* argtypes, ... );
// example
wxPli_push_arguments( aTHX_ SP, "iP", 12, "foo" );
this one pushes a variable number of arguments onto the perl stack β so useful when you're passing params to a Perl function π«Ά
the argtypes string describes the types of the arguments that come after it, one character per single argument. the possible values are:
bβ aboolvalueiβ anintvaluelβ alongvalueLβ anunsigned longvaluedβ adoublevaluepβ achar*valuewβ awxChar*valuePβ awxString*valueSβ aSV*, and a copy of the SV is pushed on the stacksβ aSV*, and the pointer itself is pushed on the stackOβ awxObject*; the function will internally callwxPli_object_2_svand push the result on the stackoβ this is the only type that uses 2 parameters: the first is avoid*, the second achar*; the function will internally callwxPli_non_object_2_svand push the result on the stack
Introduced before wxPerl 0.14
π wxPli_sv_2_object π
void* wxPli_sv_2_object( pTHX_ SV* scalar, const char* classname );
extracts a bound pointer from a perl reference, and it checks that the reference belongs to the correct class β and yes bestie, it die()s on failure ππ
if classname is NULL, the check is simply not done. no vibe check, no consequences, live your truth ig π
Introduced before wxPerl 0.14
β wxPli_wxChar_2_sv β
SV* wxPli_wxChar_2_sv( pTHX_ const wxChar* str, SV* out );
stores a string into an SV*, and returns that SV*. that's it, that's the function, and it ate π
Introduced before wxPerl 0.14
π wxPli_wxString_2_sv π
SV* wxPli_wxString_2_sv( pTHX_ const wxString& str, SV* out );
stores a string into an SV*, and returns that SV* β same deal, just wxString flavored π
Introduced before wxPerl 0.14
π AUTHOR π
Mattia Barbon <mbarbon at cpan dot org> β thank you for the lore king π
and that's the whole page, bestie!! this was Wx::Api from the User Contributed Perl Documentation, running on perl v5.42.3, dated 2026-08-20. go forth and write your extensions, you've got this π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: libwx-perl 1:0.9932-10build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms