]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_defs.i
fixed wxString iterators linked list corruption
[wxWidgets.git] / wxPython / src / _defs.i
index 7e75d49c80a028b8caa3c442e2375cebef1e81cc..1eb46b0cf2209ce09d554c98a0352af21fea50b1 100644 (file)
 %feature("nodefaultdtor");
 #endif
 
 %feature("nodefaultdtor");
 #endif
 
+// For all items that don't have a %rename already, give them a %rename that
+// removes the leading 'wx' (except for wxEVT_* items.)
+%rename("%(wxpy)s") "";
+
 // For now, just supress the warning about using Python keywords as parameter
 // names.  Will need to come back later and correct these rather than just
 // hide them...
 // For now, just supress the warning about using Python keywords as parameter
 // names.  Will need to come back later and correct these rather than just
 // hide them...
 
 // This one will turn off the generation of the thread wrapper code
 %define %threadWrapperOff
 
 // This one will turn off the generation of the thread wrapper code
 %define %threadWrapperOff
-%exception 
+%exception {
+    $action
+    if (PyErr_Occurred()) SWIG_fail;
+}
 %enddef
 
 // Turn it on by default
 %enddef
 
 // Turn it on by default
@@ -70,7 +77,7 @@
 
 
 // This macro can be used to disable the releasing of the GIL when calling the
 
 
 // This macro can be used to disable the releasing of the GIL when calling the
