-// %{
-// #if wxUSE_UNICODE
-// #define ADD_STRING(dict, str) \
-// wxString tmp##str(str); \
-// PyDict_SetItemString(dict, #str, \
-// PyUnicode_FromUnicode(tmp##str.c_str(), tmp##str.Len()))
-// #else
-// #define ADD_STRING(dict, str) \
-// PyDict_SetItemString(d, #str, PyString_FromString(str))
-// #endif
-// %}
+class wxSingleInstanceChecker
+{
+public:
+ // like Create() but no error checking (dangerous!)
+ wxSingleInstanceChecker(const wxString& name,
+ const wxString& path = wxPyEmptyString);
+
+ // default ctor, use Create() after it
+ %name(wxPreSingleInstanceChecker) wxSingleInstanceChecker();
+
+ ~wxSingleInstanceChecker();
+
+
+ // name must be given and be as unique as possible, it is used as the mutex
+ // name under Win32 and the lock file name under Unix -
+ // wxTheApp->GetAppName() may be a good value for this parameter
+ //
+ // path is optional and is ignored under Win32 and used as the directory to
+ // create the lock file in under Unix (default is wxGetHomeDir())
+ //
+ // returns FALSE if initialization failed, it doesn't mean that another
+ // instance is running - use IsAnotherRunning() to check it
+ bool Create(const wxString& name, const wxString& path = wxPyEmptyString);
+
+ // is another copy of this program already running?
+ bool IsAnotherRunning() const;
+};
+
+//----------------------------------------------------------------------