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