Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / dnd / DND.c
1 /*
2  * This file was generated automatically by ExtUtils::ParseXS version 2.2202 from the
3  * contents of DND.xs. Do not edit this file, edit DND.xs instead.
4  *
5  *      ANY CHANGES MADE HERE WILL BE LOST! 
6  *
7  */
8
9 /////////////////////////////////////////////////////////////////////////////
10 // Name:        ext/dnd/DND.xs
11 // Purpose:     XS for Drag'n'Drop and Clipboard
12 // Author:      Mattia Barbon
13 // Modified by:
14 // Created:     12/08/2001
15 // RCS-ID:      $Id: DND.xs 2057 2007-06-18 23:03:00Z mbarbon $
16 // Copyright:   (c) 2001-2004 Mattia Barbon
17 // Licence:     This program is free software; you can redistribute it and/or
18 //              modify it under the same terms as Perl itself
19 /////////////////////////////////////////////////////////////////////////////
20
21 #define PERL_NO_GET_CONTEXT
22
23 #include "cpp/wxapi.h"
24
25 #undef THIS
26
27 #include <wx/dataobj.h>
28 #include "cpp/dn_constants.cpp"
29
30 typedef wxDataObjectBase::Direction Direction;
31 typedef wxDataFormat::NativeFormat  NativeFormat;
32
33 #include <wx/dataobj.h>
34
35 #ifndef PERL_UNUSED_VAR
36 #  define PERL_UNUSED_VAR(var) if (0) var = var
37 #endif
38
39 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
40 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
41
42 /* prototype to pass -Wmissing-prototypes */
43 STATIC void
44 S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);
45
46 STATIC void
47 S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
48 {
49     const GV *const gv = CvGV(cv);
50
51     PERL_ARGS_ASSERT_CROAK_XS_USAGE;
52
53     if (gv) {
54         const char *const gvname = GvNAME(gv);
55         const HV *const stash = GvSTASH(gv);
56         const char *const hvname = stash ? HvNAME(stash) : NULL;
57
58         if (hvname)
59             Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
60         else
61             Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
62     } else {
63         /* Pants. I don't think that it should be possible to get here. */
64         Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
65     }
66 }
67 #undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE
68
69 #ifdef PERL_IMPLICIT_CONTEXT
70 #define croak_xs_usage(a,b)     S_croak_xs_usage(aTHX_ a,b)
71 #else
72 #define croak_xs_usage          S_croak_xs_usage
73 #endif
74
75 #endif
76
77 /* NOTE: the prototype of newXSproto() is different in versions of perls,
78  * so we define a portable version of newXSproto()
79  */
80 #ifdef newXS_flags
81 #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
82 #else
83 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
84 #endif /* !defined(newXS_flags) */
85
86
87 /* INCLUDE:  Including 'XS/DataObject.xs' from 'DND.xs' */
88
89
90 /* INCLUDE:  Including 'XS/Clipboard.xs' from 'XS/DataObject.xs' */
91
92 #include <wx/clipbrd.h>
93
94 XS(XS_Wx__Clipboard_AddData); /* prototype to pass -Wmissing-prototypes */
95 XS(XS_Wx__Clipboard_AddData)
96 {
97 #ifdef dVAR
98     dVAR; dXSARGS;
99 #else
100     dXSARGS;
101 #endif
102     if (items != 2)
103        croak_xs_usage(cv,  "THIS, data");
104     {
105         wxDataObject*    data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
106         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
107         bool    RETVAL;
108     wxPli_object_set_deleteable( aTHX_ ST(1), false );
109     SvREFCNT_inc( SvRV( ST(1) ) ); // at this point the scalar must not go away
110     RETVAL = THIS->AddData( data );
111         ST(0) = boolSV(RETVAL);
112         sv_2mortal(ST(0));
113     }
114     XSRETURN(1);
115 }
116
117
118 XS(XS_Wx__Clipboard_Clear); /* prototype to pass -Wmissing-prototypes */
119 XS(XS_Wx__Clipboard_Clear)
120 {
121 #ifdef dVAR
122     dVAR; dXSARGS;
123 #else
124     dXSARGS;
125 #endif
126     if (items != 1)
127        croak_xs_usage(cv,  "THIS");
128     {
129         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
130
131         THIS->Clear();
132     }
133     XSRETURN_EMPTY;
134 }
135
136
137 XS(XS_Wx__Clipboard_Close); /* prototype to pass -Wmissing-prototypes */
138 XS(XS_Wx__Clipboard_Close)
139 {
140 #ifdef dVAR
141     dVAR; dXSARGS;
142 #else
143     dXSARGS;
144 #endif
145     if (items != 1)
146        croak_xs_usage(cv,  "THIS");
147     {
148         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
149
150         THIS->Close();
151     }
152     XSRETURN_EMPTY;
153 }
154
155
156 XS(XS_Wx__Clipboard_Flush); /* prototype to pass -Wmissing-prototypes */
157 XS(XS_Wx__Clipboard_Flush)
158 {
159 #ifdef dVAR
160     dVAR; dXSARGS;
161 #else
162     dXSARGS;
163 #endif
164     if (items != 1)
165        croak_xs_usage(cv,  "THIS");
166     {
167         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
168         bool    RETVAL;
169
170         RETVAL = THIS->Flush();
171         ST(0) = boolSV(RETVAL);
172         sv_2mortal(ST(0));
173     }
174     XSRETURN(1);
175 }
176
177
178 XS(XS_Wx__Clipboard_GetData); /* prototype to pass -Wmissing-prototypes */
179 XS(XS_Wx__Clipboard_GetData)
180 {
181 #ifdef dVAR
182     dVAR; dXSARGS;
183 #else
184     dXSARGS;
185 #endif
186     if (items != 2)
187        croak_xs_usage(cv,  "THIS, data");
188     {
189         wxDataObject*    data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
190         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
191         bool    RETVAL;
192     RETVAL = THIS->GetData( *data );
193         ST(0) = boolSV(RETVAL);
194         sv_2mortal(ST(0));
195     }
196     XSRETURN(1);
197 }
198
199
200 XS(XS_Wx__Clipboard_IsOpened); /* prototype to pass -Wmissing-prototypes */
201 XS(XS_Wx__Clipboard_IsOpened)
202 {
203 #ifdef dVAR
204     dVAR; dXSARGS;
205 #else
206     dXSARGS;
207 #endif
208     if (items != 1)
209        croak_xs_usage(cv,  "THIS");
210     {
211         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
212         bool    RETVAL;
213
214         RETVAL = THIS->IsOpened();
215         ST(0) = boolSV(RETVAL);
216         sv_2mortal(ST(0));
217     }
218     XSRETURN(1);
219 }
220
221
222 XS(XS_Wx__Clipboard_IsSupported); /* prototype to pass -Wmissing-prototypes */
223 XS(XS_Wx__Clipboard_IsSupported)
224 {
225 #ifdef dVAR
226     dVAR; dXSARGS;
227 #else
228     dXSARGS;
229 #endif
230     if (items != 2)
231        croak_xs_usage(cv,  "THIS, format");
232     {
233         wxDataFormat*    format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
234         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
235         bool    RETVAL;
236     RETVAL = THIS->IsSupported( *format );
237         ST(0) = boolSV(RETVAL);
238         sv_2mortal(ST(0));
239     }
240     XSRETURN(1);
241 }
242
243
244 XS(XS_Wx__Clipboard_Open); /* prototype to pass -Wmissing-prototypes */
245 XS(XS_Wx__Clipboard_Open)
246 {
247 #ifdef dVAR
248     dVAR; dXSARGS;
249 #else
250     dXSARGS;
251 #endif
252     if (items != 1)
253        croak_xs_usage(cv,  "THIS");
254     {
255         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
256         bool    RETVAL;
257
258         RETVAL = THIS->Open();
259         ST(0) = boolSV(RETVAL);
260         sv_2mortal(ST(0));
261     }
262     XSRETURN(1);
263 }
264
265
266 XS(XS_Wx__Clipboard_SetData); /* prototype to pass -Wmissing-prototypes */
267 XS(XS_Wx__Clipboard_SetData)
268 {
269 #ifdef dVAR
270     dVAR; dXSARGS;
271 #else
272     dXSARGS;
273 #endif
274     if (items != 2)
275        croak_xs_usage(cv,  "THIS, data");
276     {
277         wxDataObject*    data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
278         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
279         bool    RETVAL;
280     wxPli_object_set_deleteable( aTHX_ ST(1), false );
281     SvREFCNT_inc( SvRV( ST(1) ) ); // at this point the scalar must not go away
282     RETVAL = THIS->SetData( data );
283         ST(0) = boolSV(RETVAL);
284         sv_2mortal(ST(0));
285     }
286     XSRETURN(1);
287 }
288
289
290 XS(XS_Wx__Clipboard_UsePrimarySelection); /* prototype to pass -Wmissing-prototypes */
291 XS(XS_Wx__Clipboard_UsePrimarySelection)
292 {
293 #ifdef dVAR
294     dVAR; dXSARGS;
295 #else
296     dXSARGS;
297 #endif
298     if (items < 1 || items > 2)
299        croak_xs_usage(cv,  "THIS, primary = true");
300     {
301         bool    primary;
302         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
303
304         if (items < 2)
305             primary = true;
306         else {
307             primary = (bool)SvTRUE(ST(1));
308         }
309
310         THIS->UsePrimarySelection(primary);
311     }
312     XSRETURN_EMPTY;
313 }
314
315 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
316 #define XSubPPtmpAAAA 1
317
318
319 XS(XS_Wx__Clipboard_IsUsingPrimarySelection); /* prototype to pass -Wmissing-prototypes */
320 XS(XS_Wx__Clipboard_IsUsingPrimarySelection)
321 {
322 #ifdef dVAR
323     dVAR; dXSARGS;
324 #else
325     dXSARGS;
326 #endif
327     if (items != 1)
328        croak_xs_usage(cv,  "THIS");
329     {
330         wxClipboard *    THIS = (wxClipboard *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::Clipboard" );
331         bool    RETVAL;
332
333         RETVAL = THIS->IsUsingPrimarySelection();
334         ST(0) = boolSV(RETVAL);
335         sv_2mortal(ST(0));
336     }
337     XSRETURN(1);
338 }
339
340 #endif
341
342 /* INCLUDE: Returning to 'XS/DataObject.xs' from 'XS/Clipboard.xs' */
343
344 #include <wx/dataobj.h>
345 #include "cpp/dataobject.h"
346 #ifdef __WXGTK20__
347 #define XSubPPtmpAAAB 1
348
349
350 XS(XS_Wx__DataFormat_newNative); /* prototype to pass -Wmissing-prototypes */
351 XS(XS_Wx__DataFormat_newNative)
352 {
353 #ifdef dVAR
354     dVAR; dXSARGS;
355 #else
356     dXSARGS;
357 #endif
358     if (items < 1 || items > 2)
359        croak_xs_usage(cv,  "dummy, format = wxDF_INVALID");
360     {
361         SV*     dummy = ST(0);
362         wxDataFormatId  format;
363         wxDataFormat *  RETVAL;
364
365         if (items < 2)
366             format = wxDF_INVALID;
367         else {
368             format = (wxDataFormatId)SvIV(ST(1));
369         }
370     RETVAL = new wxDataFormat( format );
371         ST(0) = sv_newmortal();
372     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
373     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
374
375     }
376     XSRETURN(1);
377 }
378
379 #else
380 #define XSubPPtmpAAAC 1
381
382
383 XS(XS_Wx__DataFormat_newNative); /* prototype to pass -Wmissing-prototypes */
384 XS(XS_Wx__DataFormat_newNative)
385 {
386 #ifdef dVAR
387     dVAR; dXSARGS;
388 #else
389     dXSARGS;
390 #endif
391     if (items < 1 || items > 2)
392        croak_xs_usage(cv,  "dummy, format = wxDF_INVALID");
393     {
394         SV*     dummy = ST(0);
395         NativeFormat    format;
396         wxDataFormat *  RETVAL;
397
398         if (items < 2)
399             format = wxDF_INVALID;
400         else {
401             format = (NativeFormat)SvIV(ST(1));
402         }
403     RETVAL = new wxDataFormat( format );
404         ST(0) = sv_newmortal();
405     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
406     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
407
408     }
409     XSRETURN(1);
410 }
411
412 #endif
413 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
414 #define XSubPPtmpAAAD 1
415
416
417 XS(XS_Wx__DataFormat_newUser); /* prototype to pass -Wmissing-prototypes */
418 XS(XS_Wx__DataFormat_newUser)
419 {
420 #ifdef dVAR
421     dVAR; dXSARGS;
422 #else
423     dXSARGS;
424 #endif
425     if (items != 2)
426        croak_xs_usage(cv,  "dummy, id");
427     {
428         SV*     dummy = ST(0);
429         wxString        id;
430         wxDataFormat *  RETVAL;
431
432     WXSTRING_INPUT( id, wxString, ST(1) );
433     RETVAL = new wxDataFormat( id );
434         ST(0) = sv_newmortal();
435     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
436     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
437
438     }
439     XSRETURN(1);
440 }
441
442 #else
443 #define XSubPPtmpAAAE 1
444
445
446 XS(XS_Wx__DataFormat_newUser); /* prototype to pass -Wmissing-prototypes */
447 XS(XS_Wx__DataFormat_newUser)
448 {
449 #ifdef dVAR
450     dVAR; dXSARGS;
451 #else
452     dXSARGS;
453 #endif
454     if (items != 2)
455        croak_xs_usage(cv,  "dummy, id");
456     {
457         SV*     dummy = ST(0);
458         wxChar* id;
459         wxDataFormat *  RETVAL;
460
461     WXCHAR_INPUT( id, wxChar*, ST(1) );
462     RETVAL = new wxDataFormat( id );
463         ST(0) = sv_newmortal();
464     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
465     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
466
467     }
468     XSRETURN(1);
469 }
470
471 #endif
472
473 XS(XS_Wx__DataFormat_CLONE); /* prototype to pass -Wmissing-prototypes */
474 XS(XS_Wx__DataFormat_CLONE)
475 {
476 #ifdef dVAR
477     dVAR; dXSARGS;
478 #else
479     dXSARGS;
480 #endif
481     if (items != 1)
482        croak_xs_usage(cv,  "CLASS");
483     {
484         char *  CLASS = (char *)SvPV_nolen(ST(0));
485     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
486     }
487     XSRETURN_EMPTY;
488 }
489
490
491 XS(XS_Wx__DataFormat_DESTROY); /* prototype to pass -Wmissing-prototypes */
492 XS(XS_Wx__DataFormat_DESTROY)
493 {
494 #ifdef dVAR
495     dVAR; dXSARGS;
496 #else
497     dXSARGS;
498 #endif
499     if (items != 1)
500        croak_xs_usage(cv,  "THIS");
501     {
502         wxDataFormat *    THIS = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataFormat" );
503     wxPli_thread_sv_unregister( aTHX_ "Wx::DataFormat", THIS, ST(0) );
504     delete THIS;
505     }
506     XSRETURN_EMPTY;
507 }
508
509
510 XS(XS_Wx__DataFormat_GetId); /* prototype to pass -Wmissing-prototypes */
511 XS(XS_Wx__DataFormat_GetId)
512 {
513 #ifdef dVAR
514     dVAR; dXSARGS;
515 #else
516     dXSARGS;
517 #endif
518     if (items != 1)
519        croak_xs_usage(cv,  "THIS");
520     {
521         wxDataFormat *    THIS = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataFormat" );
522         wxString        RETVAL;
523
524         RETVAL = THIS->GetId();
525         ST(0) = sv_newmortal();
526     WXSTRING_OUTPUT( RETVAL, ST(0) );
527
528     }
529     XSRETURN(1);
530 }
531
532
533 XS(XS_Wx__DataFormat_SetId); /* prototype to pass -Wmissing-prototypes */
534 XS(XS_Wx__DataFormat_SetId)
535 {
536 #ifdef dVAR
537     dVAR; dXSARGS;
538 #else
539     dXSARGS;
540 #endif
541     if (items != 2)
542        croak_xs_usage(cv,  "THIS, id");
543     {
544         wxString        id;
545         wxDataFormat *    THIS = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataFormat" );
546
547     WXSTRING_INPUT( id, wxString, ST(1) );
548
549         THIS->SetId(id);
550     }
551     XSRETURN_EMPTY;
552 }
553
554 #if defined( __WXMSW__ )
555 #define XSubPPtmpAAAF 1
556
557
558 XS(XS_Wx__DataFormat_GetType); /* prototype to pass -Wmissing-prototypes */
559 XS(XS_Wx__DataFormat_GetType)
560 {
561 #ifdef dVAR
562     dVAR; dXSARGS;
563 #else
564     dXSARGS;
565 #endif
566     if (items != 1)
567        croak_xs_usage(cv,  "THIS");
568     {
569         wxDataFormat *    THIS = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataFormat" );
570         NativeFormat    RETVAL;
571         dXSTARG;
572
573         RETVAL = THIS->GetType();
574         XSprePUSH; PUSHi((IV)RETVAL);
575     }
576     XSRETURN(1);
577 }
578
579
580 XS(XS_Wx__DataFormat_SetType); /* prototype to pass -Wmissing-prototypes */
581 XS(XS_Wx__DataFormat_SetType)
582 {
583 #ifdef dVAR
584     dVAR; dXSARGS;
585 #else
586     dXSARGS;
587 #endif
588     if (items != 2)
589        croak_xs_usage(cv,  "THIS, type");
590     {
591         NativeFormat    type = (NativeFormat)SvIV(ST(1));
592         wxDataFormat *    THIS = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataFormat" );
593
594         THIS->SetType(type);
595     }
596     XSRETURN_EMPTY;
597 }
598
599 #else
600 #define XSubPPtmpAAAG 1
601
602
603 XS(XS_Wx__DataFormat_GetType); /* prototype to pass -Wmissing-prototypes */
604 XS(XS_Wx__DataFormat_GetType)
605 {
606 #ifdef dVAR
607     dVAR; dXSARGS;
608 #else
609     dXSARGS;
610 #endif
611     if (items != 1)
612        croak_xs_usage(cv,  "THIS");
613     {
614         wxDataFormat *    THIS = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataFormat" );
615         wxDataFormatId  RETVAL;
616         dXSTARG;
617
618         RETVAL = THIS->GetType();
619         XSprePUSH; PUSHi((IV)RETVAL);
620     }
621     XSRETURN(1);
622 }
623
624 #if 0
625 #define XSubPPtmpAAAH 1
626
627
628 XS(XS_Wx__DataFormat_SetType); /* prototype to pass -Wmissing-prototypes */
629 XS(XS_Wx__DataFormat_SetType)
630 {
631 #ifdef dVAR
632     dVAR; dXSARGS;
633 #else
634     dXSARGS;
635 #endif
636     if (items != 2)
637        croak_xs_usage(cv,  "THIS, type");
638     {
639         wxDataFormatId  type = (wxDataFormatId)SvIV(ST(1));
640         wxDataFormat *    THIS = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataFormat" );
641
642         THIS->SetType(type);
643     }
644     XSRETURN_EMPTY;
645 }
646
647 #endif
648 #endif
649
650 XS(XS_Wx__DataObject_CLONE); /* prototype to pass -Wmissing-prototypes */
651 XS(XS_Wx__DataObject_CLONE)
652 {
653 #ifdef dVAR
654     dVAR; dXSARGS;
655 #else
656     dXSARGS;
657 #endif
658     if (items != 1)
659        croak_xs_usage(cv,  "CLASS");
660     {
661         char *  CLASS = (char *)SvPV_nolen(ST(0));
662     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
663     }
664     XSRETURN_EMPTY;
665 }
666
667
668 XS(XS_Wx__DataObject_DESTROY); /* prototype to pass -Wmissing-prototypes */
669 XS(XS_Wx__DataObject_DESTROY)
670 {
671 #ifdef dVAR
672     dVAR; dXSARGS;
673 #else
674     dXSARGS;
675 #endif
676     if (items != 1)
677        croak_xs_usage(cv,  "THIS");
678     {
679         wxDataObject*    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
680     wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
681     if( THIS && wxPli_object_is_deleteable( aTHX_ ST(0) ) )
682     {
683         delete THIS;
684     }
685     }
686     XSRETURN_EMPTY;
687 }
688
689
690 XS(XS_Wx__DataObject_Destroy); /* prototype to pass -Wmissing-prototypes */
691 XS(XS_Wx__DataObject_Destroy)
692 {
693 #ifdef dVAR
694     dVAR; dXSARGS;
695 #else
696     dXSARGS;
697 #endif
698     if (items != 1)
699        croak_xs_usage(cv,  "THIS");
700     {
701         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
702     wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
703     delete THIS;
704     }
705     XSRETURN_EMPTY;
706 }
707
708
709 XS(XS_Wx__DataObject_GetAllFormats); /* prototype to pass -Wmissing-prototypes */
710 XS(XS_Wx__DataObject_GetAllFormats)
711 {
712 #ifdef dVAR
713     dVAR; dXSARGS;
714 #else
715     dXSARGS;
716 #endif
717     if (items < 1 || items > 2)
718        croak_xs_usage(cv,  "THIS, dir = wxDataObjectBase::Get");
719     PERL_UNUSED_VAR(ax); /* -Wall */
720     SP -= items;
721     {
722         Direction       dir;
723         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
724
725         if (items < 2)
726             dir = wxDataObjectBase::Get;
727         else {
728             dir = (Direction)SvIV(ST(1));
729         }
730     size_t formats = THIS->GetFormatCount( dir );
731     size_t i, wanted = formats;
732     wxDataFormat* formats_d = new wxDataFormat[ formats ];
733
734     THIS->GetAllFormats( formats_d, dir );
735     if( GIMME_V == G_SCALAR )
736         wanted = 1;
737     EXTEND( SP, (IV)wanted );
738     for( i = 0; i < wanted; ++i )
739     {
740         PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
741                 new wxDataFormat( formats_d[i] ), "Wx::DataFormat" ) );
742     }
743     delete [] formats_d;
744         PUTBACK;
745         return;
746     }
747 }
748
749
750 XS(XS_Wx__DataObject_GetDataHere); /* prototype to pass -Wmissing-prototypes */
751 XS(XS_Wx__DataObject_GetDataHere)
752 {
753 #ifdef dVAR
754     dVAR; dXSARGS;
755 #else
756     dXSARGS;
757 #endif
758     if (items != 3)
759        croak_xs_usage(cv,  "THIS, format, buf");
760     {
761         wxDataFormat*    format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
762         SV*     buf = ST(2);
763         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
764         bool    RETVAL;
765     size_t size = THIS->GetDataSize( *format );
766     void* buffer = SvGROW( buf, size + 1 );
767
768     SvCUR_set( buf, size );
769     RETVAL = THIS->GetDataHere( *format, buffer );
770         ST(0) = boolSV(RETVAL);
771         sv_2mortal(ST(0));
772     }
773     XSRETURN(1);
774 }
775
776
777 XS(XS_Wx__DataObject_GetDataSize); /* prototype to pass -Wmissing-prototypes */
778 XS(XS_Wx__DataObject_GetDataSize)
779 {
780 #ifdef dVAR
781     dVAR; dXSARGS;
782 #else
783     dXSARGS;
784 #endif
785     if (items != 2)
786        croak_xs_usage(cv,  "THIS, format");
787     {
788         wxDataFormat*    format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
789         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
790         size_t  RETVAL;
791         dXSTARG;
792     RETVAL = THIS->GetDataSize( *format );
793         XSprePUSH; PUSHu((UV)RETVAL );
794     }
795     XSRETURN(1);
796 }
797
798
799 XS(XS_Wx__DataObject_GetFormatCount); /* prototype to pass -Wmissing-prototypes */
800 XS(XS_Wx__DataObject_GetFormatCount)
801 {
802 #ifdef dVAR
803     dVAR; dXSARGS;
804 #else
805     dXSARGS;
806 #endif
807     if (items < 1 || items > 2)
808        croak_xs_usage(cv,  "THIS, dir = wxDataObjectBase::Get");
809     {
810         Direction       dir;
811         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
812         size_t  RETVAL;
813         dXSTARG;
814
815         if (items < 2)
816             dir = wxDataObjectBase::Get;
817         else {
818             dir = (Direction)SvIV(ST(1));
819         }
820
821         RETVAL = THIS->GetFormatCount(dir);
822         XSprePUSH; PUSHu((UV)RETVAL );
823     }
824     XSRETURN(1);
825 }
826
827
828 XS(XS_Wx__DataObject_GetPreferredFormat); /* prototype to pass -Wmissing-prototypes */
829 XS(XS_Wx__DataObject_GetPreferredFormat)
830 {
831 #ifdef dVAR
832     dVAR; dXSARGS;
833 #else
834     dXSARGS;
835 #endif
836     if (items < 1 || items > 2)
837        croak_xs_usage(cv,  "THIS, dir = wxDataObjectBase::Get");
838     {
839         Direction       dir;
840         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
841         wxDataFormat *  RETVAL;
842
843         if (items < 2)
844             dir = wxDataObjectBase::Get;
845         else {
846             dir = (Direction)SvIV(ST(1));
847         }
848     RETVAL = new wxDataFormat( THIS->GetPreferredFormat( dir ) );
849         ST(0) = sv_newmortal();
850     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
851     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
852
853     }
854     XSRETURN(1);
855 }
856
857
858 XS(XS_Wx__DataObject_IsSupported); /* prototype to pass -Wmissing-prototypes */
859 XS(XS_Wx__DataObject_IsSupported)
860 {
861 #ifdef dVAR
862     dVAR; dXSARGS;
863 #else
864     dXSARGS;
865 #endif
866     if (items < 2 || items > 3)
867        croak_xs_usage(cv,  "THIS, format, dir = wxDataObjectBase::Get");
868     {
869         wxDataFormat*    format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
870         Direction       dir;
871         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
872         bool    RETVAL;
873
874         if (items < 3)
875             dir = wxDataObjectBase::Get;
876         else {
877             dir = (Direction)SvIV(ST(2));
878         }
879     RETVAL = THIS->IsSupported( *format, dir );
880         ST(0) = boolSV(RETVAL);
881         sv_2mortal(ST(0));
882     }
883     XSRETURN(1);
884 }
885
886
887 XS(XS_Wx__DataObject_SetData); /* prototype to pass -Wmissing-prototypes */
888 XS(XS_Wx__DataObject_SetData)
889 {
890 #ifdef dVAR
891     dVAR; dXSARGS;
892 #else
893     dXSARGS;
894 #endif
895     if (items != 3)
896        croak_xs_usage(cv,  "THIS, format, buf");
897     {
898         wxDataFormat*    format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
899         SV*     buf = ST(2);
900     char* data;
901     STRLEN len;
902         wxDataObject *    THIS = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObject" );
903         bool    RETVAL;
904     data = SvPV( buf, len );
905     RETVAL = THIS->SetData( *format, len, data );
906         ST(0) = boolSV(RETVAL);
907         sv_2mortal(ST(0));
908     }
909     XSRETURN(1);
910 }
911
912
913 XS(XS_Wx__DataObjectSimple_new); /* prototype to pass -Wmissing-prototypes */
914 XS(XS_Wx__DataObjectSimple_new)
915 {
916 #ifdef dVAR
917     dVAR; dXSARGS;
918 #else
919     dXSARGS;
920 #endif
921     if (items < 1 || items > 2)
922        croak_xs_usage(cv,  "CLASS, format = (wxDataFormat*)&wxFormatInvalid");
923     {
924         wxDataFormat*   format;
925         char *  CLASS = (char *)SvPV_nolen(ST(0));
926         wxDataObjectSimple *    RETVAL;
927
928         if (items < 2)
929             format = (wxDataFormat*)&wxFormatInvalid;
930         else {
931     format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
932         }
933     RETVAL = new wxDataObjectSimple( *format );
934         ST(0) = sv_newmortal();
935     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataObjectSimple" );
936     wxPli_thread_sv_register( aTHX_ "Wx::DataObjectSimple", RETVAL, ST(0) );
937
938     }
939     XSRETURN(1);
940 }
941
942
943 XS(XS_Wx__DataObjectSimple_GetFormat); /* prototype to pass -Wmissing-prototypes */
944 XS(XS_Wx__DataObjectSimple_GetFormat)
945 {
946 #ifdef dVAR
947     dVAR; dXSARGS;
948 #else
949     dXSARGS;
950 #endif
951     if (items != 1)
952        croak_xs_usage(cv,  "THIS");
953     {
954         wxDataObjectSimple *    THIS = (wxDataObjectSimple *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObjectSimple" );
955         wxDataFormat *  RETVAL;
956     RETVAL = new wxDataFormat( THIS->GetFormat() );
957         ST(0) = sv_newmortal();
958     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
959     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
960
961     }
962     XSRETURN(1);
963 }
964
965
966 XS(XS_Wx__DataObjectSimple_SetFormat); /* prototype to pass -Wmissing-prototypes */
967 XS(XS_Wx__DataObjectSimple_SetFormat)
968 {
969 #ifdef dVAR
970     dVAR; dXSARGS;
971 #else
972     dXSARGS;
973 #endif
974     if (items != 2)
975        croak_xs_usage(cv,  "THIS, format");
976     {
977         wxDataFormat*    format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
978         wxDataObjectSimple *    THIS = (wxDataObjectSimple *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObjectSimple" );
979     THIS->SetFormat( *format );
980     }
981     XSRETURN_EMPTY;
982 }
983
984
985 XS(XS_Wx__PlDataObjectSimple_new); /* prototype to pass -Wmissing-prototypes */
986 XS(XS_Wx__PlDataObjectSimple_new)
987 {
988 #ifdef dVAR
989     dVAR; dXSARGS;
990 #else
991     dXSARGS;
992 #endif
993     if (items < 1 || items > 2)
994        croak_xs_usage(cv,  "CLASS, format = (wxDataFormat*)&wxFormatInvalid");
995     {
996         wxDataFormat*   format;
997         char *  CLASS = (char *)SvPV_nolen(ST(0));
998         SV *    RETVAL;
999
1000         if (items < 2)
1001             format = (wxDataFormat*)&wxFormatInvalid;
1002         else {
1003     format = (wxDataFormat *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataFormat" );
1004         }
1005     wxPlDataObjectSimple* THIS = new wxPlDataObjectSimple( CLASS, *format );
1006     RETVAL = newRV_noinc( SvRV( THIS->m_callback.GetSelf() ) );
1007     wxPli_thread_sv_register( aTHX_ "Wx::PlDataObjectSimple", THIS, RETVAL );
1008         ST(0) = RETVAL;
1009         sv_2mortal(ST(0));
1010     }
1011     XSRETURN(1);
1012 }
1013
1014
1015 XS(XS_Wx__PlDataObjectSimple_DESTROY); /* prototype to pass -Wmissing-prototypes */
1016 XS(XS_Wx__PlDataObjectSimple_DESTROY)
1017 {
1018 #ifdef dVAR
1019     dVAR; dXSARGS;
1020 #else
1021     dXSARGS;
1022 #endif
1023     if (items != 1)
1024        croak_xs_usage(cv,  "THIS");
1025     {
1026         wxPlDataObjectSimple *    THIS = (wxPlDataObjectSimple *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::PlDataObjectSimple" );
1027     wxPli_thread_sv_unregister( aTHX_ "Wx::PlDataObjectSimple", THIS, ST(0) );
1028     if( THIS && wxPli_object_is_deleteable( aTHX_ ST(0) ) )
1029     {
1030         SV* self = THIS->m_callback.GetSelf();
1031         SvROK_off( self );
1032         SvRV( self ) = NULL;
1033         delete THIS;
1034     }
1035     }
1036     XSRETURN(1);
1037 }
1038
1039
1040 XS(XS_Wx__DataObjectComposite_new); /* prototype to pass -Wmissing-prototypes */
1041 XS(XS_Wx__DataObjectComposite_new)
1042 {
1043 #ifdef dVAR
1044     dVAR; dXSARGS;
1045 #else
1046     dXSARGS;
1047 #endif
1048     if (items != 1)
1049        croak_xs_usage(cv,  "CLASS");
1050     {
1051         char *  CLASS = (char *)SvPV_nolen(ST(0));
1052         wxDataObjectComposite * RETVAL;
1053
1054         RETVAL = new wxDataObjectComposite();
1055         ST(0) = sv_newmortal();
1056     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataObjectComposite" );
1057     wxPli_thread_sv_register( aTHX_ "Wx::DataObjectComposite", RETVAL, ST(0) );
1058
1059     }
1060     XSRETURN(1);
1061 }
1062
1063
1064 XS(XS_Wx__DataObjectComposite_Add); /* prototype to pass -Wmissing-prototypes */
1065 XS(XS_Wx__DataObjectComposite_Add)
1066 {
1067 #ifdef dVAR
1068     dVAR; dXSARGS;
1069 #else
1070     dXSARGS;
1071 #endif
1072     if (items < 2 || items > 3)
1073        croak_xs_usage(cv,  "THIS, dataObject, preferred = false");
1074     {
1075         wxDataObjectSimple*    dataObject = (wxDataObjectSimple *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObjectSimple" );
1076         bool    preferred;
1077         wxDataObjectComposite *    THIS = (wxDataObjectComposite *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObjectComposite" );
1078
1079         if (items < 3)
1080             preferred = false;
1081         else {
1082             preferred = (bool)SvTRUE(ST(2));
1083         }
1084     // at this point the data object is owned!
1085     wxPli_object_set_deleteable( aTHX_ ST(1), false );
1086     SvREFCNT_inc( SvRV( ST(1) ) ); // at this point the scalar must not go away
1087     THIS->Add( dataObject, preferred );
1088     }
1089     XSRETURN_EMPTY;
1090 }
1091
1092 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
1093 #define XSubPPtmpAAAI 1
1094
1095
1096 XS(XS_Wx__DataObjectComposite_GetReceivedFormat); /* prototype to pass -Wmissing-prototypes */
1097 XS(XS_Wx__DataObjectComposite_GetReceivedFormat)
1098 {
1099 #ifdef dVAR
1100     dVAR; dXSARGS;
1101 #else
1102     dXSARGS;
1103 #endif
1104     if (items != 1)
1105        croak_xs_usage(cv,  "THIS");
1106     {
1107         wxDataObjectComposite *    THIS = (wxDataObjectComposite *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DataObjectComposite" );
1108         wxDataFormat *  RETVAL;
1109     RETVAL = new wxDataFormat( THIS->GetReceivedFormat() );
1110         ST(0) = sv_newmortal();
1111     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
1112     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
1113
1114     }
1115     XSRETURN(1);
1116 }
1117
1118 #endif
1119
1120 XS(XS_Wx__TextDataObject_new); /* prototype to pass -Wmissing-prototypes */
1121 XS(XS_Wx__TextDataObject_new)
1122 {
1123 #ifdef dVAR
1124     dVAR; dXSARGS;
1125 #else
1126     dXSARGS;
1127 #endif
1128     if (items < 1 || items > 2)
1129        croak_xs_usage(cv,  "CLASS, text = wxEmptyString");
1130     {
1131         wxString        text;
1132         char *  CLASS = (char *)SvPV_nolen(ST(0));
1133         wxTextDataObject *      RETVAL;
1134
1135         if (items < 2)
1136             text = wxEmptyString;
1137         else {
1138     WXSTRING_INPUT( text, wxString, ST(1) );
1139         }
1140
1141         RETVAL = new wxTextDataObject(text);
1142         ST(0) = sv_newmortal();
1143     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::TextDataObject" );
1144     wxPli_thread_sv_register( aTHX_ "Wx::TextDataObject", RETVAL, ST(0) );
1145
1146     }
1147     XSRETURN(1);
1148 }
1149
1150
1151 XS(XS_Wx__TextDataObject_GetTextLength); /* prototype to pass -Wmissing-prototypes */
1152 XS(XS_Wx__TextDataObject_GetTextLength)
1153 {
1154 #ifdef dVAR
1155     dVAR; dXSARGS;
1156 #else
1157     dXSARGS;
1158 #endif
1159     if (items != 1)
1160        croak_xs_usage(cv,  "THIS");
1161     {
1162         wxTextDataObject *    THIS = (wxTextDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::TextDataObject" );
1163         size_t  RETVAL;
1164         dXSTARG;
1165
1166         RETVAL = THIS->GetTextLength();
1167         XSprePUSH; PUSHu((UV)RETVAL );
1168     }
1169     XSRETURN(1);
1170 }
1171
1172
1173 XS(XS_Wx__TextDataObject_GetText); /* prototype to pass -Wmissing-prototypes */
1174 XS(XS_Wx__TextDataObject_GetText)
1175 {
1176 #ifdef dVAR
1177     dVAR; dXSARGS;
1178 #else
1179     dXSARGS;
1180 #endif
1181     if (items != 1)
1182        croak_xs_usage(cv,  "THIS");
1183     {
1184         wxTextDataObject *    THIS = (wxTextDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::TextDataObject" );
1185         wxString        RETVAL;
1186
1187         RETVAL = THIS->GetText();
1188         ST(0) = sv_newmortal();
1189     WXSTRING_OUTPUT( RETVAL, ST(0) );
1190
1191     }
1192     XSRETURN(1);
1193 }
1194
1195
1196 XS(XS_Wx__TextDataObject_SetText); /* prototype to pass -Wmissing-prototypes */
1197 XS(XS_Wx__TextDataObject_SetText)
1198 {
1199 #ifdef dVAR
1200     dVAR; dXSARGS;
1201 #else
1202     dXSARGS;
1203 #endif
1204     if (items != 2)
1205        croak_xs_usage(cv,  "THIS, text");
1206     {
1207         wxString        text;
1208         wxTextDataObject *    THIS = (wxTextDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::TextDataObject" );
1209
1210     WXSTRING_INPUT( text, wxString, ST(1) );
1211
1212         THIS->SetText(text);
1213     }
1214     XSRETURN_EMPTY;
1215 }
1216
1217 #if WXPERL_W_VERSION_GE( 2, 5, 1 ) || !defined(__WXMOTIF__)
1218 #define XSubPPtmpAAAJ 1
1219
1220
1221 XS(XS_Wx__BitmapDataObject_new); /* prototype to pass -Wmissing-prototypes */
1222 XS(XS_Wx__BitmapDataObject_new)
1223 {
1224 #ifdef dVAR
1225     dVAR; dXSARGS;
1226 #else
1227     dXSARGS;
1228 #endif
1229     if (items < 1 || items > 2)
1230        croak_xs_usage(cv,  "CLASS, bitmap = (wxBitmap*)&wxNullBitmap");
1231     {
1232         wxBitmap*       bitmap;
1233         char *  CLASS = (char *)SvPV_nolen(ST(0));
1234         wxBitmapDataObject *    RETVAL;
1235
1236         if (items < 2)
1237             bitmap = (wxBitmap*)&wxNullBitmap;
1238         else {
1239     bitmap = (wxBitmap *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::Bitmap" );
1240         }
1241     RETVAL = new wxBitmapDataObject( *bitmap );
1242         ST(0) = sv_newmortal();
1243     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::BitmapDataObject" );
1244     wxPli_thread_sv_register( aTHX_ "Wx::BitmapDataObject", RETVAL, ST(0) );
1245
1246     }
1247     XSRETURN(1);
1248 }
1249
1250
1251 XS(XS_Wx__BitmapDataObject_GetBitmap); /* prototype to pass -Wmissing-prototypes */
1252 XS(XS_Wx__BitmapDataObject_GetBitmap)
1253 {
1254 #ifdef dVAR
1255     dVAR; dXSARGS;
1256 #else
1257     dXSARGS;
1258 #endif
1259     if (items != 1)
1260        croak_xs_usage(cv,  "THIS");
1261     {
1262         wxBitmapDataObject *    THIS = (wxBitmapDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::BitmapDataObject" );
1263         wxBitmap *      RETVAL;
1264     RETVAL = new wxBitmap( THIS->GetBitmap() );
1265         ST(0) = sv_newmortal();
1266     wxPli_object_2_sv( aTHX_ ST(0), RETVAL );
1267     wxPli_thread_sv_register( aTHX_ "Wx::Bitmap", RETVAL, ST(0) );
1268
1269     }
1270     XSRETURN(1);
1271 }
1272
1273
1274 XS(XS_Wx__BitmapDataObject_SetBitmap); /* prototype to pass -Wmissing-prototypes */
1275 XS(XS_Wx__BitmapDataObject_SetBitmap)
1276 {
1277 #ifdef dVAR
1278     dVAR; dXSARGS;
1279 #else
1280     dXSARGS;
1281 #endif
1282     if (items != 2)
1283        croak_xs_usage(cv,  "THIS, bitmap");
1284     {
1285         wxBitmap*    bitmap = (wxBitmap *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::Bitmap" );
1286         wxBitmapDataObject *    THIS = (wxBitmapDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::BitmapDataObject" );
1287     THIS->SetBitmap( *bitmap );
1288     }
1289     XSRETURN_EMPTY;
1290 }
1291
1292 #endif
1293 #if !defined(__WXMOTIF__)
1294 #define XSubPPtmpAAAK 1
1295
1296
1297 XS(XS_Wx__FileDataObject_new); /* prototype to pass -Wmissing-prototypes */
1298 XS(XS_Wx__FileDataObject_new)
1299 {
1300 #ifdef dVAR
1301     dVAR; dXSARGS;
1302 #else
1303     dXSARGS;
1304 #endif
1305     if (items != 1)
1306        croak_xs_usage(cv,  "CLASS");
1307     {
1308         char *  CLASS = (char *)SvPV_nolen(ST(0));
1309         wxFileDataObject *      RETVAL;
1310
1311         RETVAL = new wxFileDataObject();
1312         ST(0) = sv_newmortal();
1313     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::FileDataObject" );
1314     wxPli_thread_sv_register( aTHX_ "Wx::FileDataObject", RETVAL, ST(0) );
1315
1316     }
1317     XSRETURN(1);
1318 }
1319
1320
1321 XS(XS_Wx__FileDataObject_AddFile); /* prototype to pass -Wmissing-prototypes */
1322 XS(XS_Wx__FileDataObject_AddFile)
1323 {
1324 #ifdef dVAR
1325     dVAR; dXSARGS;
1326 #else
1327     dXSARGS;
1328 #endif
1329     if (items != 2)
1330        croak_xs_usage(cv,  "THIS, file");
1331     {
1332         wxString        file;
1333         wxFileDataObject *    THIS = (wxFileDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::FileDataObject" );
1334
1335     WXSTRING_INPUT( file, wxString, ST(1) );
1336
1337         THIS->AddFile(file);
1338     }
1339     XSRETURN_EMPTY;
1340 }
1341
1342
1343 XS(XS_Wx__FileDataObject_GetFilenames); /* prototype to pass -Wmissing-prototypes */
1344 XS(XS_Wx__FileDataObject_GetFilenames)
1345 {
1346 #ifdef dVAR
1347     dVAR; dXSARGS;
1348 #else
1349     dXSARGS;
1350 #endif
1351     if (items != 1)
1352        croak_xs_usage(cv,  "THIS");
1353     PERL_UNUSED_VAR(ax); /* -Wall */
1354     SP -= items;
1355     {
1356     int i, max;
1357         wxFileDataObject *    THIS = (wxFileDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::FileDataObject" );
1358     const wxArrayString& filenames = THIS->GetFilenames();
1359     max = filenames.GetCount();
1360     EXTEND( SP, max );
1361     for( i = 0; i < max; ++i ) {
1362 #if wxUSE_UNICODE
1363       SV* tmp = sv_2mortal( newSVpv( filenames[i].mb_str(wxConvUTF8), 0 ) );
1364       SvUTF8_on( tmp );
1365       PUSHs( tmp );
1366 #else
1367       PUSHs( sv_2mortal( newSVpv( CHAR_P filenames[i].c_str(), 0 ) ) );
1368 #endif
1369     }
1370         PUTBACK;
1371         return;
1372     }
1373 }
1374
1375
1376 XS(XS_Wx__URLDataObject_new); /* prototype to pass -Wmissing-prototypes */
1377 XS(XS_Wx__URLDataObject_new)
1378 {
1379 #ifdef dVAR
1380     dVAR; dXSARGS;
1381 #else
1382     dXSARGS;
1383 #endif
1384     if (items != 1)
1385        croak_xs_usage(cv,  "CLASS");
1386     {
1387         char *  CLASS = (char *)SvPV_nolen(ST(0));
1388         wxURLDataObject *       RETVAL;
1389
1390         RETVAL = new wxURLDataObject();
1391         ST(0) = sv_newmortal();
1392     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::URLDataObject" );
1393     wxPli_thread_sv_register( aTHX_ "Wx::URLDataObject", RETVAL, ST(0) );
1394
1395     }
1396     XSRETURN(1);
1397 }
1398
1399
1400 XS(XS_Wx__URLDataObject_GetURL); /* prototype to pass -Wmissing-prototypes */
1401 XS(XS_Wx__URLDataObject_GetURL)
1402 {
1403 #ifdef dVAR
1404     dVAR; dXSARGS;
1405 #else
1406     dXSARGS;
1407 #endif
1408     if (items != 1)
1409        croak_xs_usage(cv,  "THIS");
1410     {
1411         wxURLDataObject *    THIS = (wxURLDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::URLDataObject" );
1412         wxString        RETVAL;
1413
1414         RETVAL = THIS->GetURL();
1415         ST(0) = sv_newmortal();
1416     WXSTRING_OUTPUT( RETVAL, ST(0) );
1417
1418     }
1419     XSRETURN(1);
1420 }
1421
1422
1423 XS(XS_Wx__URLDataObject_SetURL); /* prototype to pass -Wmissing-prototypes */
1424 XS(XS_Wx__URLDataObject_SetURL)
1425 {
1426 #ifdef dVAR
1427     dVAR; dXSARGS;
1428 #else
1429     dXSARGS;
1430 #endif
1431     if (items != 2)
1432        croak_xs_usage(cv,  "THIS, url");
1433     {
1434         wxString        url;
1435         wxURLDataObject *    THIS = (wxURLDataObject *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::URLDataObject" );
1436
1437     WXSTRING_INPUT( url, wxString, ST(1) );
1438
1439         THIS->SetURL(url);
1440     }
1441     XSRETURN_EMPTY;
1442 }
1443
1444 #endif
1445
1446 /* INCLUDE: Returning to 'DND.xs' from 'XS/DataObject.xs' */
1447
1448 #if wxPERL_USE_DRAG_AND_DROP
1449 #define XSubPPtmpAAAL 1
1450
1451
1452 /* INCLUDE:  Including 'XS/DropFiles.xs' from 'DND.xs' */
1453
1454
1455 /* INCLUDE:  Including 'XS/DropSource.xs' from 'XS/DropFiles.xs' */
1456
1457
1458 /* INCLUDE:  Including 'XS/DropTarget.xs' from 'XS/DropSource.xs' */
1459
1460 #include <wx/dnd.h>
1461 #include "cpp/droptarget.h"
1462
1463 XS(XS_Wx__DropTarget_new); /* prototype to pass -Wmissing-prototypes */
1464 XS(XS_Wx__DropTarget_new)
1465 {
1466 #ifdef dVAR
1467     dVAR; dXSARGS;
1468 #else
1469     dXSARGS;
1470 #endif
1471     if (items < 1 || items > 2)
1472        croak_xs_usage(cv,  "CLASS, data = 0");
1473     {
1474         wxDataObject*   data;
1475         char *  CLASS = (char *)SvPV_nolen(ST(0));
1476         SV *    RETVAL;
1477
1478         if (items < 2)
1479             data = 0;
1480         else {
1481     data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
1482         }
1483     wxPliDropTarget* retval = new wxPliDropTarget( CLASS, data );
1484     RETVAL = newRV_noinc( SvRV( retval->m_callback.GetSelf() ) );
1485     wxPli_thread_sv_register( aTHX_ "Wx::DropTarget", retval, RETVAL );
1486         ST(0) = RETVAL;
1487         sv_2mortal(ST(0));
1488     }
1489     XSRETURN(1);
1490 }
1491
1492
1493 XS(XS_Wx__DropTarget_CLONE); /* prototype to pass -Wmissing-prototypes */
1494 XS(XS_Wx__DropTarget_CLONE)
1495 {
1496 #ifdef dVAR
1497     dVAR; dXSARGS;
1498 #else
1499     dXSARGS;
1500 #endif
1501     if (items != 1)
1502        croak_xs_usage(cv,  "CLASS");
1503     {
1504         char *  CLASS = (char *)SvPV_nolen(ST(0));
1505     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
1506     }
1507     XSRETURN_EMPTY;
1508 }
1509
1510
1511 XS(XS_Wx__DropTarget_DESTROY); /* prototype to pass -Wmissing-prototypes */
1512 XS(XS_Wx__DropTarget_DESTROY)
1513 {
1514 #ifdef dVAR
1515     dVAR; dXSARGS;
1516 #else
1517     dXSARGS;
1518 #endif
1519     if (items != 1)
1520        croak_xs_usage(cv,  "THIS");
1521     {
1522         wxDropTarget*    THIS = (wxDropTarget *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropTarget" );
1523     wxPli_thread_sv_unregister( aTHX_ "Wx::DropTarget", THIS, ST(0) );
1524     if( wxPli_object_is_deleteable( aTHX_ ST(0) ) )
1525         delete THIS;
1526     }
1527     XSRETURN_EMPTY;
1528 }
1529
1530
1531 XS(XS_Wx__DropTarget_GetData); /* prototype to pass -Wmissing-prototypes */
1532 XS(XS_Wx__DropTarget_GetData)
1533 {
1534 #ifdef dVAR
1535     dVAR; dXSARGS;
1536 #else
1537     dXSARGS;
1538 #endif
1539     if (items != 1)
1540        croak_xs_usage(cv,  "THIS");
1541     {
1542         wxDropTarget *    THIS = (wxDropTarget *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropTarget" );
1543
1544         THIS->GetData();
1545     }
1546     XSRETURN_EMPTY;
1547 }
1548
1549
1550 XS(XS_Wx__DropTarget_SetDataObject); /* prototype to pass -Wmissing-prototypes */
1551 XS(XS_Wx__DropTarget_SetDataObject)
1552 {
1553 #ifdef dVAR
1554     dVAR; dXSARGS;
1555 #else
1556     dXSARGS;
1557 #endif
1558     if (items != 2)
1559        croak_xs_usage(cv,  "THIS, data");
1560     {
1561         wxDataObject*    data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
1562         wxDropTarget *    THIS = (wxDropTarget *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropTarget" );
1563     wxPli_object_set_deleteable( aTHX_ ST(1), false );
1564     SvREFCNT_inc( SvRV( ST(1) ) ); // at this point the scalar must not go away
1565     THIS->SetDataObject( data );
1566     }
1567     XSRETURN_EMPTY;
1568 }
1569
1570
1571 XS(XS_Wx__DropTarget_OnEnter); /* prototype to pass -Wmissing-prototypes */
1572 XS(XS_Wx__DropTarget_OnEnter)
1573 {
1574 #ifdef dVAR
1575     dVAR; dXSARGS;
1576 #else
1577     dXSARGS;
1578 #endif
1579     if (items != 4)
1580        croak_xs_usage(cv,  "THIS, x, y, def");
1581     {
1582         wxCoord x = (wxCoord)SvIV(ST(1));
1583         wxCoord y = (wxCoord)SvIV(ST(2));
1584         wxDragResult    def = (wxDragResult)SvIV(ST(3));
1585         wxDropTarget *    THIS = (wxDropTarget *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropTarget" );
1586         wxDragResult    RETVAL;
1587         dXSTARG;
1588     RETVAL = THIS->wxDropTarget::OnEnter( x, y, def );
1589         XSprePUSH; PUSHi((IV)RETVAL);
1590     }
1591     XSRETURN(1);
1592 }
1593
1594
1595 XS(XS_Wx__DropTarget_OnDragOver); /* prototype to pass -Wmissing-prototypes */
1596 XS(XS_Wx__DropTarget_OnDragOver)
1597 {
1598 #ifdef dVAR
1599     dVAR; dXSARGS;
1600 #else
1601     dXSARGS;
1602 #endif
1603     if (items != 4)
1604        croak_xs_usage(cv,  "THIS, x, y, def");
1605     {
1606         wxCoord x = (wxCoord)SvIV(ST(1));
1607         wxCoord y = (wxCoord)SvIV(ST(2));
1608         wxDragResult    def = (wxDragResult)SvIV(ST(3));
1609         wxDropTarget *    THIS = (wxDropTarget *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropTarget" );
1610         wxDragResult    RETVAL;
1611         dXSTARG;
1612     RETVAL = THIS->wxDropTarget::OnDragOver( x, y, def );
1613         XSprePUSH; PUSHi((IV)RETVAL);
1614     }
1615     XSRETURN(1);
1616 }
1617
1618
1619 XS(XS_Wx__DropTarget_OnDrop); /* prototype to pass -Wmissing-prototypes */
1620 XS(XS_Wx__DropTarget_OnDrop)
1621 {
1622 #ifdef dVAR
1623     dVAR; dXSARGS;
1624 #else
1625     dXSARGS;
1626 #endif
1627     if (items != 3)
1628        croak_xs_usage(cv,  "THIS, x, y");
1629     {
1630         wxCoord x = (wxCoord)SvIV(ST(1));
1631         wxCoord y = (wxCoord)SvIV(ST(2));
1632         wxDropTarget *    THIS = (wxDropTarget *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropTarget" );
1633         bool    RETVAL;
1634     RETVAL = THIS->wxDropTarget::OnDrop( x, y );
1635         ST(0) = boolSV(RETVAL);
1636         sv_2mortal(ST(0));
1637     }
1638     XSRETURN(1);
1639 }
1640
1641
1642 XS(XS_Wx__DropTarget_OnLeave); /* prototype to pass -Wmissing-prototypes */
1643 XS(XS_Wx__DropTarget_OnLeave)
1644 {
1645 #ifdef dVAR
1646     dVAR; dXSARGS;
1647 #else
1648     dXSARGS;
1649 #endif
1650     if (items != 1)
1651        croak_xs_usage(cv,  "THIS");
1652     {
1653         wxDropTarget *    THIS = (wxDropTarget *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropTarget" );
1654     THIS->wxDropTarget::OnLeave();
1655     }
1656     XSRETURN_EMPTY;
1657 }
1658
1659
1660 XS(XS_Wx__TextDropTarget_new); /* prototype to pass -Wmissing-prototypes */
1661 XS(XS_Wx__TextDropTarget_new)
1662 {
1663 #ifdef dVAR
1664     dVAR; dXSARGS;
1665 #else
1666     dXSARGS;
1667 #endif
1668     if (items != 1)
1669        croak_xs_usage(cv,  "CLASS");
1670     {
1671         char *  CLASS = (char *)SvPV_nolen(ST(0));
1672         SV *    RETVAL;
1673     wxPliTextDropTarget* retval = new wxPliTextDropTarget( CLASS );
1674     RETVAL = retval->m_callback.GetSelf();
1675     SvREFCNT_inc( RETVAL );
1676         ST(0) = RETVAL;
1677         sv_2mortal(ST(0));
1678     }
1679     XSRETURN(1);
1680 }
1681
1682
1683 XS(XS_Wx__FileDropTarget_new); /* prototype to pass -Wmissing-prototypes */
1684 XS(XS_Wx__FileDropTarget_new)
1685 {
1686 #ifdef dVAR
1687     dVAR; dXSARGS;
1688 #else
1689     dXSARGS;
1690 #endif
1691     if (items != 1)
1692        croak_xs_usage(cv,  "CLASS");
1693     {
1694         char *  CLASS = (char *)SvPV_nolen(ST(0));
1695         SV *    RETVAL;
1696     wxPliFileDropTarget* retval = new wxPliFileDropTarget( CLASS );
1697     RETVAL = retval->m_callback.GetSelf();
1698     SvREFCNT_inc( RETVAL );
1699         ST(0) = RETVAL;
1700         sv_2mortal(ST(0));
1701     }
1702     XSRETURN(1);
1703 }
1704
1705
1706 /* INCLUDE: Returning to 'XS/DropSource.xs' from 'XS/DropTarget.xs' */
1707
1708 #include <wx/dnd.h>
1709 #include "cpp/dropsource.h"
1710 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
1711 #define XSubPPtmpAAAM 1
1712
1713
1714 XS(XS_Wx__DropSource_newCursorEmpty); /* prototype to pass -Wmissing-prototypes */
1715 XS(XS_Wx__DropSource_newCursorEmpty)
1716 {
1717 #ifdef dVAR
1718     dVAR; dXSARGS;
1719 #else
1720     dXSARGS;
1721 #endif
1722     if (items < 1 || items > 5)
1723        croak_xs_usage(cv,  "CLASS, win = 0, cursorCopy = (wxCursor*)&wxNullCursor, cursorMove = (wxCursor*)&wxNullCursor, cursorStop = (wxCursor*)&wxNullCursor");
1724     {
1725         SV*     CLASS = ST(0);
1726         wxWindow*       win;
1727         wxCursor*       cursorCopy;
1728         wxCursor*       cursorMove;
1729         wxCursor*       cursorStop;
1730         wxDropSource *  RETVAL;
1731
1732         if (items < 2)
1733             win = 0;
1734         else {
1735     win = (wxWindow *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::Window" );
1736         }
1737
1738         if (items < 3)
1739             cursorCopy = (wxCursor*)&wxNullCursor;
1740         else {
1741     cursorCopy = (wxCursor *) wxPli_sv_2_object( aTHX_ ST(2), "Wx::Cursor" );
1742         }
1743
1744         if (items < 4)
1745             cursorMove = (wxCursor*)&wxNullCursor;
1746         else {
1747     cursorMove = (wxCursor *) wxPli_sv_2_object( aTHX_ ST(3), "Wx::Cursor" );
1748         }
1749
1750         if (items < 5)
1751             cursorStop = (wxCursor*)&wxNullCursor;
1752         else {
1753     cursorStop = (wxCursor *) wxPli_sv_2_object( aTHX_ ST(4), "Wx::Cursor" );
1754         }
1755     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), win,
1756                                   *cursorCopy, *cursorMove,
1757         *cursorStop );
1758         ST(0) = sv_newmortal();
1759     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DropSource" );
1760
1761     }
1762     XSRETURN(1);
1763 }
1764
1765
1766 XS(XS_Wx__DropSource_newCursorData); /* prototype to pass -Wmissing-prototypes */
1767 XS(XS_Wx__DropSource_newCursorData)
1768 {
1769 #ifdef dVAR
1770     dVAR; dXSARGS;
1771 #else
1772     dXSARGS;
1773 #endif
1774     if (items < 2 || items > 6)
1775        croak_xs_usage(cv,  "CLASS, data, win = 0, cursorCopy = (wxCursor*)&wxNullCursor, cursorMove = (wxCursor*)&wxNullCursor, cursorStop = (wxCursor*)&wxNullCursor");
1776     {
1777         SV*     CLASS = ST(0);
1778         wxDataObject*    data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
1779         wxWindow*       win;
1780         wxCursor*       cursorCopy;
1781         wxCursor*       cursorMove;
1782         wxCursor*       cursorStop;
1783         wxDropSource *  RETVAL;
1784
1785         if (items < 3)
1786             win = 0;
1787         else {
1788     win = (wxWindow *) wxPli_sv_2_object( aTHX_ ST(2), "Wx::Window" );
1789         }
1790
1791         if (items < 4)
1792             cursorCopy = (wxCursor*)&wxNullCursor;
1793         else {
1794     cursorCopy = (wxCursor *) wxPli_sv_2_object( aTHX_ ST(3), "Wx::Cursor" );
1795         }
1796
1797         if (items < 5)
1798             cursorMove = (wxCursor*)&wxNullCursor;
1799         else {
1800     cursorMove = (wxCursor *) wxPli_sv_2_object( aTHX_ ST(4), "Wx::Cursor" );
1801         }
1802
1803         if (items < 6)
1804             cursorStop = (wxCursor*)&wxNullCursor;
1805         else {
1806     cursorStop = (wxCursor *) wxPli_sv_2_object( aTHX_ ST(5), "Wx::Cursor" );
1807         }
1808     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), *data, win,
1809                                   *cursorCopy, *cursorMove,
1810         *cursorStop );
1811         ST(0) = sv_newmortal();
1812     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DropSource" );
1813
1814     }
1815     XSRETURN(1);
1816 }
1817
1818 #else
1819 #define XSubPPtmpAAAN 1
1820
1821
1822 XS(XS_Wx__DropSource_newIconEmpty); /* prototype to pass -Wmissing-prototypes */
1823 XS(XS_Wx__DropSource_newIconEmpty)
1824 {
1825 #ifdef dVAR
1826     dVAR; dXSARGS;
1827 #else
1828     dXSARGS;
1829 #endif
1830     if (items < 1 || items > 5)
1831        croak_xs_usage(cv,  "CLASS, win = 0, iconCopy = (wxIcon*)&wxNullIcon, iconMove = (wxIcon*)&wxNullIcon, iconStop = (wxIcon*)&wxNullIcon");
1832     {
1833         SV*     CLASS = ST(0);
1834         wxWindow*       win;
1835         wxIcon* iconCopy;
1836         wxIcon* iconMove;
1837         wxIcon* iconStop;
1838         wxDropSource *  RETVAL;
1839
1840         if (items < 2)
1841             win = 0;
1842         else {
1843     win = (wxWindow *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::Window" );
1844         }
1845
1846         if (items < 3)
1847             iconCopy = (wxIcon*)&wxNullIcon;
1848         else {
1849     iconCopy = (wxIcon *) wxPli_sv_2_object( aTHX_ ST(2), "Wx::Icon" );
1850         }
1851
1852         if (items < 4)
1853             iconMove = (wxIcon*)&wxNullIcon;
1854         else {
1855     iconMove = (wxIcon *) wxPli_sv_2_object( aTHX_ ST(3), "Wx::Icon" );
1856         }
1857
1858         if (items < 5)
1859             iconStop = (wxIcon*)&wxNullIcon;
1860         else {
1861     iconStop = (wxIcon *) wxPli_sv_2_object( aTHX_ ST(4), "Wx::Icon" );
1862         }
1863     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), win,
1864                                   *iconCopy, *iconMove, *iconStop );
1865         ST(0) = sv_newmortal();
1866     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DropSource" );
1867
1868     }
1869     XSRETURN(1);
1870 }
1871
1872
1873 XS(XS_Wx__DropSource_newIconData); /* prototype to pass -Wmissing-prototypes */
1874 XS(XS_Wx__DropSource_newIconData)
1875 {
1876 #ifdef dVAR
1877     dVAR; dXSARGS;
1878 #else
1879     dXSARGS;
1880 #endif
1881     if (items < 2 || items > 6)
1882        croak_xs_usage(cv,  "CLASS, data, win = 0, iconCopy = (wxIcon*)&wxNullIcon, iconMove = (wxIcon*)&wxNullIcon, iconStop = (wxIcon*)&wxNullIcon");
1883     {
1884         SV*     CLASS = ST(0);
1885         wxDataObject*    data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
1886         wxWindow*       win;
1887         wxIcon* iconCopy;
1888         wxIcon* iconMove;
1889         wxIcon* iconStop;
1890         wxDropSource *  RETVAL;
1891
1892         if (items < 3)
1893             win = 0;
1894         else {
1895     win = (wxWindow *) wxPli_sv_2_object( aTHX_ ST(2), "Wx::Window" );
1896         }
1897
1898         if (items < 4)
1899             iconCopy = (wxIcon*)&wxNullIcon;
1900         else {
1901     iconCopy = (wxIcon *) wxPli_sv_2_object( aTHX_ ST(3), "Wx::Icon" );
1902         }
1903
1904         if (items < 5)
1905             iconMove = (wxIcon*)&wxNullIcon;
1906         else {
1907     iconMove = (wxIcon *) wxPli_sv_2_object( aTHX_ ST(4), "Wx::Icon" );
1908         }
1909
1910         if (items < 6)
1911             iconStop = (wxIcon*)&wxNullIcon;
1912         else {
1913     iconStop = (wxIcon *) wxPli_sv_2_object( aTHX_ ST(5), "Wx::Icon" );
1914         }
1915     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), *data, win,
1916                                   *iconCopy, *iconMove, *iconStop );
1917         ST(0) = sv_newmortal();
1918     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DropSource" );
1919
1920     }
1921     XSRETURN(1);
1922 }
1923
1924 #endif
1925
1926 XS(XS_Wx__DropSource_DoDragDrop); /* prototype to pass -Wmissing-prototypes */
1927 XS(XS_Wx__DropSource_DoDragDrop)
1928 {
1929 #ifdef dVAR
1930     dVAR; dXSARGS;
1931 #else
1932     dXSARGS;
1933 #endif
1934     if (items < 1 || items > 2)
1935        croak_xs_usage(cv,  "THIS, flags = wxDrag_CopyOnly");
1936     {
1937         int     flags;
1938         wxDropSource *    THIS = (wxDropSource *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropSource" );
1939         wxDragResult    RETVAL;
1940         dXSTARG;
1941
1942         if (items < 2)
1943             flags = wxDrag_CopyOnly;
1944         else {
1945             flags = (int)SvIV(ST(1));
1946         }
1947
1948         RETVAL = THIS->DoDragDrop(flags);
1949         XSprePUSH; PUSHi((IV)RETVAL);
1950     }
1951     XSRETURN(1);
1952 }
1953
1954
1955 XS(XS_Wx__DropSource_SetData); /* prototype to pass -Wmissing-prototypes */
1956 XS(XS_Wx__DropSource_SetData)
1957 {
1958 #ifdef dVAR
1959     dVAR; dXSARGS;
1960 #else
1961     dXSARGS;
1962 #endif
1963     if (items != 2)
1964        croak_xs_usage(cv,  "THIS, data");
1965     {
1966         wxDataObject*    data = (wxDataObject *) wxPli_sv_2_object( aTHX_ ST(1), "Wx::DataObject" );
1967         wxDropSource *    THIS = (wxDropSource *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropSource" );
1968     THIS->SetData( *data );
1969     }
1970     XSRETURN_EMPTY;
1971 }
1972
1973
1974 XS(XS_Wx__DropSource_GetDataObject); /* prototype to pass -Wmissing-prototypes */
1975 XS(XS_Wx__DropSource_GetDataObject)
1976 {
1977 #ifdef dVAR
1978     dVAR; dXSARGS;
1979 #else
1980     dXSARGS;
1981 #endif
1982     if (items != 1)
1983        croak_xs_usage(cv,  "THIS");
1984     {
1985         wxDropSource *    THIS = (wxDropSource *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropSource" );
1986         wxDataObject *  RETVAL;
1987     RETVAL = THIS->GetDataObject();
1988         ST(0) = sv_newmortal();
1989     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataObject" );
1990     wxPli_thread_sv_register( aTHX_ "Wx::DataObject", RETVAL, ST(0) );
1991
1992     wxPli_object_set_deleteable( aTHX_ ST(0), false );
1993     }
1994     XSRETURN(1);
1995 }
1996
1997
1998 XS(XS_Wx__DropSource_SetCursor); /* prototype to pass -Wmissing-prototypes */
1999 XS(XS_Wx__DropSource_SetCursor)
2000 {
2001 #ifdef dVAR
2002     dVAR; dXSARGS;
2003 #else
2004     dXSARGS;
2005 #endif
2006     if (items != 3)
2007        croak_xs_usage(cv,  "THIS, res, cursor");
2008     {
2009         wxDragResult    res = (wxDragResult)SvIV(ST(1));
2010         wxCursor*    cursor = (wxCursor *) wxPli_sv_2_object( aTHX_ ST(2), "Wx::Cursor" );
2011         wxDropSource *    THIS = (wxDropSource *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropSource" );
2012     THIS->SetCursor( res, *cursor );
2013     }
2014     XSRETURN_EMPTY;
2015 }
2016
2017
2018 /* INCLUDE: Returning to 'XS/DropFiles.xs' from 'XS/DropSource.xs' */
2019
2020 #include <wx/event.h>
2021
2022 XS(XS_Wx__DropFilesEvent_GetFiles); /* prototype to pass -Wmissing-prototypes */
2023 XS(XS_Wx__DropFilesEvent_GetFiles)
2024 {
2025 #ifdef dVAR
2026     dVAR; dXSARGS;
2027 #else
2028     dXSARGS;
2029 #endif
2030     if (items != 1)
2031        croak_xs_usage(cv,  "THIS");
2032     PERL_UNUSED_VAR(ax); /* -Wall */
2033     SP -= items;
2034     {
2035         wxDropFilesEvent *    THIS = (wxDropFilesEvent *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropFilesEvent" );
2036     wxString* files = THIS->GetFiles();
2037     int i, max = THIS->GetNumberOfFiles();
2038     EXTEND( SP, max );
2039     for( i = 0; i < max; ++i )
2040     {
2041 #if wxUSE_UNICODE
2042       SV* tmp = sv_2mortal( newSVpv( CHAR_P files[i].mb_str(wxConvUTF8), 0 ) );
2043       SvUTF8_on( tmp );
2044       PUSHs( tmp );
2045 #else
2046       PUSHs( sv_2mortal( newSVpv( CHAR_P files[i].c_str(), 0 ) ) );
2047 #endif
2048     }
2049         PUTBACK;
2050         return;
2051     }
2052 }
2053
2054
2055 XS(XS_Wx__DropFilesEvent_GetNumberOfFiles); /* prototype to pass -Wmissing-prototypes */
2056 XS(XS_Wx__DropFilesEvent_GetNumberOfFiles)
2057 {
2058 #ifdef dVAR
2059     dVAR; dXSARGS;
2060 #else
2061     dXSARGS;
2062 #endif
2063     if (items != 1)
2064        croak_xs_usage(cv,  "THIS");
2065     {
2066         wxDropFilesEvent *    THIS = (wxDropFilesEvent *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropFilesEvent" );
2067         int     RETVAL;
2068         dXSTARG;
2069
2070         RETVAL = THIS->GetNumberOfFiles();
2071         XSprePUSH; PUSHi((IV)RETVAL);
2072     }
2073     XSRETURN(1);
2074 }
2075
2076
2077 XS(XS_Wx__DropFilesEvent_GetPosition); /* prototype to pass -Wmissing-prototypes */
2078 XS(XS_Wx__DropFilesEvent_GetPosition)
2079 {
2080 #ifdef dVAR
2081     dVAR; dXSARGS;
2082 #else
2083     dXSARGS;
2084 #endif
2085     if (items != 1)
2086        croak_xs_usage(cv,  "THIS");
2087     {
2088         wxDropFilesEvent *    THIS = (wxDropFilesEvent *) wxPli_sv_2_object( aTHX_ ST(0), "Wx::DropFilesEvent" );
2089         wxPoint *       RETVAL;
2090     RETVAL = new wxPoint( THIS->GetPosition() );
2091         ST(0) = sv_newmortal();
2092     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::Point" );
2093     wxPli_thread_sv_register( aTHX_ "Wx::Point", RETVAL, ST(0) );
2094
2095     }
2096     XSRETURN(1);
2097 }
2098
2099
2100 /* INCLUDE: Returning to 'DND.xs' from 'XS/DropFiles.xs' */
2101
2102 #endif
2103
2104 XS(XS_Wx_wxDF_TEXT); /* prototype to pass -Wmissing-prototypes */
2105 XS(XS_Wx_wxDF_TEXT)
2106 {
2107 #ifdef dVAR
2108     dVAR; dXSARGS;
2109 #else
2110     dXSARGS;
2111 #endif
2112     if (items != 0)
2113        croak_xs_usage(cv,  "");
2114     {
2115         wxDataFormat *  RETVAL;
2116     RETVAL = new wxDataFormat( wxDF_TEXT );
2117         ST(0) = sv_newmortal();
2118     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
2119     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
2120
2121     }
2122     XSRETURN(1);
2123 }
2124
2125
2126 XS(XS_Wx_wxDF_BITMAP); /* prototype to pass -Wmissing-prototypes */
2127 XS(XS_Wx_wxDF_BITMAP)
2128 {
2129 #ifdef dVAR
2130     dVAR; dXSARGS;
2131 #else
2132     dXSARGS;
2133 #endif
2134     if (items != 0)
2135        croak_xs_usage(cv,  "");
2136     {
2137         wxDataFormat *  RETVAL;
2138     RETVAL = new wxDataFormat( wxDF_BITMAP );
2139         ST(0) = sv_newmortal();
2140     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
2141     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
2142
2143     }
2144     XSRETURN(1);
2145 }
2146
2147 #if defined(__WXMSW__)
2148 #define XSubPPtmpAAAO 1
2149
2150
2151 XS(XS_Wx_wxDF_METAFILE); /* prototype to pass -Wmissing-prototypes */
2152 XS(XS_Wx_wxDF_METAFILE)
2153 {
2154 #ifdef dVAR
2155     dVAR; dXSARGS;
2156 #else
2157     dXSARGS;
2158 #endif
2159     if (items != 0)
2160        croak_xs_usage(cv,  "");
2161     {
2162         wxDataFormat *  RETVAL;
2163     RETVAL = new wxDataFormat( wxDF_METAFILE );
2164         ST(0) = sv_newmortal();
2165     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
2166     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
2167
2168     }
2169     XSRETURN(1);
2170 }
2171
2172 #endif
2173
2174 XS(XS_Wx_wxDF_FILENAME); /* prototype to pass -Wmissing-prototypes */
2175 XS(XS_Wx_wxDF_FILENAME)
2176 {
2177 #ifdef dVAR
2178     dVAR; dXSARGS;
2179 #else
2180     dXSARGS;
2181 #endif
2182     if (items != 0)
2183        croak_xs_usage(cv,  "");
2184     {
2185         wxDataFormat *  RETVAL;
2186     RETVAL = new wxDataFormat( wxDF_FILENAME );
2187         ST(0) = sv_newmortal();
2188     wxPli_non_object_2_sv( aTHX_ ST(0), RETVAL, "Wx::DataFormat" );
2189     wxPli_thread_sv_register( aTHX_ "Wx::DataFormat", RETVAL, ST(0) );
2190
2191     }
2192     XSRETURN(1);
2193 }
2194
2195 #if defined(__WXMSW__)
2196 #undef XS
2197 #define XS( name ) WXXS( name )
2198 #endif
2199 #ifdef __cplusplus
2200 extern "C"
2201 #endif
2202 XS(boot_Wx__DND); /* prototype to pass -Wmissing-prototypes */
2203 XS(boot_Wx__DND)
2204 {
2205 #ifdef dVAR
2206     dVAR; dXSARGS;
2207 #else
2208     dXSARGS;
2209 #endif
2210 #if (PERL_REVISION == 5 && PERL_VERSION < 9)
2211     char* file = __FILE__;
2212 #else
2213     const char* file = __FILE__;
2214 #endif
2215
2216     PERL_UNUSED_VAR(cv); /* -W */
2217     PERL_UNUSED_VAR(items); /* -W */
2218     XS_VERSION_BOOTCHECK ;
2219
2220         newXS("Wx::Clipboard::AddData", XS_Wx__Clipboard_AddData, file);
2221         newXS("Wx::Clipboard::Clear", XS_Wx__Clipboard_Clear, file);
2222         newXS("Wx::Clipboard::Close", XS_Wx__Clipboard_Close, file);
2223         newXS("Wx::Clipboard::Flush", XS_Wx__Clipboard_Flush, file);
2224         newXS("Wx::Clipboard::GetData", XS_Wx__Clipboard_GetData, file);
2225         newXS("Wx::Clipboard::IsOpened", XS_Wx__Clipboard_IsOpened, file);
2226         newXS("Wx::Clipboard::IsSupported", XS_Wx__Clipboard_IsSupported, file);
2227         newXS("Wx::Clipboard::Open", XS_Wx__Clipboard_Open, file);
2228         newXS("Wx::Clipboard::SetData", XS_Wx__Clipboard_SetData, file);
2229         newXS("Wx::Clipboard::UsePrimarySelection", XS_Wx__Clipboard_UsePrimarySelection, file);
2230 #if XSubPPtmpAAAA
2231         newXS("Wx::Clipboard::IsUsingPrimarySelection", XS_Wx__Clipboard_IsUsingPrimarySelection, file);
2232 #endif
2233 #if XSubPPtmpAAAB
2234         newXS("Wx::DataFormat::newNative", XS_Wx__DataFormat_newNative, file);
2235 #endif
2236 #if XSubPPtmpAAAC
2237         newXS("Wx::DataFormat::newNative", XS_Wx__DataFormat_newNative, file);
2238 #endif
2239 #if XSubPPtmpAAAD
2240         newXS("Wx::DataFormat::newUser", XS_Wx__DataFormat_newUser, file);
2241 #endif
2242 #if XSubPPtmpAAAE
2243         newXS("Wx::DataFormat::newUser", XS_Wx__DataFormat_newUser, file);
2244 #endif
2245         newXS("Wx::DataFormat::CLONE", XS_Wx__DataFormat_CLONE, file);
2246         newXS("Wx::DataFormat::DESTROY", XS_Wx__DataFormat_DESTROY, file);
2247         newXS("Wx::DataFormat::GetId", XS_Wx__DataFormat_GetId, file);
2248         newXS("Wx::DataFormat::SetId", XS_Wx__DataFormat_SetId, file);
2249 #if XSubPPtmpAAAF
2250         newXS("Wx::DataFormat::GetType", XS_Wx__DataFormat_GetType, file);
2251         newXS("Wx::DataFormat::SetType", XS_Wx__DataFormat_SetType, file);
2252 #endif
2253 #if XSubPPtmpAAAG
2254         newXS("Wx::DataFormat::GetType", XS_Wx__DataFormat_GetType, file);
2255 #if XSubPPtmpAAAH
2256         newXS("Wx::DataFormat::SetType", XS_Wx__DataFormat_SetType, file);
2257 #endif
2258 #endif
2259         newXS("Wx::DataObject::CLONE", XS_Wx__DataObject_CLONE, file);
2260         newXS("Wx::DataObject::DESTROY", XS_Wx__DataObject_DESTROY, file);
2261         newXS("Wx::DataObject::Destroy", XS_Wx__DataObject_Destroy, file);
2262         newXS("Wx::DataObject::GetAllFormats", XS_Wx__DataObject_GetAllFormats, file);
2263         newXS("Wx::DataObject::GetDataHere", XS_Wx__DataObject_GetDataHere, file);
2264         newXS("Wx::DataObject::GetDataSize", XS_Wx__DataObject_GetDataSize, file);
2265         newXS("Wx::DataObject::GetFormatCount", XS_Wx__DataObject_GetFormatCount, file);
2266         newXS("Wx::DataObject::GetPreferredFormat", XS_Wx__DataObject_GetPreferredFormat, file);
2267         newXS("Wx::DataObject::IsSupported", XS_Wx__DataObject_IsSupported, file);
2268         newXS("Wx::DataObject::SetData", XS_Wx__DataObject_SetData, file);
2269         newXS("Wx::DataObjectSimple::new", XS_Wx__DataObjectSimple_new, file);
2270         newXS("Wx::DataObjectSimple::GetFormat", XS_Wx__DataObjectSimple_GetFormat, file);
2271         newXS("Wx::DataObjectSimple::SetFormat", XS_Wx__DataObjectSimple_SetFormat, file);
2272         newXS("Wx::PlDataObjectSimple::new", XS_Wx__PlDataObjectSimple_new, file);
2273         newXS("Wx::PlDataObjectSimple::DESTROY", XS_Wx__PlDataObjectSimple_DESTROY, file);
2274         newXS("Wx::DataObjectComposite::new", XS_Wx__DataObjectComposite_new, file);
2275         newXS("Wx::DataObjectComposite::Add", XS_Wx__DataObjectComposite_Add, file);
2276 #if XSubPPtmpAAAI
2277         newXS("Wx::DataObjectComposite::GetReceivedFormat", XS_Wx__DataObjectComposite_GetReceivedFormat, file);
2278 #endif
2279         newXS("Wx::TextDataObject::new", XS_Wx__TextDataObject_new, file);
2280         newXS("Wx::TextDataObject::GetTextLength", XS_Wx__TextDataObject_GetTextLength, file);
2281         newXS("Wx::TextDataObject::GetText", XS_Wx__TextDataObject_GetText, file);
2282         newXS("Wx::TextDataObject::SetText", XS_Wx__TextDataObject_SetText, file);
2283 #if XSubPPtmpAAAJ
2284         newXS("Wx::BitmapDataObject::new", XS_Wx__BitmapDataObject_new, file);
2285         newXS("Wx::BitmapDataObject::GetBitmap", XS_Wx__BitmapDataObject_GetBitmap, file);
2286         newXS("Wx::BitmapDataObject::SetBitmap", XS_Wx__BitmapDataObject_SetBitmap, file);
2287 #endif
2288 #if XSubPPtmpAAAK
2289         newXS("Wx::FileDataObject::new", XS_Wx__FileDataObject_new, file);
2290         newXS("Wx::FileDataObject::AddFile", XS_Wx__FileDataObject_AddFile, file);
2291         newXS("Wx::FileDataObject::GetFilenames", XS_Wx__FileDataObject_GetFilenames, file);
2292         newXS("Wx::URLDataObject::new", XS_Wx__URLDataObject_new, file);
2293         newXS("Wx::URLDataObject::GetURL", XS_Wx__URLDataObject_GetURL, file);
2294         newXS("Wx::URLDataObject::SetURL", XS_Wx__URLDataObject_SetURL, file);
2295 #endif
2296 #if XSubPPtmpAAAL
2297         newXS("Wx::DropTarget::new", XS_Wx__DropTarget_new, file);
2298         newXS("Wx::DropTarget::CLONE", XS_Wx__DropTarget_CLONE, file);
2299         newXS("Wx::DropTarget::DESTROY", XS_Wx__DropTarget_DESTROY, file);
2300         newXS("Wx::DropTarget::GetData", XS_Wx__DropTarget_GetData, file);
2301         newXS("Wx::DropTarget::SetDataObject", XS_Wx__DropTarget_SetDataObject, file);
2302         newXS("Wx::DropTarget::OnEnter", XS_Wx__DropTarget_OnEnter, file);
2303         newXS("Wx::DropTarget::OnDragOver", XS_Wx__DropTarget_OnDragOver, file);
2304         newXS("Wx::DropTarget::OnDrop", XS_Wx__DropTarget_OnDrop, file);
2305         newXS("Wx::DropTarget::OnLeave", XS_Wx__DropTarget_OnLeave, file);
2306         newXS("Wx::TextDropTarget::new", XS_Wx__TextDropTarget_new, file);
2307         newXS("Wx::FileDropTarget::new", XS_Wx__FileDropTarget_new, file);
2308 #if XSubPPtmpAAAM
2309         newXS("Wx::DropSource::newCursorEmpty", XS_Wx__DropSource_newCursorEmpty, file);
2310         newXS("Wx::DropSource::newCursorData", XS_Wx__DropSource_newCursorData, file);
2311 #endif
2312 #if XSubPPtmpAAAN
2313         newXS("Wx::DropSource::newIconEmpty", XS_Wx__DropSource_newIconEmpty, file);
2314         newXS("Wx::DropSource::newIconData", XS_Wx__DropSource_newIconData, file);
2315 #endif
2316         newXS("Wx::DropSource::DoDragDrop", XS_Wx__DropSource_DoDragDrop, file);
2317         newXS("Wx::DropSource::SetData", XS_Wx__DropSource_SetData, file);
2318         newXS("Wx::DropSource::GetDataObject", XS_Wx__DropSource_GetDataObject, file);
2319         newXS("Wx::DropSource::SetCursor", XS_Wx__DropSource_SetCursor, file);
2320         newXS("Wx::DropFilesEvent::GetFiles", XS_Wx__DropFilesEvent_GetFiles, file);
2321         newXS("Wx::DropFilesEvent::GetNumberOfFiles", XS_Wx__DropFilesEvent_GetNumberOfFiles, file);
2322         newXS("Wx::DropFilesEvent::GetPosition", XS_Wx__DropFilesEvent_GetPosition, file);
2323 #endif
2324         newXS("Wx::wxDF_TEXT", XS_Wx_wxDF_TEXT, file);
2325         newXS("Wx::wxDF_BITMAP", XS_Wx_wxDF_BITMAP, file);
2326 #if XSubPPtmpAAAO
2327         newXS("Wx::wxDF_METAFILE", XS_Wx_wxDF_METAFILE, file);
2328 #endif
2329         newXS("Wx::wxDF_FILENAME", XS_Wx_wxDF_FILENAME, file);
2330
2331     /* Initialisation Section */
2332
2333   INIT_PLI_HELPERS( wx_pli_helpers );
2334
2335 #if XSubPPtmpAAAA
2336 #endif
2337 #if XSubPPtmpAAAB
2338 #endif
2339 #if XSubPPtmpAAAC
2340 #endif
2341 #if XSubPPtmpAAAD
2342 #endif
2343 #if XSubPPtmpAAAE
2344 #endif
2345 #if XSubPPtmpAAAF
2346 #endif
2347 #if XSubPPtmpAAAG
2348 #if XSubPPtmpAAAH
2349 #endif
2350 #endif
2351 #if XSubPPtmpAAAI
2352 #endif
2353 #if XSubPPtmpAAAJ
2354 #endif
2355 #if XSubPPtmpAAAK
2356 #endif
2357 #if XSubPPtmpAAAL
2358 #if XSubPPtmpAAAM
2359 #endif
2360 #if XSubPPtmpAAAN
2361 #endif
2362 #endif
2363 #if XSubPPtmpAAAO
2364 #endif
2365
2366     /* End of Initialisation Section */
2367
2368 #if (PERL_REVISION == 5 && PERL_VERSION >= 9)
2369   if (PL_unitcheckav)
2370        call_list(PL_scopestack_ix, PL_unitcheckav);
2371 #endif
2372     XSRETURN_YES;
2373 }
2374