-// C++ function.
+// C++ function.  This is like using threadWrapperOff for just this function.
 %define KeepGIL(name)
 %exception name {
     $action
 %define KeepGIL(name)
 %exception name {
     $action
@@ -151,6 +158,15 @@ typedef unsigned long   wxUIntPtr;
 %typemap(constcode) wxEventType "PyDict_SetItemString(d, \"$symname\", PyInt_FromLong($value));";
 
 
 %typemap(constcode) wxEventType "PyDict_SetItemString(d, \"$symname\", PyInt_FromLong($value));";
 
 
+%define %property(NAME, STUFF...)
+    %pythoncode { NAME = property(STUFF) }
+%enddef
+
+
+%define setCallbackInfo(klass)
+    "klass._setCallbackInfo(self, self, klass)"
+%enddef
+
 
 //----------------------------------------------------------------------
 // Macros for the docstring and autodoc features of SWIG.  These will
 
 //----------------------------------------------------------------------
 // Macros for the docstring and autodoc features of SWIG.  These will
@@ -486,6 +502,8 @@ enum {
     wxCLIP_CHILDREN,
     wxCLIP_SIBLINGS,
 
     wxCLIP_CHILDREN,
     wxCLIP_SIBLINGS,
 
+    wxWINDOW_STYLE_MASK,
+    
     wxALWAYS_SHOW_SB,
     
     wxRETAINED,
     wxALWAYS_SHOW_SB,
     
     wxRETAINED,
@@ -502,8 +520,6 @@ enum {
     wxLB_EXTENDED,
     wxLB_OWNERDRAW,
     wxLB_HSCROLL,
     wxLB_EXTENDED,
     wxLB_OWNERDRAW,
     wxLB_HSCROLL,
-    wxPROCESS_ENTER,
-    wxPASSWORD,
 
     wxCB_SIMPLE,
     wxCB_DROPDOWN,
 
     wxCB_SIMPLE,
     wxCB_DROPDOWN,
@@ -520,9 +536,6 @@ enum {
     wxSB_VERTICAL,
     wxRB_USE_CHECKBOX,
     wxST_SIZEGRIP,
     wxSB_VERTICAL,
     wxRB_USE_CHECKBOX,
     wxST_SIZEGRIP,
-    wxST_NO_AUTORESIZE,
-    wxST_DOTS_MIDDLE,
-    wxST_DOTS_END,
     
     wxFLOOD_SURFACE,
     wxFLOOD_BORDER,
     
     wxFLOOD_SURFACE,
     wxFLOOD_BORDER,
@@ -539,6 +552,9 @@ enum {
     wxNO,
     wxNO_DEFAULT,
     wxYES_DEFAULT,
     wxNO,
     wxNO_DEFAULT,
     wxYES_DEFAULT,
+    wxAPPLY,
+    wxCLOSE,
+     
     wxICON_EXCLAMATION,
     wxICON_HAND,
     wxICON_QUESTION,
     wxICON_EXCLAMATION,
     wxICON_HAND,
     wxICON_QUESTION,
@@ -587,15 +603,19 @@ enum {
     wxID_HELP,
     wxID_PRINT,
     wxID_PRINT_SETUP,
     wxID_HELP,
     wxID_PRINT,
     wxID_PRINT_SETUP,
+    wxID_PAGE_SETUP,
     wxID_PREVIEW,
     wxID_ABOUT,
     wxID_HELP_CONTENTS,
     wxID_HELP_COMMANDS,
     wxID_HELP_PROCEDURES,
     wxID_HELP_CONTEXT,
     wxID_PREVIEW,
     wxID_ABOUT,
     wxID_HELP_CONTENTS,
     wxID_HELP_COMMANDS,
     wxID_HELP_PROCEDURES,
     wxID_HELP_CONTEXT,
+    wxID_HELP_INDEX,
+    wxID_HELP_SEARCH,
     wxID_CLOSE_ALL,
     wxID_PREFERENCES,
 
     wxID_CLOSE_ALL,
     wxID_PREFERENCES,
 
+    wxID_EDIT,
     wxID_CUT,
     wxID_COPY,
     wxID_PASTE,
     wxID_CUT,
     wxID_COPY,
     wxID_PASTE,
@@ -618,6 +638,7 @@ enum {
     wxID_VIEW_SORTSIZE,
     wxID_VIEW_SORTTYPE,
 
     wxID_VIEW_SORTSIZE,
     wxID_VIEW_SORTTYPE,
 
+    wxID_FILE,
     wxID_FILE1,
     wxID_FILE2,
     wxID_FILE3,
     wxID_FILE1,
     wxID_FILE2,
     wxID_FILE3,
@@ -675,31 +696,6 @@ enum {
    
     wxID_HIGHEST,
 
    
     wxID_HIGHEST,
 
-    wxOPEN,
-    wxSAVE,
-    wxHIDE_READONLY,
-    wxOVERWRITE_PROMPT,
-    wxFILE_MUST_EXIST,
-    wxMULTIPLE,
-    wxCHANGE_DIR,
-
-    wxACCEL_ALT,
-    wxACCEL_CTRL,
-    wxACCEL_SHIFT,
-    wxACCEL_NORMAL,
-
-    wxPD_AUTO_HIDE,
-    wxPD_APP_MODAL,
-    wxPD_CAN_ABORT,
-    wxPD_ELAPSED_TIME,
-    wxPD_ESTIMATED_TIME,
-    wxPD_REMAINING_TIME,
-    wxPD_SMOOTH,
-    wxPD_CAN_SKIP,
-
-    wxDD_NEW_DIR_BUTTON,
-    wxDD_DEFAULT_STYLE,
-
     wxMENU_TEAROFF,
     wxMB_DOCKABLE,
     wxNO_FULL_REPAINT_ON_RESIZE,
     wxMENU_TEAROFF,
     wxMB_DOCKABLE,
     wxNO_FULL_REPAINT_ON_RESIZE,
@@ -804,9 +800,8 @@ enum wxStretch
     wxSHAPED,
     wxFIXED_MINSIZE,
     wxTILE,
     wxSHAPED,
     wxFIXED_MINSIZE,
     wxTILE,
-    wxADJUST_MINSIZE,
 };
 };
-
+%pythoncode { ADJUST_MINSIZE = 0 }
 
 enum wxBorder
 {
 
 enum wxBorder
 {
@@ -909,8 +904,6 @@ enum wxKeyCode {
     WXK_MENU,
     WXK_PAUSE,
     WXK_CAPITAL,
     WXK_MENU,
     WXK_PAUSE,
     WXK_CAPITAL,
-    WXK_PRIOR,  /* Page up */
-    WXK_NEXT,   /* Page down */
     WXK_END,
     WXK_HOME,
     WXK_LEFT,
     WXK_END,
     WXK_HOME,
     WXK_LEFT,
@@ -980,9 +973,7 @@ enum wxKeyCode {
     WXK_NUMPAD_UP,
     WXK_NUMPAD_RIGHT,
     WXK_NUMPAD_DOWN,
     WXK_NUMPAD_UP,
     WXK_NUMPAD_RIGHT,
     WXK_NUMPAD_DOWN,
-    WXK_NUMPAD_PRIOR,
     WXK_NUMPAD_PAGEUP,
     WXK_NUMPAD_PAGEUP,
-    WXK_NUMPAD_NEXT,
     WXK_NUMPAD_PAGEDOWN,
     WXK_NUMPAD_END,
     WXK_NUMPAD_BEGIN,
     WXK_NUMPAD_PAGEDOWN,
     WXK_NUMPAD_END,
     WXK_NUMPAD_BEGIN,
@@ -1025,7 +1016,13 @@ enum wxKeyCode {
     WXK_SPECIAL20
 };
 
     WXK_SPECIAL20
 };
 
-
+// deprecated synonymns
+%pythoncode {
+    WXK_PRIOR = WXK_PAGEUP
+    WXK_NEXT  = WXK_PAGEDOWN
+    WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP
+    WXK_NUMPAD_NEXT  = WXK_NUMPAD_PAGEDOWN    
+}
 
 typedef enum {
     wxPAPER_NONE,               // Use specific dimensions
 
 typedef enum {
     wxPAPER_NONE,               // Use specific dimensions
@@ -1165,6 +1162,7 @@ enum wxItemKind
     wxITEM_NORMAL,
     wxITEM_CHECK,
     wxITEM_RADIO,
     wxITEM_NORMAL,
     wxITEM_CHECK,
     wxITEM_RADIO,
+    wxITEM_DROPDOWN,
     wxITEM_MAX
 };
 
     wxITEM_MAX
 };
 
@@ -1218,6 +1216,14 @@ enum wxUpdateUI
 };
 
 
 };
 
 
+enum wxLayoutDirection
+{
+    wxLayout_Default,
+    wxLayout_LeftToRight,
+    wxLayout_RightToLeft
+};
+
+
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------