From 923e5f56fceaeff29d9dc61a9fe2d25363437894 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 8 Sep 2002 00:11:00 +0000 Subject: [PATCH] GetLanguageInfo git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/fonts.i | 5 +++++ wxPython/src/msw/fonts.cpp | 27 +++++++++++++++++++++++++++ wxPython/src/msw/fonts.py | 5 +++++ 3 files changed, 37 insertions(+) diff --git a/wxPython/src/fonts.i b/wxPython/src/fonts.i index 7506801a9d..4b94964473 100644 --- a/wxPython/src/fonts.i +++ b/wxPython/src/fonts.i @@ -755,6 +755,11 @@ public: // check if the given catalog is loaded bool IsLoaded(const wxString& szDomain) const; + // Retrieve the language info struct for the given language + // + // Returns NULL if no info found, pointer must *not* be deleted by caller + static const wxLanguageInfo *GetLanguageInfo(int lang); + // Add custom language to the list of known languages. // Notes: 1) wxLanguageInfo contains platform-specific data // 2) must be called before Init to have effect diff --git a/wxPython/src/msw/fonts.cpp b/wxPython/src/msw/fonts.cpp index 665cd6bee6..ed567c86b6 100644 --- a/wxPython/src/msw/fonts.cpp +++ b/wxPython/src/msw/fonts.cpp @@ -3322,6 +3322,32 @@ static PyObject *_wrap_wxLocale_IsLoaded(PyObject *self, PyObject *args, PyObjec return _resultobj; } +static PyObject *_wrap_wxLocale_GetLanguageInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxLanguageInfo * _result; + int _arg0; + char *_kwnames[] = { "lang", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxLocale_GetLanguageInfo",_kwnames,&_arg0)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxLanguageInfo *)wxLocale::GetLanguageInfo(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxLanguageInfo_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + static PyObject *_wrap_wxLocale_AddLanguage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxLanguageInfo * _arg0; @@ -3648,6 +3674,7 @@ static PyMethodDef fontscMethods[] = { { "wxLocale_GetName", (PyCFunction) _wrap_wxLocale_GetName, METH_VARARGS | METH_KEYWORDS }, { "wxLocale_GetString", (PyCFunction) _wrap_wxLocale_GetString, METH_VARARGS | METH_KEYWORDS }, { "wxLocale_AddLanguage", (PyCFunction) _wrap_wxLocale_AddLanguage, METH_VARARGS | METH_KEYWORDS }, + { "wxLocale_GetLanguageInfo", (PyCFunction) _wrap_wxLocale_GetLanguageInfo, METH_VARARGS | METH_KEYWORDS }, { "wxLocale_IsLoaded", (PyCFunction) _wrap_wxLocale_IsLoaded, METH_VARARGS | METH_KEYWORDS }, { "wxLocale_AddCatalog", (PyCFunction) _wrap_wxLocale_AddCatalog, METH_VARARGS | METH_KEYWORDS }, { "wxLocale_AddCatalogLookupPathPrefix", (PyCFunction) _wrap_wxLocale_AddCatalogLookupPathPrefix, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/fonts.py b/wxPython/src/msw/fonts.py index 67f10f0940..a52f613181 100644 --- a/wxPython/src/msw/fonts.py +++ b/wxPython/src/msw/fonts.py @@ -409,6 +409,11 @@ wxLocale_GetSystemEncodingName = fontsc.wxLocale_GetSystemEncodingName wxLocale_AddCatalogLookupPathPrefix = fontsc.wxLocale_AddCatalogLookupPathPrefix +def wxLocale_GetLanguageInfo(*_args, **_kwargs): + val = apply(fontsc.wxLocale_GetLanguageInfo,_args,_kwargs) + if val: val = wxLanguageInfoPtr(val) + return val + wxLocale_AddLanguage = fontsc.wxLocale_AddLanguage wxEncodingConverter_GetPlatformEquivalents = fontsc.wxEncodingConverter_GetPlatformEquivalents -- 2.45.2