<ul>\r
<li class="add">TPI_INFO_HANDLE_ON_COMMANDを追加。</li>\r
<li class="chg">Command()に書庫のハンドルを渡せるよう変更。</li>\r
+ <li class="chg">TPI内部でライブラリのパスをハードコーディングしないよう変更。</li>\r
</ul>\r
</dd>\r
<dt>Lychee</dt>\r
return dt;\r
}\r
#endif\r
+\r
+#ifdef MYUSE_LIBPATH\r
+wxString g_szLibPath;\r
+\r
+wxString inline myMakeXMLName(const wxString & szFile)\r
+{\r
+ return g_szLibPath + szFile + wxT(".xml");\r
+}\r
+\r
+#ifdef __WINDOWS__\r
+BOOL WINAPI DllMain(HINSTANCE hLib, DWORD dwReason, void *)\r
+{\r
+ if (dwReason == DLL_PROCESS_ATTACH)\r
+ {\r
+ wchar_t szName[1024];\r
+ ::GetModuleFileName(hLib, szName, sizeof(szName) - 1);\r
+ g_szLibPath = wxFileName::wxFileName(WC2String(szName)).GetPath(true);\r
+ }\r
+ return TRUE;\r
+}\r
+#else\r
+#include <dlfcn.h>\r
+__attribute__((constructor)) void on_load(void)\r
+{\r
+ Dl_info dl;\r
+ dladdr((void *) on_load, & dl);\r
+ g_szLibPath = wxFileName(UTF82String(dl.dli_fname)).GetPath(true);\r
+}\r
+#endif\r
+#endif\r
\r
#include "../header/plugin.h"\r
#include <wx/xml/xml.h>\r
-#include <wx/stdpaths.h>\r
#ifndef WXWIN_COMPATIBILITY_2_8\r
#define GetAttribute GetPropVal\r
#define HasAttribute HasProp\r
wxULongLong_t myGetAttributeInt( wxXmlNode * n, const wxString & szValue, wxULongLong_t nDefaultValue = 0, int nBase = 10);\r
bool myGetAttributeBool(wxXmlNode * n, const wxString & szValue, bool bDefaultValue = false);\r
void MakeFormatInfo(wxXmlNode * n, const wxString & szTPIName, TPI_FORMATINFO * _fiInfo, wxULongLong_t nId);\r
-\r
-wxString inline myMakeXMLName(const wxString & szFile)\r
-{\r
- return wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/") + szFile + wxT(".xml");\r
-}\r
-\r
-#ifdef MYUSE_CONFIG\r
-wxString g_szLibPath;\r
-\r
-wxString inline myMakeXMLName(const wxString & szFile)\r
-{\r
- return g_szLibPath + szFile + wxT(".xml");\r
-}\r
-\r
-#ifdef __WINDOWS__\r
-BOOL WINAPI DllMain(HINSTANCE hLib, DWORD dwReason, void *)\r
-{\r
- if (dwReason == DLL_PROCESS_ATTACH)\r
- {\r
- wchar_t szName[1024];\r
- ::GetModuleFileName(hLib, szName, sizeof(szName) - 1);\r
- g_szLibPath = wxFileName::wxFileName(WC2String(szName)).GetPath(true);\r
- }\r
- return TRUE;\r
-}\r
-#else\r
-#define _GNU_SOURCE\r
-#include <dlfcn.h>\r
-\r
-__attribute__((constructor)) void on_load(void)\r
-{\r
- Dl_info dl;\r
- dladdr(on_load, & dl);\r
- g_szLibPath = wxFileName::wxFileName(UTF82String(dl.dli_fname)).GetPath(true);\r
-}\r
-#endif\r
-#endif\r
//******************************************************************************\r
\r
#define wxUSE_DYNLIB_CLASS 1\r
+#define MYUSE_LIBPATH 1\r
#include "../../common/header/plugin.h"\r
#include "../../common/header/plugin-extra.h"\r
#include "../../common/library/library.h"\r
// Includes\r
//******************************************************************************\r
\r
+#define MYUSE_LIBPATH 1\r
#include "../../common/header/plugin.h"\r
#include "../../common/header/plugin-extra.h"\r
#include "../../common/library/library.h"\r
#include "../../common/library/xmldoc.h"\r
#include <wx/dynlib.h>\r
#include <wx/config.h>\r
-#include <wx/stdpaths.h>\r
#include <wx/xml/xml.h>\r
#include <windows.h>\r
#include "calLibrary.h"\r
// Includes\r
//******************************************************************************\r
\r
+#define MYUSE_LIBPATH 1\r
#include "../../common/header/plugin.h"\r
#include "../../common/header/plugin-extra.h"\r
#include "../../common/library/library.h"\r
// Includes\r
//******************************************************************************\r
\r
+#define MYUSE_LIBPATH 1\r
#include "../../common/header/plugin.h"\r
#include "../../common/header/plugin-extra.h"\r
#include "../../common/library/library.h"\r
#include <wx/file.h>\r
-#include <wx/stdpaths.h>\r
#include <wx/dir.h>\r
#include <windows.h>\r
#include "spiLibrary.h"\r
}\r
}\r
\r
- wxString szSPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/"), szSPIName;\r
- wxDir fs(szSPIPath);\r
+ wxString szSPIName;\r
+ wxDir fs(g_szLibPath);\r
if (fs.GetFirst(& szSPIName, wxT("*.spi")))\r
{\r
do\r
{\r
// SPIをロード。\r
- g_hLib = ::LoadLibrary((szSPIPath + szSPIName).wchar_str());\r
+ g_hLib = ::LoadLibrary((g_szLibPath + szSPIName).wchar_str());\r
if (g_hLib == NULL)\r
{\r
continue;\r
// Includes\r
//******************************************************************************\r
\r
+#define MYUSE_LIBPATH 1\r
#include "../../common/header/plugin.h"\r
#include "../../common/header/plugin-extra.h"\r
#include "../../common/library/library.h"\r
#include <wx/file.h>\r
-#include <wx/stdpaths.h>\r
#include <wx/dir.h>\r
#include <windows.h>\r
#include "xpiLibrary.h"\r
}\r
}\r
\r
- wxString szSPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/"), szSPIName;\r
- wxDir fs(szSPIPath);\r
+ wxString szSPIName;\r
+ wxDir fs(g_szLibPath);\r
if (fs.GetFirst(& szSPIName, wxT("*.spi")))\r
{\r
do\r
{\r
// SPIをロード。\r
- g_hLib = ::LoadLibrary((szSPIPath + szSPIName).wchar_str());\r
+ g_hLib = ::LoadLibrary((g_szLibPath + szSPIName).wchar_str());\r
if (g_hLib == NULL)\r
{\r
continue;\r
bool _bFirst\r
)\r
{\r
- static wxString szXPIPath, szXPIName, szArcName = * (wxString *) _hArchive;\r
+ static wxString szXPIName, szArcName = * (wxString *) _hArchive;\r
static int nColorDepth;\r
static wxDir fs;\r
if (_bFirst)\r
{\r
- szXPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/");\r
- fs.Open(szXPIPath);\r
+ fs.Open(g_szLibPath);\r
\r
// 画像の情報を取得。\r
FARPROC fpProc = ::GetProcAddress(g_hLib, "GetPictureInfo");\r
do\r
{\r
// XPIをロード。\r
- HMODULE hXPI = ::LoadLibrary((szXPIPath + szXPIName).wchar_str());\r
+ HMODULE hXPI = ::LoadLibrary((g_szLibPath + szXPIName).wchar_str());\r
if (hXPI == NULL)\r
{\r
continue;\r
return nErrorCode;\r
}\r
\r
- wxString szXPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/");\r
for (size_t i = 0; i < _asFiles.GetCount(); i++)\r
{\r
// 処理を行うか確認。\r
}\r
\r
// XPIをロード。\r
- HMODULE hXPI = ::LoadLibrary((szXPIPath + piInfo.fiInfo.fnFileName.GetPath()).wchar_str());\r
+ HMODULE hXPI = ::LoadLibrary((g_szLibPath + piInfo.fiInfo.fnFileName.GetPath()).wchar_str());\r
if (hXPI == NULL)\r
{\r
nErrorCode = TPI_ERROR_U_USE_LIBRARY;\r