X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1bd5559898b8bb4e650b26e815240d90592854c2..b8aab4d28d578817139f9038deec03e9609a50c8:/wxPython/src/mac/_misc_wrap.cpp diff --git a/wxPython/src/mac/_misc_wrap.cpp b/wxPython/src/mac/_misc_wrap.cpp index 0a188a92a0..ca306535f7 100644 --- a/wxPython/src/mac/_misc_wrap.cpp +++ b/wxPython/src/mac/_misc_wrap.cpp @@ -3531,12 +3531,14 @@ SWIGINTERN void wxPyArtProvider_Destroy(wxPyArtProvider *self){ delete self; } static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) { + wxPyBlock_t blocked = wxPyBeginBlockThreads(); PyObject* ret = PyTuple_New(3); if (ret) { PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(flag)); PyTuple_SET_ITEM(ret, 1, wx2PyString(str)); PyTuple_SET_ITEM(ret, 2, PyInt_FromLong(index)); } + wxPyEndBlockThreads(blocked); return ret; } @@ -3999,54 +4001,18 @@ SWIGINTERN bool wxClipboardLocker___nonzero__(wxClipboardLocker *self){ return ! SWIGINTERN bool wxVideoMode___eq__(wxVideoMode *self,wxVideoMode const *other){ return other ? (*self == *other) : false; } SWIGINTERN bool wxVideoMode___ne__(wxVideoMode *self,wxVideoMode const *other){ return other ? (*self != *other) : true; } -// dummy version of wxDisplay for when it is not enabled in the wxWidgets build #if !wxUSE_DISPLAY -#include -#include - - WX_DECLARE_OBJARRAY(wxVideoMode, wxArrayVideoModes); -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxArrayVideoModes); -const wxVideoMode wxDefaultVideoMode; - -class wxDisplay -{ -public: - wxDisplay(size_t index = 0) { wxPyRaiseNotImplemented(); } - ~wxDisplay() {} - - static size_t GetCount() - { wxPyRaiseNotImplemented(); return 0; } - - static int GetFromPoint(const wxPoint& pt) - { wxPyRaiseNotImplemented(); return wxNOT_FOUND; } - static int GetFromWindow(wxWindow *window) - { wxPyRaiseNotImplemented(); return wxNOT_FOUND; } - - virtual bool IsOk() const { return false; } - virtual wxRect GetGeometry() const { wxRect r; return r; } - virtual wxString GetName() const { return wxEmptyString; } - bool IsPrimary() const { return false; } - - wxArrayVideoModes GetModes(const wxVideoMode& mode = wxDefaultVideoMode) - { wxArrayVideoModes a; return a; } - - virtual wxVideoMode GetCurrentMode() const - { return wxDefaultVideoMode; } - - virtual bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode) - { return false; } - - void ResetMode() {} -}; +const wxVideoMode wxDefaultVideoMode; #endif SWIGINTERN PyObject *wxDisplay_GetModes(wxDisplay *self,wxVideoMode const &mode=wxDefaultVideoMode){ +#if wxUSE_DISPLAY PyObject* pyList = NULL; wxArrayVideoModes arr = self->GetModes(mode); wxPyBlock_t blocked = wxPyBeginBlockThreads(); pyList = PyList_New(0); - for (int i=0; i < arr.GetCount(); i++) { + for (size_t i=0; i < arr.GetCount(); i++) + { wxVideoMode* m = new wxVideoMode(arr.Item(i)); PyObject* pyObj = wxPyConstructObject(m, wxT("wxVideoMode"), true); PyList_Append(pyList, pyObj); @@ -4054,6 +4020,33 @@ SWIGINTERN PyObject *wxDisplay_GetModes(wxDisplay *self,wxVideoMode const &mode= } wxPyEndBlockThreads(blocked); return pyList; +#else + wxPyRaiseNotImplemented(); + return NULL; +#endif + } +SWIGINTERN wxVideoMode wxDisplay_GetCurrentMode(wxDisplay const *self){ +#if wxUSE_DISPLAY + return self->GetCurrentMode(); +#else + wxPyRaiseNotImplemented(); + return wxDefaultVideoMode; +#endif + } +SWIGINTERN bool wxDisplay_ChangeMode(wxDisplay *self,wxVideoMode const &mode=wxDefaultVideoMode){ +#if wxUSE_DISPLAY + return self->ChangeMode(mode); +#else + wxPyRaiseNotImplemented(); + return false; +#endif + } +SWIGINTERN void wxDisplay_ResetMode(wxDisplay *self){ +#if wxUSE_DISPLAY + self->ResetMode(); +#else + wxPyRaiseNotImplemented(); +#endif } #include @@ -27299,6 +27292,54 @@ SWIGINTERN PyObject *DateTime_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject return SWIG_Python_InitShadowInstance(args); } +SWIGINTERN PyObject *_wrap_TimeSpan_Milliseconds(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + long arg1 ; + wxTimeSpan result; + long val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "ms", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:TimeSpan_Milliseconds",kwnames,&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_long(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "TimeSpan_Milliseconds" "', expected argument " "1"" of type '" "long""'"); + } + arg1 = static_cast< long >(val1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = wxTimeSpan::Milliseconds(arg1); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxTimeSpan(static_cast< const wxTimeSpan& >(result))), SWIGTYPE_p_wxTimeSpan, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_TimeSpan_Millisecond(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxTimeSpan result; + + if (!SWIG_Python_UnpackTuple(args,"TimeSpan_Millisecond",0,0,0)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = wxTimeSpan::Millisecond(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxTimeSpan(static_cast< const wxTimeSpan& >(result))), SWIGTYPE_p_wxTimeSpan, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_TimeSpan_Seconds(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; long arg1 ; @@ -31313,6 +31354,34 @@ fail: } +SWIGINTERN PyObject *_wrap_DataObjectComposite_GetReceivedFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxDataObjectComposite *arg1 = (wxDataObjectComposite *) 0 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxDataObjectComposite, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataObjectComposite_GetReceivedFormat" "', expected argument " "1"" of type '" "wxDataObjectComposite const *""'"); + } + arg1 = reinterpret_cast< wxDataObjectComposite * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxDataObjectComposite const *)arg1)->GetReceivedFormat(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxDataFormat(static_cast< const wxDataFormat& >(result))), SWIGTYPE_p_wxDataFormat, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *DataObjectComposite_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; @@ -35194,6 +35263,34 @@ fail: } +SWIGINTERN PyObject *_wrap_Display_GetClientArea(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxDisplay *arg1 = (wxDisplay *) 0 ; + wxRect result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxDisplay, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Display_GetClientArea" "', expected argument " "1"" of type '" "wxDisplay const *""'"); + } + arg1 = reinterpret_cast< wxDisplay * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxDisplay const *)arg1)->GetClientArea(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxRect(static_cast< const wxRect& >(result))), SWIGTYPE_p_wxRect, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Display_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; wxDisplay *arg1 = (wxDisplay *) 0 ; @@ -35320,7 +35417,7 @@ SWIGINTERN PyObject *_wrap_Display_GetCurrentMode(PyObject *SWIGUNUSEDPARM(self) arg1 = reinterpret_cast< wxDisplay * >(argp1); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = ((wxDisplay const *)arg1)->GetCurrentMode(); + result = wxDisplay_GetCurrentMode((wxDisplay const *)arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -35365,7 +35462,7 @@ SWIGINTERN PyObject *_wrap_Display_ChangeMode(PyObject *SWIGUNUSEDPARM(self), Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->ChangeMode((wxVideoMode const &)*arg2); + result = (bool)wxDisplay_ChangeMode(arg1,(wxVideoMode const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -35394,7 +35491,7 @@ SWIGINTERN PyObject *_wrap_Display_ResetMode(PyObject *SWIGUNUSEDPARM(self), PyO arg1 = reinterpret_cast< wxDisplay * >(argp1); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->ResetMode(); + wxDisplay_ResetMode(arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -35672,6 +35769,137 @@ fail: } +SWIGINTERN PyObject *_wrap_StandardPaths_GetResourcesDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxStandardPaths *arg1 = (wxStandardPaths *) 0 ; + wxString result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxStandardPaths, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardPaths_GetResourcesDir" "', expected argument " "1"" of type '" "wxStandardPaths const *""'"); + } + arg1 = reinterpret_cast< wxStandardPaths * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxStandardPaths const *)arg1)->GetResourcesDir(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_StandardPaths_GetLocalizedResourcesDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxStandardPaths *arg1 = (wxStandardPaths *) 0 ; + wxString *arg2 = 0 ; + wxStandardPaths::ResourceCat arg3 = (wxStandardPaths::ResourceCat) wxStandardPaths::ResourceCat_None ; + wxString result; + void *argp1 = 0 ; + int res1 = 0 ; + bool temp2 = false ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "lang",(char *) "category", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:StandardPaths_GetLocalizedResourcesDir",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxStandardPaths, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardPaths_GetLocalizedResourcesDir" "', expected argument " "1"" of type '" "wxStandardPaths const *""'"); + } + arg1 = reinterpret_cast< wxStandardPaths * >(argp1); + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = true; + } + if (obj2) { + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StandardPaths_GetLocalizedResourcesDir" "', expected argument " "3"" of type '" "wxStandardPaths::ResourceCat""'"); + } + arg3 = static_cast< wxStandardPaths::ResourceCat >(val3); + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxStandardPaths const *)arg1)->GetLocalizedResourcesDir((wxString const &)*arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + { + if (temp2) + delete arg2; + } + return resultobj; +fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_StandardPaths_GetDocumentsDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxStandardPaths *arg1 = (wxStandardPaths *) 0 ; + wxString result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxStandardPaths, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardPaths_GetDocumentsDir" "', expected argument " "1"" of type '" "wxStandardPaths const *""'"); + } + arg1 = reinterpret_cast< wxStandardPaths * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxStandardPaths const *)arg1)->GetDocumentsDir(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_StandardPaths_SetInstallPrefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxStandardPaths *arg1 = (wxStandardPaths *) 0 ; @@ -36395,6 +36623,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"DateTime_FormatISOTime", (PyCFunction)_wrap_DateTime_FormatISOTime, METH_O, NULL}, { (char *)"DateTime_swigregister", DateTime_swigregister, METH_VARARGS, NULL}, { (char *)"DateTime_swiginit", DateTime_swiginit, METH_VARARGS, NULL}, + { (char *)"TimeSpan_Milliseconds", (PyCFunction) _wrap_TimeSpan_Milliseconds, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"TimeSpan_Millisecond", (PyCFunction)_wrap_TimeSpan_Millisecond, METH_NOARGS, NULL}, { (char *)"TimeSpan_Seconds", (PyCFunction) _wrap_TimeSpan_Seconds, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"TimeSpan_Second", (PyCFunction)_wrap_TimeSpan_Second, METH_NOARGS, NULL}, { (char *)"TimeSpan_Minutes", (PyCFunction) _wrap_TimeSpan_Minutes, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -36514,6 +36744,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"PyDataObjectSimple_swiginit", PyDataObjectSimple_swiginit, METH_VARARGS, NULL}, { (char *)"new_DataObjectComposite", (PyCFunction)_wrap_new_DataObjectComposite, METH_NOARGS, NULL}, { (char *)"DataObjectComposite_Add", (PyCFunction) _wrap_DataObjectComposite_Add, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"DataObjectComposite_GetReceivedFormat", (PyCFunction)_wrap_DataObjectComposite_GetReceivedFormat, METH_O, NULL}, { (char *)"DataObjectComposite_swigregister", DataObjectComposite_swigregister, METH_VARARGS, NULL}, { (char *)"DataObjectComposite_swiginit", DataObjectComposite_swiginit, METH_VARARGS, NULL}, { (char *)"new_TextDataObject", (PyCFunction) _wrap_new_TextDataObject, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -36647,6 +36878,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Display_GetFromWindow", (PyCFunction) _wrap_Display_GetFromWindow, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Display_IsOk", (PyCFunction)_wrap_Display_IsOk, METH_O, NULL}, { (char *)"Display_GetGeometry", (PyCFunction)_wrap_Display_GetGeometry, METH_O, NULL}, + { (char *)"Display_GetClientArea", (PyCFunction)_wrap_Display_GetClientArea, METH_O, NULL}, { (char *)"Display_GetName", (PyCFunction)_wrap_Display_GetName, METH_O, NULL}, { (char *)"Display_IsPrimary", (PyCFunction)_wrap_Display_IsPrimary, METH_O, NULL}, { (char *)"Display_GetModes", (PyCFunction) _wrap_Display_GetModes, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -36663,6 +36895,9 @@ static PyMethodDef SwigMethods[] = { { (char *)"StandardPaths_GetUserDataDir", (PyCFunction)_wrap_StandardPaths_GetUserDataDir, METH_O, NULL}, { (char *)"StandardPaths_GetUserLocalDataDir", (PyCFunction)_wrap_StandardPaths_GetUserLocalDataDir, METH_O, NULL}, { (char *)"StandardPaths_GetPluginsDir", (PyCFunction)_wrap_StandardPaths_GetPluginsDir, METH_O, NULL}, + { (char *)"StandardPaths_GetResourcesDir", (PyCFunction)_wrap_StandardPaths_GetResourcesDir, METH_O, NULL}, + { (char *)"StandardPaths_GetLocalizedResourcesDir", (PyCFunction) _wrap_StandardPaths_GetLocalizedResourcesDir, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StandardPaths_GetDocumentsDir", (PyCFunction)_wrap_StandardPaths_GetDocumentsDir, METH_O, NULL}, { (char *)"StandardPaths_SetInstallPrefix", (PyCFunction) _wrap_StandardPaths_SetInstallPrefix, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"StandardPaths_GetInstallPrefix", (PyCFunction)_wrap_StandardPaths_GetInstallPrefix, METH_O, NULL}, { (char *)"StandardPaths_swigregister", StandardPaths_swigregister, METH_VARARGS, NULL}, @@ -38821,5 +39056,8 @@ SWIGEXPORT void SWIG_init(void) { wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget"); SWIG_addvarlink(SWIG_globals(),(char*)"DefaultVideoMode",DefaultVideoMode_get, DefaultVideoMode_set); + SWIG_Python_SetConstant(d, "StandardPaths_ResourceCat_None",SWIG_From_int(static_cast< int >(wxStandardPaths::ResourceCat_None))); + SWIG_Python_SetConstant(d, "StandardPaths_ResourceCat_Messages",SWIG_From_int(static_cast< int >(wxStandardPaths::ResourceCat_Messages))); + SWIG_Python_SetConstant(d, "StandardPaths_ResourceCat_Max",SWIG_From_int(static_cast< int >(wxStandardPaths::ResourceCat_Max))); }