diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL.ncb b/build/tools/MasterEditorTWL/MasterEditorTWL.ncb index 3995af18..2f9685c0 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL.ncb and b/build/tools/MasterEditorTWL/MasterEditorTWL.ncb differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL.suo b/build/tools/MasterEditorTWL/MasterEditorTWL.suo index 25a362dd..22114adb 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL.suo and b/build/tools/MasterEditorTWL/MasterEditorTWL.suo differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm b/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm index 21b97282..6e38b05e 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm and b/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h b/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h index 3568dee3..3dc60fa3 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h @@ -579,6 +579,8 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ colErrorEnd; private: System::Windows::Forms::DataGridViewTextBoxColumn^ colErrorCause; private: System::Windows::Forms::DataGridViewTextBoxColumn^ colLibPublisher; private: System::Windows::Forms::DataGridViewTextBoxColumn^ colLibName; +private: System::Windows::Forms::ToolStripMenuItem^ stripItemMiddlewareXml; +private: System::Windows::Forms::ToolStripMenuItem^ stripItemMiddlewareHtml; @@ -930,6 +932,8 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ colLibName; this->stripMaster = (gcnew System::Windows::Forms::ToolStripMenuItem()); this->stripItemSheet = (gcnew System::Windows::Forms::ToolStripMenuItem()); this->stripItemMasterRom = (gcnew System::Windows::Forms::ToolStripMenuItem()); + this->stripItemMiddlewareXml = (gcnew System::Windows::Forms::ToolStripMenuItem()); + this->stripItemMiddlewareHtml = (gcnew System::Windows::Forms::ToolStripMenuItem()); this->stripLang = (gcnew System::Windows::Forms::ToolStripMenuItem()); this->stripItemEnglish = (gcnew System::Windows::Forms::ToolStripMenuItem()); this->stripItemJapanese = (gcnew System::Windows::Forms::ToolStripMenuItem()); @@ -2791,8 +2795,8 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ colLibName; // // stripMaster // - this->stripMaster->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->stripItemSheet, - this->stripItemMasterRom}); + this->stripMaster->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) {this->stripItemSheet, + this->stripItemMasterRom, this->stripItemMiddlewareXml, this->stripItemMiddlewareHtml}); this->stripMaster->Name = L"stripMaster"; this->stripMaster->Size = System::Drawing::Size(53, 20); this->stripMaster->Text = L"マスター"; @@ -2800,17 +2804,31 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ colLibName; // stripItemSheet // this->stripItemSheet->Name = L"stripItemSheet"; - this->stripItemSheet->Size = System::Drawing::Size(232, 22); - this->stripItemSheet->Text = L"提出確認書とマスターROMを作成"; + this->stripItemSheet->Size = System::Drawing::Size(259, 22); + this->stripItemSheet->Text = L"提出確認書とマスターROMを作成する"; this->stripItemSheet->Click += gcnew System::EventHandler(this, &Form1::stripItemSheet_Click); // // stripItemMasterRom // this->stripItemMasterRom->Name = L"stripItemMasterRom"; - this->stripItemMasterRom->Size = System::Drawing::Size(232, 22); - this->stripItemMasterRom->Text = L"マスターROMのみを作成"; + this->stripItemMasterRom->Size = System::Drawing::Size(259, 22); + this->stripItemMasterRom->Text = L"マスターROMのみを作成する"; this->stripItemMasterRom->Click += gcnew System::EventHandler(this, &Form1::stripItemMasterRom_Click); // + // stripItemMiddlewareXml + // + this->stripItemMiddlewareXml->Name = L"stripItemMiddlewareXml"; + this->stripItemMiddlewareXml->Size = System::Drawing::Size(259, 22); + this->stripItemMiddlewareXml->Text = L"ミドルウェアリストを作成する(XML形式)"; + this->stripItemMiddlewareXml->Click += gcnew System::EventHandler(this, &Form1::stripItemMiddlewareXml_Click); + // + // stripItemMiddlewareHtml + // + this->stripItemMiddlewareHtml->Name = L"stripItemMiddlewareHtml"; + this->stripItemMiddlewareHtml->Size = System::Drawing::Size(259, 22); + this->stripItemMiddlewareHtml->Text = L"ミドルウェアリストを作成する(HTML形式)"; + this->stripItemMiddlewareHtml->Click += gcnew System::EventHandler(this, &Form1::stripItemMiddlewareHtml_Click); + // // stripLang // this->stripLang->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->stripItemEnglish, @@ -3482,6 +3500,18 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ colLibName; // SRLの保存のみ @ret 成否 System::Boolean saveSrlCore( System::String ^filename ); + // ミドルウェアリストの作成(XML形式) + System::Void makeMiddlewareListXml(System::Xml::XmlDocument^ doc); + + // ミドルウェアリストの保存 + System::Boolean saveMiddlewareListXml( System::String ^filename ); + + // ミドルウェアリストの保存(XML->HTML変換) + System::Boolean saveMiddlewareListHtml( System::String ^filename ); + + // ミドルウェアリストの保存(XSL埋め込み) + System::Boolean saveMiddlewareListXmlEmbeddedXsl( System::String ^filename ); + private: // ---------------------------------------------- // 一時ファイルの取り扱い @@ -4019,6 +4049,79 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ colLibName; this->loadTmp( filename ); } //stripItemLoadTemp_Click() + private: + System::Void stripItemMiddlewareXml_Click(System::Object^ sender, System::EventArgs^ e) + { + System::String ^filename = gcnew System::String(""); + + if( System::String::IsNullOrEmpty(this->tboxFile->Text) ) + { + this->errMsg( "ROMデータファイルがオープンされていません。", "ROM file has not opened yet." ); + return; + } + + // ダイアログでファイルパスを決定 + { + System::Windows::Forms::SaveFileDialog ^dlg = gcnew (SaveFileDialog); + + dlg->InitialDirectory = "c:\\"; + dlg->Filter = "xml形式 (*.xml)|*.xml"; + dlg->FilterIndex = 1; + dlg->RestoreDirectory = true; + + if( dlg->ShowDialog() != System::Windows::Forms::DialogResult::OK ) + { + return; + } + filename = dlg->FileName; + if( !(dlg->FileName->EndsWith( ".xml" )) ) + { + filename += ".xml"; + } + } + if( !this->saveMiddlewareListXmlEmbeddedXsl(filename) ) + { + this->errMsg( "ミドルウェアリストの作成に失敗しました。","Making a middleware list failed." ); + } + } //stripItemMiddlewareXml_Click() + + private: + System::Void stripItemMiddlewareHtml_Click(System::Object^ sender, System::EventArgs^ e) + { + System::String ^filename = gcnew System::String(""); + + if( System::String::IsNullOrEmpty(this->tboxFile->Text) ) + { + this->errMsg( "ROMデータファイルがオープンされていません。", "ROM file has not opened yet." ); + return; + } + + // ダイアログでファイルパスを決定 + { + System::Windows::Forms::SaveFileDialog ^dlg = gcnew (SaveFileDialog); + + dlg->InitialDirectory = "c:\\"; + dlg->Filter = "html形式 (*.html)|*.html"; + dlg->FilterIndex = 1; + dlg->RestoreDirectory = true; + + if( dlg->ShowDialog() != System::Windows::Forms::DialogResult::OK ) + { + return; + } + filename = dlg->FileName; + if( !(dlg->FileName->EndsWith( ".html" )) ) + { + filename += ".html"; + } + } + if( !this->saveMiddlewareListHtml(filename) ) + { + this->errMsg( "ミドルウェアリストの作成に失敗しました。","Making a middleware list failed." ); + } + } //stripItemMiddlewareHtml_Click + + ///////////////////////////////////////////// // フォーム操作メソッド ///////////////////////////////////////////// diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Form_file.cpp b/build/tools/MasterEditorTWL/MasterEditorTWL/Form_file.cpp index b520a7e2..5c83264c 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/Form_file.cpp +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/Form_file.cpp @@ -34,7 +34,13 @@ void Form1::loadInit(void) catch( System::IO::FileNotFoundException ^s ) { (void)s; - this->sucMsg( "設定ファイルを開くことができませんでした。", "Setting file can't be opened." ); + this->errMsg( "設定ファイルが見つかりません。", "Setting file is not found." ); + return; + } + catch( System::Exception ^s ) + { + (void)s; + this->errMsg( "設定ファイルを開くことができませんでした。", "Setting file can't be opened." ); return; } @@ -221,4 +227,129 @@ System::Boolean Form1::saveSrlCore( System::String ^filename ) return false; } return true; -} \ No newline at end of file +} + +// ミドルウェアリストの作成 +System::Void Form1::makeMiddlewareListXml(System::Xml::XmlDocument^ doc) +{ + System::Xml::XmlElement ^root = doc->CreateElement( "twl-master-editor" ); + System::Reflection::Assembly ^ass = System::Reflection::Assembly::GetEntryAssembly(); + root->SetAttribute( "version", ass->GetName()->Version->ToString() ); + doc->AppendChild( root ); + + // ゲーム情報 + System::Xml::XmlElement ^game = doc->CreateElement( "game" ); + root->AppendChild( game ); + if( System::String::IsNullOrEmpty( this->tboxProductName->Text ) ) + { + MasterEditorTWL::appendXmlTag( doc, game, "product-name", this->tboxTitleName->Text ); // 製品名が未入力のときはソフトタイトルで代用 + } + else + { + MasterEditorTWL::appendXmlTag( doc, game, "product-name", this->tboxProductName->Text ); + } + MasterEditorTWL::appendXmlTag( doc, game, "title-name", this->tboxTitleName->Text ); + MasterEditorTWL::appendXmlTag( doc, game, "game-code", this->tboxGameCode->Text ); + MasterEditorTWL::appendXmlTag( doc, game, "rom-version", this->tboxRemasterVer->Text ); + MasterEditorTWL::appendXmlTag( doc, game, "submit-version", this->numSubmitVersion->Value.ToString() ); + + // ミドルウェアリスト + System::Xml::XmlElement ^midlist = doc->CreateElement( "middleware-list" ); + root->AppendChild( midlist ); + if( this->hSrl->hLicenseList != nullptr ) + { + for each( RCLicense ^lic in this->hSrl->hLicenseList ) + { + System::Xml::XmlElement ^mid = doc->CreateElement( "middleware" ); + MasterEditorTWL::appendXmlTag( doc, mid, "publisher", lic->Publisher ); + MasterEditorTWL::appendXmlTag( doc, mid, "name", lic->Name ); + midlist->AppendChild( mid ); + } + } +} + +// ミドルウェアリストの保存 +System::Boolean Form1::saveMiddlewareListXml( System::String ^filename ) +{ + System::Xml::XmlDocument ^doc = gcnew System::Xml::XmlDocument(); + doc->AppendChild( doc->CreateXmlDeclaration("1.0","UTF-8",nullptr) ); + + this->makeMiddlewareListXml( doc ); + + try + { + doc->Save( filename ); + } + catch ( System::Exception ^ex ) + { + (void)ex; + return false; + } + return true; +} + +// ミドルウェアリストの保存 +System::Boolean Form1::saveMiddlewareListXmlEmbeddedXsl( System::String ^filename ) +{ + System::Xml::XmlDocument ^doc = gcnew System::Xml::XmlDocument(); + doc->AppendChild( doc->CreateXmlDeclaration("1.0","UTF-8",nullptr) ); + + // XSLを埋め込むための宣言たち + System::Xml::XmlProcessingInstruction ^proc = doc->CreateProcessingInstruction( "xml-stylesheet", "type='text/xml' href='#stylesheet'" ); + doc->AppendChild( proc ); + System::Xml::XmlDocumentType ^doctype = doc->CreateDocumentType( "twl-master-editor", nullptr, nullptr, "" ); + doc->AppendChild( doctype ); + + this->makeMiddlewareListXml( doc ); + + // 埋め込みスタイルシート + System::Xml::XmlDocument ^xsl = gcnew System::Xml::XmlDocument(); + System::Xml::XmlElement ^root = doc->DocumentElement; + try + { + xsl->Load("../resource/middleware_e.xsl"); + root->AppendChild( doc->ImportNode(xsl->DocumentElement, true) ); + } + catch ( System::Exception ^ex ) + { + (void)ex; + return false; + } + + try + { + doc->Save( filename ); + } + catch ( System::Exception ^ex ) + { + (void)ex; + return false; + } + return true; +} + +// ミドルウェアリストの保存(XML->HTML変換) +System::Boolean Form1::saveMiddlewareListHtml( System::String ^filename ) +{ + System::Xml::Xsl::XslCompiledTransform ^xslt = gcnew System::Xml::Xsl::XslCompiledTransform; + System::String ^tmpxml = gcnew System::String( "middleware-tmp.xml" ); + + if( !saveMiddlewareListXml(tmpxml) ) + { + return false; + } + + try + { + xslt->Load("../resource/middleware.xsl"); + xslt->Transform( tmpxml, filename ); + } + catch (System::Exception ^s) + { + (void)s; + System::IO::File::Delete( tmpxml ); + return false; + } + System::IO::File::Delete( tmpxml ); + return true; +} diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Form_lang.cpp b/build/tools/MasterEditorTWL/MasterEditorTWL/Form_lang.cpp index f3efd973..7d25ce0c 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/Form_lang.cpp +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/Form_lang.cpp @@ -48,6 +48,8 @@ void Form1::changeJapanese(void) this->stripMaster->Text = gcnew System::String( "マスター" ); this->stripItemSheet->Text = gcnew System::String( "提出確認書とマスターROMを作成する" ); this->stripItemMasterRom->Text = gcnew System::String( "マスターROMのみを作成する" ); + this->stripItemMiddlewareXml->Text = gcnew System::String( "ミドルウェアリストを作成する(XML形式)" ); + this->stripItemMiddlewareHtml->Text = gcnew System::String( "ミドルウェアリストを作成する(HTML形式)" ); // 入力ファイル this->labFile->Text = gcnew System::String( "ROMデータファイル" ); @@ -271,6 +273,8 @@ void Form1::changeEnglish(void) this->stripMaster->Text = gcnew System::String( "Master" ); this->stripItemSheet->Text = gcnew System::String( "Make a submission sheet and a master ROM data file" ); this->stripItemMasterRom->Text = gcnew System::String( "Make a master ROM data file only" ); + this->stripItemMiddlewareXml->Text = gcnew System::String( "Make a middleware list(XML format)" ); + this->stripItemMiddlewareHtml->Text = gcnew System::String( "Make a middleware list(HTML format)" ); // 入力ファイル this->labFile->Text = gcnew System::String( "ROM Data File" ); diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm b/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm index 6bf07e65..22bb3b7a 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm and b/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWLSetup/MasterEditorTWLSetup.vdproj b/build/tools/MasterEditorTWL/MasterEditorTWLSetup/MasterEditorTWLSetup.vdproj index 2f2a5540..3c4a1ef2 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWLSetup/MasterEditorTWLSetup.vdproj +++ b/build/tools/MasterEditorTWL/MasterEditorTWLSetup/MasterEditorTWLSetup.vdproj @@ -21,6 +21,18 @@ } "Entry" { + "MsmKey" = "8:_491C89DAB2F34A939F356C47975E7BD0" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_6EC739CA561443E48045379A268C1657" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_7746D2D347F0423FB46FA2300F6158A4" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -156,6 +168,46 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_491C89DAB2F34A939F356C47975E7BD0" + { + "SourcePath" = "8:..\\resource\\middleware.xsl" + "TargetName" = "8:middleware.xsl" + "Tag" = "8:" + "Folder" = "8:_99EFE6B595C5432FB4712560C9D29AE5" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6EC739CA561443E48045379A268C1657" + { + "SourcePath" = "8:..\\resource\\middleware_e.xsl" + "TargetName" = "8:middleware_e.xsl" + "Tag" = "8:" + "Folder" = "8:_99EFE6B595C5432FB4712560C9D29AE5" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A3417E9C9F294832AE49B5BDAF95E373" { "SourcePath" = "8:..\\resource\\ini.xml" @@ -789,7 +841,7 @@ { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_7746D2D347F0423FB46FA2300F6158A4" { - "SourcePath" = "8:..\\Release\\MasterEditorTWL.exe" + "SourcePath" = "8:..\\Debug\\MasterEditorTWL.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_1494B8B199184797B9C812877A4DFB7F" diff --git a/build/tools/MasterEditorTWL/resource/middleware.xsl b/build/tools/MasterEditorTWL/resource/middleware.xsl new file mode 100644 index 00000000..776cb973 --- /dev/null +++ b/build/tools/MasterEditorTWL/resource/middleware.xsl @@ -0,0 +1,92 @@ + + + + + + TWL Middleware List + + + + + + + + + + + + + +
+ +
+ +
+ + +
+ () +
+
+ version: - +
+
+ + + + + + + + + + +
PublisherMiddleware Name
+
+ + + + + + + + +
diff --git a/build/tools/MasterEditorTWL/resource/middleware_e.xsl b/build/tools/MasterEditorTWL/resource/middleware_e.xsl new file mode 100644 index 00000000..958d9f90 --- /dev/null +++ b/build/tools/MasterEditorTWL/resource/middleware_e.xsl @@ -0,0 +1,92 @@ + + + + + + TWL Middleware List + + + + + + + + + + + + + +
+ +
+ +
+ + +
+ () +
+
+ version: - +
+
+ + + + + + + + + + +
PublisherMiddleware Name
+
+ + + + + + + + +