this->FreeLibrary();\r
}\r
\r
-bool TPIHandle::InitLibrary(const wxString & _szLibName, const wxString & _szArcName, wxULongLong_t _llTypeId)\r
+bool TPIHandle::InitLibrary(const wxString & _szLibName, const wxString & _szArcName, TPI_PROC _prProc, wxULongLong_t _llTypeId)\r
{\r
this->nErrorCode = TPI_ERROR_SUCCESS;\r
if (! this->lib.Load(_szLibName))\r
}\r
\r
GetAPIAddress("LoadPlugin", p);\r
- this->nErrorCode = ((int (__stdcall *)(const wxString &, wxULongLong_t)) p)(_szArcName, _llTypeId);\r
+ this->nErrorCode = ((int (__stdcall *)(const wxString &, TPI_PROC, wxULongLong_t)) p)(_szArcName, _prProc, _llTypeId);\r
return this->nErrorCode == TPI_ERROR_SUCCESS;\r
}\r
\r
this->nErrorCode = ((int (__stdcall *)(wxULongLong_t, TPI_SWITCHES *, const wxString &, const wxArrayString &)) p)(_eCommand, _swInfo, _szArcName, _szFiles);\r
return this->nErrorCode == TPI_ERROR_SUCCESS;\r
}\r
-\r
-bool TPIHandle::SetCallbackProc(TPI_PROC _prProc)\r
-{\r
- this->nErrorCode = TPI_ERROR_SUCCESS;\r
- GetAPIAddress("SetCallbackProc", p);\r
- this->nErrorCode = ((int (__stdcall *)(TPI_PROC)) p)(_prProc);\r
- return this->nErrorCode == TPI_ERROR_SUCCESS;\r
-}\r
public:\r
TPIHandle(void);\r
~TPIHandle(void);\r
- bool InitLibrary(const wxString & _szLibName, const wxString & _szArcName, wxULongLong_t _llTypeId = 0);\r
+ bool InitLibrary(const wxString & _szLibName, const wxString & _szArcName, TPI_PROC _prProc = NULL, wxULongLong_t _llTypeId = 0);\r
bool FreeLibrary(void);\r
\r
bool GetPluginInformation(unsigned int _uInfoId, wxULongLong_t _llSubOption, void * _pPtr);\r
\r
bool Command(wxULongLong_t _eCommand, TPI_SWITCHES * _swInfo, const wxString & _szArcName, const wxArrayString & _szFiles);\r
\r
- bool SetCallbackProc(TPI_PROC _prProc);\r
-\r
int nErrorCode;\r
\r
private:\r
GetFileInformation @22
GetArchiveInformation @23
Command @40
- SetCallbackProc @41
\r
/** プラグインを使用するための初期化を行う。\r
* @param _szArcName これから操作する対象となる書庫名。不明な場合はNULLを指定。\r
+ * @param _prProc コールバック関数へのポインタ。\r
* @param _nTypeId 書庫を作成する場合には、その格納形式IDを指定。それ以外の場合は0。\r
* @return エラーコード。\r
*/\r
int __stdcall LoadPlugin\r
(\r
const wxString & _szArcName,\r
+ TPI_PROC _prProc,\r
wxULongLong_t _nTypeId = 0\r
);\r
\r
const wxArrayString & _szFiles\r
);\r
\r
-/** Command() 実行中に処理の進捗状況を送信するコールバック関数を指定する。\r
- * @param _prArcProc コールバック関数へのポインタ。\r
- * @return エラーコード。\r
- */\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-);\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
\r
// TPIを読み込み。\r
this->fnArchive = wxFileName(mkDlg.cbDir->GetValue(), mkDlg.cbFileName->GetValue());\r
- if (! tpi.InitLibrary(mkDlg.afInfo[nSelected].szTPIName, this->fnArchive.GetFullPath(), mkDlg.afInfo[nSelected].nTypeId))\r
+ if (! tpi.InitLibrary(mkDlg.afInfo[nSelected].szTPIName, this->fnArchive.GetFullPath(), TPICallbackProc, mkDlg.afInfo[nSelected].nTypeId))\r
{\r
this->ErrorCheck(tpi.nErrorCode, wxT("InitLibrary"));\r
return;\r
}\r
\r
- // コールバック関数を設定。\r
- tpi.SetCallbackProc(TPICallbackProc);\r
- this->ErrorCheck(tpi.nErrorCode, wxT("SetCallbackProc"));\r
-\r
// 処理を行う。\r
{\r
ProcessDialog procDlg;\r
do\r
{\r
// 初期化。\r
- if (! tpi.InitLibrary(L_DIR_B_LIB + szTPIName, szFileName))\r
+ if (! tpi.InitLibrary(L_DIR_B_LIB + szTPIName, szFileName, TPICallbackProc))\r
{\r
tpi.FreeLibrary();\r
continue;\r
}\r
\r
- // コールバック関数を設定。\r
- tpi.SetCallbackProc(TPICallbackProc);\r
-\r
// 対応確認。\r
if (! tpi.OpenArchive(szFileName, llFileCount))\r
{\r
int __stdcall LoadPlugin\r
(\r
const wxString & _szArcName,\r
+ TPI_PROC _prProc,\r
wxULongLong_t _nTypeId\r
)\r
{\r
}\r
g_LibInfo.node = * xmlLibrary;\r
g_LibInfo.nLibIndex = _nTypeId;\r
- return TPI_ERROR_SUCCESS;\r
}\r
\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
return nErrorCode;\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
int __stdcall LoadPlugin\r
(\r
const wxString & _szArcName,\r
+ TPI_PROC _prProc,\r
wxULongLong_t _nTypeId\r
)\r
{\r
g_LibInfoAlt.szPrefix = xmlLibrary->GetAttribute(wxT("prefix-alt"), wxEmptyString);\r
g_LibInfoAlt.fUnicode = myGetAttributeBool(xmlLibrary, wxT("unicode-alt"));\r
g_LibInfoAlt.hLib = ::LoadLibrary(xmlLibrary->GetAttribute(wxT("name-alt"), wxEmptyString).wchar_str());\r
+\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ CalSetCallbackProc(true);\r
+ CalSetCallbackProc(false);\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
? ((BOOL (__stdcall *)(const wchar_t *, const int)) fpProc)(_szArcName.wchar_str(), 0)\r
: ((BOOL (__stdcall *)(const char *, const int)) fpProc)(_szArcName.ToUTF8(), 0)))\r
{\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ CalSetCallbackProc(true);\r
+ CalSetCallbackProc(false);\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
::FreeLibrary(g_LibInfo.hLib);\r
return ErrorCodeConvert(nErrorCode);\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- // コールバック関数を設定。\r
- CalSetCallbackProc(true);\r
- return CalSetCallbackProc(false);\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
int __stdcall LoadPlugin\r
(\r
const wxString & _szArcName,\r
+ TPI_PROC _prProc,\r
wxULongLong_t _nTypeId\r
)\r
{\r
wxXmlDocument xmlDoc(myMakeXMLName(wxT("cuiWrapper")));\r
wxXmlNode * xmlLibrary;\r
\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ }\r
+\r
// 対象が存在するならば対応するライブラリを調査、\r
// 対象が存在しないならば指示されたライブラリをロード。\r
if (! ::wxFileExists(_szArcName))\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
int __stdcall LoadPlugin\r
(\r
const wxString &,\r
+ TPI_PROC _prProc,\r
wxULongLong_t\r
)\r
{\r
return TPI_ERROR_U_LOAD_LIBRARY;\r
}\r
\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
return CloseArchive(hArc);\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
int __stdcall LoadPlugin\r
(\r
const wxString &,\r
+ TPI_PROC _prProc,\r
wxULongLong_t\r
)\r
{\r
return TPI_ERROR_U_LOAD_LIBRARY;\r
}\r
\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
return nErrorCode;\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
int __stdcall LoadPlugin\r
(\r
const wxString & _szArcName,\r
+ TPI_PROC _prProc,\r
wxULongLong_t\r
)\r
{\r
\r
if (((BOOL (PASCAL *)(const char *, unsigned long)) fpProc)(_szArcName.ToUTF8(), (unsigned long) buffer))\r
{\r
- // 対応していれば処理を終了。\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
}\r
return nErrorCode;\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
with this library; if not, write to the Free Software Foundation, Inc.,\r
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
\r
- $Id: eggArc.cpp 482 2011-02-09 13:29:52Z sirakaba $\r
+ $Id$\r
*******************************************************************************/\r
\r
//******************************************************************************\r
int __stdcall LoadPlugin\r
(\r
const wxString &,\r
+ TPI_PROC _prProc,\r
wxULongLong_t\r
)\r
{\r
return TPI_ERROR_U_LOAD_LIBRARY;\r
}\r
\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
return CloseArchive(hArc);\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
int __stdcall LoadPlugin\r
(\r
const wxString & _szArcName,\r
+ TPI_PROC _prProc,\r
wxULongLong_t\r
)\r
{\r
\r
if (((BOOL (PASCAL *)(const char *, unsigned long)) fpProc)(_szArcName.ToUTF8(), (unsigned long) buffer))\r
{\r
- // 対応していれば処理を終了。\r
+ // コールバック関数を設定。\r
+ if (_prProc != NULL)\r
+ {\r
+ g_prProc = * _prProc;\r
+ }\r
return TPI_ERROR_SUCCESS;\r
}\r
}\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
-int __stdcall SetCallbackProc\r
-(\r
- TPI_PROC _prArcProc\r
-)\r
-{\r
- // ポインタを保存。\r
- if (_prArcProc == NULL)\r
- {\r
- return TPI_ERROR_D_PARAMETER;\r
- }\r
- g_prProc = * _prArcProc;\r
-\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r