X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=typemap;h=f457b4daf1139d1f7f3f8b730051b4cf6a78ae20;hb=2e2fd270bb6786a1bec87b18b0c648a5ceb0991e;hp=572311b84f60226ca5ab8b3852d83eee2964171b;hpb=45f7368964390b1b6e48edfba3dfa4b0d6cc74ce;p=sdlgit%2FSDL_perl.git diff --git a/typemap b/typemap index 572311b..f457b4d 100644 --- a/typemap +++ b/typemap @@ -14,15 +14,15 @@ Sint16 * T_PTR Sint32 T_IV Sint32 * T_PTR SDL_Event * T_PTR -SDL_Surface * T_PTR +SDL_Surface * O_OBJECT SDL_SysWMmsg * T_PTR SDL_CD * T_PTR SDL_CDtrack * T_PTR SDL_TimerCallback T_PTR -SDL_Rect * T_PTR -SDL_Color * T_PTR +SDL_Rect * O_OBJECT +SDL_Color * O_OBJECT SDL_Palette * T_PTR -SDL_PixelFormat * T_PTR +SDL_PixelFormat * O_OBJECT SDL_Cursor * T_PTR SDL_AudioSpec * T_PTR SDL_AudioCVT * T_PTR @@ -69,3 +69,23 @@ Sound_Sample * T_PTR Sound_AudioInfo * T_PTR SDL_RWops* T_PTR SDL_svg_context* T_PTR + +OUTPUT + +# The Perl object is blessed into 'CLASS', which should be a +# char* having the name of the package for the blessing. +O_OBJECT + sv_setref_pv( $arg, CLASS, (void*)$var ); + + +INPUT + +O_OBJECT + if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) + $var = ($type)SvIV((SV*)SvRV( $arg )); + else{ + warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" ); + XSRETURN_UNDEF; + } + +