]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/misc2.i
81d212afdde41f5742a908d7e8ce18a6069bb88d
[wxWidgets.git] / wxPython / src / misc2.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: misc2.i
3 // Purpose: Definitions of miscelaneous functions and classes that need
4 // to know about wxWindow. (So they can't be in misc.i or an
5 // import loop will happen.)
6 //
7 // Author: Robin Dunn
8 //
9 // Created: 18-June-1999
10 // RCS-ID: $Id$
11 // Copyright: (c) 1998 by Total Control Software
12 // Licence: wxWindows license
13 /////////////////////////////////////////////////////////////////////////////
14
15 %module misc2
16
17 %{
18 #include "helpers.h"
19 #include <wx/resource.h>
20 #include <wx/tooltip.h>
21 #include <wx/caret.h>
22 #include <wx/fontenum.h>
23 #include <wx/tipdlg.h>
24 #include <wx/process.h>
25
26 #if wxUSE_JOYSTICK || defined(__WXMSW__)
27 #include <wx/joystick.h>
28 #endif
29
30 #if wxUSE_WAVE || defined(__WXMSW__)
31 #include <wx/wave.h>
32 #endif
33 %}
34
35 //----------------------------------------------------------------------
36
37 %include typemaps.i
38 %include my_typemaps.i
39
40 // Import some definitions of other classes, etc.
41 %import _defs.i
42 %import windows.i
43 %import misc.i
44 %import gdi.i
45 %import events.i
46 %import streams.i
47
48 %{
49 static wxString wxPyEmptyStr("");
50 %}
51
52 //---------------------------------------------------------------------------
53 // Dialog Functions
54
55 wxString wxFileSelector(char* message,
56 char* default_path = NULL,
57 char* default_filename = NULL,
58 char* default_extension = NULL,
59 char* wildcard = "*.*",
60 int flags = 0,
61 wxWindow *parent = NULL,
62 int x = -1, int y = -1);
63
64 wxString wxGetTextFromUser(const wxString& message,
65 const wxString& caption = wxPyEmptyStr,
66 const wxString& default_value = wxPyEmptyStr,
67 wxWindow *parent = NULL,
68 int x = -1, int y = -1,
69 bool centre = TRUE);
70
71 wxString wxGetPasswordFromUser(const wxString& message,
72 const wxString& caption = wxPyEmptyStr,
73 const wxString& default_value = wxPyEmptyStr,
74 wxWindow *parent = NULL);
75
76
77 // TODO: Need to custom wrap this one...
78 // int wxGetMultipleChoice(char* message, char* caption,
79 // int LCOUNT, char** choices,
80 // int nsel, int *selection,
81 // wxWindow *parent = NULL, int x = -1, int y = -1,
82 // bool centre = TRUE, int width=150, int height=200);
83
84
85 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
86 int LCOUNT, wxString* choices,
87 wxWindow *parent = NULL,
88 int x = -1, int y = -1,
89 bool centre = TRUE,
90 int width=150, int height=200);
91
92 int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
93 int LCOUNT, wxString* choices,
94 wxWindow *parent = NULL,
95 int x = -1, int y = -1,
96 bool centre = TRUE,
97 int width=150, int height=200);
98
99
100 int wxMessageBox(const wxString& message,
101 const wxString& caption = wxPyEmptyStr,
102 int style = wxOK | wxCENTRE,
103 wxWindow *parent = NULL,
104 int x = -1, int y = -1);
105
106 long wxGetNumberFromUser(const wxString& message,
107 const wxString& prompt,
108 const wxString& caption,
109 long value,
110 long min = 0, long max = 100,
111 wxWindow *parent = NULL,
112 const wxPoint& pos = wxDefaultPosition);
113
114 //---------------------------------------------------------------------------
115 // GDI Functions
116
117 bool wxColourDisplay();
118
119 int wxDisplayDepth();
120 int wxGetDisplayDepth();
121
122 void wxDisplaySize(int* OUTPUT, int* OUTPUT);
123 wxSize wxGetDisplaySize();
124
125 void wxDisplaySizeMM(int* OUTPUT, int* OUTPUT);
126 wxSize wxGetDisplaySizeMM();
127
128 void wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT);
129 wxRect wxGetClientDisplayRect();
130
131 void wxSetCursor(wxCursor& cursor);
132
133 //----------------------------------------------------------------------
134 // Miscellaneous functions
135
136 wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
137 wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
138
139 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
140 wxWindow * wxGetActiveWindow();
141
142 wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
143 wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
144 bool wxCheckForInterrupt(wxWindow *wnd);
145
146 //---------------------------------------------------------------------------
147 // Resource System
148
149 bool wxResourceAddIdentifier(char *name, int value);
150 void wxResourceClear(void);
151 wxBitmap wxResourceCreateBitmap(char *resource);
152 wxIcon wxResourceCreateIcon(char *resource);
153 wxMenuBar * wxResourceCreateMenuBar(char *resource);
154 int wxResourceGetIdentifier(char *name);
155 bool wxResourceParseData(char *resource, wxResourceTable *table = NULL);
156 bool wxResourceParseFile(char *filename, wxResourceTable *table = NULL);
157 bool wxResourceParseString(char *resource, wxResourceTable *table = NULL);
158
159 //---------------------------------------------------------------------------
160 // System Settings
161
162 enum {
163 wxSYS_WHITE_BRUSH,
164 wxSYS_LTGRAY_BRUSH,
165 wxSYS_GRAY_BRUSH,
166 wxSYS_DKGRAY_BRUSH,
167 wxSYS_BLACK_BRUSH,
168 wxSYS_NULL_BRUSH,
169 wxSYS_HOLLOW_BRUSH,
170 wxSYS_WHITE_PEN,
171 wxSYS_BLACK_PEN,
172 wxSYS_NULL_PEN,
173 wxSYS_OEM_FIXED_FONT,
174 wxSYS_ANSI_FIXED_FONT,
175 wxSYS_ANSI_VAR_FONT,
176 wxSYS_SYSTEM_FONT,
177 wxSYS_DEVICE_DEFAULT_FONT,
178 wxSYS_DEFAULT_PALETTE,
179 wxSYS_SYSTEM_FIXED_FONT,
180 wxSYS_DEFAULT_GUI_FONT,
181
182 wxSYS_COLOUR_SCROLLBAR,
183 wxSYS_COLOUR_BACKGROUND,
184 wxSYS_COLOUR_ACTIVECAPTION,
185 wxSYS_COLOUR_INACTIVECAPTION,
186 wxSYS_COLOUR_MENU,
187 wxSYS_COLOUR_WINDOW,
188 wxSYS_COLOUR_WINDOWFRAME,
189 wxSYS_COLOUR_MENUTEXT,
190 wxSYS_COLOUR_WINDOWTEXT,
191 wxSYS_COLOUR_CAPTIONTEXT,
192 wxSYS_COLOUR_ACTIVEBORDER,
193 wxSYS_COLOUR_INACTIVEBORDER,
194 wxSYS_COLOUR_APPWORKSPACE,
195 wxSYS_COLOUR_HIGHLIGHT,
196 wxSYS_COLOUR_HIGHLIGHTTEXT,
197 wxSYS_COLOUR_BTNFACE,
198 wxSYS_COLOUR_BTNSHADOW,
199 wxSYS_COLOUR_GRAYTEXT,
200 wxSYS_COLOUR_BTNTEXT,
201 wxSYS_COLOUR_INACTIVECAPTIONTEXT,
202 wxSYS_COLOUR_BTNHIGHLIGHT,
203
204 wxSYS_COLOUR_3DDKSHADOW,
205 wxSYS_COLOUR_3DLIGHT,
206 wxSYS_COLOUR_INFOTEXT,
207 wxSYS_COLOUR_INFOBK,
208
209 wxSYS_COLOUR_DESKTOP,
210 wxSYS_COLOUR_3DFACE,
211 wxSYS_COLOUR_3DSHADOW,
212 wxSYS_COLOUR_3DHIGHLIGHT,
213 wxSYS_COLOUR_3DHILIGHT,
214 wxSYS_COLOUR_BTNHILIGHT,
215
216 wxSYS_MOUSE_BUTTONS,
217 wxSYS_BORDER_X,
218 wxSYS_BORDER_Y,
219 wxSYS_CURSOR_X,
220 wxSYS_CURSOR_Y,
221 wxSYS_DCLICK_X,
222 wxSYS_DCLICK_Y,
223 wxSYS_DRAG_X,
224 wxSYS_DRAG_Y,
225 wxSYS_EDGE_X,
226 wxSYS_EDGE_Y,
227 wxSYS_HSCROLL_ARROW_X,
228 wxSYS_HSCROLL_ARROW_Y,
229 wxSYS_HTHUMB_X,
230 wxSYS_ICON_X,
231 wxSYS_ICON_Y,
232 wxSYS_ICONSPACING_X,
233 wxSYS_ICONSPACING_Y,
234 wxSYS_WINDOWMIN_X,
235 wxSYS_WINDOWMIN_Y,
236 wxSYS_SCREEN_X,
237 wxSYS_SCREEN_Y,
238 wxSYS_FRAMESIZE_X,
239 wxSYS_FRAMESIZE_Y,
240 wxSYS_SMALLICON_X,
241 wxSYS_SMALLICON_Y,
242 wxSYS_HSCROLL_Y,
243 wxSYS_VSCROLL_X,
244 wxSYS_VSCROLL_ARROW_X,
245 wxSYS_VSCROLL_ARROW_Y,
246 wxSYS_VTHUMB_Y,
247 wxSYS_CAPTION_Y,
248 wxSYS_MENU_Y,
249 wxSYS_NETWORK_PRESENT,
250 wxSYS_PENWINDOWS_PRESENT,
251 wxSYS_SHOW_SOUNDS,
252 wxSYS_SWAP_BUTTONS,
253 };
254
255
256
257 %inline %{
258
259 wxColour wxSystemSettings_GetSystemColour(int index) {
260 return wxSystemSettings::GetSystemColour(index);
261 }
262
263 wxFont wxSystemSettings_GetSystemFont(int index) {
264 return wxSystemSettings::GetSystemFont(index);
265 }
266
267 int wxSystemSettings_GetSystemMetric(int index) {
268 return wxSystemSettings::GetSystemMetric(index);
269 }
270 %}
271
272 //---------------------------------------------------------------------------
273 // wxToolTip
274
275 class wxToolTip : public wxObject {
276 public:
277 wxToolTip(const wxString &tip);
278
279 void SetTip(const wxString& tip);
280 wxString GetTip();
281 // *** Not in the "public" interface void SetWindow(wxWindow *win);
282 wxWindow *GetWindow();
283 };
284
285
286 %inline %{
287 void wxToolTip_Enable(bool flag) {
288 wxToolTip::Enable(flag);
289 }
290
291 void wxToolTip_SetDelay(long milliseconds) {
292 wxToolTip::SetDelay(milliseconds);
293 }
294 %}
295
296 //----------------------------------------------------------------------
297
298 class wxCaret {
299 public:
300 wxCaret(wxWindow* window, const wxSize& size);
301 ~wxCaret();
302
303 bool IsOk();
304 bool IsVisible();
305 %name(GetPositionTuple)void GetPosition(int *OUTPUT, int *OUTPUT);
306 wxPoint GetPosition();
307 %name(GetSizeTuple)void GetSize(int *OUTPUT, int *OUTPUT);
308 wxSize GetSize();
309 wxWindow *GetWindow();
310 %name(MoveXY)void Move(int x, int y);
311 void Move(const wxPoint& pt);
312 %name(SetSizeWH) void SetSize(int width, int height);
313 void SetSize(const wxSize& size);
314 void Show(int show = TRUE);
315 void Hide();
316 };
317
318 %inline %{
319 int wxCaret_GetBlinkTime() {
320 return wxCaret::GetBlinkTime();
321 }
322
323 void wxCaret_SetBlinkTime(int milliseconds) {
324 wxCaret::SetBlinkTime(milliseconds);
325 }
326 %}
327
328 //----------------------------------------------------------------------
329
330 %{
331 class wxPyFontEnumerator : public wxFontEnumerator {
332 public:
333 wxPyFontEnumerator() {}
334 ~wxPyFontEnumerator() {}
335
336 DEC_PYCALLBACK_BOOL_STRING(OnFacename);
337 DEC_PYCALLBACK_BOOL_STRINGSTRING(OnFontEncoding);
338
339 PYPRIVATE;
340 };
341
342 IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFacename);
343 IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding);
344
345 %}
346
347 %name(wxFontEnumerator) class wxPyFontEnumerator {
348 public:
349 wxPyFontEnumerator();
350 ~wxPyFontEnumerator();
351 void _setSelf(PyObject* self, PyObject* _class);
352 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxFontEnumerator)"
353
354 bool EnumerateFacenames(
355 wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
356 bool fixedWidthOnly = FALSE);
357 bool EnumerateEncodings(const char* facename = "");
358
359 //wxArrayString* GetEncodings();
360 //wxArrayString* GetFacenames();
361 %addmethods {
362 PyObject* GetEncodings() {
363 wxArrayString* arr = self->GetEncodings();
364 PyObject* list = PyList_New(0);
365 for (size_t x=0; x<arr->GetCount(); x++)
366 PyList_Append(list, PyString_FromString((*arr)[x]));
367 return list;
368 }
369
370 PyObject* GetFacenames() {
371 wxArrayString* arr = self->GetFacenames();
372 PyObject* list = PyList_New(0);
373 for (size_t x=0; x<arr->GetCount(); x++)
374 PyList_Append(list, PyString_FromString((*arr)[x]));
375 return list;
376 }
377 }
378 };
379
380 //----------------------------------------------------------------------
381
382 class wxBusyCursor {
383 public:
384 wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
385 ~wxBusyCursor();
386 };
387
388 //----------------------------------------------------------------------
389
390 class wxWindowDisabler {
391 public:
392 wxWindowDisabler(wxWindow *winToSkip = NULL);
393 ~wxWindowDisabler();
394 };
395
396 //----------------------------------------------------------------------
397
398 bool wxSafeYield(wxWindow* win=NULL);
399 void wxPostEvent(wxEvtHandler *dest, wxEvent& event);
400 void wxWakeUpIdle();
401
402
403 #ifdef __WXMSW__
404 void wxWakeUpMainThread();
405 #endif
406
407 void wxMutexGuiEnter();
408 void wxMutexGuiLeave();
409
410
411 class wxMutexGuiLocker {
412 public:
413 wxMutexGuiLocker();
414 ~wxMutexGuiLocker();
415 };
416
417
418 %inline %{
419 bool wxThread_IsMain() {
420 return wxThread::IsMain();
421 }
422 %}
423
424 //----------------------------------------------------------------------
425
426
427 class wxTipProvider
428 {
429 public:
430 // wxTipProvider(size_t currentTip); **** Abstract base class
431 ~wxTipProvider();
432
433 virtual wxString GetTip() = 0;
434 size_t GetCurrentTip();
435
436 };
437
438
439 // The C++ version of wxPyTipProvider
440 %{
441 class wxPyTipProvider : public wxTipProvider {
442 public:
443 wxPyTipProvider(size_t currentTip)
444 : wxTipProvider(currentTip) {}
445
446 DEC_PYCALLBACK_STRING__pure(GetTip);
447
448 PYPRIVATE;
449 };
450
451 IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
452
453 %}
454
455
456 // Now let SWIG know about it
457 class wxPyTipProvider : public wxTipProvider {
458 public:
459 wxPyTipProvider(size_t currentTip);
460 };
461
462
463
464 bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = TRUE);
465 %new wxTipProvider * wxCreateFileTipProvider(const wxString& filename, size_t currentTip);
466
467
468 //----------------------------------------------------------------------
469
470 %{
471 #include <wx/generic/dragimgg.h>
472 static wxPoint wxPyNullPoint;
473 %}
474
475 %name (wxDragImage) class wxGenericDragImage : public wxObject
476 {
477 public:
478
479 wxGenericDragImage(const wxBitmap& image,
480 const wxCursor& cursor = wxNullCursor,
481 const wxPoint& hotspot = wxPyNullPoint);
482 ~wxGenericDragImage();
483
484 bool BeginDrag(const wxPoint& hotspot, wxWindow* window,
485 bool fullScreen = FALSE, wxRect* rect = NULL);
486
487 %name(BeginDrag2) bool BeginDrag(const wxPoint& hotspot, wxWindow* window,
488 wxWindow* fullScreenRect);
489
490 bool EndDrag();
491 bool Move(const wxPoint& pt);
492 bool Show();
493 bool Hide();
494
495 wxRect GetImageRect(const wxPoint& pos) const;
496 bool RedrawImage(const wxPoint& oldPos, const wxPoint& newPos,
497 bool eraseOld, bool drawNew);
498 };
499
500
501 // Alternate Constructors
502 %new wxGenericDragImage* wxDragIcon(const wxIcon& image,
503 const wxCursor& cursor = wxNullCursor,
504 const wxPoint& hotspot = wxPyNullPoint);
505
506 %new wxGenericDragImage* wxDragString(const wxString& str,
507 const wxCursor& cursor = wxNullCursor,
508 const wxPoint& hotspot = wxPyNullPoint);
509
510 %new wxGenericDragImage* wxDragTreeItem(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
511
512 %new wxGenericDragImage* wxDragListItem(const wxListCtrl& listCtrl, long id);
513
514
515 %{
516
517 wxGenericDragImage* wxDragIcon(const wxIcon& image,
518 const wxCursor& cursor,
519 const wxPoint& hotspot) {
520 return new wxGenericDragImage(image, cursor, hotspot);
521 }
522
523 wxGenericDragImage* wxDragString(const wxString& str,
524 const wxCursor& cursor,
525 const wxPoint& hotspot) {
526 return new wxGenericDragImage(str, cursor, hotspot);
527 }
528
529 wxGenericDragImage* wxDragTreeItem(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) {
530 return new wxGenericDragImage(treeCtrl, id);
531 }
532
533 wxGenericDragImage* wxDragListItem(const wxListCtrl& listCtrl, long id) {
534 return new wxGenericDragImage(listCtrl, id);
535 }
536
537 %}
538
539
540
541 //----------------------------------------------------------------------
542
543 class wxPyTimer : public wxObject {
544 public:
545 wxPyTimer(PyObject* notify);
546 ~wxPyTimer();
547 int GetInterval();
548 bool IsOneShot();
549 bool IsRunning();
550 void SetOwner(wxEvtHandler *owner, int id = -1);
551 void Start(int milliseconds=-1, int oneShot=FALSE);
552 void Stop();
553 };
554
555 //----------------------------------------------------------------------
556 //----------------------------------------------------------------------
557
558
559 enum
560 {
561 wxLOG_FatalError, // program can't continue, abort immediately
562 wxLOG_Error, // a serious error, user must be informed about it
563 wxLOG_Warning, // user is normally informed about it but may be ignored
564 wxLOG_Message, // normal message (i.e. normal output of a non GUI app)
565 wxLOG_Info, // informational message (a.k.a. 'Verbose')
566 wxLOG_Status, // informational: might go to the status line of GUI app
567 wxLOG_Debug, // never shown to the user, disabled in release mode
568 wxLOG_Trace, // trace messages are also only enabled in debug mode
569 wxLOG_Progress, // used for progress indicator (not yet)
570 wxLOG_User = 100 // user defined levels start here
571 };
572
573
574 class wxLog
575 {
576 public:
577 wxLog();
578
579 static bool IsEnabled();
580 static bool EnableLogging(bool doIt = TRUE);
581 static void OnLog(wxLogLevel level, const char *szString, int t=0);
582
583 virtual void Flush();
584 bool HasPendingMessages() const;
585
586 static void FlushActive();
587 static wxLog *GetActiveTarget();
588 static wxLog *SetActiveTarget(wxLog *pLogger);
589
590 static void Suspend();
591 static void Resume();
592
593 void SetVerbose(bool bVerbose = TRUE);
594
595 static void DontCreateOnDemand();
596 static void SetTraceMask(wxTraceMask ulMask);
597 static void AddTraceMask(const wxString& str);
598 static void RemoveTraceMask(const wxString& str);
599
600 bool GetVerbose() const { return m_bVerbose; }
601
602 static wxTraceMask GetTraceMask();
603 static bool IsAllowedTraceMask(const char *mask);
604
605 };
606
607
608 class wxLogStderr : public wxLog
609 {
610 public:
611 wxLogStderr(/* TODO: FILE *fp = (FILE *) NULL*/);
612 };
613
614
615 class wxLogTextCtrl : public wxLog
616 {
617 public:
618 wxLogTextCtrl(wxTextCtrl *pTextCtrl);
619 };
620
621
622 class wxLogGui : public wxLog
623 {
624 public:
625 wxLogGui();
626 };
627
628 class wxLogWindow : public wxLog
629 {
630 public:
631 wxLogWindow(wxFrame *pParent, // the parent frame (can be NULL)
632 const char *szTitle, // the title of the frame
633 bool bShow = TRUE, // show window immediately?
634 bool bPassToOld = TRUE); // pass log messages to the old target?
635
636 void Show(bool bShow = TRUE);
637 wxFrame *GetFrame() const;
638 wxLog *GetOldLog() const;
639 bool IsPassingMessages() const;
640 void PassMessages(bool bDoPass) { m_bPassMessages = bDoPass; }
641 };
642
643
644 class wxLogNull
645 {
646 public:
647 wxLogNull();
648 ~wxLogNull();
649 };
650
651
652 unsigned long wxSysErrorCode();
653 const char* wxSysErrorMsg(unsigned long nErrCode = 0);
654 void wxLogFatalError(const char *szFormat);
655 void wxLogError(const char *szFormat);
656 void wxLogWarning(const char *szFormat);
657 void wxLogMessage(const char *szFormat);
658 void wxLogInfo(const char *szFormat);
659 void wxLogVerbose(const char *szFormat);
660 void wxLogStatus(const char *szFormat);
661 %name(wxLogStatusFrame)void wxLogStatus(wxFrame *pFrame, const char *szFormat);
662 void wxLogSysError(const char *szFormat);
663
664
665
666 //----------------------------------------------------------------------
667
668
669 enum {
670 /* event type */
671 wxEVT_END_PROCESS
672 };
673
674
675 class wxProcessEvent : public wxEvent {
676 public:
677 wxProcessEvent(int id = 0, int pid = 0, int exitcode = 0);
678 int GetPid();
679 int GetExitCode();
680 int m_pid, m_exitcode;
681 };
682
683
684
685
686 %{ // C++ version of wxProcess derived class
687
688 class wxPyProcess : public wxProcess {
689 public:
690 wxPyProcess(wxEvtHandler *parent = NULL, int id = -1)
691 : wxProcess(parent, id)
692 {}
693
694 DEC_PYCALLBACK_VOID_INTINT(OnTerminate);
695
696 PYPRIVATE;
697 };
698
699 IMP_PYCALLBACK_VOID_INTINT( wxPyProcess, wxProcess, OnTerminate);
700 %}
701
702
703 %name(wxProcess)class wxPyProcess : public wxEvtHandler {
704 public:
705 wxPyProcess(wxEvtHandler *parent = NULL, int id = -1);
706 %addmethods { void Destroy() { delete self; } }
707
708 void _setSelf(PyObject* self, PyObject* _class);
709 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxProcess)"
710
711 void base_OnTerminate(int pid, int status);
712
713 void Redirect();
714 bool IsRedirected();
715 void Detach();
716
717 wxInputStream *GetInputStream();
718 wxInputStream *GetErrorStream();
719 wxOutputStream *GetOutputStream();
720
721 void CloseOutput();
722 };
723
724
725
726 long wxExecute(const wxString& command,
727 int sync = FALSE,
728 wxPyProcess *process = NULL);
729
730 //----------------------------------------------------------------------
731
732 %{
733 #if !wxUSE_JOYSTICK && !defined(__WXMSW__)
734 // A C++ stub class for wxJoystick for platforms that don't have it.
735 class wxJoystick : public wxObject {
736 public:
737 wxJoystick(int joystick = wxJOYSTICK1) {
738 bool doSave = wxPyRestoreThread();
739 PyErr_SetString(PyExc_NotImplementedError, "wxJoystick is not available on this platform.");
740 wxPySaveThread(doSave);
741 }
742 wxPoint GetPosition() { return wxPoint(-1,-1); }
743 int GetZPosition() { return -1; }
744 int GetButtonState() { return -1; }
745 int GetPOVPosition() { return -1; }
746 int GetPOVCTSPosition() { return -1; }
747 int GetRudderPosition() { return -1; }
748 int GetUPosition() { return -1; }
749 int GetVPosition() { return -1; }
750 int GetMovementThreshold() { return -1; }
751 void SetMovementThreshold(int threshold) ;
752
753 bool IsOk(void) { return FALSE; }
754 int GetNumberJoysticks() { return -1; }
755 int GetManufacturerId() { return -1; }
756 int GetProductId() { return -1; }
757 wxString GetProductName() { return ""; }
758 int GetXMin() { return -1; }
759 int GetYMin() { return -1; }
760 int GetZMin() { return -1; }
761 int GetXMax() { return -1; }
762 int GetYMax() { return -1; }
763 int GetZMax() { return -1; }
764 int GetNumberButtons() { return -1; }
765 int GetNumberAxes() { return -1; }
766 int GetMaxButtons() { return -1; }
767 int GetMaxAxes() { return -1; }
768 int GetPollingMin() { return -1; }
769 int GetPollingMax() { return -1; }
770 int GetRudderMin() { return -1; }
771 int GetRudderMax() { return -1; }
772 int GetUMin() { return -1; }
773 int GetUMax() { return -1; }
774 int GetVMin() { return -1; }
775 int GetVMax() { return -1; }
776
777 bool HasRudder() { return FALSE; }
778 bool HasZ() { return FALSE; }
779 bool HasU() { return FALSE; }
780 bool HasV() { return FALSE; }
781 bool HasPOV() { return FALSE; }
782 bool HasPOV4Dir() { return FALSE; }
783 bool HasPOVCTS() { return FALSE; }
784
785 bool SetCapture(wxWindow* win, int pollingFreq = 0) { return FALSE; }
786 bool ReleaseCapture() { return FALSE; }
787 };
788 #endif
789 %}
790
791
792 class wxJoystick : public wxObject {
793 public:
794 wxJoystick(int joystick = wxJOYSTICK1);
795 wxPoint GetPosition();
796 int GetZPosition();
797 int GetButtonState();
798 int GetPOVPosition();
799 int GetPOVCTSPosition();
800 int GetRudderPosition();
801 int GetUPosition();
802 int GetVPosition();
803 int GetMovementThreshold();
804 void SetMovementThreshold(int threshold) ;
805
806 bool IsOk(void);
807 int GetNumberJoysticks();
808 int GetManufacturerId();
809 int GetProductId();
810 wxString GetProductName();
811 int GetXMin();
812 int GetYMin();
813 int GetZMin();
814 int GetXMax();
815 int GetYMax();
816 int GetZMax();
817 int GetNumberButtons();
818 int GetNumberAxes();
819 int GetMaxButtons();
820 int GetMaxAxes();
821 int GetPollingMin();
822 int GetPollingMax();
823 int GetRudderMin();
824 int GetRudderMax();
825 int GetUMin();
826 int GetUMax();
827 int GetVMin();
828 int GetVMax();
829
830 bool HasRudder();
831 bool HasZ();
832 bool HasU();
833 bool HasV();
834 bool HasPOV();
835 bool HasPOV4Dir();
836 bool HasPOVCTS();
837
838 bool SetCapture(wxWindow* win, int pollingFreq = 0);
839 bool ReleaseCapture();
840 };
841
842 //----------------------------------------------------------------------
843
844 %{
845 #if !wxUSE_WAVE && !defined(__WXMSW__)
846 // A C++ stub class for wxWave for platforms that don't have it.
847 class wxWave : public wxObject
848 {
849 public:
850 wxWave(const wxString& fileName, bool isResource = FALSE) {
851 bool doSave = wxPyRestoreThread();
852 PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
853 wxPySaveThread(doSave);
854 }
855 wxWave(int size, const wxByte* data) {
856 bool doSave = wxPyRestoreThread();
857 PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
858 wxPySaveThread(doSave);
859 }
860
861 ~wxWave() {}
862
863 bool IsOk() const { return FALSE; }
864 bool Play(bool async = TRUE, bool looped = FALSE) const { return FALSE; }
865 };
866
867 #endif
868 %}
869
870 class wxWave : public wxObject
871 {
872 public:
873 wxWave(const wxString& fileName, bool isResource = FALSE);
874 ~wxWave();
875
876 bool IsOk() const;
877 bool Play(bool async = TRUE, bool looped = FALSE) const;
878 };
879
880 %new wxWave* wxWaveData(const wxString& data);
881 %{ // Implementations of some alternate "constructors"
882 wxWave* wxWaveData(const wxString& data) {
883 return new wxWave(data.Len(), (wxByte*)data.c_str());
884 }
885 %}
886
887 //----------------------------------------------------------------------
888
889
890 %init %{
891 wxPyPtrTypeMap_Add("wxFontEnumerator", "wxPyFontEnumerator");
892 wxPyPtrTypeMap_Add("wxDragImage", "wxGenericDragImage");
893 wxPyPtrTypeMap_Add("wxProcess", "wxPyProcess");
894 %}
895
896 //----------------------------------------------------------------------
897