Initial commit of Command & Conquer Generals and Command & Conquer Generals Zero Hour source code.

This commit is contained in:
LFeenanEA 2025-02-27 17:34:39 +00:00
parent 2e338c00cb
commit 3d0ee53a05
No known key found for this signature in database
GPG key ID: C6EBE8C2EA08F7E0
6072 changed files with 2283311 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,106 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// DlgProxy.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "DlgProxy.h"
#include "noxstringDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNoxstringDlgAutoProxy
IMPLEMENT_DYNCREATE(CNoxstringDlgAutoProxy, CCmdTarget)
CNoxstringDlgAutoProxy::CNoxstringDlgAutoProxy()
{
EnableAutomation();
// To keep the application running as long as an automation
// object is active, the constructor calls AfxOleLockApp.
AfxOleLockApp();
// Get access to the dialog through the application's
// main window pointer. Set the proxy's internal pointer
// to point to the dialog, and set the dialog's back pointer to
// this proxy.
ASSERT (AfxGetApp()->m_pMainWnd != NULL);
ASSERT_VALID (AfxGetApp()->m_pMainWnd);
ASSERT_KINDOF(CNoxstringDlg, AfxGetApp()->m_pMainWnd);
m_pDialog = (CNoxstringDlg*) AfxGetApp()->m_pMainWnd;
m_pDialog->m_pAutoProxy = this;
}
CNoxstringDlgAutoProxy::~CNoxstringDlgAutoProxy()
{
// To terminate the application when all objects created with
// with automation, the destructor calls AfxOleUnlockApp.
// Among other things, this will destroy the main dialog
if (m_pDialog != NULL)
m_pDialog->m_pAutoProxy = NULL;
AfxOleUnlockApp();
}
void CNoxstringDlgAutoProxy::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CCmdTarget::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(CNoxstringDlgAutoProxy, CCmdTarget)
//{{AFX_MSG_MAP(CNoxstringDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CNoxstringDlgAutoProxy, CCmdTarget)
//{{AFX_DISPATCH_MAP(CNoxstringDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_INoxstring to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {2BF31248-3BA1-11D3-B9DA-006097B90D93}
static const IID IID_INoxstring =
{ 0x2bf31248, 0x3ba1, 0x11d3, { 0xb9, 0xda, 0x0, 0x60, 0x97, 0xb9, 0xd, 0x93 } };
BEGIN_INTERFACE_MAP(CNoxstringDlgAutoProxy, CCmdTarget)
INTERFACE_PART(CNoxstringDlgAutoProxy, IID_INoxstring, Dispatch)
END_INTERFACE_MAP()
// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {2BF31246-3BA1-11D3-B9DA-006097B90D93}
IMPLEMENT_OLECREATE2(CNoxstringDlgAutoProxy, "Noxstring.Application", 0x2bf31246, 0x3ba1, 0x11d3, 0xb9, 0xda, 0x0, 0x60, 0x97, 0xb9, 0xd, 0x93)
/////////////////////////////////////////////////////////////////////////////
// CNoxstringDlgAutoProxy message handlers

View file

@ -0,0 +1,79 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// DlgProxy.h : header file
//
#if !defined(AFX_DLGPROXY_H__2BF3124F_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_DLGPROXY_H__2BF3124F_3BA1_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CNoxstringDlg;
/////////////////////////////////////////////////////////////////////////////
// CNoxstringDlgAutoProxy command target
class CNoxstringDlgAutoProxy : public CCmdTarget
{
DECLARE_DYNCREATE(CNoxstringDlgAutoProxy)
CNoxstringDlgAutoProxy(); // protected constructor used by dynamic creation
// Attributes
public:
CNoxstringDlg* m_pDialog;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNoxstringDlgAutoProxy)
public:
virtual void OnFinalRelease();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CNoxstringDlgAutoProxy();
// Generated message map functions
//{{AFX_MSG(CNoxstringDlgAutoProxy)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
DECLARE_OLECREATE(CNoxstringDlgAutoProxy)
// Generated OLE dispatch map functions
//{{AFX_DISPATCH(CNoxstringDlgAutoProxy)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_DISPATCH
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGPROXY_H__2BF3124F_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,243 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// ExportDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "ExportDlg.h"
#include "direct.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
static int max_index;
/////////////////////////////////////////////////////////////////////////////
// CExportDlg dialog
CExportDlg::CExportDlg(CWnd* pParent /*=NULL*/)
: CDialog(CExportDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExportDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CExportDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExportDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CExportDlg, CDialog)
//{{AFX_MSG_MAP(CExportDlg)
ON_CBN_SELCHANGE(IDC_COMBOLANG, OnSelchangeCombolang)
ON_CBN_SELENDOK(IDC_COMBOLANG, OnSelendokCombolang)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExportDlg message handlers
void CExportDlg::OnOK()
{
char buffer[100];
char *ptr;
// TODO: Add extra validation here
CEdit *edit = (CEdit *) GetDlgItem ( IDC_FILENAME );
CButton *all = (CButton *) GetDlgItem ( IDC_RADIOALL );
CButton *button;
CButton *sample = (CButton *) GetDlgItem ( IDC_RADIOSAMPLE );
CButton *dialog = (CButton *) GetDlgItem ( IDC_RADIODIALOG );
CButton *nondialog = (CButton *) GetDlgItem ( IDC_RADIONONDIALOG );
CButton *unverified = (CButton *) GetDlgItem ( IDC_RADIOUNVERIFIED );
CButton *missing = (CButton *) GetDlgItem ( IDC_RADIOMISSING );
CButton *unsent = (CButton *) GetDlgItem ( IDC_RADIOUNSENT );
edit->GetWindowText ( buffer, sizeof ( filename) -1 );
_getcwd ( filename, sizeof (filename ) -1 );
strcat ( filename, "\\" );
if ( ( ptr = strchr ( buffer, '.' )))
{
*ptr = 0;
}
strcat ( filename, buffer );
if ( all->GetCheck ())
{
options.filter = TR_ALL;
}
else if ( dialog->GetCheck ())
{
options.filter = TR_DIALOG;
}
else if ( nondialog->GetCheck ())
{
options.filter = TR_NONDIALOG;
}
else if ( sample->GetCheck ())
{
options.filter = TR_SAMPLE;
}
else if ( unverified->GetCheck ())
{
options.filter = TR_UNVERIFIED;
}
else if ( missing->GetCheck ())
{
options.filter = TR_MISSING_DIALOG;
}
else if ( unsent->GetCheck ())
{
options.filter = TR_UNSENT;
}
else
{
options.filter = TR_CHANGES;
}
options.include_comments = FALSE;
button = (CButton *) GetDlgItem ( IDC_CHECKTRANS );
options.include_translations = button->GetCheck ();
CDialog::OnOK();
}
void CExportDlg::OnCancel()
{
// TODO: Add extra cleanup here
langid = LANGID_UNKNOWN;
CDialog::OnCancel();
}
BOOL CExportDlg::OnInitDialog()
{
int index;
int lang_index;
LANGINFO *info;
CComboBox *combo;
CEdit *edit = (CEdit *) GetDlgItem ( IDC_FILENAME );
CButton *button = (CButton *) GetDlgItem ( IDC_RADIOCHANGES );
CDialog::OnInitDialog();
// TODO: Add extra initialization here
combo = (CComboBox *) GetDlgItem ( IDC_COMBOLANG );
combo->SetItemDataPtr ( 0, NULL );
options.filter = TR_CHANGES;
options.include_comments = FALSE;
options.include_translations = FALSE;
langid = LANGID_UNKNOWN;
filename[0] = 0;
button->SetCheck ( 1 );
index = 0;
lang_index = 0;
got_lang = FALSE;
while ( (info = GetLangInfo ( lang_index )) )
{
if ( TRUE )//info->langid != LANGID_US )
{
combo->InsertString ( index, info->name );
combo->SetItemDataPtr ( index, info );
if ( info->langid == CurrentLanguage )
{
combo->SetCurSel ( index );
got_lang = TRUE;
}
index++;
}
lang_index++;
}
max_index = index;
if ( !got_lang )
{
combo->InsertString ( 0, "Select language" );
combo->SetCurSel ( 0 );
max_index++;
}
edit->SetLimitText ( 8 );
OnSelchangeCombolang ();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CExportDlg::OnSelchangeCombolang()
{
// TODO: Add your control notification handler code here
LANGINFO *info = NULL;
int index;
CButton *export = (CButton *) GetDlgItem ( IDOK );
CComboBox *combo = (CComboBox *) GetDlgItem ( IDC_COMBOLANG );
CEdit *edit = (CEdit *) GetDlgItem ( IDC_FILENAME );
index = combo->GetCurSel ();
if ( index >= 0 && index < max_index )
{
info = (LANGINFO *) combo->GetItemDataPtr ( index );
}
if ( info )
{
char buffer[10];
edit->EnableWindow ( TRUE );
sprintf ( buffer, "Generals_%s", info->initials );
edit->SetWindowText ( buffer );
export->EnableWindow ( TRUE );
langid = info->langid;
if ( !got_lang )
{
combo->DeleteString ( 0 );
max_index--;
got_lang = TRUE;
}
}
else
{
edit->SetWindowText ("");
edit->EnableWindow ( FALSE );
export->EnableWindow ( FALSE );
langid = LANGID_UNKNOWN;
}
}
void CExportDlg::OnSelendokCombolang()
{
// TODO: Add your control notification handler code here
int i = 0;
}

View file

@ -0,0 +1,81 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EXPORTDLG_H__DDA81307_4F1A_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_EXPORTDLG_H__DDA81307_4F1A_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ExportDlg.h : header file
//
#include "expimp.h"
/////////////////////////////////////////////////////////////////////////////
// CExportDlg dialog
class CExportDlg : public CDialog
{
LangID langid;
char filename[200];
TROPTIONS options;
int got_lang;
// Construction
public:
LangID Language ( void ) { return langid; };
char* Filename ( void ) { return filename; };
TROPTIONS* Options ( void ) { return &options; };
CExportDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CExportDlg)
enum { IDD = IDD_EXPORT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CExportDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CExportDlg)
virtual void OnOK();
virtual void OnCancel();
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeCombolang();
afx_msg void OnSelendokCombolang();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EXPORTDLG_H__DDA81307_4F1A_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,231 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// GenerateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "GenerateDlg.h"
#include "direct.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGenerateDlg dialog
CGenerateDlg::CGenerateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CGenerateDlg::IDD, pParent)
{
options.format = GN_UNICODE;
options.untranslated = GN_USEIDS;
langids[0] = LANGID_UNKNOWN;
filename[0] = 0;
//{{AFX_DATA_INIT(CGenerateDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CGenerateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGenerateDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGenerateDlg, CDialog)
//{{AFX_MSG_MAP(CGenerateDlg)
ON_BN_CLICKED(IDC_SELECTALL, OnSelectall)
ON_BN_CLICKED(IDC_INVERT, OnInvert)
ON_EN_CHANGE(IDC_PREFIX, OnChangePrefix)
ON_BN_CLICKED(IDC_NOXSTR, OnNoxstr)
ON_BN_CLICKED(IDC_UNICODE, OnUnicode)
ON_BN_CLICKED(IDC_IDS, OnIds)
ON_BN_CLICKED(IDC_ORIGINAL, OnOriginal)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGenerateDlg message handlers
BOOL CGenerateDlg::OnInitDialog()
{
int index;
LANGINFO *info;
edit = (CEdit *) GetDlgItem ( IDC_PREFIX );
unicode = (CButton *) GetDlgItem ( IDC_UNICODE );
strfile = (CButton *) GetDlgItem ( IDC_NOXSTR );
useids = (CButton *) GetDlgItem ( IDC_IDS );
usetext = (CButton *) GetDlgItem ( IDC_ORIGINAL );
list = (CListBox *) GetDlgItem ( IDC_LANGUAGE );
filetext = ( CStatic *) GetDlgItem ( IDC_FILENAME );
CDialog::OnInitDialog();
// TODO: Add extra initialization here
unicode->SetCheck ( 1 );
useids->SetCheck ( 1 );
edit->SetWindowText ( "Generals" );
edit->SetLimitText ( 5 );
OnChangePrefix ();
index = 0;
while ( (info = GetLangInfo ( index )) )
{
list->InsertString ( index, info->name );
if ( info->langid == CurrentLanguage )
{
list->SetSel ( index );
}
index++;
}
num_langs = index;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CGenerateDlg::OnSelectall()
{
// TODO: Add your control notification handler code here
list->SelItemRange ( TRUE, 0, num_langs-1 );
}
void CGenerateDlg::OnInvert()
{
// TODO: Add your control notification handler code here
int index = 0;
while ( index < num_langs )
{
list->SetSel ( index, !list->GetSel ( index ));
index++;
}
}
void CGenerateDlg::OnChangePrefix()
{
char buffer[30];
edit->GetWindowText ( buffer, 6 );
if ( options.format == GN_NOXSTR )
{
strcat ( buffer, "_{xx}.str" );
}
else
{
strcat ( buffer, "_{xx}.csf" );
}
filetext->SetWindowText ( buffer );
}
void CGenerateDlg::OnNoxstr()
{
// TODO: Add your control notification handler code here
options.format = GN_NOXSTR;
OnChangePrefix ();
unicode->SetCheck ( 0 );
}
void CGenerateDlg::OnUnicode()
{
// TODO: Add your control notification handler code here
options.format = GN_UNICODE;
OnChangePrefix ();
strfile->SetCheck ( 0 );
}
void CGenerateDlg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void CGenerateDlg::OnOK()
{
char buffer[30];
int count;
int i;
// TODO: Add extra validation here
edit->GetWindowText ( buffer, sizeof ( filename) -1 );
_getcwd ( filename, sizeof (filename ) -1 );
strcat ( filename, "\\" );
strcat ( filename, buffer );
count = list->GetSelItems ( num_langs, langindices );
if ( !count )
{
AfxMessageBox ( "No languages selected" );
return;
}
num_langs = 0;
for ( i = 0; i <count; i++ )
{
LANGINFO *info;
if ( info = GetLangInfo ( langindices[i] ))
{
langids[num_langs++] = info->langid;
}
}
langids[num_langs] = LANGID_UNKNOWN;
CDialog::OnOK();
}
void CGenerateDlg::OnIds()
{
options.untranslated = GN_USEIDS;
usetext->SetCheck ( 0 );
}
void CGenerateDlg::OnOriginal()
{
options.untranslated = GN_USEORIGINAL;
useids->SetCheck ( 0 );
}

View file

@ -0,0 +1,92 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_GENERATEDLG_H__959D0D41_50A5_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_GENERATEDLG_H__959D0D41_50A5_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GenerateDlg.h : header file
//
#include "expimp.h"
/////////////////////////////////////////////////////////////////////////////
// CGenerateDlg dialog
class CGenerateDlg : public CDialog
{
char filename[200];
GNOPTIONS options;
LangID langids[200];
int langindices[200];
int num_langs;
CListBox *list;
CEdit *edit;
CStatic *filetext;
CButton *unicode;
CButton *strfile;
CButton *useids;
CButton *usetext;
// Construction
public:
CGenerateDlg(CWnd* pParent = NULL); // standard constructor
char* FilePrefix ( void ) { return filename; };
GNOPTIONS* Options ( void ) { return &options; };
LangID* Langauges ( void ) { return langids; };
// Dialog Data
//{{AFX_DATA(CGenerateDlg)
enum { IDD = IDD_GENERATE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGenerateDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CGenerateDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSelectall();
afx_msg void OnInvert();
afx_msg void OnChangePrefix();
afx_msg void OnNoxstr();
afx_msg void OnUnicode();
virtual void OnCancel();
virtual void OnOK();
afx_msg void OnIds();
afx_msg void OnOriginal();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GENERATEDLG_H__959D0D41_50A5_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,186 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// MatchDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "MatchDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
NoxText *MatchingNoxText = NULL;
NoxText *MatchOriginalText;
NoxLabel *MatchLabel;
#define MAX_MATCH 256
static NoxText *current_match = NULL;
/////////////////////////////////////////////////////////////////////////////
// CMatchDlg dialog
CMatchDlg::CMatchDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMatchDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMatchDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMatchDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMatchDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMatchDlg, CDialog)
//{{AFX_MSG_MAP(CMatchDlg)
ON_BN_CLICKED(IDC_NOMATCH, OnNomatch)
ON_BN_CLICKED(IDC_MATCH, OnMatch)
ON_BN_CLICKED(IDC_SKIP, OnSkip)
ON_CBN_SELCHANGE(IDC_MATCHCOMBO, OnSelchangeMatchcombo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMatchDlg message handlers
void CMatchDlg::OnCancel()
{
// TODO: Add extra cleanup here
MatchingNoxText = NULL;
CDialog::OnCancel();
}
void CMatchDlg::OnNomatch()
{
// TODO: Add your control notification handler code here
MatchingNoxText = NULL;
CDialog::OnOK ();
}
void CMatchDlg::OnMatch()
{
// TODO: Add your control notification handler code here
if ( (MatchingNoxText = current_match ) )
{
CButton *check = (CButton *) GetDlgItem ( IDC_CHECKRETRANSLATE );
current_match->SetRetranslate ( check->GetCheck ());
}
CDialog::OnOK ();
}
BOOL CMatchDlg::OnInitDialog()
{
NoxText *text;
ListSearch sh;
int index;
CStatic *newtext;
CComboBox *combo;
static char buffer[4*1024];
sprintf ( buffer, "Resolve umatched text from \"%s\" on line %d", MatchLabel->NameSB(),
MatchOriginalText->LineNumber() );
SetWindowText ( buffer );
CDialog::OnInitDialog();
current_match = NULL;
newtext = (CStatic *) GetDlgItem ( IDC_NEWTEXT );
newtext->SetWindowText ( MatchOriginalText->GetSB());
combo = (CComboBox *) GetDlgItem ( IDC_MATCHCOMBO );
CButton *check = (CButton *) GetDlgItem ( IDC_CHECKRETRANSLATE );
check->SetCheck ( 1 );
text = MatchLabel->FirstText ( sh );
index = 0;
while ( text )
{
if ( !text->Matched ())
{
int result;
result = combo->InsertString ( index, text->GetSB ());
result = combo->SetItemDataPtr ( index, text );
if ( result == CB_ERR )
{
result = 0;
}
if ( result == CB_ERRSPACE )
{
result = 0;
}
index++;
}
text = MatchLabel->NextText ( sh );
}
combo->SetCurSel ( 0 );
OnSelchangeMatchcombo();
MatchingNoxText = NULL;
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMatchDlg::OnSelchangeMatchcombo()
{
// TODO: Add your control notification handler code here
int index;
CComboBox *combo = (CComboBox *) GetDlgItem ( IDC_MATCHCOMBO );
index = combo->GetCurSel ();
if ( index >= 0 )
{
CStatic *newtext = (CStatic *) GetDlgItem ( IDC_MATCHTEXT );
current_match = (NoxText *) combo->GetItemDataPtr ( index );
newtext->SetWindowText ( current_match->GetSB());
}
else
{
current_match = NULL;
}
}
void CMatchDlg::OnSkip()
{
// TODO: Add your control notification handler code here
EndDialog ( IDSKIP );
}

View file

@ -0,0 +1,76 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_MATCHDLG_H__FA868061_4EA7_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_MATCHDLG_H__FA868061_4EA7_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MatchDlg.h : header file
//
#include "transDB.h"
#define IDSKIP 100
/////////////////////////////////////////////////////////////////////////////
// CMatchDlg dialog
class CMatchDlg : public CDialog
{
// Construction
public:
CMatchDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMatchDlg)
enum { IDD = IDD_MATCH };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMatchDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CMatchDlg)
virtual void OnCancel();
afx_msg void OnNomatch();
afx_msg void OnMatch();
virtual BOOL OnInitDialog();
afx_msg void OnSkip();
afx_msg void OnSelchangeMatchcombo();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
extern NoxText *MatchingNoxText;
extern NoxText *MatchOriginalText;
extern NoxLabel *MatchLabel;
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MATCHDLG_H__FA868061_4EA7_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,105 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// ProceedDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "ProceedDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ProceedDlg dialog
ProceedDlg::ProceedDlg(const char *nmessage, CWnd* pParent /*=NULL*/)
: CDialog(ProceedDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(ProceedDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
message = nmessage;
}
void ProceedDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ProceedDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ProceedDlg, CDialog)
//{{AFX_MSG_MAP(ProceedDlg)
ON_BN_CLICKED(IDC_YES, OnYes)
ON_BN_CLICKED(IDC_ALWAYS, OnAlways)
ON_BN_CLICKED(IDC_NO, OnNo)
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_BUTTON_NO, OnNo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ProceedDlg message handlers
void ProceedDlg::OnYes()
{
// TODO: Add your control notification handler code here
EndDialog ( IDYES );
}
void ProceedDlg::OnAlways()
{
// TODO: Add your control notification handler code here
EndDialog ( IDALWAYS );
}
void ProceedDlg::OnNo()
{
// TODO: Add your control notification handler code here
EndDialog ( IDNO );
}
void ProceedDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
EndDialog ( IDNO );
CDialog::OnClose();
}
BOOL ProceedDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetDlgItemText ( IDC_MESSAGE, message );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

View file

@ -0,0 +1,70 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_PROCEEDDLG_H__35C33E24_5AD8_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_PROCEEDDLG_H__35C33E24_5AD8_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ProceedDlg.h : header file
//
#define IDALWAYS 101
/////////////////////////////////////////////////////////////////////////////
// ProceedDlg dialog
class ProceedDlg : public CDialog
{
// Construction
const char *message;
public:
ProceedDlg(const char *message, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(ProceedDlg)
enum { IDD = IDD_PROCEED };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ProceedDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(ProceedDlg)
afx_msg void OnYes();
afx_msg void OnAlways();
afx_msg void OnNo();
afx_msg void OnClose();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROCEEDDLG_H__35C33E24_5AD8_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,218 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Report.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "Report.h"
#include <limits.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CReport dialog
CReport::CReport(CWnd* pParent /*=NULL*/)
: CDialog(CReport::IDD, pParent)
{
options.translations = TRUE;
options.dialog = TRUE;
options.limit = 0;
langids[0] = LANGID_UNKNOWN;
filename[0] = 0;
//{{AFX_DATA_INIT(CReport)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CReport::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CReport)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CReport, CDialog)
//{{AFX_MSG_MAP(CReport)
ON_BN_CLICKED(IDC_INVERT, OnInvert)
ON_BN_CLICKED(IDC_SELECTALL, OnSelectall)
ON_BN_CLICKED(IDC_SHOW_DETAILS, OnShowDetails)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CReport message handlers
BOOL CReport::OnInitDialog()
{
int index;
LANGINFO *info;
limit = (CEdit *) GetDlgItem ( IDC_LIMIT );
trans_status = (CButton *) GetDlgItem ( IDC_TRANSLATION_STATUS );
dialog_status = (CButton *) GetDlgItem ( IDC_DIALOG_STATUS );
show_details = (CButton *) GetDlgItem ( IDC_SHOW_DETAILS );
ifless = (CButton *) GetDlgItem ( IDC_IFLESS );
list = (CListBox *) GetDlgItem ( IDC_LANGUAGE );
items = (CStatic *) GetDlgItem ( IDC_ITEMS );
CDialog::OnInitDialog();
// TODO: Add extra initialization here
trans_status->SetCheck ( options.translations );
dialog_status->SetCheck ( options.dialog );
show_details->SetCheck ( 0 );
ifless->SetCheck ( 1 );
limit->EnableWindow ( FALSE );
ifless->EnableWindow ( FALSE );
items->EnableWindow ( FALSE );
limit->SetWindowText ( "100" );
limit->SetLimitText ( 50 );
options.limit = 100;
index = 0;
while ( (info = GetLangInfo ( index )) )
{
list->InsertString ( index, info->name );
if ( info->langid == CurrentLanguage )
{
list->SetSel ( index );
}
index++;
}
num_langs = index;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CReport::OnSelectall()
{
// TODO: Add your control notification handler code here
list->SelItemRange ( TRUE, 0, num_langs-1 );
}
void CReport::OnInvert()
{
// TODO: Add your control notification handler code here
int index = 0;
while ( index < num_langs )
{
list->SetSel ( index, !list->GetSel ( index ));
index++;
}
}
void CReport::OnShowDetails()
{
// TODO: Add your control notification handler code here
if ( show_details->GetCheck () == 0 )
{
ifless->EnableWindow ( FALSE );
limit->EnableWindow ( FALSE );
items->EnableWindow ( FALSE );
}
else
{
ifless->EnableWindow ( TRUE );
limit->EnableWindow ( TRUE );
items->EnableWindow ( TRUE );
}
}
void CReport::OnOK()
{
int count;
int i;
char buffer[100];
count = list->GetSelItems ( num_langs, langindices );
if ( !count )
{
AfxMessageBox ( "No languages selected" );
return;
}
// get the filename
CFileDialog fd ( FALSE , NULL, "*.txt", OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR );
if ( fd.DoModal () != IDOK )
{
return;
}
strcpy ( filename, fd.GetPathName ());
num_langs = 0;
for ( i = 0; i <count; i++ )
{
LANGINFO *info;
if ( info = GetLangInfo ( langindices[i] ))
{
langids[num_langs++] = info->langid;
}
}
langids[num_langs] = LANGID_UNKNOWN;
options.dialog = dialog_status->GetCheck ();
options.translations = trans_status->GetCheck ();
limit->GetWindowText( buffer, sizeof(buffer)-1);
options.limit = atoi ( buffer );
if ( !show_details->GetCheck () )
{
options.limit = 0;
}
else if ( !ifless->GetCheck () )
{
options.limit = INT_MAX;
}
CDialog::OnOK();
}
void CReport::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}

View file

@ -0,0 +1,89 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_REPORT_H__47F98BA1_70E3_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_REPORT_H__47F98BA1_70E3_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Report.h : header file
//
#include "expimp.h"
/////////////////////////////////////////////////////////////////////////////
// CReport dialog
class CReport : public CDialog
{
char filename[300];
RPOPTIONS options;
LangID langids[200];
int langindices[200];
int num_langs;
CListBox *list;
CEdit *limit;
CButton *dialog_status;
CButton *trans_status;
CButton *show_details;
CButton *ifless;
CStatic *items;
// Construction
public:
CReport(CWnd* pParent = NULL); // standard constructor
char* Filename ( void ) { return filename; };
RPOPTIONS* Options ( void ) { return &options; };
LangID* Langauges ( void ) { return langids; };
// Dialog Data
//{{AFX_DATA(CReport)
enum { IDD = IDD_CREATE_REPORTS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CReport)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CReport)
virtual BOOL OnInitDialog();
afx_msg void OnInvert();
afx_msg void OnSelectall();
afx_msg void OnShowDetails();
virtual void OnOK();
virtual void OnCancel();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_REPORT_H__47F98BA1_70E3_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,123 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// RetranslateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "RetranslateDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// RetranslateDlg dialog
RetranslateDlg::RetranslateDlg(CWnd* pParent /*=NULL*/)
: CDialog(RetranslateDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(RetranslateDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void RetranslateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(RetranslateDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(RetranslateDlg, CDialog)
//{{AFX_MSG_MAP(RetranslateDlg)
ON_WM_CANCELMODE()
ON_BN_CLICKED(IDC_MATCH, OnRetranslate)
ON_BN_CLICKED(IDC_SKIP, OnSkip)
ON_BN_CLICKED(IDC_NOMATCH, OnNoRetranslate)
ON_BN_CLICKED(IDCANCEL, OnSkipAll)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// RetranslateDlg message handlers
BOOL RetranslateDlg::OnInitDialog()
{
// TODO: Add extra initialization here
CStatic *text;
static char buffer[4*1024];
CDialog::OnInitDialog();
text = (CStatic *) GetDlgItem ( IDC_NEWTEXT );
text->SetWindowText ( newtext->GetSB());
text = (CStatic *) GetDlgItem ( IDC_OLDTEXT );
text->SetWindowText ( oldtext->GetSB());
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void RetranslateDlg::OnCancelMode()
{
CDialog::OnCancelMode();
// TODO: Add your message handler code here
}
void RetranslateDlg::OnRetranslate()
{
// TODO: Add your control notification handler code here
oldtext->SetRetranslate ( TRUE );
CDialog::OnOK ();
}
void RetranslateDlg::OnSkip()
{
// TODO: Add your control notification handler code here
EndDialog ( IDSKIP );
}
void RetranslateDlg::OnNoRetranslate()
{
// TODO: Add your control notification handler code here
oldtext->SetRetranslate ( FALSE );
CDialog::OnOK ();
}
void RetranslateDlg::OnSkipAll()
{
// TODO: Add your control notification handler code here
CDialog::OnCancel ();
}

View file

@ -0,0 +1,75 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_RETRANSLATEDLG_H__19E25401_0ECB_11D4_B9DB_006097B90D93__INCLUDED_)
#define AFX_RETRANSLATEDLG_H__19E25401_0ECB_11D4_B9DB_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RetranslateDlg.h : header file
//
#include "transdb.h"
#define IDSKIP 100
/////////////////////////////////////////////////////////////////////////////
// RetranslateDlg dialog
class RetranslateDlg : public CDialog
{
// Construction
public:
NoxText *newtext;
NoxText *oldtext;
RetranslateDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(RetranslateDlg)
enum { IDD = IDD_RETRANSLATE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(RetranslateDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(RetranslateDlg)
virtual BOOL OnInitDialog();
afx_msg void OnCancelMode();
afx_msg void OnRetranslate();
afx_msg void OnSkip();
afx_msg void OnNoRetranslate();
afx_msg void OnSkipAll();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RETRANSLATEDLG_H__19E25401_0ECB_11D4_B9DB_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,192 @@
#
# Command & Conquer Generals™
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
sub ShowWarning;
sub ShowError;
$noxScript = shift || 'C:\Nox\Game\nox.str';
$outFile = shift;
open(STR, $noxScript) || die "Can't open Nox string file: $!\n";
if ($outFile)
{
open(STDOUT, ">$outFile") || die "Can't open output file: $!\n";
}
select((select(STDOUT), $| = 1)[0]);
$state = 0;
$line = 0;
$strcount = 0;
$strMaxCount = 32;
$lastFileName = "";
$lastFileNameLine = 0;
$ignoreErrors = 0;
$errCount = 0;
%labels = ();
while (<STR>)
{
$strline = $_;
$line++;
$strline =~ s/\/\/.*//g;
$strline =~ s/^\s*//g;
$strline =~ s/\s*$//g;
if (! ($strline eq ""))
{
if ($state == 0)
{
if (! ($strline =~ /^[^\"][^ :]*:[^ :]*[^\"]$/))
{
ShowError($line, $strline, "Expecting 'file:name'\n");
}
else
{
if (defined ($labels{$strline}))
{
ShowWarning($line, $strline, "Duplicate label at line $labels{$strline}\n");
}
$labels{$strline} = $line;
$lastFileName = $strline;
$lastFileNameLine = $line;
$strcount = 0;
$ignoreErrors = 0;
$state = 1;
}
}
elsif ($state == 1)
{
if (++$strcount >= $strMaxCount)
{
ShowError($line, $strline, "Too many strings ($strcount) - suspected missing END from section $lastFileName on line $lastFileNameLine\n");
}
elsif ($strline =~ /^END$/i)
{
$state = 0;
}
elsif ($strline =~ /\/n/i)
{
ShowWarning($line, $strline, "'/n'? This should probably be '\\n' instead\n");
}
elsif ($strline =~ /^\"[^\"]*[^\"]$/)
{
$state = 2;
}
else
{
$strline =~ s/\"\s*={0,1}\s*[a-zA-Z0-9_\.]*[^\"]$/\"/i;
if (! ($strline =~ /^\".*\"$/))
{
if ($strline =~ /^[^\"][^ :]*:[^ :]*[^\"]$/)
{
ShowError($line, $strline, "Missing quote - suspected missing END from section $lastFileName on line $lastFileNameLine\n");
}
else
{
ShowError($line, $strline, "Missing quote\n");
}
}
}
}
elsif ($state == 2)
{
$strline =~ s/\"\s*={0,1}\s*[a-zA-Z0-9_\.]*[^\"]$/\"/i;
if (++$strcount >= $strMaxCount)
{
ShowError($line, $strline, "Too many strings ($strcount) - suspected missing END from section $lastFileName on line $lastFileNameLine\n");
}
elsif ($strline =~ /\/n/i)
{
ShowWarning($line, $strline, "'/n'? This should probably be '\\n' instead\n");
}
elsif ($strline =~ /^[^\"].*\"$/)
{
$state = 1;
}
elsif (! ($strline =~ /^[^\"].*[^\"]$/))
{
ShowError($line, $strline, "Extra quote character found at start of line\n");
}
elsif ($strline =~ /^END$/i)
{
ShowWarning($line, $strline, "Suspiciously placed 'END'. Maybe missing an end-quote from previous section\n");
}
}
}
}
if ($state != 0)
{
ShowError($line, $strline, "Missing END\n");
}
print STDOUT "$line lines processed\n";
close(STR);
if ($errCount == 0)
{
open(RESULT, ">strcheck.err") || die "Can't open output file: $!\n";
print RESULT "OK";
close (RESULT);
}
exit($errCount);
sub ShowWarning
{
my ($errLine, $errString, $errDesc) = @_;
if (length($errString) > 32)
{
$errString = substr($errString, 0, 32) . "...";
}
if ($ignoreErrors == 0)
{
print STDOUT "$noxScript($errLine) : warning: '$errString' : $errDesc";
}
$state = 0;
$ignoreErrors = 1;
}
sub ShowError
{
my ($errLine, $errString, $errDesc) = @_;
if (length($errString) > 32)
{
$errString = substr($errString, 0, 32) . "...";
}
if ($ignoreErrors == 0)
{
print STDOUT "$noxScript($errLine) : error: '$errString' : $errDesc";
$errCount++;
}
$state = 0;
$ignoreErrors = 1;
}

View file

@ -0,0 +1,26 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// stdafx.cpp : source file that includes just the standard includes
// noxstring.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View file

@ -0,0 +1,60 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__2BF31252_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_STDAFX_H__2BF31252_3BA1_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
// This macro is the same as IMPLEMENT_OLECREATE, except it passes TRUE
// for the bMultiInstance parameter to the COleObjectFactory constructor.
// We want a separate instance of this application to be launched for
// each automation proxy object requested by automation controllers.
#ifndef IMPLEMENT_OLECREATE2
#define IMPLEMENT_OLECREATE2(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
AFX_DATADEF COleObjectFactory class_name::factory(class_name::guid, \
RUNTIME_CLASS(class_name), TRUE, _T(external_name)); \
const AFX_DATADEF GUID class_name::guid = \
{ l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } };
#endif // IMPLEMENT_OLECREATE2
#include "excel8.h"
extern char AppTitle[];
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__2BF31252_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,430 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// ParseStr.h
//
//
#ifndef __TRANSDB_H
#define __TRANSDB_H
#include "olestring.h"
#include "list.h"
#include "bin.h"
class CNoxstringDlg;
typedef struct
{
int numdialog;
int missing;
int unresolved;
int resolved;
int errors;
} DLGREPORT;
typedef struct
{
int numlabels;
int numstrings;
int missing;
int retranslate;
int too_big;
int errors;
int bad_format;
int translated;
} TRNREPORT;
typedef enum
{
PMASK_NONE = 0,
PMASK_MISSING = 0x00000001,
PMASK_UNRESOLVED = 0x00000002,
PMASK_BADFORMAT = 0x00000004,
PMASK_TOOLONG = 0x00000008,
PMASK_RETRANSLATE = 0x00000010,
PMASK_ALL = 0xffffffff
} PMASK;
typedef enum
{
LANGID_US,
LANGID_UK,
LANGID_GERMAN,
LANGID_FRENCH,
LANGID_SPANISH,
LANGID_ITALIAN,
LANGID_JAPANESE,
LANGID_JABBER,
LANGID_KOREAN,
LANGID_CHINESE,
LANGID_UNKNOWN
} LangID;
typedef struct
{
LangID langid;
char *name;
char *initials ; // two character identifier
char *character; // single character identifier
} LANGINFO;
LANGINFO* GetLangInfo ( LangID langid );
char* GetLangName ( LangID langid );
LANGINFO* GetLangInfo ( int index );
LANGINFO* GetLangInfo ( char *language );
class CWaveInfo
{
int wave_valid;
DWORD wave_size_hi;
DWORD wave_size_lo;
int missing;
public:
CWaveInfo ( void );
int Valid ( void ) { return wave_valid; };
DWORD Lo ( void ) { return wave_size_lo; };
DWORD Hi ( void ) { return wave_size_hi; };
void SetValid( int new_valid ) { wave_valid = new_valid; };
void SetLo ( DWORD new_lo ) { wave_size_lo = new_lo; };
void SetHi ( DWORD new_hi ) { wave_size_hi = new_hi; };
int Missing ( void ) { return missing; };
void SetMissing ( int val ) { missing = val; };
};
class DBAttribs
{
DBAttribs *parent;
int changed;
int processed;
void *match;
public:
DBAttribs( void ) { parent = NULL; changed = FALSE; processed = FALSE; match = NULL; };
void SetParent ( DBAttribs *new_parent ) { parent = new_parent; };
int IsChanged ( void ) { return changed; };
void Changed ( void ) { changed = TRUE; if ( parent ) parent->Changed(); };
void NotChanged ( void ) { changed = FALSE; };
char ChangedSymbol ( void ) { return changed ? '*' :' '; };
int IsProcessed ( void ) { return processed; };
void Processed ( void ) { processed = TRUE; };
void NotProcessed ( void ) { processed = FALSE; };
void* Matched ( void ) { return match; };
void Match ( void* new_match ) { match = new_match; };
void NotMatched ( void ) { match = NULL; };
};
class TransDB;
class NoxLabel;
class NoxText;
class Translation : public DBAttribs
{
TransDB *db;
OLEString *text;
OLEString *comment;
LangID langid;
int revision;
int sent;
public:
CWaveInfo WaveInfo;
Translation ( void );
~Translation ( );
void SetDB ( TransDB *new_db );
Translation* Clone ( void );
void SetLangID ( LangID new_id ) { langid = new_id; };
TransDB* DB ( void ) { return db; };
void ClearChanges (void) { NotChanged(); };
void ClearProcessed (void) { NotProcessed(); };
void ClearMatched (void) { NotMatched(); };
int Clear ( void ) { return 0;};
void Set ( OLECHAR *string ) { text->Set ( string ); Changed();};
void Set ( char *string ) { text->Set ( string ); Changed(); };
OLECHAR* Get ( void ) { return text->Get (); };
int Len ( void ) { return text->Len (); };
char* GetSB ( void ) { return text->GetSB (); };
void SetComment ( OLECHAR *string ) { comment->Set ( string ); Changed(); };
void SetComment ( char *string ) { comment->Set ( string ); Changed(); };
OLECHAR* Comment ( void ) { return comment->Get(); };
char* CommentSB ( void ) { return comment->GetSB(); };
int Revision ( void ) { return revision; };
void SetRevision ( int new_rev ) { revision = new_rev; Changed(); };
LangID GetLangID ( void ) { return langid; };
char* Language ( void ) { return GetLangName ( langid );};
void AddToTree ( CTreeCtrl *tc, HTREEITEM parent, int changes = FALSE );
int TooLong ( int maxlen );
int ValidateFormat ( NoxText *text );
int IsSent ( void );
void Sent ( int val );
};
class NoxText : public DBAttribs
{
TransDB *db;
OLEString *text;
NoxLabel *label;
OLEString *wavefile;
unsigned int line_number;
List translations;
int revision;
int id;
int retranslate;
int sent;
void init ( void );
public:
CWaveInfo WaveInfo;
NoxText( void );
~NoxText( );
void AddTranslation ( Translation *trans );
Translation* FirstTranslation ( ListSearch &sh );
Translation* NextTranslation ( ListSearch &sh );
Translation* GetTranslation ( LangID langid );
void SetDB ( TransDB *new_db );
void ClearChanges ( void );
void ClearProcessed ( void );
void ClearMatched ( void );
int Clear ( void );
NoxText* Clone ( void );
void Remove ( void );
void AssignID ( void );
void Set ( OLECHAR *string );
void Set ( char *string );
void SetID ( int new_id ) { id = new_id; Changed(); };
int ID ( void ) { return id; };
void LockText ( void ) { text->Lock(); };
TransDB* DB ( void ) { return db; };
OLECHAR* Get ( void ) { return text->Get (); } ;
int Len ( void ) { return text->Len (); };
char* GetSB ( void ) { return text->GetSB (); } ;
void SetWave ( OLECHAR *string ) { wavefile->Set ( string ); Changed(); InvalidateAllWaves (); };
void SetWave ( char *string ) { wavefile->Set ( string ); Changed(); InvalidateAllWaves (); };
void SetLabel ( NoxLabel *new_label ) { label = new_label; };
void SetRetranslate ( int flag = TRUE ) { retranslate = flag;};
int Retranslate ( void ) { return retranslate; };
OLECHAR* Wave ( void ) { return wavefile->Get (); } ;
char* WaveSB ( void ) { return wavefile->GetSB (); } ;
NoxLabel* Label ( void ) { return label; } ;
int Revision ( void ) { return revision; } ;
void SetRevision ( int new_rev ) { revision = new_rev; Changed(); } ;
void IncRevision ( void ) { revision++; Changed(); };
void AddToTree ( CTreeCtrl *tc, HTREEITEM parent, int changes = FALSE );
int LineNumber ( void ) { return line_number; };
void SetLineNumber ( int line ) { line_number = line; Changed(); };
void FormatMetaString ( void ) { text->FormatMetaString (); Changed();};
int IsDialog ( void );
int DialogIsPresent ( const char *path, LangID langid = LANGID_US );
int DialogIsValid ( const char *path, LangID langid = LANGID_US, int check = TRUE );
int ValidateDialog( const char *path, LangID langid = LANGID_US );
void InvalidateAllWaves ( void );
void InvalidateWave ( void );
void InvalidateWave ( LangID langid );
int IsSent ( void );
void Sent ( int val );
};
class NoxLabel : public DBAttribs
{
TransDB *db;
OLEString *name;
OLEString *comment;
OLEString *context;
OLEString *speaker;
OLEString *listener;
unsigned int max_len;
unsigned int line_number;
List text;
void init ( void );
public:
NoxLabel ( void );
~NoxLabel ( );
int Clear ( void );
void ClearChanges ( void );
void ClearProcessed ( void );
void ClearMatched ( void );
int AllMatched ( void );
void Remove ( void );
void AddText ( NoxText *new_text );
void RemoveText ( NoxText *new_text );
NoxText* FirstText ( ListSearch& sh );
NoxText* NextText ( ListSearch& sh);
NoxText* FindText ( OLECHAR *find_text );
void SetDB ( TransDB *new_db );
NoxLabel* Clone ( void );
int NumStrings ( void ) { return text.NumItems(); };
void SetMaxLen ( int max ) { max_len = max; Changed(); };
int MaxLen ( void ) { return max_len; };
void SetLineNumber( int line ) { line_number = line; Changed(); };
int LineNumber ( void ) { return line_number; };
TransDB* DB ( void ) { return db;};
void LockName ( void ) { name->Lock(); };
void SetName ( OLECHAR *string ) { name->Set ( string ); Changed(); };
void SetName ( char *string ) { name->Set ( string ); Changed(); };
void SetComment ( OLECHAR *string ) { comment->Set ( string ); Changed(); };
void SetComment ( char *string ) { comment->Set ( string ); Changed(); };
void SetContext ( OLECHAR *string ) { context->Set ( string ); Changed(); };
void SetContext ( char *string ) { context->Set ( string ); Changed(); };
void SetSpeaker ( char *string ) { speaker->Set ( string ); Changed(); };
void SetSpeaker ( OLECHAR *string ) { speaker->Set ( string ); Changed(); };
void SetListener ( char *string ) { listener->Set ( string ); Changed(); };
void SetListener ( OLECHAR *string ) { listener->Set ( string ); Changed(); };
OLECHAR* Name ( void ) { return name->Get (); };
OLECHAR* Comment ( void ) { return comment->Get(); };
OLECHAR* Context ( void ) { return context->Get(); };
OLECHAR* Speaker ( void ) { return speaker->Get(); };
OLECHAR* Listener ( void ) { return listener->Get(); };
char* NameSB ( void ) { return name->GetSB (); };
char* CommentSB ( void ) { return comment->GetSB(); };
char* ContextSB ( void ) { return context->GetSB(); };
char* SpeakerSB ( void ) { return speaker->GetSB(); };
char* ListenerSB ( void ) { return listener->GetSB(); };
void AddToTree ( CTreeCtrl *tc, HTREEITEM parent, int changes = FALSE );
};
#define TRANSDB_OPTION_NONE 00000000
#define TRANSDB_OPTION_DUP_TEXT 00000001 // strings can be dupilcated across labels
#define TRANSDB_OPTION_MULTI_TEXT 00000002 // labels can have more than 1 string
const int START_STRING_ID = 10000;
class TransDB : public DBAttribs
{
ListNode node;
List labels;
List obsolete;
Bin *label_bin;
Bin *text_bin;
BinID *text_id_bin;
Bin *obsolete_bin;
char name[100];
int num_obsolete;
int next_string_id;
int valid;
int checked_for_errors;
int last_error_count;
int flags;
public:
TransDB ( char *name = "no name" );
~TransDB ( );
void InvalidateDialog( LangID langid );
void VerifyDialog( LangID langid, void (*cb) ( void ) = NULL );
int ReportDialog( DLGREPORT *report, LangID langid, void (*print) ( const char *)= NULL, PMASK pmask= PMASK_ALL );
int ReportTranslations( TRNREPORT *report, LangID langid, void (*print) ( const char *) = NULL, PMASK pmask = PMASK_ALL );
void ReportDuplicates ( CNoxstringDlg *dlg = NULL );
void AddLabel ( NoxLabel *label );
void AddText ( NoxText *text );
void AddObsolete ( NoxText *text );
void RemoveLabel ( NoxLabel *label );
void RemoveText ( NoxText *text );
void RemoveObsolete ( NoxText *text );
int Errors ( CNoxstringDlg *dlg = NULL );
int HasErrors ( void ) { return checked_for_errors ? last_error_count != 0 : FALSE; };
int Warnings ( CNoxstringDlg *dlg = NULL );
int NumLabelsChanged ( void );
int NumLabels ( void );
int NumObsolete ( void ) { return num_obsolete; };
NoxLabel* FirstLabel ( ListSearch& sh );
NoxLabel* NextLabel ( ListSearch& sh);
NoxText* FirstObsolete ( ListSearch& sh );
NoxText* NextObsolete ( ListSearch& sh);
NoxLabel* FindLabel ( OLECHAR *name );
NoxText* FindText ( OLECHAR *text );
NoxText* FindSubText ( OLECHAR *text, int item = 0 );
NoxText* FindText ( int id );
NoxText* FindNextText ( void );
NoxText* FindObsolete ( OLECHAR *text );
NoxText* FindNextObsolete ( void );
int Clear ( void );
void ClearChanges ( void );
void ClearProcessed ( void );
void ClearMatched ( void );
TransDB* Next ( void );
void AddToTree ( CTreeCtrl *tc, HTREEITEM parent, int changes = FALSE, void (*cb) ( void ) = NULL );
char* Name ( void ) { return name;};
void EnableIDs ( void ) { next_string_id = START_STRING_ID; };
int NewID ( void ) { if ( next_string_id != -1) return next_string_id++; else return -1; };
int ID ( void ) { return next_string_id; };
void SetID ( int new_id ) { next_string_id = new_id; };
int IsValid ( void ) { return valid; };
void InValid ( void ) { valid = FALSE; };
int DuplicatesAllowed ( void ) { return flags & TRANSDB_OPTION_DUP_TEXT;};
int MultiTextAllowed ( void ) { return flags & TRANSDB_OPTION_MULTI_TEXT;};
void AllowDupiclates ( int yes = TRUE) { yes ? flags |= TRANSDB_OPTION_DUP_TEXT : flags &= ~(TRANSDB_OPTION_DUP_TEXT ); };
void AllowMultiText ( int yes = TRUE) { yes ? flags |= TRANSDB_OPTION_MULTI_TEXT : flags &= ~(TRANSDB_OPTION_MULTI_TEXT ); };
};
class DupNode : public ListNode
{
NoxText *original;
NoxText *duplicate;
public:
DupNode ( NoxText *dup, NoxText *orig ) { original = orig; duplicate = dup, SetPriority ( orig->LineNumber ());};
NoxText *Duplicate ( void ) { return duplicate; };
NoxText *Original ( void ) { return original; };
};
extern TransDB* FirstTransDB ( void );
#endif // __TRANSDB_H

View file

@ -0,0 +1,61 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// VIEWDBSII.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "VIEWDBSII.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// VIEWDBSII dialog
VIEWDBSII::VIEWDBSII(CWnd* pParent /*=NULL*/)
: CDialog(VIEWDBSII::IDD, pParent)
{
//{{AFX_DATA_INIT(VIEWDBSII)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void VIEWDBSII::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(VIEWDBSII)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(VIEWDBSII, CDialog)
//{{AFX_MSG_MAP(VIEWDBSII)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// VIEWDBSII message handlers

View file

@ -0,0 +1,70 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_VIEWDBSII_H__AC697EE4_6D37_4F29_ACC7_8B260A33DA2E__INCLUDED_)
#define AFX_VIEWDBSII_H__AC697EE4_6D37_4F29_ACC7_8B260A33DA2E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// VIEWDBSII.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// VIEWDBSII dialog
class VIEWDBSII : public CDialog
{
// Construction
public:
VIEWDBSII(CWnd* pParent = NULL); // standard constructor
void OnClose();
BOOL OnInitDialog();
HTREEITEM create_changes_view ( void );
HTREEITEM VIEWDBSII::create_full_view ( void );
// Dialog Data
//{{AFX_DATA(VIEWDBSII)
enum { IDD = IDD_VIEWDBS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(VIEWDBSII)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(VIEWDBSII)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
extern int ViewChanges;
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VIEWDBSII_H__AC697EE4_6D37_4F29_ACC7_8B260A33DA2E__INCLUDED_)

View file

@ -0,0 +1,238 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// VerifyDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "VerifyDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define TIMERID 1000
/////////////////////////////////////////////////////////////////////////////
// VerifyDlg dialog
VerifyDlg::VerifyDlg( NoxText *ntext, LangID langid, const char *path, CWnd* pParent /*=NULL*/)
: CDialog(VerifyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(VerifyDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
nox_text = ntext;
linfo = GetLangInfo ( langid );
sprintf ( wavefile, "%s%s\\%s%s.wav", path, linfo->character, ntext->WaveSB(), linfo->character );
}
void VerifyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(VerifyDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(VerifyDlg, CDialog)
//{{AFX_MSG_MAP(VerifyDlg)
ON_BN_CLICKED(IDC_NOMATCH, OnNomatch)
ON_BN_CLICKED(IDOK, OnMatch)
ON_BN_CLICKED(IDC_STOP, OnStop)
ON_BN_CLICKED(IDC_PLAY, OnPlay)
ON_BN_CLICKED(IDC_PAUSE, OnPause)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// VerifyDlg message handlers
BOOL VerifyDlg::OnInitDialog()
{
//long total;
CDialog::OnInitDialog();
RECT rect;
// TODO: Add extra initialization here
this->GetWindowRect ( &rect );
rect.top -= 100;
rect.bottom -= 100;
this->MoveWindow ( &rect );
stop.AutoLoad ( IDC_STOP, this );
pause.AutoLoad ( IDC_PAUSE, this );
play.AutoLoad ( IDC_PLAY, this );
wave = GetDlgItem ( IDC_WAVENAME );
text = (CStatic *) GetDlgItem ( IDC_TEXT );
slider = (CSliderCtrl *) GetDlgItem ( IDC_SLIDER );
wave->SetWindowText ( wavefile );
SetDlgItemText ( IDC_TEXT_TITLE, (nox_text->Label()->NameSB()));
if ( linfo->langid == LANGID_US )
{
text->SetWindowText ( nox_text->GetSB ());
}
else
{
Translation *trans = nox_text->GetTranslation ( linfo->langid );
if ( trans )
{
text->SetWindowText ( trans->GetSB ());
}
else
{
text->SetWindowText ( "No translation!!");
}
}
#if 0
HDIGDRIVER dig;
HMDIDRIVER mdi;
HDLSDEVICE dls;
AIL_quick_handles ( &dig, &mdi, &dls );
stream = AIL_open_stream ( dig, wavefile, 0 );
if ( stream )
{
timer = SetTimer( TIMERID, 300, NULL );
AIL_stream_ms_position ( stream, &total, NULL );
slider->SetRange ( 0, total );
}
#endif
PostMessage ( WM_COMMAND, MAKEWPARAM ( IDC_PLAY, BN_CLICKED ));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void VerifyDlg::OnNomatch()
{
// TODO: Add your control notification handler code here
CloseAudio ();
this->EndDialog ( IDSKIP );
}
void VerifyDlg::OnMatch()
{
// TODO: Add your control notification handler code here
CloseAudio ();
CDialog::OnOK();
}
void VerifyDlg::OnCancel()
{
// TODO: Add extra cleanup here
CloseAudio ();
CDialog::OnCancel();
}
void VerifyDlg::OnStop()
{
// TODO: Add your control notification handler code here
#if 0
if ( stream )
{
AIL_pause_stream ( stream, TRUE );
AIL_set_stream_ms_position ( stream, 0 );
}
#endif
}
void VerifyDlg::OnPlay()
{
// TODO: Add your control notification handler code here
#if 0
if ( stream )
{
if ( AIL_stream_status ( stream ) == SMP_STOPPED )
{
AIL_pause_stream ( stream, FALSE);
}
else
{
AIL_start_stream ( stream );
}
}
#endif
}
void VerifyDlg::OnPause()
{
// TODO: Add your control notification handler code here
#if 0
if ( stream )
{
if ( AIL_stream_status ( stream ) == SMP_STOPPED )
{
AIL_pause_stream ( stream, FALSE);
}
else
{
AIL_pause_stream ( stream, TRUE);
}
}
#endif
}
void VerifyDlg::CloseAudio ( void )
{
#if 0
if ( stream )
{
AIL_close_stream ( stream );
stream = NULL;
}
#endif
}
void VerifyDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if ( nIDEvent == TIMERID )
{
#if 0
if ( stream )
{
long current;
AIL_stream_ms_position ( stream, NULL, &current );
slider->SetPos ( current );
}
#endif
}
else
{
CDialog::OnTimer(nIDEvent);
}
}

View file

@ -0,0 +1,85 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_VERIFYDLG_H__88E9C121_599B_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_VERIFYDLG_H__88E9C121_599B_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// VerifyDlg.h : header file
//
#include "transDB.h"
#define IDSKIP 100
/////////////////////////////////////////////////////////////////////////////
// VerifyDlg dialog
class VerifyDlg : public CDialog
{
CBitmapButton stop;
CBitmapButton play;
CBitmapButton pause;
CWnd *wave;
CStatic *text;
NoxText *nox_text;
LANGINFO *linfo;
UINT timer;
char wavefile[1024];
CSliderCtrl *slider;
// Construction
public:
VerifyDlg(NoxText *ntext, LangID langid, const char *path, CWnd* pParent = NULL); // standard constructor
void CloseAudio ( void );
// Dialog Data
//{{AFX_DATA(VerifyDlg)
enum { IDD = IDD_MATCHDIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(VerifyDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(VerifyDlg)
virtual BOOL OnInitDialog();
afx_msg void OnNomatch();
afx_msg void OnMatch();
virtual void OnCancel();
afx_msg void OnStop();
afx_msg void OnPlay();
afx_msg void OnPause();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VERIFYDLG_H__88E9C121_599B_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,91 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// VerifyTextDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "VerifyTextDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVerifyTextDlg dialog
CVerifyTextDlg::CVerifyTextDlg( char *trans, char *orig, CWnd* pParent /*=NULL*/)
: CDialog(CVerifyTextDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CVerifyTextDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_trans = trans;
m_orig = orig;
}
void CVerifyTextDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CVerifyTextDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CVerifyTextDlg, CDialog)
//{{AFX_MSG_MAP(CVerifyTextDlg)
ON_BN_CLICKED(IDC_NOMATCH, OnNomatch)
ON_BN_CLICKED(IDC_MATCH, OnMatch)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVerifyTextDlg message handlers
void CVerifyTextDlg::OnNomatch()
{
EndDialog ( IDNO );
}
void CVerifyTextDlg::OnMatch()
{
EndDialog ( IDYES );
}
BOOL CVerifyTextDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetDlgItemText ( IDC_TRANS, m_trans );
SetDlgItemText ( IDC_ORIG, m_orig );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

View file

@ -0,0 +1,68 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_VERIFYTEXTDLG_H__39DB1C81_6B90_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_VERIFYTEXTDLG_H__39DB1C81_6B90_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// VerifyTextDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CVerifyTextDlg dialog
class CVerifyTextDlg : public CDialog
{
// Construction
char *m_trans;
char *m_orig;
public:
CVerifyTextDlg(char *trans, char *orig, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CVerifyTextDlg)
enum { IDD = IDD_VERIFYTEXT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVerifyTextDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CVerifyTextDlg)
afx_msg void OnNomatch();
afx_msg void OnMatch();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VERIFYTEXTDLG_H__39DB1C81_6B90_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,221 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// ViewDBsDlg.cpp : implementation file
//
#include "stdafx.h"
#include "noxstring.h"
#include "noxstringdlg.h"
#include "VIEWDBSII.h"
#include "transdb.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
int ViewChanges = FALSE;
/////////////////////////////////////////////////////////////////////////////
// CViewDBsDlg dialog
VIEWDBSII::VIEWDBSII(CWnd* pParent /*=NULL*/)
: CDialog(VIEWDBSII::IDD, pParent)
{
//{{AFX_DATA_INIT(CViewDBsDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void VIEWDBSII::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CViewDBsDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(VIEWDBSII, CDialog)
//{{AFX_MSG_MAP(CViewDBsDlg)
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CViewDBsDlg message handlers
static int label_count;
static void progress_cb ( void )
{
label_count++;
if ( MainDLG )
{
MainDLG->SetProgress ( label_count );
}
}
HTREEITEM VIEWDBSII::create_full_view ( void )
{
CTreeCtrl *tc = ( CTreeCtrl *) GetDlgItem ( IDC_TREEVIEW );
HTREEITEM root;
TransDB *db;
int count = 0;
char *title = "Building database view...";
MainDLG->Log ("");
MainDLG->Status ( title );
root = tc->InsertItem ( "DBs" );
db = FirstTransDB ( );
while ( db )
{
count += db->NumLabels ();
count += db->NumObsolete ();
db = db->Next ();
}
MainDLG->InitProgress ( count );
label_count = 0;
db = FirstTransDB ( );
while ( db )
{
char buffer[100];
sprintf ( buffer, "%s%s", title, db->Name());
MainDLG->Status ( buffer, FALSE );
db->AddToTree ( tc, root, FALSE, progress_cb );
db = db->Next ();
}
MainDLG->Log ("OK", SAME_LINE );
tc->Expand ( root, TVE_EXPAND );
return root;
}
HTREEITEM VIEWDBSII::create_changes_view ( void )
{
CTreeCtrl *tc = ( CTreeCtrl *) GetDlgItem ( IDC_TREEVIEW );
HTREEITEM root;
TransDB *db;
int count = 0;
char *title = "Building changes view...";
MainDLG->Log ("");
MainDLG->Status ( title );
db = FirstTransDB ( );
while ( db )
{
if ( db->IsChanged ())
{
count += db->NumLabels ();
count += db->NumObsolete ();
}
db = db->Next ();
}
if ( MainDLG )
{
MainDLG->InitProgress ( count );
}
if ( count )
{
root = tc->InsertItem ( "Changes" );
}
else
{
root = tc->InsertItem ( "No Changes" );
}
label_count = 0;
db = FirstTransDB ( );
while ( db )
{
char buffer[100];
if ( db->IsChanged ())
{
sprintf ( buffer, "%s%s", title, db->Name());
MainDLG->Status ( buffer, FALSE );
db->AddToTree ( tc, root, TRUE, progress_cb );
}
db = db->Next ();
}
if ( MainDLG )
{
MainDLG->ProgressComplete ( );
MainDLG->Log ("OK", SAME_LINE );
MainDLG->Ready ();
}
tc->Expand ( root, TVE_EXPAND );
return root;
}
BOOL VIEWDBSII::OnInitDialog()
{
HTREEITEM root;
CDialog::OnInitDialog();
// TODO: Add extra initialization here
if ( !ViewChanges )
{
root = create_full_view ();
}
else
{
root = create_changes_view ();
}
MainDLG->Ready();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void VIEWDBSII::OnClose()
{
// TODO: Add your message handler code here and/or call default
CTreeCtrl *tc = ( CTreeCtrl *) GetDlgItem ( IDC_TREEVIEW );
HTREEITEM root = tc->GetRootItem ();
tc->Expand ( root, TVE_COLLAPSE );
tc->DeleteAllItems ();
CDialog::OnClose();
}

View file

@ -0,0 +1,673 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// XLStuff.cpp
//
//
#include "stdAfx.h"
#include "noxstring.h"
#include "resource.h"
#include <stdio.h>
#include "xlstuff.h"
#include <assert.h>
#include <comdef.h>
static const int xlWorkbookNormal = -4143;
static const int xlNoChange = 1;
static const int xlLocalSessionChanges = 2;
static const int xlWBATWorksheet = -4167;
static _Workbook *workbook = NULL;
static _Application *xl = NULL;
static Workbooks *wbs = NULL;
static Range *range = NULL;
static _Worksheet *ws = NULL;
static OLECHAR buffer[100*1024];
static VARIANT no, yes, dummy, dummy0, nullstring, empty;
static VARIANT continuous, automatic, medium, thin, none;
static VARIANT yellow, solid;
static VARIANT GetCell ( int row, int column )
{
VARIANT cell;
VARIANT result;
LPDISPATCH dispatch;
OLECHAR cellname[20];
V_VT ( &cell ) = VT_EMPTY;
assert ( column > 0 );
swprintf ( cellname, L"%c%d", 'A'+column -1 , row );
V_VT ( &cell ) = VT_BSTR;
V_BSTR ( &cell ) = SysAllocString (cellname);
V_VT ( &result ) = VT_BOOL;
V_BOOL ( &result ) = FALSE;
if ( !ws )
{
goto error;
}
if ( ! (dispatch = ws->GetRange (cell, cell )))
{
goto error;
}
range->AttachDispatch ( dispatch );
result = range->GetValue ();
range->ReleaseDispatch ( );
error:
VariantClear ( &cell );
return result;
}
int PutCell ( int row, int column, OLECHAR *string, int val )
{
VARIANT cell;
VARIANT newValue;
int ok = FALSE;
LPDISPATCH dispatch;
OLECHAR cellname[20];
V_VT ( &newValue ) = VT_EMPTY;
V_VT ( &cell ) = VT_EMPTY;
assert ( column > 0 );
swprintf ( cellname, L"%c%d", 'A'+column-1, row );
V_VT ( &cell ) = VT_BSTR;
V_BSTR ( &cell ) = SysAllocString (cellname);
if ( !ws )
{
goto error;
}
if ( ! (dispatch = ws->GetRange (cell, cell )))
{
goto error;
}
range->AttachDispatch ( dispatch );
if ( string )
{
V_VT ( &newValue ) = VT_BSTR;
if ( string[0] == '\'')
{
buffer[0] = '\\';
wcscpy ( &buffer[1], string );
V_BSTR ( &newValue ) = SysAllocString ( buffer );
}
else
{
V_BSTR ( &newValue ) = SysAllocString ( string );
}
}
else
{
V_VT ( &newValue ) = VT_I4;
V_I4 ( &newValue ) = val;
}
range->SetValue ( newValue );
range->ReleaseDispatch ( );
ok = TRUE;
error:
VariantClear ( &cell );
VariantClear ( &newValue );
return ok;
}
int PutSeparator ( int row )
{
// Rows(row).Select
// Selection.Borders(xlDiagonalDown).LineStyle = xlNone
// Selection.Borders(xlDiagonalUp).LineStyle = xlNone
// Selection.Borders(xlEdgeLeft).LineStyle = xlNone
// Selection.Borders(xlEdgeTop).LineStyle = xlNone
// With Selection.Borders(xlEdgeBottom)
// .LineStyle = xlContinuous
// .Weight = xlMedium
// .ColorIndex = xlAutomatic
// End With
// With Selection.Borders(xlEdgeRight)
// .LineStyle = xlContinuous
// .Weight = xlThin
// .ColorIndex = xlAutomatic
// End With
int ok = FALSE;
Border *border = NULL;
Borders *borders = NULL;
LPDISPATCH dispatch;
OLECHAR cellname1[20];
OLECHAR cellname2[20];
VARIANT cell1,cell2;
if ( !ws )
{
goto error;
}
assert ( row > 0 );
swprintf ( cellname1, L"A%d", row );
swprintf ( cellname2, L"%c%d", 'A'+CELL_LAST-1-1, row );
V_VT ( &cell1 ) = VT_BSTR;
V_BSTR ( &cell1 ) = SysAllocString (cellname1);
V_VT ( &cell2 ) = VT_BSTR;
V_BSTR ( &cell2 ) = SysAllocString (cellname2);
if ( ! (dispatch = ws->GetRange (cell1, cell2 )))
{
goto error;
}
range->AttachDispatch ( dispatch );
dispatch = range->GetBorders ();
borders = new Borders ( dispatch );
if ( !borders )
{
goto error;
}
dispatch = borders->GetItem ( xlEdgeBottom );
border = new Border ( dispatch );
if ( !border )
{
goto error;
}
border->SetLineStyle ( continuous );
border->SetColorIndex ( automatic );
border->SetWeight ( thin );
ok = TRUE;
error:
range->ReleaseDispatch ( );
if ( borders )
{
delete borders ;
}
if ( border )
{
delete border ;
}
VariantClear ( &cell1 );
VariantClear ( &cell2 );
return ok;
}
int PutSection ( int row, OLECHAR *title )
{
int ok = FALSE;
Range *range = NULL;
Border *border = NULL;
Borders *borders = NULL;
Interior *interior = NULL;
LPDISPATCH dispatch;
OLECHAR cellname1[20];
OLECHAR cellname2[20];
VARIANT cell1,cell2;
_Worksheet *ws = NULL;
if ( !ws )
{
goto error;
}
assert ( row > 0 );
swprintf ( cellname1, L"A%d", row );
swprintf ( cellname2, L"%c%d", 'A'+CELL_LAST-1-1, row );
V_VT ( &cell1 ) = VT_BSTR;
V_BSTR ( &cell1 ) = SysAllocString (cellname1);
V_VT ( &cell2 ) = VT_BSTR;
V_BSTR ( &cell2 ) = SysAllocString (cellname2);
if ( ! (dispatch = ws->GetRange (cell1, cell2 )))
{
goto error;
}
range->AttachDispatch ( dispatch );
dispatch = range->GetBorders ();
borders = new Borders ( dispatch );
if ( !borders )
{
goto error;
}
dispatch = borders->GetItem ( xlEdgeBottom );
border = new Border ( dispatch );
if ( !border )
{
goto error;
}
border->SetLineStyle ( continuous );
border->SetColorIndex ( automatic );
border->SetWeight ( thin );
delete border;
border = NULL;
dispatch = borders->GetItem ( xlEdgeTop );
border = new Border ( dispatch );
if ( !border )
{
goto error;
}
border->SetLineStyle ( continuous );
border->SetColorIndex ( automatic );
border->SetWeight ( medium );
delete border;
border = NULL;
dispatch = borders->GetItem ( xlEdgeRight );
border = new Border ( dispatch );
if ( !border )
{
goto error;
}
border->SetLineStyle ( none );
delete border;
border = NULL;
dispatch = borders->GetItem ( xlEdgeLeft );
border = new Border ( dispatch );
if ( !border )
{
goto error;
}
border->SetLineStyle ( none );
dispatch = range->GetInterior ( );
interior = new Interior ( dispatch );
if ( !interior )
{
goto error;
}
interior->SetColorIndex ( yellow );
interior->SetPattern ( solid );
PutCell ( row, 1, L"Section", 0 );
PutCell ( row, 2, title, 0 );
ok = TRUE;
error:
range->ReleaseDispatch ( );
if ( borders )
{
delete borders ;
}
if ( border )
{
delete border ;
}
VariantClear ( &cell1 );
VariantClear ( &cell2 );
return ok;
}
int OpenExcel ( void )
{
LPDISPATCH dispatch;
if ( xl )
{
return TRUE;
}
#if 0
while ( ExcelRunning ())
{
if ( AfxMessageBox ( "Excel is running!\n\nClose or kill all instances of Excel and retry\n\nNOTE: Check task tray (CTRL-ALT-DELETE) for instances of Excel", MB_OKCANCEL ) == IDCANCEL )
{
return FALSE;
}
}
#endif
xl = new _Application();
if ( !xl )
{
return FALSE;
}
if ( !xl->CreateDispatch ("Excel.Application"))
{
goto error_access;
}
dispatch = xl->GetWorkbooks ( );
if ( dispatch )
{
wbs = new Workbooks( dispatch );
}
if ( !wbs )
{
return FALSE;
}
if ( ! (ws = new _Worksheet ()))
{
return FALSE;
}
if ( ! (range = new Range ()))
{
return FALSE;
}
V_VT ( &no ) = VT_BOOL;
V_VT ( &yes ) = VT_BOOL;
V_VT ( &dummy ) = VT_I4;
V_VT ( &dummy0 ) = VT_I4;
V_VT ( &nullstring ) = VT_BSTR ;
V_VT ( &empty ) = VT_EMPTY;
V_VT ( &continuous ) = VT_I4;
V_VT ( &automatic ) = VT_I4;
V_VT ( &medium ) = VT_I4;
V_VT ( &thin ) = VT_I4;
V_VT ( &none ) = VT_I4;
V_VT ( &solid ) = VT_I4;
V_VT ( &yellow ) = VT_I4;
V_BOOL ( &no ) = FALSE;
V_BOOL ( &yes ) = TRUE;
V_I4 ( &dummy ) = 1;
V_I4 ( &dummy0 ) = 0;
V_BSTR ( &nullstring ) = SysAllocString ( OLESTR ("") );
V_I4 ( &continuous ) = xlContinuous;
V_I4 ( &automatic ) = xlAutomatic;
V_I4 ( &medium ) = xlMedium;
V_I4 ( &thin ) = xlThin;
V_I4 ( &none ) = xlThin;
V_I4 ( &solid ) = xlSolid;
V_I4 ( &yellow ) = 6;
return TRUE;
error_access:
AfxMessageBox ("Could not access Excel!\n\nMake sure Excel is installed on this system.");
return FALSE;
}
void CloseExcel ( void )
{
CloseWorkBook ();
if ( range )
{
delete range;
range = NULL;
}
if ( ws )
{
delete ws;
ws = NULL;
}
if ( wbs )
{
wbs->Close();
delete wbs;
wbs = NULL;
}
if ( xl )
{
xl->Quit();
xl->ReleaseDispatch ();
delete xl;
xl = NULL;
}
VariantClear ( &nullstring );
}
int OpenWorkBook ( const char *filename )
{
LPDISPATCH dispatch;
dispatch = wbs->Open ((LPCTSTR) filename, dummy0, yes, dummy, nullstring, nullstring, yes, dummy, dummy, no, no, dummy, no );
if ( dispatch )
{
workbook = new _Workbook ( dispatch );
}
if ( !workbook )
{
return FALSE;
}
SelectActiveSheet ( );
return TRUE;
}
int NewWorkBook ( const char *path )
{
LPDISPATCH dispatch;
VARIANT temp;
char tfile[200];
char *p;
WIN32_FIND_DATA finfo;
HANDLE handle;
V_VT ( &temp ) = VT_I4;
V_I4 ( &temp ) = xlWBATWorksheet;
if ( path )
{
strcpy ( tfile, path );
if ( (p = strchr ( tfile, '.' )))
{
*p = 0;
}
strcpy ( p, ".xlt" );
if ( (handle = FindFirstFile ( tfile, &finfo)) != INVALID_HANDLE_VALUE )
{
if ( !(finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
{
swprintf ( buffer, L"%S", tfile );
V_VT ( &temp ) = VT_BSTR;
V_BSTR ( &temp ) = SysAllocString ( buffer );
}
FindClose ( handle );
}
}
dispatch = wbs->Add ( temp );
VariantClear ( &temp );
if ( dispatch )
{
workbook = new _Workbook ( dispatch );
}
if ( !workbook )
{
return FALSE;
}
SelectActiveSheet ( );
return TRUE;
}
int SaveWorkBook ( const char *filename, int protect )
{
VARIANT name, fileformat, rc;
V_VT ( &name ) = VT_BSTR;
swprintf ( buffer, L"%S", filename );
V_BSTR ( &name ) = SysAllocString ( buffer );
V_VT ( &fileformat ) = VT_I4;
V_I4 ( &fileformat ) = xlWorkbookNormal;
V_VT ( &rc ) = VT_I4;
V_I4 ( &rc ) = xlLocalSessionChanges;
if ( protect )
{
VARIANT password;
V_VT ( &password ) = VT_BSTR;
V_BSTR ( &password ) = SysAllocString ( L"" );
ws->Protect ( password, yes, yes, yes, no );
VariantClear ( &password );
}
workbook->SaveAs ( name, fileformat, nullstring, nullstring, no, no,
xlNoChange, rc, no, empty, empty );
VariantClear ( &name );
return TRUE;
}
void CloseWorkBook ( void )
{
if ( workbook )
{
workbook->SetSaved ( TRUE );
workbook->Close ( no, nullstring, no );
delete workbook;
workbook = NULL;
}
}
void SelectActiveSheet ( void )
{
LPDISPATCH dispatch;
if ( ! (dispatch = xl->GetActiveSheet ()))
{
return;
}
ws->ReleaseDispatch ( );
ws->AttachDispatch ( dispatch );
}
int GetInt ( int row, int cell )
{
long value;
VARIANT var;
_variant_t v;
var = GetCell ( row, cell );
v.Attach ( var );
value = v;
return (int) value;
}
int GetString ( int row, int cell, OLECHAR *string )
{
VARIANT var;
string[0] =0;
var = GetCell ( row, cell );
if ( V_VT ( &var ) == VT_BSTR )
{
wcscpy ( string, V_BSTR ( &var ));
}
VariantClear ( &var );
return 1;
}

View file

@ -0,0 +1,262 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// XLStuff.h
//
//
#ifndef XLSTUFF_H
#define XLSTUFF_H
#include "noxstringDlg.h"
typedef enum {
xlAll = -4104,
xlAutomatic = -4105,
xlBoth = 1,
xlCenter = -4108,
xlChecker = 9,
xlCircle = 8,
xlCorner = 2,
xlCrissCross = 16,
xlCross = 4,
xlDiamond = 2,
xlDistributed = -4117,
xlDoubleAccounting = 5,
xlFixedValue = 1,
xlFormats = -4122,
xlGray16 = 17,
xlGray8 = 18,
xlGrid = 15,
xlHigh = -4127,
xlInside = 2,
xlJustify = -4130,
xlLightDown = 13,
xlLightHorizontal = 11,
xlLightUp = 14,
xlLightVertical = 12,
xlLow = -4134,
xlManual = -4135,
xlMinusValues = 3,
xlModule = -4141,
xlNextToAxis = 4,
xlNone = -4142,
xlNotes = -4144,
xlOff = -4146,
xlOn = 1,
xlPercent = 2,
xlPlus = 9,
xlPlusValues = 2,
xlSemiGray75 = 10,
xlShowLabel = 4,
xlShowLabelAndPercent = 5,
xlShowPercent = 3,
xlShowValue = 2,
xlSimple = -4154,
xlSingle = 2,
xlSingleAccounting = 4,
xlSolid = 1,
xlSquare = 1,
xlStar = 5,
xlStError = 4,
xlToolbarButton = 2,
xlTriangle = 3,
xlGray25 = -4124,
xlGray50 = -4125,
xlGray75 = -4126,
xlBottom = -4107,
xlLeft = -4131,
xlRight = -4152,
xlTop = -4160,
xl3DBar = -4099,
xl3DSurface = -4103,
xlBar = 2,
xlColumn = 3,
xlCombination = -4111,
xlCustom = -4114,
xlDefaultAutoFormat = -1,
xlMaximum = 2,
xlMinimum = 4,
xlOpaque = 3,
xlTransparent = 2,
xlBidi = -5000,
xlLatin = -5001,
xlContext = -5002,
xlLTR = -5003,
xlRTL = -5004,
xlVisualCursor = 2,
xlLogicalCursor = 1,
xlSystem = 1,
xlPartial = 3,
xlHindiNumerals = 3,
xlBidiCalendar = 3,
xlGregorian = 2,
xlComplete = 4,
xlScale = 3,
xlClosed = 3,
xlColor1 = 7,
xlColor2 = 8,
xlColor3 = 9,
xlConstants = 2,
xlContents = 2,
xlBelow = 1,
xlCascade = 7,
xlCenterAcrossSelection = 7,
xlChart4 = 2,
xlChartSeries = 17,
xlChartShort = 6,
xlChartTitles = 18,
xlClassic1 = 1,
xlClassic2 = 2,
xlClassic3 = 3,
xl3DEffects1 = 13,
xl3DEffects2 = 14,
xlAbove = 0,
xlAccounting1 = 4,
xlAccounting2 = 5,
xlAccounting3 = 6,
xlAccounting4 = 17,
xlAdd = 2,
xlDebugCodePane = 13,
xlDesktop = 9,
xlDirect = 1,
xlDivide = 5,
xlDoubleClosed = 5,
xlDoubleOpen = 4,
xlDoubleQuote = 1,
xlEntireChart = 20,
xlExcelMenus = 1,
xlExtended = 3,
xlFill = 5,
xlFirst = 0,
xlFloating = 5,
xlFormula = 5,
xlGeneral = 1,
xlGridline = 22,
xlIcons = 1,
xlImmediatePane = 12,
xlInteger = 2,
xlLast = 1,
xlLastCell = 11,
xlList1 = 10,
xlList2 = 11,
xlList3 = 12,
xlLocalFormat1 = 15,
xlLocalFormat2 = 16,
xlLong = 3,
xlLotusHelp = 2,
xlMacrosheetCell = 7,
xlMixed = 2,
xlMultiply = 4,
xlNarrow = 1,
xlNoDocuments = 3,
xlOpen = 2,
xlOutside = 3,
xlReference = 4,
xlSemiautomatic = 2,
xlShort = 1,
xlSingleQuote = 2,
xlStrict = 2,
xlSubtract = 3,
xlTextBox = 16,
xlTiled = 1,
xlTitleBar = 8,
xlToolbar = 1,
xlVisible = 12,
xlWatchPane = 11,
xlWide = 3,
xlWorkbookTab = 6,
xlWorksheet4 = 1,
xlWorksheetCell = 3,
xlWorksheetShort = 5,
xlAllExceptBorders = 6,
xlLeftToRight = 2,
xlTopToBottom = 1,
xlVeryHidden = 2,
xlDrawingObject = 14
} Constants;
typedef enum {
xlHairline = 1,
xlMedium = -4138,
xlThick = 4,
xlThin = 2
} XlBorderWeight;
typedef enum {
xlContinuous = 1,
xlDash = -4115,
xlDashDot = 4,
xlDashDotDot = 5,
xlDot = -4118,
xlDouble = -4119,
xlSlantDashDot = 13,
xlLineStyleNone = -4142
} XlLineStyle;
typedef enum {
xlInsideHorizontal = 12,
xlInsideVertical = 11,
xlDiagonalDown = 5,
xlDiagonalUp = 6,
xlEdgeBottom = 9,
xlEdgeLeft = 7,
xlEdgeRight = 10,
xlEdgeTop = 8
} XlBordersIndex;
enum {
CELL_WAVEFILE = 1,
CELL_LABEL,
CELL_SPEAKER,
CELL_LISTENER,
CELL_STRINGID,
CELL_ENGLISH,
CELL_LOCALIZED,
CELL_CONTEXT,
CELL_COMMENT,
CELL_MAXLEN,
CELL_STRLEN,
CELL_LENCHECK,
CELL_REVISION,
CELL_LAST
};
#define ROW_COUNT 1
#define COLUMN_COUNT 2
#define ROW_LANGUAGE 1
#define COLUMN_LANGUAGE 1
int OpenExcel ( void );
void CloseExcel ( void );
int NewWorkBook ( const char *path );
int SaveWorkBook ( const char *filename, int protect = FALSE );
int OpenWorkBook ( const char *filename );
void CloseWorkBook ( void );
int PutCell ( int row, int column, OLECHAR *string, int val );
int PutSeparator ( int row );
int PutSection ( int row, OLECHAR *title );
void SelectActiveSheet ( void );
int GetInt ( int row, int cell );
int GetString ( int row, int cell, OLECHAR *buffer );
#endif // XLSTUFF_H

View file

@ -0,0 +1,404 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// Bin.cpp
//
#include "stdAfx.h"
#include "bin.h"
#include "assert.h"
#include "list.h"
Bin::Bin ( int size )
{
assert ( size > 0 );
num_buckets = size;
sh_item = NULL;
bucket = new List[size];
}
Bin::~Bin ( )
{
Clear ();
delete [] bucket;
}
void Bin::Clear ( void )
{
int count = num_buckets;
sh_item = NULL;
while ( count-- )
{
List *head = &bucket[count];
BinItem *item;
while ( ( item = (BinItem *) head->Next ()))
{
Remove ( item );
}
}
}
void* Bin::Get ( OLECHAR *text1, OLECHAR *text2 )
{
BinItem *item;
if ( ( item = GetBinItem ( text1, text2 )) )
{
return item->Item();
}
return NULL;
}
void* Bin::GetNext ( void )
{
BinItem *item;
if ( ( item = GetNextBinItem ( )) )
{
return item->Item();
}
return NULL;
}
void Bin::Add ( void *data, OLECHAR *text1, OLECHAR *text2 )
{
BinItem *item;
List *list;
int hash;
sh_item = NULL;
hash = calc_hash ( text1 );
item = new BinItem ( data, hash, text1, text2 );
list = &bucket[hash%num_buckets];
list->AddToTail ( (ListNode *) item );
}
BinItem* Bin::GetBinItem ( OLECHAR *text1, OLECHAR *text2)
{
sh_size1 = sh_size2 = 0;
sh_text1 = text1;
sh_text2 = text2;
sh_hash = calc_hash ( text1 );
if ( sh_text1 )
{
sh_size1 = wcslen ( sh_text1 );
}
if ( sh_text2 )
{
sh_size2 = wcslen ( sh_text2 );
}
sh_item = (BinItem *) &bucket[sh_hash%num_buckets];
return GetNextBinItem ();
}
BinItem* Bin::GetNextBinItem ( void )
{
if ( sh_item )
{
sh_item = (BinItem *) sh_item->Next ();
}
while ( sh_item )
{
if ( sh_item->Same ( sh_hash, sh_text1, sh_size1, sh_text2, sh_size2 ))
{
break;
}
sh_item = (BinItem *) sh_item->Next ();
}
return sh_item;
}
BinItem* Bin::GetBinItem ( void *item )
{
BinItem *bitem = NULL;
int i;
for ( i=0; i< num_buckets; i++)
{
if ( ( bitem = (BinItem *) bucket[i].Find ( item )))
{
break;
}
}
return bitem;
}
void Bin::Remove ( void *item )
{
BinItem *bitem;
if ( ( bitem = GetBinItem ( item ) ))
{
Remove ( bitem );
}
}
void Bin::Remove ( OLECHAR *text1, OLECHAR *text2 )
{
BinItem *bitem;
if ( ( bitem = GetBinItem ( text1, text2 ) ))
{
Remove ( bitem );
}
}
void Bin::Remove ( BinItem *item )
{
sh_item = NULL;
item->Remove ();
delete item ;
}
BinItem::BinItem ( void *data, int new_hash, OLECHAR *new_text1, OLECHAR *new_text2 )
{
SetItem ( data );
hash = new_hash;
if ( (text1 = new_text1) )
{
text1size = wcslen ( text1 );
}
else
{
text1size = 0;
}
if ( (text2 = new_text2) )
{
text2size = wcslen ( text2 );
}
else
{
text2size = 0;
}
}
int BinItem::Same ( int chash, OLECHAR *ctext1, int size1, OLECHAR *ctext2, int size2 )
{
if ( hash != chash || text1size != size1 || text2size != size2 )
{
return FALSE;
}
if ( wcsicmp ( text1, ctext1 ))
{
return FALSE;
}
if ( text2 && ctext2 && wcsicmp ( text2, ctext2 ))
{
return FALSE;
}
return TRUE;
}
int Bin::calc_hash ( OLECHAR *text )
{
int hash = 0;
while ( *text )
{
hash += *text++;
}
return hash;
}
// Bin ID code
BinID::BinID ( int size )
{
assert ( size > 0 );
num_buckets = size;
bucket = new List[size];
}
BinID::~BinID ( )
{
Clear ();
delete [] bucket;
}
void BinID::Clear ( void )
{
int count = num_buckets;
while ( count-- )
{
List *head = &bucket[count];
BinIDItem *item;
while ( ( item = (BinIDItem *) head->Next ()))
{
Remove ( item );
}
}
}
void* BinID::Get ( int id)
{
BinIDItem *item;
if ( ( item = GetBinIDItem ( id )) )
{
return item->Item();
}
return NULL;
}
void BinID::Add ( void *data, int id )
{
BinIDItem *item;
List *list;
item = new BinIDItem ( data, id );
list = &bucket[id%num_buckets];
list->AddToTail ( (ListNode *) item );
}
BinIDItem* BinID::GetBinIDItem ( int id )
{
BinIDItem *item;
item = (BinIDItem *) bucket[id%num_buckets].Next();
while ( item )
{
if ( item->Same ( id ))
{
break;
}
item = (BinIDItem *) item->Next ();
}
return item ;
}
BinIDItem* BinID::GetBinIDItem ( void *item )
{
BinIDItem *bitem = NULL;
int i;
for ( i=0; i< num_buckets; i++)
{
if ( ( bitem = (BinIDItem *) bucket[i].Find ( item )))
{
break;
}
}
return bitem;
}
void BinID::Remove ( void *item )
{
BinIDItem *bitem;
if ( ( bitem = GetBinIDItem ( item ) ))
{
Remove ( bitem );
}
}
void BinID::Remove ( int id )
{
BinIDItem *bitem;
if ( ( bitem = GetBinIDItem ( id ) ))
{
Remove ( bitem );
}
}
void BinID::Remove ( BinIDItem *item )
{
item->Remove ();
delete item ;
}
BinIDItem::BinIDItem ( void *data, int new_id )
{
SetItem ( data );
id = new_id;
}
int BinIDItem::Same ( int compare_id )
{
return id == compare_id;
}

View file

@ -0,0 +1,108 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// Bin.h
//
#ifndef __BIN_H
#define __BIN_H
#include "list.h"
#include "OLEString.h"
class BinItem: public ListNode
{
int hash;
OLECHAR *text1;
int text1size;
OLECHAR *text2;
int text2size;
public:
BinItem ( void *data, int hash, OLECHAR *text1, OLECHAR *text2 );
int Same ( int chash, OLECHAR *ctext1, int size1, OLECHAR *ctext2, int size2 );
};
class Bin
{
List *bucket;
int num_buckets;
BinItem *sh_item;
int sh_size1,sh_size2;
int sh_hash;
OLECHAR *sh_text1, *sh_text2;
int calc_hash ( OLECHAR *text );
public:
Bin ( int size = 256 );
~Bin ();
void Clear ( void );
void* Get ( OLECHAR *text1, OLECHAR *text2 = NULL );
void* GetNext ( void );
void Add ( void *item, OLECHAR *text1, OLECHAR *text2 = NULL );
BinItem* GetBinItem ( OLECHAR *text1, OLECHAR *text2 = NULL );
BinItem* GetBinItem ( void *item );
BinItem* GetNextBinItem ( void );
void Remove ( void *item );
void Remove ( OLECHAR *text1, OLECHAR *text2 = NULL );
void Remove ( BinItem *item );
};
class BinIDItem: public ListNode
{
int id;
public:
BinIDItem ( void *data, int id );
int Same ( int id );
};
class BinID
{
List *bucket;
int num_buckets;
public:
BinID ( int size = 256 );
~BinID ();
void Clear ( void );
void* Get ( int id );
void Add ( void *item, int id );
BinIDItem* GetBinIDItem ( int id );
BinIDItem* GetBinIDItem ( void *item );
void Remove ( void *item );
void Remove ( int id );
void Remove ( BinIDItem *item );
};
#endif // __BIN_H

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,884 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Machine generated IDispatch wrapper class(es) created with ClassWizard
/////////////////////////////////////////////////////////////////////////////
// Workbooks wrapper class
class Workbooks : public COleDispatchDriver
{
public:
Workbooks() {} // Calls COleDispatchDriver default constructor
Workbooks(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
Workbooks(const Workbooks& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
LPDISPATCH Add(const VARIANT& Template);
void Close();
long GetCount();
LPDISPATCH GetItem(const VARIANT& Index);
LPUNKNOWN Get_NewEnum();
LPDISPATCH Open(LPCTSTR Filename, const VARIANT& UpdateLinks, const VARIANT& ReadOnly, const VARIANT& Format, const VARIANT& Password, const VARIANT& WriteResPassword, const VARIANT& IgnoreReadOnlyRecommended, const VARIANT& Origin,
const VARIANT& Delimiter, const VARIANT& Editable, const VARIANT& Notify, const VARIANT& Converter, const VARIANT& AddToMru);
void OpenText(LPCTSTR Filename, const VARIANT& Origin, const VARIANT& StartRow, const VARIANT& DataType, long TextQualifier, const VARIANT& ConsecutiveDelimiter, const VARIANT& Tab, const VARIANT& Semicolon, const VARIANT& Comma,
const VARIANT& Space, const VARIANT& Other, const VARIANT& OtherChar, const VARIANT& FieldInfo, const VARIANT& TextVisualLayout);
LPDISPATCH Get_Default(const VARIANT& Index);
};
/////////////////////////////////////////////////////////////////////////////
// _Application wrapper class
class _Application : public COleDispatchDriver
{
public:
_Application() {} // Calls COleDispatchDriver default constructor
_Application(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
_Application(const _Application& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
LPDISPATCH GetActiveCell();
LPDISPATCH GetActiveChart();
CString GetActivePrinter();
void SetActivePrinter(LPCTSTR lpszNewValue);
LPDISPATCH GetActiveSheet();
LPDISPATCH GetActiveWindow();
LPDISPATCH GetActiveWorkbook();
LPDISPATCH GetAddIns();
LPDISPATCH GetAssistant();
void Calculate();
LPDISPATCH GetCells();
LPDISPATCH GetCharts();
LPDISPATCH GetColumns();
LPDISPATCH GetCommandBars();
long GetDDEAppReturnCode();
void DDEExecute(long Channel, LPCTSTR String);
long DDEInitiate(LPCTSTR App, LPCTSTR Topic);
void DDEPoke(long Channel, const VARIANT& Item, const VARIANT& Data);
VARIANT DDERequest(long Channel, LPCTSTR Item);
void DDETerminate(long Channel);
VARIANT Evaluate(const VARIANT& Name);
VARIANT _Evaluate(const VARIANT& Name);
VARIANT ExecuteExcel4Macro(LPCTSTR String);
LPDISPATCH Intersect(LPDISPATCH Arg1, LPDISPATCH Arg2, const VARIANT& Arg3, const VARIANT& Arg4, const VARIANT& Arg5, const VARIANT& Arg6, const VARIANT& Arg7, const VARIANT& Arg8, const VARIANT& Arg9, const VARIANT& Arg10,
const VARIANT& Arg11, const VARIANT& Arg12, const VARIANT& Arg13, const VARIANT& Arg14, const VARIANT& Arg15, const VARIANT& Arg16, const VARIANT& Arg17, const VARIANT& Arg18, const VARIANT& Arg19, const VARIANT& Arg20,
const VARIANT& Arg21, const VARIANT& Arg22, const VARIANT& Arg23, const VARIANT& Arg24, const VARIANT& Arg25, const VARIANT& Arg26, const VARIANT& Arg27, const VARIANT& Arg28, const VARIANT& Arg29, const VARIANT& Arg30);
LPDISPATCH GetNames();
LPDISPATCH GetRange(const VARIANT& Cell1, const VARIANT& Cell2);
LPDISPATCH GetRows();
VARIANT Run(const VARIANT& Macro, const VARIANT& Arg1, const VARIANT& Arg2, const VARIANT& Arg3, const VARIANT& Arg4, const VARIANT& Arg5, const VARIANT& Arg6, const VARIANT& Arg7, const VARIANT& Arg8, const VARIANT& Arg9,
const VARIANT& Arg10, const VARIANT& Arg11, const VARIANT& Arg12, const VARIANT& Arg13, const VARIANT& Arg14, const VARIANT& Arg15, const VARIANT& Arg16, const VARIANT& Arg17, const VARIANT& Arg18, const VARIANT& Arg19,
const VARIANT& Arg20, const VARIANT& Arg21, const VARIANT& Arg22, const VARIANT& Arg23, const VARIANT& Arg24, const VARIANT& Arg25, const VARIANT& Arg26, const VARIANT& Arg27, const VARIANT& Arg28, const VARIANT& Arg29,
const VARIANT& Arg30);
VARIANT _Run2(const VARIANT& Macro, const VARIANT& Arg1, const VARIANT& Arg2, const VARIANT& Arg3, const VARIANT& Arg4, const VARIANT& Arg5, const VARIANT& Arg6, const VARIANT& Arg7, const VARIANT& Arg8, const VARIANT& Arg9,
const VARIANT& Arg10, const VARIANT& Arg11, const VARIANT& Arg12, const VARIANT& Arg13, const VARIANT& Arg14, const VARIANT& Arg15, const VARIANT& Arg16, const VARIANT& Arg17, const VARIANT& Arg18, const VARIANT& Arg19,
const VARIANT& Arg20, const VARIANT& Arg21, const VARIANT& Arg22, const VARIANT& Arg23, const VARIANT& Arg24, const VARIANT& Arg25, const VARIANT& Arg26, const VARIANT& Arg27, const VARIANT& Arg28, const VARIANT& Arg29,
const VARIANT& Arg30);
LPDISPATCH GetSelection();
void SendKeys(const VARIANT& Keys, const VARIANT& Wait);
LPDISPATCH GetSheets();
LPDISPATCH GetThisWorkbook();
LPDISPATCH Union(LPDISPATCH Arg1, LPDISPATCH Arg2, const VARIANT& Arg3, const VARIANT& Arg4, const VARIANT& Arg5, const VARIANT& Arg6, const VARIANT& Arg7, const VARIANT& Arg8, const VARIANT& Arg9, const VARIANT& Arg10, const VARIANT& Arg11,
const VARIANT& Arg12, const VARIANT& Arg13, const VARIANT& Arg14, const VARIANT& Arg15, const VARIANT& Arg16, const VARIANT& Arg17, const VARIANT& Arg18, const VARIANT& Arg19, const VARIANT& Arg20, const VARIANT& Arg21,
const VARIANT& Arg22, const VARIANT& Arg23, const VARIANT& Arg24, const VARIANT& Arg25, const VARIANT& Arg26, const VARIANT& Arg27, const VARIANT& Arg28, const VARIANT& Arg29, const VARIANT& Arg30);
LPDISPATCH GetWindows();
LPDISPATCH GetWorkbooks();
LPDISPATCH GetWorksheetFunction();
LPDISPATCH GetWorksheets();
LPDISPATCH GetExcel4IntlMacroSheets();
LPDISPATCH GetExcel4MacroSheets();
void ActivateMicrosoftApp(long Index);
void AddChartAutoFormat(const VARIANT& Chart, LPCTSTR Name, const VARIANT& Description);
void AddCustomList(const VARIANT& ListArray, const VARIANT& ByRow);
BOOL GetAlertBeforeOverwriting();
void SetAlertBeforeOverwriting(BOOL bNewValue);
CString GetAltStartupPath();
void SetAltStartupPath(LPCTSTR lpszNewValue);
BOOL GetAskToUpdateLinks();
void SetAskToUpdateLinks(BOOL bNewValue);
BOOL GetEnableAnimations();
void SetEnableAnimations(BOOL bNewValue);
LPDISPATCH GetAutoCorrect();
long GetBuild();
BOOL GetCalculateBeforeSave();
void SetCalculateBeforeSave(BOOL bNewValue);
long GetCalculation();
void SetCalculation(long nNewValue);
VARIANT GetCaller(const VARIANT& Index);
BOOL GetCanPlaySounds();
BOOL GetCanRecordSounds();
CString GetCaption();
void SetCaption(LPCTSTR lpszNewValue);
BOOL GetCellDragAndDrop();
void SetCellDragAndDrop(BOOL bNewValue);
double CentimetersToPoints(double Centimeters);
BOOL CheckSpelling(LPCTSTR Word, const VARIANT& CustomDictionary, const VARIANT& IgnoreUppercase);
VARIANT GetClipboardFormats(const VARIANT& Index);
BOOL GetDisplayClipboardWindow();
void SetDisplayClipboardWindow(BOOL bNewValue);
long GetCommandUnderlines();
void SetCommandUnderlines(long nNewValue);
BOOL GetConstrainNumeric();
void SetConstrainNumeric(BOOL bNewValue);
VARIANT ConvertFormula(const VARIANT& Formula, long FromReferenceStyle, const VARIANT& ToReferenceStyle, const VARIANT& ToAbsolute, const VARIANT& RelativeTo);
BOOL GetCopyObjectsWithCells();
void SetCopyObjectsWithCells(BOOL bNewValue);
long GetCursor();
void SetCursor(long nNewValue);
long GetCustomListCount();
long GetCutCopyMode();
void SetCutCopyMode(long nNewValue);
long GetDataEntryMode();
void SetDataEntryMode(long nNewValue);
CString Get_Default();
CString GetDefaultFilePath();
void SetDefaultFilePath(LPCTSTR lpszNewValue);
void DeleteChartAutoFormat(LPCTSTR Name);
void DeleteCustomList(long ListNum);
LPDISPATCH GetDialogs();
BOOL GetDisplayAlerts();
void SetDisplayAlerts(BOOL bNewValue);
BOOL GetDisplayFormulaBar();
void SetDisplayFormulaBar(BOOL bNewValue);
BOOL GetDisplayFullScreen();
void SetDisplayFullScreen(BOOL bNewValue);
BOOL GetDisplayNoteIndicator();
void SetDisplayNoteIndicator(BOOL bNewValue);
long GetDisplayCommentIndicator();
void SetDisplayCommentIndicator(long nNewValue);
BOOL GetDisplayExcel4Menus();
void SetDisplayExcel4Menus(BOOL bNewValue);
BOOL GetDisplayRecentFiles();
void SetDisplayRecentFiles(BOOL bNewValue);
BOOL GetDisplayScrollBars();
void SetDisplayScrollBars(BOOL bNewValue);
BOOL GetDisplayStatusBar();
void SetDisplayStatusBar(BOOL bNewValue);
void DoubleClick();
BOOL GetEditDirectlyInCell();
void SetEditDirectlyInCell(BOOL bNewValue);
BOOL GetEnableAutoComplete();
void SetEnableAutoComplete(BOOL bNewValue);
long GetEnableCancelKey();
void SetEnableCancelKey(long nNewValue);
BOOL GetEnableSound();
void SetEnableSound(BOOL bNewValue);
VARIANT GetFileConverters(const VARIANT& Index1, const VARIANT& Index2);
LPDISPATCH GetFileSearch();
LPDISPATCH GetFileFind();
void FindFile();
BOOL GetFixedDecimal();
void SetFixedDecimal(BOOL bNewValue);
long GetFixedDecimalPlaces();
void SetFixedDecimalPlaces(long nNewValue);
VARIANT GetCustomListContents(long ListNum);
long GetCustomListNum(const VARIANT& ListArray);
VARIANT GetOpenFilename(const VARIANT& FileFilter, const VARIANT& FilterIndex, const VARIANT& Title, const VARIANT& ButtonText, const VARIANT& MultiSelect);
VARIANT GetSaveAsFilename(const VARIANT& InitialFilename, const VARIANT& FileFilter, const VARIANT& FilterIndex, const VARIANT& Title, const VARIANT& ButtonText);
void Goto(const VARIANT& Reference, const VARIANT& Scroll);
double GetHeight();
void SetHeight(double newValue);
void Help(const VARIANT& HelpFile, const VARIANT& HelpContextID);
BOOL GetIgnoreRemoteRequests();
void SetIgnoreRemoteRequests(BOOL bNewValue);
double InchesToPoints(double Inches);
VARIANT InputBox(LPCTSTR Prompt, const VARIANT& Title, const VARIANT& Default, const VARIANT& Left, const VARIANT& Top, const VARIANT& HelpFile, const VARIANT& HelpContextID, const VARIANT& Type);
BOOL GetInteractive();
void SetInteractive(BOOL bNewValue);
VARIANT GetInternational(const VARIANT& Index);
BOOL GetIteration();
void SetIteration(BOOL bNewValue);
double GetLeft();
void SetLeft(double newValue);
CString GetLibraryPath();
void MacroOptions(const VARIANT& Macro, const VARIANT& Description, const VARIANT& HasMenu, const VARIANT& MenuText, const VARIANT& HasShortcutKey, const VARIANT& ShortcutKey, const VARIANT& Category, const VARIANT& StatusBar,
const VARIANT& HelpContextID, const VARIANT& HelpFile);
void MailLogoff();
void MailLogon(const VARIANT& Name, const VARIANT& Password, const VARIANT& DownloadNewMail);
VARIANT GetMailSession();
long GetMailSystem();
BOOL GetMathCoprocessorAvailable();
double GetMaxChange();
void SetMaxChange(double newValue);
long GetMaxIterations();
void SetMaxIterations(long nNewValue);
long GetMemoryFree();
long GetMemoryTotal();
long GetMemoryUsed();
BOOL GetMouseAvailable();
BOOL GetMoveAfterReturn();
void SetMoveAfterReturn(BOOL bNewValue);
long GetMoveAfterReturnDirection();
void SetMoveAfterReturnDirection(long nNewValue);
LPDISPATCH GetRecentFiles();
CString GetName();
LPDISPATCH NextLetter();
CString GetNetworkTemplatesPath();
LPDISPATCH GetODBCErrors();
long GetODBCTimeout();
void SetODBCTimeout(long nNewValue);
void OnKey(LPCTSTR Key, const VARIANT& Procedure);
void OnRepeat(LPCTSTR Text, LPCTSTR Procedure);
void OnTime(const VARIANT& EarliestTime, LPCTSTR Procedure, const VARIANT& LatestTime, const VARIANT& Schedule);
void OnUndo(LPCTSTR Text, LPCTSTR Procedure);
CString GetOnWindow();
void SetOnWindow(LPCTSTR lpszNewValue);
CString GetOperatingSystem();
CString GetOrganizationName();
CString GetPath();
CString GetPathSeparator();
VARIANT GetPreviousSelections(const VARIANT& Index);
BOOL GetPivotTableSelection();
void SetPivotTableSelection(BOOL bNewValue);
BOOL GetPromptForSummaryInfo();
void SetPromptForSummaryInfo(BOOL bNewValue);
void Quit();
void RecordMacro(const VARIANT& BasicCode, const VARIANT& XlmCode);
BOOL GetRecordRelative();
long GetReferenceStyle();
void SetReferenceStyle(long nNewValue);
VARIANT GetRegisteredFunctions(const VARIANT& Index1, const VARIANT& Index2);
BOOL RegisterXLL(LPCTSTR Filename);
void Repeat();
BOOL GetRollZoom();
void SetRollZoom(BOOL bNewValue);
void SaveWorkspace(const VARIANT& Filename);
BOOL GetScreenUpdating();
void SetScreenUpdating(BOOL bNewValue);
void SetDefaultChart(const VARIANT& FormatName, const VARIANT& Gallery);
long GetSheetsInNewWorkbook();
void SetSheetsInNewWorkbook(long nNewValue);
BOOL GetShowChartTipNames();
void SetShowChartTipNames(BOOL bNewValue);
BOOL GetShowChartTipValues();
void SetShowChartTipValues(BOOL bNewValue);
CString GetStandardFont();
void SetStandardFont(LPCTSTR lpszNewValue);
double GetStandardFontSize();
void SetStandardFontSize(double newValue);
CString GetStartupPath();
VARIANT GetStatusBar();
void SetStatusBar(const VARIANT& newValue);
CString GetTemplatesPath();
BOOL GetShowToolTips();
void SetShowToolTips(BOOL bNewValue);
double GetTop();
void SetTop(double newValue);
long GetDefaultSaveFormat();
void SetDefaultSaveFormat(long nNewValue);
CString GetTransitionMenuKey();
void SetTransitionMenuKey(LPCTSTR lpszNewValue);
long GetTransitionMenuKeyAction();
void SetTransitionMenuKeyAction(long nNewValue);
BOOL GetTransitionNavigKeys();
void SetTransitionNavigKeys(BOOL bNewValue);
void Undo();
double GetUsableHeight();
double GetUsableWidth();
BOOL GetUserControl();
void SetUserControl(BOOL bNewValue);
CString GetUserName_();
void SetUserName(LPCTSTR lpszNewValue);
CString GetValue();
LPDISPATCH GetVbe();
CString GetVersion();
BOOL GetVisible();
void SetVisible(BOOL bNewValue);
void Volatile(const VARIANT& Volatile);
void Wait(const VARIANT& Time);
double GetWidth();
void SetWidth(double newValue);
BOOL GetWindowsForPens();
long GetWindowState();
void SetWindowState(long nNewValue);
long GetUILanguage();
void SetUILanguage(long nNewValue);
long GetDefaultSheetDirection();
void SetDefaultSheetDirection(long nNewValue);
long GetCursorMovement();
void SetCursorMovement(long nNewValue);
long GetControlCharacters();
void SetControlCharacters(long nNewValue);
BOOL GetEnableEvents();
void SetEnableEvents(BOOL bNewValue);
};
/////////////////////////////////////////////////////////////////////////////
// _Workbook wrapper class
class _Workbook : public COleDispatchDriver
{
public:
_Workbook() {} // Calls COleDispatchDriver default constructor
_Workbook(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
_Workbook(const _Workbook& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
BOOL GetAcceptLabelsInFormulas();
void SetAcceptLabelsInFormulas(BOOL bNewValue);
void Activate();
LPDISPATCH GetActiveChart();
LPDISPATCH GetActiveSheet();
long GetAutoUpdateFrequency();
void SetAutoUpdateFrequency(long nNewValue);
BOOL GetAutoUpdateSaveChanges();
void SetAutoUpdateSaveChanges(BOOL bNewValue);
long GetChangeHistoryDuration();
void SetChangeHistoryDuration(long nNewValue);
LPDISPATCH GetBuiltinDocumentProperties();
void ChangeFileAccess(long Mode, const VARIANT& WritePassword, const VARIANT& Notify);
void ChangeLink(LPCTSTR Name, LPCTSTR NewName, long Type);
LPDISPATCH GetCharts();
void Close(const VARIANT& SaveChanges, const VARIANT& Filename, const VARIANT& RouteWorkbook);
CString GetCodeName();
CString Get_CodeName();
void Set_CodeName(LPCTSTR lpszNewValue);
VARIANT GetColors(const VARIANT& Index);
void SetColors(const VARIANT& Index, const VARIANT& newValue);
LPDISPATCH GetCommandBars();
long GetConflictResolution();
void SetConflictResolution(long nNewValue);
LPDISPATCH GetContainer();
BOOL GetCreateBackup();
LPDISPATCH GetCustomDocumentProperties();
BOOL GetDate1904();
void SetDate1904(BOOL bNewValue);
void DeleteNumberFormat(LPCTSTR NumberFormat);
long GetDisplayDrawingObjects();
void SetDisplayDrawingObjects(long nNewValue);
BOOL ExclusiveAccess();
long GetFileFormat();
void ForwardMailer();
CString GetFullName();
BOOL GetHasPassword();
BOOL GetHasRoutingSlip();
void SetHasRoutingSlip(BOOL bNewValue);
BOOL GetIsAddin();
void SetIsAddin(BOOL bNewValue);
VARIANT LinkInfo(LPCTSTR Name, long LinkInfo, const VARIANT& Type, const VARIANT& EditionRef);
VARIANT LinkSources(const VARIANT& Type);
LPDISPATCH GetMailer();
void MergeWorkbook(const VARIANT& Filename);
BOOL GetMultiUserEditing();
CString GetName();
LPDISPATCH GetNames();
LPDISPATCH NewWindow();
void OpenLinks(LPCTSTR Name, const VARIANT& ReadOnly, const VARIANT& Type);
CString GetPath();
BOOL GetPersonalViewListSettings();
void SetPersonalViewListSettings(BOOL bNewValue);
BOOL GetPersonalViewPrintSettings();
void SetPersonalViewPrintSettings(BOOL bNewValue);
LPDISPATCH PivotCaches();
void Post(const VARIANT& DestName);
BOOL GetPrecisionAsDisplayed();
void SetPrecisionAsDisplayed(BOOL bNewValue);
void PrintOut(const VARIANT& From, const VARIANT& To, const VARIANT& Copies, const VARIANT& Preview, const VARIANT& ActivePrinter, const VARIANT& PrintToFile, const VARIANT& Collate);
void PrintPreview(const VARIANT& EnableChanges);
void Protect(const VARIANT& Password, const VARIANT& Structure, const VARIANT& Windows);
void ProtectSharing(const VARIANT& Filename, const VARIANT& Password, const VARIANT& WriteResPassword, const VARIANT& ReadOnlyRecommended, const VARIANT& CreateBackup, const VARIANT& SharingPassword);
BOOL GetProtectStructure();
BOOL GetProtectWindows();
BOOL GetReadOnly();
BOOL GetReadOnlyRecommended();
void RefreshAll();
void Reply();
void ReplyAll();
void RemoveUser(long Index);
long GetRevisionNumber();
void Route();
BOOL GetRouted();
LPDISPATCH GetRoutingSlip();
void RunAutoMacros(long Which);
void Save();
void SaveAs(const VARIANT& Filename, const VARIANT& FileFormat, const VARIANT& Password, const VARIANT& WriteResPassword, const VARIANT& ReadOnlyRecommended, const VARIANT& CreateBackup, long AccessMode, const VARIANT& ConflictResolution,
const VARIANT& AddToMru, const VARIANT& TextCodepage, const VARIANT& TextVisualLayout);
void SaveCopyAs(const VARIANT& Filename);
BOOL GetSaved();
void SetSaved(BOOL bNewValue);
BOOL GetSaveLinkValues();
void SetSaveLinkValues(BOOL bNewValue);
void SendMail(const VARIANT& Recipients, const VARIANT& Subject, const VARIANT& ReturnReceipt);
void SendMailer(const VARIANT& FileFormat, long Priority);
void SetLinkOnData(LPCTSTR Name, const VARIANT& Procedure);
LPDISPATCH GetSheets();
BOOL GetShowConflictHistory();
void SetShowConflictHistory(BOOL bNewValue);
LPDISPATCH GetStyles();
void Unprotect(const VARIANT& Password);
void UnprotectSharing(const VARIANT& SharingPassword);
void UpdateFromFile();
void UpdateLink(const VARIANT& Name, const VARIANT& Type);
BOOL GetUpdateRemoteReferences();
void SetUpdateRemoteReferences(BOOL bNewValue);
VARIANT GetUserStatus();
LPDISPATCH GetCustomViews();
LPDISPATCH GetWindows();
LPDISPATCH GetWorksheets();
BOOL GetWriteReserved();
CString GetWriteReservedBy();
LPDISPATCH GetExcel4IntlMacroSheets();
LPDISPATCH GetExcel4MacroSheets();
BOOL GetTemplateRemoveExtData();
void SetTemplateRemoveExtData(BOOL bNewValue);
void HighlightChangesOptions(const VARIANT& When, const VARIANT& Who, const VARIANT& Where);
BOOL GetHighlightChangesOnScreen();
void SetHighlightChangesOnScreen(BOOL bNewValue);
BOOL GetKeepChangeHistory();
void SetKeepChangeHistory(BOOL bNewValue);
BOOL GetListChangesOnNewSheet();
void SetListChangesOnNewSheet(BOOL bNewValue);
void PurgeChangeHistoryNow(long Days, const VARIANT& SharingPassword);
void AcceptAllChanges(const VARIANT& When, const VARIANT& Who, const VARIANT& Where);
void RejectAllChanges(const VARIANT& When, const VARIANT& Who, const VARIANT& Where);
void ResetColors();
LPDISPATCH GetVBProject();
void FollowHyperlink(LPCTSTR Address, const VARIANT& SubAddress, const VARIANT& NewWindow, const VARIANT& AddHistory, const VARIANT& ExtraInfo, const VARIANT& Method, const VARIANT& HeaderInfo);
void AddToFavorites();
BOOL GetIsInplace();
};
/////////////////////////////////////////////////////////////////////////////
// _Worksheet wrapper class
class _Worksheet : public COleDispatchDriver
{
public:
_Worksheet() {} // Calls COleDispatchDriver default constructor
_Worksheet(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
_Worksheet(const _Worksheet& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
void Activate();
void Copy(const VARIANT& Before, const VARIANT& After);
void Delete();
CString GetCodeName();
CString Get_CodeName();
void Set_CodeName(LPCTSTR lpszNewValue);
long GetIndex();
void Move(const VARIANT& Before, const VARIANT& After);
CString GetName();
void SetName(LPCTSTR lpszNewValue);
LPDISPATCH GetNext();
LPDISPATCH GetPageSetup();
LPDISPATCH GetPrevious();
void PrintOut(const VARIANT& From, const VARIANT& To, const VARIANT& Copies, const VARIANT& Preview, const VARIANT& ActivePrinter, const VARIANT& PrintToFile, const VARIANT& Collate);
void PrintPreview(const VARIANT& EnableChanges);
void Protect(const VARIANT& Password, const VARIANT& DrawingObjects, const VARIANT& Contents, const VARIANT& Scenarios, const VARIANT& UserInterfaceOnly);
BOOL GetProtectContents();
BOOL GetProtectDrawingObjects();
BOOL GetProtectionMode();
BOOL GetProtectScenarios();
void SaveAs(LPCTSTR Filename, const VARIANT& FileFormat, const VARIANT& Password, const VARIANT& WriteResPassword, const VARIANT& ReadOnlyRecommended, const VARIANT& CreateBackup, const VARIANT& AddToMru, const VARIANT& TextCodepage,
const VARIANT& TextVisualLayout);
void Select(const VARIANT& Replace);
void Unprotect(const VARIANT& Password);
long GetVisible();
void SetVisible(long nNewValue);
LPDISPATCH GetShapes();
BOOL GetTransitionExpEval();
void SetTransitionExpEval(BOOL bNewValue);
BOOL GetAutoFilterMode();
void SetAutoFilterMode(BOOL bNewValue);
void SetBackgroundPicture(LPCTSTR Filename);
void Calculate();
BOOL GetEnableCalculation();
void SetEnableCalculation(BOOL bNewValue);
LPDISPATCH GetCells();
LPDISPATCH ChartObjects(const VARIANT& Index);
void CheckSpelling(const VARIANT& CustomDictionary, const VARIANT& IgnoreUppercase, const VARIANT& AlwaysSuggest, const VARIANT& IgnoreInitialAlefHamza, const VARIANT& IgnoreFinalYaa, const VARIANT& SpellScript);
LPDISPATCH GetCircularReference();
void ClearArrows();
LPDISPATCH GetColumns();
long GetConsolidationFunction();
VARIANT GetConsolidationOptions();
VARIANT GetConsolidationSources();
BOOL GetEnableAutoFilter();
void SetEnableAutoFilter(BOOL bNewValue);
long GetEnableSelection();
void SetEnableSelection(long nNewValue);
BOOL GetEnableOutlining();
void SetEnableOutlining(BOOL bNewValue);
BOOL GetEnablePivotTable();
void SetEnablePivotTable(BOOL bNewValue);
VARIANT Evaluate(const VARIANT& Name);
VARIANT _Evaluate(const VARIANT& Name);
BOOL GetFilterMode();
void ResetAllPageBreaks();
LPDISPATCH GetNames();
LPDISPATCH OLEObjects(const VARIANT& Index);
LPDISPATCH GetOutline();
void Paste(const VARIANT& Destination, const VARIANT& Link);
void PasteSpecial(const VARIANT& Format, const VARIANT& Link, const VARIANT& DisplayAsIcon, const VARIANT& IconFileName, const VARIANT& IconIndex, const VARIANT& IconLabel);
LPDISPATCH PivotTables(const VARIANT& Index);
LPDISPATCH PivotTableWizard(const VARIANT& SourceType, const VARIANT& SourceData, const VARIANT& TableDestination, const VARIANT& TableName, const VARIANT& RowGrand, const VARIANT& ColumnGrand, const VARIANT& SaveData,
const VARIANT& HasAutoFormat, const VARIANT& AutoPage, const VARIANT& Reserved, const VARIANT& BackgroundQuery, const VARIANT& OptimizeCache, const VARIANT& PageFieldOrder, const VARIANT& PageFieldWrapCount, const VARIANT& ReadData,
const VARIANT& Connection);
LPDISPATCH GetRange(const VARIANT& Cell1, const VARIANT& Cell2);
LPDISPATCH GetRows();
LPDISPATCH Scenarios(const VARIANT& Index);
CString GetScrollArea();
void SetScrollArea(LPCTSTR lpszNewValue);
void ShowAllData();
void ShowDataForm();
double GetStandardHeight();
double GetStandardWidth();
void SetStandardWidth(double newValue);
BOOL GetTransitionFormEntry();
void SetTransitionFormEntry(BOOL bNewValue);
long GetType();
LPDISPATCH GetUsedRange();
LPDISPATCH GetHPageBreaks();
LPDISPATCH GetVPageBreaks();
LPDISPATCH GetQueryTables();
BOOL GetDisplayPageBreaks();
void SetDisplayPageBreaks(BOOL bNewValue);
LPDISPATCH GetComments();
LPDISPATCH GetHyperlinks();
void ClearCircles();
void CircleInvalid();
LPDISPATCH GetAutoFilter();
};
/////////////////////////////////////////////////////////////////////////////
// Range wrapper class
class Range : public COleDispatchDriver
{
public:
Range() {} // Calls COleDispatchDriver default constructor
Range(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
Range(const Range& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
void Activate();
VARIANT GetAddIndent();
void SetAddIndent(const VARIANT& newValue);
CString GetAddress(const VARIANT& RowAbsolute, const VARIANT& ColumnAbsolute, long ReferenceStyle, const VARIANT& External, const VARIANT& RelativeTo);
CString GetAddressLocal(const VARIANT& RowAbsolute, const VARIANT& ColumnAbsolute, long ReferenceStyle, const VARIANT& External, const VARIANT& RelativeTo);
void AdvancedFilter(long Action, const VARIANT& CriteriaRange, const VARIANT& CopyToRange, const VARIANT& Unique);
void ApplyNames(const VARIANT& Names, const VARIANT& IgnoreRelativeAbsolute, const VARIANT& UseRowColumnNames, const VARIANT& OmitColumn, const VARIANT& OmitRow, long Order, const VARIANT& AppendLast);
void ApplyOutlineStyles();
LPDISPATCH GetAreas();
CString AutoComplete(LPCTSTR String);
void AutoFill(LPDISPATCH Destination, long Type);
void AutoFilter(const VARIANT& Field, const VARIANT& Criteria1, long Operator, const VARIANT& Criteria2, const VARIANT& VisibleDropDown);
void AutoFit();
void AutoFormat(long Format, const VARIANT& Number, const VARIANT& Font, const VARIANT& Alignment, const VARIANT& Border, const VARIANT& Pattern, const VARIANT& Width);
void AutoOutline();
void BorderAround(const VARIANT& LineStyle, long Weight, long ColorIndex, const VARIANT& Color);
LPDISPATCH GetBorders();
void Calculate();
LPDISPATCH GetCells();
LPDISPATCH GetCharacters(const VARIANT& Start, const VARIANT& Length);
void CheckSpelling(const VARIANT& CustomDictionary, const VARIANT& IgnoreUppercase, const VARIANT& AlwaysSuggest, const VARIANT& IgnoreInitialAlefHamza, const VARIANT& IgnoreFinalYaa, const VARIANT& SpellScript);
void Clear();
void ClearContents();
void ClearFormats();
void ClearNotes();
void ClearOutline();
long GetColumn();
LPDISPATCH ColumnDifferences(const VARIANT& Comparison);
LPDISPATCH GetColumns();
VARIANT GetColumnWidth();
void SetColumnWidth(const VARIANT& newValue);
void Consolidate(const VARIANT& Sources, const VARIANT& Function, const VARIANT& TopRow, const VARIANT& LeftColumn, const VARIANT& CreateLinks);
void Copy(const VARIANT& Destination);
long CopyFromRecordset(LPUNKNOWN Data, const VARIANT& MaxRows, const VARIANT& MaxColumns);
void CopyPicture(long Appearance, long Format);
long GetCount();
void CreateNames(const VARIANT& Top, const VARIANT& Left, const VARIANT& Bottom, const VARIANT& Right);
void CreatePublisher(const VARIANT& Edition, long Appearance, const VARIANT& ContainsPICT, const VARIANT& ContainsBIFF, const VARIANT& ContainsRTF, const VARIANT& ContainsVALU);
LPDISPATCH GetCurrentArray();
LPDISPATCH GetCurrentRegion();
void Cut(const VARIANT& Destination);
void DataSeries(const VARIANT& Rowcol, long Type, long Date, const VARIANT& Step, const VARIANT& Stop, const VARIANT& Trend);
VARIANT Get_Default(const VARIANT& RowIndex, const VARIANT& ColumnIndex);
void Set_Default(const VARIANT& RowIndex, const VARIANT& ColumnIndex, const VARIANT& newValue);
void Delete(const VARIANT& Shift);
LPDISPATCH GetDependents();
VARIANT DialogBox_();
LPDISPATCH GetDirectDependents();
LPDISPATCH GetDirectPrecedents();
VARIANT EditionOptions(long Type, long Option, const VARIANT& Name, const VARIANT& Reference, long Appearance, long ChartSize, const VARIANT& Format);
LPDISPATCH GetEnd(long Direction);
LPDISPATCH GetEntireColumn();
LPDISPATCH GetEntireRow();
void FillDown();
void FillLeft();
void FillRight();
void FillUp();
LPDISPATCH Find(const VARIANT& What, const VARIANT& After, const VARIANT& LookIn, const VARIANT& LookAt, const VARIANT& SearchOrder, long SearchDirection, const VARIANT& MatchCase, const VARIANT& MatchByte,
const VARIANT& MatchControlCharacters, const VARIANT& MatchDiacritics, const VARIANT& MatchKashida, const VARIANT& MatchAlefHamza);
LPDISPATCH FindNext(const VARIANT& After);
LPDISPATCH FindPrevious(const VARIANT& After);
LPDISPATCH GetFont();
VARIANT GetFormula();
void SetFormula(const VARIANT& newValue);
VARIANT GetFormulaArray();
void SetFormulaArray(const VARIANT& newValue);
long GetFormulaLabel();
void SetFormulaLabel(long nNewValue);
VARIANT GetFormulaHidden();
void SetFormulaHidden(const VARIANT& newValue);
VARIANT GetFormulaLocal();
void SetFormulaLocal(const VARIANT& newValue);
VARIANT GetFormulaR1C1();
void SetFormulaR1C1(const VARIANT& newValue);
VARIANT GetFormulaR1C1Local();
void SetFormulaR1C1Local(const VARIANT& newValue);
void FunctionWizard();
BOOL GoalSeek(const VARIANT& Goal, LPDISPATCH ChangingCell);
VARIANT Group(const VARIANT& Start, const VARIANT& End, const VARIANT& By, const VARIANT& Periods);
VARIANT GetHasArray();
VARIANT GetHasFormula();
VARIANT GetHeight();
VARIANT GetHidden();
void SetHidden(const VARIANT& newValue);
VARIANT GetHorizontalAlignment();
void SetHorizontalAlignment(const VARIANT& newValue);
VARIANT GetIndentLevel();
void SetIndentLevel(const VARIANT& newValue);
void InsertIndent(long InsertAmount);
void Insert(const VARIANT& Shift);
LPDISPATCH GetInterior();
VARIANT GetItem(const VARIANT& RowIndex, const VARIANT& ColumnIndex);
void SetItem(const VARIANT& RowIndex, const VARIANT& ColumnIndex, const VARIANT& newValue);
void Justify();
VARIANT GetLeft();
long GetListHeaderRows();
void ListNames();
long GetLocationInTable();
VARIANT GetLocked();
void SetLocked(const VARIANT& newValue);
void Merge(const VARIANT& Across);
void UnMerge();
LPDISPATCH GetMergeArea();
VARIANT GetMergeCells();
void SetMergeCells(const VARIANT& newValue);
VARIANT GetName();
void SetName(const VARIANT& newValue);
void NavigateArrow(const VARIANT& TowardPrecedent, const VARIANT& ArrowNumber, const VARIANT& LinkNumber);
LPUNKNOWN Get_NewEnum();
LPDISPATCH GetNext();
CString NoteText(const VARIANT& Text, const VARIANT& Start, const VARIANT& Length);
VARIANT GetNumberFormat();
void SetNumberFormat(const VARIANT& newValue);
VARIANT GetNumberFormatLocal();
void SetNumberFormatLocal(const VARIANT& newValue);
LPDISPATCH GetOffset(const VARIANT& RowOffset, const VARIANT& ColumnOffset);
VARIANT GetOrientation();
void SetOrientation(const VARIANT& newValue);
VARIANT GetOutlineLevel();
void SetOutlineLevel(const VARIANT& newValue);
long GetPageBreak();
void SetPageBreak(long nNewValue);
void Parse(const VARIANT& ParseLine, const VARIANT& Destination);
void PasteSpecial(long Paste, long Operation, const VARIANT& SkipBlanks, const VARIANT& Transpose);
LPDISPATCH GetPivotField();
LPDISPATCH GetPivotItem();
LPDISPATCH GetPivotTable();
LPDISPATCH GetPrecedents();
VARIANT GetPrefixCharacter();
LPDISPATCH GetPrevious();
void PrintOut(const VARIANT& From, const VARIANT& To, const VARIANT& Copies, const VARIANT& Preview, const VARIANT& ActivePrinter, const VARIANT& PrintToFile, const VARIANT& Collate);
void PrintPreview(const VARIANT& EnableChanges);
LPDISPATCH GetQueryTable();
LPDISPATCH GetRange(const VARIANT& Cell1, const VARIANT& Cell2);
void RemoveSubtotal();
BOOL Replace(const VARIANT& What, const VARIANT& Replacement, const VARIANT& LookAt, const VARIANT& SearchOrder, const VARIANT& MatchCase, const VARIANT& MatchByte, const VARIANT& MatchControlCharacters, const VARIANT& MatchDiacritics,
const VARIANT& MatchKashida, const VARIANT& MatchAlefHamza);
LPDISPATCH GetResize(const VARIANT& RowSize, const VARIANT& ColumnSize);
long GetRow();
LPDISPATCH RowDifferences(const VARIANT& Comparison);
VARIANT GetRowHeight();
void SetRowHeight(const VARIANT& newValue);
LPDISPATCH GetRows();
VARIANT Run(const VARIANT& Arg1, const VARIANT& Arg2, const VARIANT& Arg3, const VARIANT& Arg4, const VARIANT& Arg5, const VARIANT& Arg6, const VARIANT& Arg7, const VARIANT& Arg8, const VARIANT& Arg9, const VARIANT& Arg10,
const VARIANT& Arg11, const VARIANT& Arg12, const VARIANT& Arg13, const VARIANT& Arg14, const VARIANT& Arg15, const VARIANT& Arg16, const VARIANT& Arg17, const VARIANT& Arg18, const VARIANT& Arg19, const VARIANT& Arg20,
const VARIANT& Arg21, const VARIANT& Arg22, const VARIANT& Arg23, const VARIANT& Arg24, const VARIANT& Arg25, const VARIANT& Arg26, const VARIANT& Arg27, const VARIANT& Arg28, const VARIANT& Arg29, const VARIANT& Arg30);
void Select();
void Show();
void ShowDependents(const VARIANT& Remove);
VARIANT GetShowDetail();
void SetShowDetail(const VARIANT& newValue);
void ShowErrors();
void ShowPrecedents(const VARIANT& Remove);
VARIANT GetShrinkToFit();
void SetShrinkToFit(const VARIANT& newValue);
void Sort(const VARIANT& Key1, long Order1, const VARIANT& Key2, const VARIANT& Type, long Order2, const VARIANT& Key3, long Order3, long Header, const VARIANT& OrderCustom, const VARIANT& MatchCase, long Orientation, long SortMethod,
const VARIANT& IgnoreControlCharacters, const VARIANT& IgnoreDiacritics, const VARIANT& IgnoreKashida);
void SortSpecial(long SortMethod, const VARIANT& Key1, long Order1, const VARIANT& Type, const VARIANT& Key2, long Order2, const VARIANT& Key3, long Order3, long Header, const VARIANT& OrderCustom, const VARIANT& MatchCase, long Orientation);
LPDISPATCH GetSoundNote();
LPDISPATCH SpecialCells(long Type, const VARIANT& Value);
VARIANT GetStyle();
void SetStyle(const VARIANT& newValue);
void SubscribeTo(LPCTSTR Edition, long Format);
void Subtotal(long GroupBy, long Function, const VARIANT& TotalList, const VARIANT& Replace, const VARIANT& PageBreaks, long SummaryBelowData);
VARIANT GetSummary();
void Table(const VARIANT& RowInput, const VARIANT& ColumnInput);
VARIANT GetText();
void TextToColumns(const VARIANT& Destination, long DataType, long TextQualifier, const VARIANT& ConsecutiveDelimiter, const VARIANT& Tab, const VARIANT& Semicolon, const VARIANT& Comma, const VARIANT& Space, const VARIANT& Other,
const VARIANT& OtherChar, const VARIANT& FieldInfo);
VARIANT GetTop();
void Ungroup();
VARIANT GetUseStandardHeight();
void SetUseStandardHeight(const VARIANT& newValue);
VARIANT GetUseStandardWidth();
void SetUseStandardWidth(const VARIANT& newValue);
LPDISPATCH GetValidation();
VARIANT GetValue();
void SetValue(const VARIANT& newValue);
VARIANT GetValue2();
void SetValue2(const VARIANT& newValue);
VARIANT GetVerticalAlignment();
void SetVerticalAlignment(const VARIANT& newValue);
VARIANT GetWidth();
LPDISPATCH GetWorksheet();
VARIANT GetWrapText();
void SetWrapText(const VARIANT& newValue);
LPDISPATCH AddComment(const VARIANT& Text);
LPDISPATCH GetComment();
void ClearComments();
LPDISPATCH GetPhonetic();
LPDISPATCH GetFormatConditions();
long GetReadingOrder();
void SetReadingOrder(long nNewValue);
LPDISPATCH GetHyperlinks();
};
/////////////////////////////////////////////////////////////////////////////
// Border wrapper class
class Border : public COleDispatchDriver
{
public:
Border() {} // Calls COleDispatchDriver default constructor
Border(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
Border(const Border& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
VARIANT GetColor();
void SetColor(const VARIANT& newValue);
VARIANT GetColorIndex();
void SetColorIndex(const VARIANT& newValue);
VARIANT GetLineStyle();
void SetLineStyle(const VARIANT& newValue);
VARIANT GetWeight();
void SetWeight(const VARIANT& newValue);
};
/////////////////////////////////////////////////////////////////////////////
// Borders wrapper class
class Borders : public COleDispatchDriver
{
public:
Borders() {} // Calls COleDispatchDriver default constructor
Borders(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
Borders(const Borders& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
VARIANT GetColor();
void SetColor(const VARIANT& newValue);
VARIANT GetColorIndex();
void SetColorIndex(const VARIANT& newValue);
long GetCount();
LPDISPATCH GetItem(long Index);
VARIANT GetLineStyle();
void SetLineStyle(const VARIANT& newValue);
LPUNKNOWN Get_NewEnum();
VARIANT GetValue();
void SetValue(const VARIANT& newValue);
VARIANT GetWeight();
void SetWeight(const VARIANT& newValue);
LPDISPATCH Get_Default(long Index);
};
/////////////////////////////////////////////////////////////////////////////
// Interior wrapper class
class Interior : public COleDispatchDriver
{
public:
Interior() {} // Calls COleDispatchDriver default constructor
Interior(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
Interior(const Interior& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
LPDISPATCH GetApplication();
long GetCreator();
LPDISPATCH GetParent();
VARIANT GetColor();
void SetColor(const VARIANT& newValue);
VARIANT GetColorIndex();
void SetColorIndex(const VARIANT& newValue);
VARIANT GetInvertIfNegative();
void SetInvertIfNegative(const VARIANT& newValue);
VARIANT GetPattern();
void SetPattern(const VARIANT& newValue);
VARIANT GetPatternColor();
void SetPatternColor(const VARIANT& newValue);
VARIANT GetPatternColorIndex();
void SetPatternColorIndex(const VARIANT& newValue);
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,110 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// expimp.h
//
#ifndef __EXPIMP_H
#define __EXPIMP_H
#include "transDB.h"
#include "noxstringdlg.h"
typedef enum
{
TR_ALL,
TR_CHANGES,
TR_DIALOG,
TR_NONDIALOG,
TR_SAMPLE,
TR_MISSING_DIALOG,
TR_UNVERIFIED,
TR_UNSENT
} TrFilter;
typedef struct
{
TrFilter filter;
int include_comments;
int include_translations;
} TROPTIONS;
typedef enum
{
GN_UNICODE,
GN_NOXSTR,
} GnFormat;
typedef enum
{
GN_USEIDS,
GN_USEORIGINAL,
} GnUntranslated;
typedef struct
{
GnFormat format; // what file format to generate
GnUntranslated untranslated; // what to do with untranslated text
} GNOPTIONS;
typedef struct
{
int translations;
int dialog;
int limit;
} RPOPTIONS;
#define CSF_ID ( ('C'<<24) | ('S'<<16) | ('F'<<8) | (' ') )
#define CSF_LABEL ( ('L'<<24) | ('B'<<16) | ('L'<<8) | (' ') )
#define CSF_STRING ( ('S'<<24) | ('T'<<16) | ('R'<<8) | (' ') )
#define CSF_STRINGWITHWAVE ( ('S'<<24) | ('T'<<16) | ('R'<<8) | ('W') )
#define CSF_VERSION 3
typedef struct
{
int id;
int version;
int num_labels;
int num_strings;
int skip;
} CSF_HEADER_V1;
typedef struct
{
int id;
int version;
int num_labels;
int num_strings;
int skip;
int langid;
} CSF_HEADER;
int ExportTranslations ( TransDB *db, const char *filename, LangID langid, TROPTIONS *options, CNoxstringDlg *dlg = NULL );
int ImportTranslations ( TransDB *db, const char *filename, CNoxstringDlg *dlg = NULL );
int UpdateSentTranslations ( TransDB *db, const char *filename, CNoxstringDlg *dlg = NULL );
int GenerateGameFiles ( TransDB *db, const char *filename, GNOPTIONS *option, LangID *languages, CNoxstringDlg *dlg = NULL );
int GenerateReport ( TransDB *db, const char *filename, RPOPTIONS *options, LangID *languages, CNoxstringDlg *dlg = NULL );
void ProcessWaves ( TransDB *db, const char *filename, CNoxstringDlg *dlg );
#endif

View file

@ -0,0 +1,108 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// fileops.cpp
//
#include "stdAfx.h"
#include "fileops.h"
int FileExists ( const char *filename )
{
int fa = FileAttribs ( filename );
return ! ( (fa == FA_NOFILE) || (fa & FA_DIRECTORY ));
}
int FileAttribs ( const char *filename )
{
WIN32_FIND_DATA fi;
HANDLE handle;
int fa = FA_NOFILE;
handle = FindFirstFile ( filename, &fi );
if ( handle != INVALID_HANDLE_VALUE )
{
if ( fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
fa |= FA_DIRECTORY;
}
if ( fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY )
{
fa |= FA_READONLY;
}
else
{
fa |= FA_WRITEABLE;
}
FindClose ( handle );
}
return fa;
}
static void make_bk_name ( char *bkname, const char *filename )
{
char *ext, *ext1;
strcpy ( bkname, filename );
ext = strchr ( filename, '.' );
ext1 = strchr ( bkname, '.' );
if ( ext )
{
strcpy ( ext1, "_back_up" );
strcat ( ext1, ext );
}
else
{
strcat ( bkname, "_back_up" );
}
}
void MakeBackupFile ( const char *filename )
{
char bkname[256];
make_bk_name ( bkname, filename );
CopyFile ( filename, bkname, FALSE );
}
void RestoreBackupFile ( const char *filename )
{
char bkname[256];
make_bk_name ( bkname, filename );
if ( FileExists ( bkname ))
{
CopyFile ( bkname, filename, FALSE );
}
}

View file

@ -0,0 +1,38 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// File IO support
//
#ifndef __FILEOPS_H
#define __FILEOPS_H
static const int FA_NOFILE = 0;
static const int FA_READONLY = 0x00000001;
static const int FA_DIRECTORY = 0x00000002;
static const int FA_WRITEABLE = 0x00000004;
int FileExists ( const char *filename );
int FileAttribs ( const char *filename );
void MakeBackupFile ( const char *filename );
void RestoreBackupFile ( const char *filename );
#endif // __FILEIO_H

View file

@ -0,0 +1,553 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdAfx.h"
#include "sys/stat.h"
#include "iff.h"
#include <fcntl.h>
#include <io.h>
#include <stdlib.h>
#include <stdio.h>
#define IFF_RAWREAD(iff,data,size,label) {if ( IFF_rawread ( (iff), (data), (size)) != (size)) goto label;}
int IFF_rawread ( IFF_FILE *iff, void *buffer, int bytes )
{
if ( ! (iff->flags & mIFF_FILE_LOADED ) )
{
return _read ( iff->fp, buffer, bytes );
}
if ( iff->file_size < (iff->file_pos + bytes) )
{
bytes = iff->file_size - iff->file_pos;
}
memcpy ( buffer, &iff->mem_file[iff->file_pos], bytes );
iff->file_pos += bytes;
return bytes;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_seek ( IFF_FILE *iff, int pos, int mode )
{
if ( ! (iff->flags & mIFF_FILE_LOADED ))
{
return lseek ( iff->fp, pos, mode );
}
switch ( mode )
{
case SEEK_CUR:
iff->file_pos += pos;
break;
case SEEK_END:
iff->file_pos = iff->file_size - pos;
break;
case SEEK_SET:
iff->file_pos = pos;
break;
}
if ( iff->file_pos < 0 )
{
iff->file_pos = 0;
}
else
{
if ( iff->file_pos > iff->file_size )
{
iff->file_pos = iff->file_size;
}
}
return iff->file_pos;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
IFF_FILE *IFF_Open ( const char *name )
{
IFF_FILE *iff = NULL;
if ( ! (iff = (IFF_FILE *) malloc ( sizeof (IFF_FILE))))
{
goto error;
}
iff->fp = -1;
memset ( iff, 0, sizeof ( IFF_FILE ));
if ((iff->fp = open ( name, _O_BINARY | _O_RDONLY )) == -1 )
{
goto error;
}
return iff;
error:
if (iff)
{
IFF_Close ( iff );
}
return NULL;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
IFF_FILE *IFF_Load ( const char *name )
{
IFF_FILE *iff = NULL;
if ( ! (iff = (IFF_FILE *) malloc ( sizeof (IFF_FILE))))
{
goto error;
}
memset ( iff, 0, sizeof ( IFF_FILE ));
iff->fp = -1;
if ((iff->fp = open ( name, _O_BINARY | _O_RDONLY )) == -1 )
{
goto error;
}
iff->file_size = lseek ( iff->fp, 0, SEEK_END );
lseek ( iff->fp, 0, SEEK_SET );
if ( !(iff->mem_file = ( char *) malloc ( iff->file_size) ) )
{
goto error;
}
DO_READ ( iff->fp, iff->mem_file, iff->file_size, error );
iff->flags |= mIFF_FILE_LOADED;
return iff;
error:
if (iff)
{
IFF_Close ( iff );
}
return NULL;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
void IFF_Reset ( IFF_FILE *iff )
{
IFF_seek ( iff, 0, SEEK_SET );
iff->pad_form = 0;
iff->pad_chunk = 0;
iff->FormSize = 0;
iff->ChunkSize = 0;
iff->next_byte = 0;
iff->chunk_size_pos = 0;
iff->form_size_pos = 0;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
void IFF_goto_form_end ( IFF_FILE *iff )
{
iff->FormSize += iff->pad_form;
iff->pad_form = 0;
if (iff->FormSize)
{
IFF_seek ( iff, iff->FormSize, SEEK_CUR );
iff->next_byte += iff->FormSize;
iff->FormSize = 0;
iff->ChunkSize = 0;
}
}
/******************************************************************/
/* */
/* */
/******************************************************************/
void IFF_goto_chunk_end ( IFF_FILE *iff )
{
iff->ChunkSize += iff->pad_chunk;
iff->pad_chunk = 0;
if (iff->ChunkSize)
{
IFF_seek ( iff, iff->ChunkSize, SEEK_CUR );
iff->next_byte += iff->ChunkSize;
iff->FormSize -= iff->ChunkSize;
iff->ChunkSize = 0;
}
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_NextForm ( IFF_FILE *iff )
{
IFF_CHUNK chunk;
int form;
IFF_goto_form_end ( iff );
IFF_RAWREAD (iff, &chunk, sizeof( IFF_CHUNK ), error );
chunk.Size = BgEn32 (chunk.Size);
chunk.ID = BgEn32 (chunk.ID);
iff->pad_form = (int) (chunk.Size & 0x0001);
if (chunk.ID != vIFF_ID_FORM )
{
goto error;
}
IFF_RAWREAD (iff, &form, sizeof( int ), error);
iff->FormID = (int) BgEn32 (form);
iff->flags |= mIFF_FILE_FORMOPEN;
iff->next_byte += sizeof( int ) + sizeof ( IFF_CHUNK );
iff->FormSize = (int) chunk.Size - sizeof ( int );
iff->ChunkSize = 0;
iff->pad_chunk = 0;
return TRUE;
error:
return FALSE;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_NextChunk ( IFF_FILE *iff )
{
IFF_CHUNK chunk;
IFF_goto_chunk_end ( iff );
if (iff->FormSize==0)
{
goto error;
}
IFF_RAWREAD ( iff, &chunk, sizeof( IFF_CHUNK ), error );
chunk.Size = BgEn32 (chunk.Size);
chunk.ID = BgEn32 (chunk.ID);
iff->pad_chunk = (int) (chunk.Size & 0x0001);
iff->flags |= mIFF_FILE_CHUNKOPEN;
iff->ChunkID = (int) chunk.ID;
iff->ChunkSize = (int) chunk.Size;
iff->next_byte += sizeof ( IFF_CHUNK );
iff->FormSize -= sizeof ( IFF_CHUNK );
return TRUE;
error:
return FALSE;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
void IFF_Close ( IFF_FILE *iff )
{
if (iff->fp != -1)
{
_close (iff->fp);
}
if ( iff->mem_file )
{
free ( iff->mem_file );
}
free ( iff );
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_Read ( IFF_FILE *iff, void *buff, int size )
{
int read =0;
if ( size>iff->ChunkSize )
{
size = iff->ChunkSize;
}
read = IFF_rawread ( iff, buff, size);
if (read==-1)
{
read = 0;
}
iff->ChunkSize -= read;
iff->FormSize -= read;
iff->next_byte += read;
return read;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
IFF_FILE *IFF_New ( const char *name )
{
IFF_FILE *iff = NULL;
if ( ! (iff = (IFF_FILE *) malloc ( sizeof (IFF_FILE))))
{
goto error;
}
memset ( iff, 0, sizeof ( IFF_FILE ));
iff->fp = -1;
if ((iff->fp = _open ( name, _O_BINARY | _O_RDWR | _O_CREAT | _O_TRUNC, _S_IREAD | _S_IWRITE )) == -1 )
{
goto error;
}
return iff;
error:
if (iff)
{
IFF_Close ( iff );
}
return NULL;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_NewForm ( IFF_FILE *iff, int id )
{
IFF_CHUNK chunk;
chunk.ID = BgEn32 (vIFF_ID_FORM);
chunk.Size = BgEn32 (90000);
iff->FormSize = 0;
iff->ChunkSize = 0;
iff->FormID = id;
DO_WRITE ( iff->fp, &chunk, sizeof (IFF_CHUNK), error);
chunk.ID = BgEn32 ( (int) iff->FormID);
DO_WRITE ( iff->fp, &chunk.ID, sizeof (int), error );
iff->flags |= mIFF_FILE_FORMOPEN;
iff->form_size_pos = iff->next_byte + sizeof (int);
iff->next_byte += sizeof ( IFF_CHUNK ) + sizeof (int);
return TRUE;
error:
return FALSE;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_NewChunk ( IFF_FILE *iff, int id )
{
IFF_CHUNK chunk;
chunk.Size = BgEn32 (90000);
chunk.ID = BgEn32 ( (int) id);
DO_WRITE ( iff->fp, &chunk, sizeof ( IFF_CHUNK ), error );
iff->flags |= mIFF_FILE_CHUNKOPEN;
iff->chunk_size_pos = iff->next_byte + sizeof (int);
iff->next_byte += sizeof ( IFF_CHUNK ) ;
iff->FormSize += sizeof ( IFF_CHUNK ) ;
iff->ChunkSize = 0;
iff->ChunkID = id;
return TRUE;
error:
return FALSE;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_Write ( IFF_FILE *iff, void *buff, int size )
{
int val =0;
val = _write ( iff->fp, buff, size);
if (val==-1)
{
val = 0;
}
iff->ChunkSize += val;
iff->FormSize += val;
iff->next_byte += val;
return val;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_CloseForm ( IFF_FILE *iff )
{
int fp;
int off;
int size;
int pad = 0;
if (iff && ((fp = iff->fp) != -1))
{
if (iff->FormSize&0x0001)
{
DO_WRITE (fp, &pad, 1, error );
iff->next_byte++;
}
off = iff->next_byte - iff->form_size_pos;
size = BgEn32 ( (int) (iff->FormSize+sizeof ( int )));
if (lseek (fp, -off, SEEK_CUR)==iff->form_size_pos)
{
DO_WRITE ( fp, &size, sizeof (int), error );
lseek ( fp, 0, SEEK_END);
return TRUE;
}
}
error:
return FALSE;
}
/******************************************************************/
/* */
/* */
/******************************************************************/
int IFF_CloseChunk ( IFF_FILE *iff )
{
int fp;
int off;
int size;
int pad = 0;
if (iff && ((fp = iff->fp) != -1 ))
{
if (iff->ChunkSize&0x0001)
{
DO_WRITE (fp, &pad, 1, error );
iff->next_byte++;
iff->FormSize++;
}
off = iff->next_byte - iff->chunk_size_pos;
size = BgEn32 ((int) iff->ChunkSize);
if (lseek (fp, -off, SEEK_CUR)==iff->chunk_size_pos)
{
DO_WRITE ( fp, &size, sizeof (int), error );
lseek ( fp, 0, SEEK_END);
return TRUE;
}
}
error:
return TRUE;
}

View file

@ -0,0 +1,127 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __IFF_H
#define __IFF_H
#define MakeID(a,b,c,d) ( (int) ( ( (int) (a) ) << 24 | ( (int) (b) ) << 16 | \
( (int) (c) ) << 8 | ( (int) (d) ) ) )
#define vIFF_ID_FORM MakeID('F','O','R','M')
#define vIFF_ID_CAT MakeID('C','A','T',' ')
#define vIFF_ID_LIST MakeID('L','I','S','T')
#define vIFF_ID_PROP MakeID('P','R','O','P')
#define vIFF_ID_FILLER W_MakeID(' ',' ',' ',' ')
/* IFF_FILE:
IFF File handling structure
*/
/* defines for IFF_FILE->flags */
#define mIFF_FILE_FORMOPEN (1<<0) /* in a form */
#define mIFF_FILE_CHUNKOPEN (1<<1) /* in a chunk */
#define mIFF_FILE_LOADED (1<<2) /* file is in memory */
typedef struct
{
int ID; /* Chunk ID */
int Size; /* Chunk size in bytes */
} IFF_CHUNK;
typedef struct {
/* public fields */
int FormID;
int ChunkID;
int FormSize;
int ChunkSize;
/* private fields */
int fp;
int flags;
int next_byte;
int chunk_size_pos;
int form_size_pos;
int pad_form;
int pad_chunk;
int file_size;
int file_pos;
char *mem_file;
} IFF_FILE;
IFF_FILE* IFF_Open ( const char * );
IFF_FILE* IFF_Load ( const char * );
VOID IFF_Reset ( IFF_FILE * );
VOID IFF_Close ( IFF_FILE * );
VOID IFF_goto_form_end ( IFF_FILE *);
VOID IFF_goto_chunk_end ( IFF_FILE *);
int IFF_NextForm ( IFF_FILE *);
int IFF_NextChunk ( IFF_FILE *);
int IFF_Read ( IFF_FILE *, void *, int );
int IFF_Write ( IFF_FILE *, void *, int );
IFF_FILE* IFF_New ( const char * );
int IFF_NewForm ( IFF_FILE *, int );
int IFF_NewChunk ( IFF_FILE *, int );
int IFF_CloseForm ( IFF_FILE * );
int IFF_CloseChunk ( IFF_FILE * );
#define DO_OPEN(P,N,F,E) {if (!((P)=open(N,(F)))) goto E;}
#define DO_READ(P,B,S,E) {if ( read((P),(B),(S))!=(S)) goto E;}
#define DO_WRITE(P,B,S,E) {if ( write((P),(B),(S))!=(S)) goto E;}
#define IFF_READ(iff,data,size,label) {if ( IFF_Read ( (iff), (data), (size)) != (size)) goto label;}
#define IFF_WRITE(iff,data,size,label) {if ( IFF_Write ( (iff), (data), (size)) != (size)) goto label;}
#define IFF_NEWCHUNK(iff,id,label) { if ( !IFF_NewChunk ( (iff), (id))) goto label; }
#define IFF_NEWFORM(iff,id,label) { if ( !IFF_NewForm ( (iff), (id))) goto label; }
#define Reverse32(L) ( (( (L)>>24 ) & 0xff) | (((L)>>8) &0xff00) | (((L)<<8)&0xff0000) | (((L)<<24)&0xff000000))
#define Reverse16(L) ( (( (L)>>8 ) & 0xff) | (((L)<<8)&0xff00) )
#define __CPU_BIG_ENDIAN__ 0
#if __CPU_BIG_ENDIAN__
#define BgEn32(L) (L)
#define BgEn16(L) (L)
#define LtEn32(L) Reverse32(L)
#define LtEn16(L) Reverse16(L)
#else
#define BgEn32(L) Reverse32(L)
#define BgEn16(L) Reverse16(L)
#define LtEn32(L) (L)
#define LtEn16(L) (L)
#endif
#endif /* __IFF_H */

View file

@ -0,0 +1,316 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// list.cpp
//
#include "stdAfx.h"
#include <assert.h>
#include "list.h"
ListNode::ListNode ( void )
{
prev = next = this;
pri = NORMAL_PRIORITY;
item = NULL;
}
void ListNode::Append ( ListNode *new_node )
{
assert ( ! new_node->InList()); /* node is already in a list or was not initialized*/
new_node->prev = this;
new_node->next = next;
next = new_node;
new_node->next->prev = new_node;
}
void ListNode::Prepend ( ListNode *new_node )
{
assert ( !new_node->InList() ); /* node is already in a list or was not initialized*/
new_node->prev = prev;
new_node->next = this;
prev = new_node;
new_node->prev->next = new_node;
}
void ListNode::Link ( ListNode *node)
{
next = node;
node->prev = next;
}
void ListNode::Remove ( void )
{
prev->next = next;
next->prev = prev;
prev = next = this; /* so we know that the node is not in a list */
}
ListNode* ListNode::Next ( void )
{
if ( next->IsHead ( ) )
{
return NULL;
}
return next;
}
ListNode* ListNode::Prev ( void )
{
if ( prev->IsHead () )
{
return NULL;
}
return prev;
}
ListNode* ListNode::NextLoop ( void )
{
ListNode *next_node = next;
if ( next_node->IsHead ( ))
{
/* skip head node */
next_node = next_node->next;
if ( next_node->IsHead ( ))
{
return NULL; /* it is an empty list */
}
}
return next_node;
}
ListNode* ListNode::PrevLoop ( void )
{
ListNode *prev_node = prev;
if ( prev_node->IsHead ( ))
{
/* skip head node */
prev_node = prev_node->prev;
if ( prev_node->IsHead ( ))
{
return NULL; /* it is an empty list */
}
}
return prev_node;
}
void* ListNode::Item ( void )
{
assert ( !IsHead () );
return item;
}
void ListNode::SetItem ( void *new_item )
{
assert ( !IsHead () );
item = new_item ;
}
int ListNode::InList ( void )
{
return prev != this;
}
int ListNode::IsHead ( void )
{
return item == &this->item;
}
int ListNode::Priority ( void )
{
return pri;
}
void ListNode::SetPriority ( int new_pri )
{
assert ( new_pri <= HIGHEST_PRIORITY );
assert ( new_pri >= LOWEST_PRIORITY );
pri = new_pri;
}
List::List ( void )
{
SetItem ( &this->item );
}
void List::AddToTail ( ListNode *node )
{
assert ( IsHead ());
Prepend ( node );
}
void List::AddToHead ( ListNode *node )
{
assert ( IsHead ());
Append ( node );
}
void List::Add ( ListNode *new_node )
{
ListNode* node;
int pri;
assert ( IsHead ());
assert ( !new_node->InList ());
pri = new_node->Priority();
node = FirstNode ( );
while( node )
{
if (node->Priority() <= pri )
{
node->Prepend ( new_node );
return;
}
node = node->Next ();
}
Prepend ( new_node );
}
void List::Merge ( List *list )
{
ListNode *first,
*last,
*node;
assert ( IsHead ());
first = list->Next();
last = list->Prev();
if ( !first || !last )
{
return;
}
node = Prev();
node->Link ( first );
last->Link ( this );
list->Empty ();
}
int List::NumItems ( void )
{
int count = 0;
ListNode *node;
assert ( IsHead ());
node = FirstNode();
while ( node )
{
count++;
node = node->Next ();
}
return count;
}
void* List::Item ( int list_index )
{
ListNode *node;
assert ( IsHead ());
node = FirstNode();
while (list_index && node )
{
list_index--;
node = node->Next ();
}
if ( node )
{
return node->Item();
}
return NULL;
}
ListNode* List::FirstNode ( void )
{
assert ( IsHead ());
return Next ();
}
ListNode* List::LastNode ( void )
{
assert ( IsHead ());
return Prev ();
}
int List::IsEmpty ( void )
{
assert ( IsHead ());
return !InList();
}
void List::Empty ( void )
{
assert ( IsHead ());
Remove ();
}
ListNode* List::Find ( void *item )
{
ListNode *node;
node = FirstNode ();
while ( node )
{
if ( node->Item () == item )
{
return node;
}
node = node->Next ();
}
return NULL;
}

View file

@ -0,0 +1,95 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LIST_H
#define __LIST_H
const int LOWEST_PRIORITY = (int ) 0x80000000;
const int HIGHEST_PRIORITY = (int) 0x7fffffff;
const int NORMAL_PRIORITY = 0;
class ListNode
{
private:
ListNode *next;
ListNode *prev;
int pri; // node's priority
protected:
void *item; // item
public:
ListNode ( void );
void Append ( ListNode *node );
void Prepend ( ListNode *node );
void Link ( ListNode *node);
void Remove ( void );
ListNode* Next ( void );
ListNode* Prev ( void );
ListNode* NextLoop ( void );
ListNode* PrevLoop ( void );
void* Item ( void );
void SetItem ( void *item );
int InList ( void );
int IsHead ( void );
int Priority ( void );
void SetPriority ( int new_pri );
};
class List: public ListNode
{
public:
List ( void );
void AddToTail ( ListNode *node );
void AddToHead ( ListNode *node );
void Add ( ListNode *node );
void Merge ( List *list );
int NumItems ( void );
void* Item ( int list_index );
ListNode* FirstNode ( void );
ListNode* LastNode ( void );
int IsEmpty ( void );
void Empty ( void );
ListNode* Find ( void *item );
};
class ListSearch
{
List *head;
ListNode *node;
public:
ListNode* Next ( void ) { if (node) { node = node->Next ();} return node;};
ListNode* Prev ( void ) { if (node) { node = node->Prev ();} return node;};
ListNode* FirstNode ( void ) { node = head; return Next (); };
ListNode* LastNode ( void ) { node = head; return Prev (); };
ListNode* FirstNode ( List *new_head ) { node = head = new_head; return Next (); };
ListNode* LastNode ( List *new_head) { node = head = new_head; return Prev (); };
};
#endif // __LIST_H

View file

@ -0,0 +1,656 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// loadsave.cpp
//
#include "stdAfx.h"
#include "iff.h"
#include "TransDB.h"
#include "noxstringdlg.h"
#define FORM_NOXDB MakeID ('N','X','D','B')
#define FORM_LABEL MakeID ('N','L','B','L')
#define FORM_TEXT MakeID ('N','T','X','T')
#define FORM_TRANS MakeID ('N','T','R','N')
#define CHUNK_COMMENT MakeID ('C','M','N','T')
#define CHUNK_CONTEXT MakeID ('C','T','X','T')
#define CHUNK_SPEAKER MakeID ('S','P','K','R')
#define CHUNK_LISTENER MakeID ('L','T','N','R')
#define CHUNK_TEXT MakeID ('T','E','X','T')
#define CHUNK_WAVE MakeID ('W','A','V','E')
#define CHUNK_WAVE_INFO MakeID ('W','V','I','N')
#define CHUNK_INFO MakeID ('I','N','F','O')
#define CHUNK_NAME MakeID ('N','A','M','E')
#define MAX_BUFFER (100*1024)
static OLECHAR buffer[MAX_BUFFER];
typedef struct
{
int num_labels;
int next_id;
} DBINFO;
typedef struct
{
int max_len;
} LBINFO;
typedef struct
{
int id;
int revision;
} TXINFO;
typedef struct
{
LangID lang;
int revision;
} TRINFO;
typedef struct
{
int valid;
DWORD lo;
DWORD hi;
} WVINFO;
static int writeString ( IFF_FILE *iff, OLECHAR *string, int chunk_id )
{
int len = (wcslen ( string ) );
int bytes = (len+1)*sizeof(OLECHAR);
if ( len )
{
IFF_NEWCHUNK ( iff, chunk_id, error );
IFF_WRITE ( iff, string, bytes, error);
IFF_CloseChunk ( iff );
}
return TRUE;
error:
return FALSE;
}
static int readString ( IFF_FILE *iff, OLECHAR *string )
{
*string = 0;
IFF_READ ( iff, string, iff->ChunkSize, error);
return TRUE;
error:
return FALSE;
}
static int writeTransForm ( IFF_FILE *iff, Translation *trans )
{
TRINFO trinfo;
WVINFO wvinfo;
if ( !IFF_NewForm ( iff, FORM_TRANS ))
{
goto error;
}
trinfo.lang = trans->GetLangID ();
trinfo.revision = trans->Revision ();
if ( !IFF_NewChunk ( iff, CHUNK_INFO ))
{
goto error;
}
IFF_Write ( iff, &trinfo, sizeof ( trinfo ));
IFF_CloseChunk ( iff );
writeString ( iff, trans->Get (), CHUNK_TEXT );
writeString ( iff, trans->Comment (), CHUNK_COMMENT );
if ( (wvinfo.valid = trans->WaveInfo.Valid()) )
{
wvinfo.lo = trans->WaveInfo.Lo ();
wvinfo.hi = trans->WaveInfo.Hi ();
if ( !IFF_NewChunk ( iff, CHUNK_WAVE_INFO ))
{
goto error;
}
IFF_Write ( iff, &wvinfo, sizeof ( wvinfo ));
IFF_CloseChunk ( iff );
}
IFF_CloseForm ( iff );
return TRUE;
error:
return FALSE;
}
static int writeTextForm ( IFF_FILE *iff, NoxText *text )
{
TXINFO txinfo;
WVINFO wvinfo;
if ( !IFF_NewForm ( iff, FORM_TEXT ))
{
goto error;
}
txinfo.id = text->ID ();
txinfo.revision = text->Revision ();
if ( !IFF_NewChunk ( iff, CHUNK_INFO ))
{
goto error;
}
IFF_Write ( iff, &txinfo, sizeof ( txinfo ));
IFF_CloseChunk ( iff );
writeString ( iff, text->Get (), CHUNK_TEXT );
writeString ( iff, text->Wave (), CHUNK_WAVE );
if ( (wvinfo.valid = text->WaveInfo.Valid()) )
{
wvinfo.lo = text->WaveInfo.Lo ();
wvinfo.hi = text->WaveInfo.Hi ();
if ( !IFF_NewChunk ( iff, CHUNK_WAVE_INFO ))
{
goto error;
}
IFF_Write ( iff, &wvinfo, sizeof ( wvinfo ));
IFF_CloseChunk ( iff );
}
IFF_CloseForm ( iff );
return TRUE;
error:
return FALSE;
}
int WriteMainDB(TransDB *db, const char *filename, CNoxstringDlg *dlg )
{
NoxText *text;
NoxLabel *label;
ListSearch sh_label;
ListSearch sh_text;
int count = 0;
IFF_FILE *iff = NULL;
DBINFO dbinfo;
int ok = FALSE;
if ( dlg )
{
dlg->InitProgress ( db->NumLabels ());
}
if ( !( iff = IFF_New ( filename )))
{
goto error;
}
if ( !IFF_NewForm ( iff, FORM_NOXDB ) )
{
goto error;
}
dbinfo.next_id = db->ID ();
dbinfo.num_labels = db->NumLabels ();
if ( !IFF_NewChunk ( iff, CHUNK_INFO ))
{
goto error;
}
IFF_Write ( iff, &dbinfo, sizeof ( dbinfo ));
IFF_CloseChunk ( iff );
IFF_CloseForm ( iff );
text = db->FirstObsolete ( sh_text );
while ( text )
{
if ( !writeTextForm ( iff, text ) )
{
goto error;
}
text = db->NextObsolete ( sh_text );
}
label = db->FirstLabel ( sh_label );
while ( label )
{
LBINFO lbinfo;
if ( !IFF_NewForm ( iff, FORM_LABEL ))
{
goto error;
}
lbinfo.max_len = label->MaxLen ();
if ( !IFF_NewChunk ( iff, CHUNK_INFO ))
{
goto error;
}
IFF_Write ( iff, &lbinfo, sizeof ( lbinfo ));
IFF_CloseChunk ( iff );
writeString ( iff, label->Name (), CHUNK_NAME );
writeString ( iff, label->Comment (), CHUNK_COMMENT );
writeString ( iff, label->Context (), CHUNK_CONTEXT );
writeString ( iff, label->Speaker (), CHUNK_SPEAKER );
writeString ( iff, label->Listener (), CHUNK_LISTENER );
IFF_CloseForm ( iff );
text = label->FirstText ( sh_text );
while ( text )
{
Translation *trans;
ListSearch sh_trans;
if ( !writeTextForm ( iff, text ) )
{
goto error;
}
trans = text->FirstTranslation ( sh_trans );
while ( trans )
{
if ( !writeTransForm ( iff, trans ) )
{
goto error;
}
trans = text->NextTranslation ( sh_trans );
}
text = label->NextText ( sh_text );
}
count++;
if ( dlg )
{
dlg->SetProgress ( count );
}
label = db->NextLabel ( sh_label );
}
ok = TRUE;
db->ClearChanges ();
error:
if ( iff )
{
IFF_Close ( iff );
}
return ok;
}
int LoadMainDB(TransDB *db, const char *filename, void (*cb) (void) )
{
NoxLabel *label = NULL;
NoxText *text = NULL;
Translation *trans = NULL;
int count = 0;
IFF_FILE *iff = NULL;
DBINFO dbinfo;
int ok = FALSE;
if ( !(iff = IFF_Load ( filename ) ) )
{
goto error;
}
if ( !IFF_NextForm ( iff ) || iff->FormID != FORM_NOXDB )
{
goto error;
}
dbinfo.next_id = -1;
dbinfo.num_labels = 0;
while ( IFF_NextChunk ( iff ))
{
switch (iff->ChunkID )
{
case CHUNK_INFO:
IFF_READ ( iff, &dbinfo, sizeof ( dbinfo ), error );
break;
}
}
db->SetID ( dbinfo.next_id );
while ( IFF_NextForm ( iff ) )
{
switch ( iff->FormID )
{
case FORM_LABEL:
{
LBINFO lbinfo;
// new label
if ( text )
{
if ( label )
{
label->AddText ( text );
}
else
{
db->AddObsolete ( text );
}
text = NULL;
}
if ( label )
{
count++;
db->AddLabel ( label );
label = NULL;
if ( cb )
{
cb ();
}
}
if ( ! (label = new NoxLabel ()))
{
goto error;
}
while ( IFF_NextChunk ( iff ))
{
switch ( iff->ChunkID )
{
case CHUNK_INFO:
IFF_READ ( iff, &lbinfo, sizeof (lbinfo), error );
label->SetMaxLen ( lbinfo.max_len );
break;
case CHUNK_COMMENT:
readString ( iff, buffer );
label->SetComment ( buffer );
break;
case CHUNK_CONTEXT:
readString ( iff, buffer );
label->SetContext ( buffer );
break;
case CHUNK_SPEAKER:
readString ( iff, buffer );
label->SetSpeaker ( buffer );
break;
case CHUNK_LISTENER:
readString ( iff, buffer );
label->SetListener ( buffer );
break;
case CHUNK_NAME:
readString ( iff, buffer );
label->SetName ( buffer );
break;
}
}
break;
}
case FORM_TEXT:
{
TXINFO txinfo;
if ( text )
{
if ( label )
{
label->AddText ( text );
}
else
{
db->AddObsolete ( text );
}
text = NULL;
}
if ( ! (text = new NoxText ()))
{
goto error;
}
while ( IFF_NextChunk ( iff ))
{
switch ( iff->ChunkID )
{
case CHUNK_INFO:
IFF_READ ( iff, &txinfo, sizeof (txinfo), error );
text->SetID ( txinfo.id );
text->SetRevision ( txinfo.revision );
break;
case CHUNK_TEXT:
readString ( iff, buffer );
text->Set ( buffer );
break;
case CHUNK_WAVE:
readString ( iff, buffer );
text->SetWave ( buffer );
break;
case CHUNK_WAVE_INFO:
{
WVINFO wvinfo;
IFF_READ ( iff, &wvinfo, sizeof (wvinfo), error );
text->WaveInfo.SetValid ( wvinfo.valid );
text->WaveInfo.SetLo ( wvinfo.lo );
text->WaveInfo.SetHi ( wvinfo.hi );
break;
}
}
}
break;
}
case FORM_TRANS:
{
TRINFO trinfo;
if ( ! (trans = new Translation ()))
{
goto error;
}
while ( IFF_NextChunk ( iff ))
{
switch ( iff->ChunkID )
{
case CHUNK_INFO:
IFF_READ ( iff, &trinfo, sizeof (trinfo), error );
trans->SetLangID ( trinfo.lang );
trans->SetRevision ( trinfo.revision );
break;
case CHUNK_TEXT:
readString ( iff, buffer );
trans->Set ( buffer );
break;
case CHUNK_COMMENT:
readString ( iff, buffer );
trans->SetComment ( buffer );
break;
case CHUNK_WAVE_INFO:
{
WVINFO wvinfo;
IFF_READ ( iff, &wvinfo, sizeof (wvinfo), error );
trans->WaveInfo.SetValid ( wvinfo.valid );
trans->WaveInfo.SetLo ( wvinfo.lo );
trans->WaveInfo.SetHi ( wvinfo.hi );
}
break;
}
}
if ( text )
{
text->AddTranslation ( trans );
}
else
{
delete trans;
}
trans = NULL;
break;
}
}
}
if ( text )
{
if ( label )
{
label->AddText ( text );
}
else
{
db->AddObsolete ( text );
}
text = NULL;
}
if ( label )
{
count++;
db->AddLabel ( label );
label = NULL;
if ( cb )
{
cb ();
}
}
ok = TRUE;
error:
if ( label )
{
delete label;
}
if ( text )
{
delete text;
}
if ( trans )
{
delete trans;
}
if ( iff )
{
IFF_Close ( iff );
}
db->ClearChanges ();
if ( !ok )
{
db->Clear ();
}
return ok;
}
int GetLabelCountDB ( char *filename )
{
IFF_FILE *iff = NULL;
DBINFO dbinfo;
int count = 0;
if ( !(iff = IFF_Open ( filename ) ) )
{
goto error;
}
if ( !IFF_NextForm ( iff ) || iff->FormID != FORM_NOXDB )
{
goto error;
}
dbinfo.next_id = -1;
dbinfo.num_labels = 0;
while ( IFF_NextChunk ( iff ))
{
switch (iff->ChunkID )
{
case CHUNK_INFO:
IFF_READ ( iff, &dbinfo, sizeof ( dbinfo ), error );
break;
}
}
count = dbinfo.num_labels;
error:
if ( iff )
{
IFF_Close ( iff );
}
return count;
}

View file

@ -0,0 +1,31 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// loadsave.h
//
#ifndef __LOADSAVE_H
#define __LOADSAVE_H
int WriteMainDB(TransDB *db, const char *filename, CNoxstringDlg *dlg );
int LoadMainDB(TransDB *db, const char *filename, void (*cb) (void ) = NULL );
int GetLabelCountDB ( char *filename );
#endif

View file

@ -0,0 +1,233 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// noxstring.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "noxstring.h"
#include "noxstringDlg.h"
#include "xlstuff.h"
#include <direct.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
char AppTitle[200];
CNoxstringDlg *MainDLG = NULL;
static char *AppName = "Babylon:";
static int AlreadyRunning( void );
static HWND FoundWindow = NULL;
/////////////////////////////////////////////////////////////////////////////
// CNoxstringApp
BEGIN_MESSAGE_MAP(CNoxstringApp, CWinApp)
//{{AFX_MSG_MAP(CNoxstringApp)
//}}AFX_MSG_MAP
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNoxstringApp construction
CNoxstringApp::CNoxstringApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CNoxstringApp object
CNoxstringApp theApp;
TransDB *NoxstrDB = NULL;
TransDB *MainDB = NULL;
char NoxstrFilename[_MAX_PATH];
char MainXLSFilename[_MAX_PATH];
char DialogPath[_MAX_PATH];
char RootPath[_MAX_PATH];
LangID CurrentLanguage = LANGID_US;
/////////////////////////////////////////////////////////////////////////////
// CNoxstringApp initialization
BOOL CNoxstringApp::InitInstance()
{
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Parse the command line to see if launched as OLE server
if (RunEmbedded() || RunAutomated())
{
// Register all OLE server (factories) as running. This enables the
// OLE libraries to create objects from other applications.
COleTemplateServer::RegisterAll();
}
else
{
// When a server application is launched stand-alone, it is a good idea
// to update the system registry in case it has been damaged.
COleObjectFactory::UpdateRegistryAll();
}
MainDB = new TransDB ( "Main" );
NoxstrDB = new TransDB ( "Generals.str" );
MainDB->EnableIDs ();
if ( !AfxInitRichEdit( ) )
{
AfxMessageBox ( "Error initializing Rich Edit" );
}
sprintf (AppTitle, "%s Built on %s - %s", AppName, __DATE__, __TIME__ );
if ( !_getcwd( RootPath, _MAX_PATH ) )
{
AfxMessageBox ( "Failed to obtain current working directoy!\n\n Set directoy path to \"c:\\Babylon\"." );
strcpy ( (char *) RootPath, "c:\\Babylon" );
}
strlwr ( RootPath );
strcpy ( (char *) NoxstrFilename, RootPath );
strcat ( (char *) NoxstrFilename, "\\Data\\Generals.str" );
strcpy ( (char *) MainXLSFilename, RootPath );
strcat ( (char *) MainXLSFilename, "\\Data\\main.db" );
strcpy ( (char *) DialogPath, RootPath );
strcat ( (char *) DialogPath, "\\dialog" );
if ( AlreadyRunning () )
{
if ( FoundWindow )
{
SetForegroundWindow ( FoundWindow );
}
}
else if ( OpenExcel ( ) )
{
CNoxstringDlg dlg;
m_pMainWnd = &dlg;
MainDLG = &dlg;
int nResponse = dlg.DoModal();
CloseExcel ();
}
delete NoxstrDB ;
delete MainDB;
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
//DEL void CNoxstringApp::OnDropFiles(HDROP hDropInfo)
//DEL {
//DEL // TODO: Add your message handler code here and/or call default
//DEL
//DEL CWinApp::OnDropFiles(hDropInfo);
//DEL }
static BOOL CALLBACK EnumAllWindowsProc(HWND hWnd, LPARAM lParam);
static BOOL CALLBACK EnumAllWindowsProcExact(HWND hWnd, LPARAM lParam);
static char *szSearchTitle;
static int AlreadyRunning( void )
{
BOOL found = FALSE;
szSearchTitle = AppName;
EnumWindows((WNDENUMPROC) EnumAllWindowsProcExact, (LPARAM) &found);
return found;
}
//--------------------------------------------------------------------------------
int ExcelRunning( void )
{
BOOL found = FALSE;
szSearchTitle = "Microsoft Excel";
EnumWindows((WNDENUMPROC) EnumAllWindowsProc, (LPARAM) &found);
return found;
}
//--------------------------------------------------------------------------------
BOOL CALLBACK EnumAllWindowsProc(HWND hWnd, LPARAM lParam)
{
char szText[256];
GetWindowText(hWnd, szText, sizeof(szText));
if ( strstr(szText, szSearchTitle))
{
* (BOOL *) lParam = TRUE;
FoundWindow = hWnd;
return FALSE;
}
FoundWindow = NULL;
return TRUE;
}
//--------------------------------------------------------------------------------
BOOL CALLBACK EnumAllWindowsProcExact(HWND hWnd, LPARAM lParam)
{
char szText[256];
GetWindowText(hWnd, szText, sizeof(szText));
if ( !strncmp (szText, szSearchTitle, strlen ( szSearchTitle)))
{
* (BOOL *) lParam = TRUE;
FoundWindow = hWnd;
return FALSE;
}
FoundWindow = NULL;
return TRUE;
}

View file

@ -0,0 +1,370 @@
# Microsoft Developer Studio Project File - Name="noxstring" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=noxstring - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "noxstring.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "noxstring.mak" CFG="noxstring - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "noxstring - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "noxstring - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/Nox/tools/noxstring", HYXCBAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "noxstring - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"..\..\..\run\babylon.exe"
# SUBTRACT LINK32 /debug
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Delete title
PostBuild_Cmds=del release\noxstr~1.obj
# End Special Build Tool
!ELSEIF "$(CFG)" == "noxstring - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/babylon.exe"
!ENDIF
# Begin Target
# Name "noxstring - Win32 Release"
# Name "noxstring - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\bin.cpp
# End Source File
# Begin Source File
SOURCE=.\DlgProxy.cpp
# End Source File
# Begin Source File
SOURCE=.\excel8.cpp
# End Source File
# Begin Source File
SOURCE=.\expimp.cpp
# End Source File
# Begin Source File
SOURCE=.\ExportDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\fileops.cpp
# End Source File
# Begin Source File
SOURCE=.\GenerateDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\iff.cpp
# End Source File
# Begin Source File
SOURCE=.\list.cpp
# End Source File
# Begin Source File
SOURCE=.\loadsave.cpp
# End Source File
# Begin Source File
SOURCE=.\MatchDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\noxstring.cpp
# End Source File
# Begin Source File
SOURCE=.\noxstring.odl
# End Source File
# Begin Source File
SOURCE=.\noxstring.rc
# End Source File
# Begin Source File
SOURCE=.\noxstringDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\olestring.cpp
# End Source File
# Begin Source File
SOURCE=.\ProceedDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\Report.cpp
# End Source File
# Begin Source File
SOURCE=.\RetranslateDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\transcs.cpp
# End Source File
# Begin Source File
SOURCE=.\TransDB.cpp
# End Source File
# Begin Source File
SOURCE=.\VerifyDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\VerifyTextDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ViewDBsDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\XLStuff.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\bin.h
# End Source File
# Begin Source File
SOURCE=.\DlgProxy.h
# End Source File
# Begin Source File
SOURCE=.\excel8.h
# End Source File
# Begin Source File
SOURCE=.\expimp.h
# End Source File
# Begin Source File
SOURCE=.\ExportDlg.h
# End Source File
# Begin Source File
SOURCE=.\fileops.h
# End Source File
# Begin Source File
SOURCE=.\GenerateDlg.h
# End Source File
# Begin Source File
SOURCE=.\iff.h
# End Source File
# Begin Source File
SOURCE=.\list.h
# End Source File
# Begin Source File
SOURCE=.\loadsave.h
# End Source File
# Begin Source File
SOURCE=.\MatchDlg.h
# End Source File
# Begin Source File
SOURCE=.\noxstring.h
# End Source File
# Begin Source File
SOURCE=.\noxstringDlg.h
# End Source File
# Begin Source File
SOURCE=.\olestring.h
# End Source File
# Begin Source File
SOURCE=.\ProceedDlg.h
# End Source File
# Begin Source File
SOURCE=.\Report.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\RetranslateDlg.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\transcs.h
# End Source File
# Begin Source File
SOURCE=.\TransDB.h
# End Source File
# Begin Source File
SOURCE=.\VerifyDlg.h
# End Source File
# Begin Source File
SOURCE=.\VerifyTextDlg.h
# End Source File
# Begin Source File
SOURCE=.\VIEWDBSII.h
# End Source File
# Begin Source File
SOURCE=.\XLStuff.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\BABYLON.XLT
# End Source File
# Begin Source File
SOURCE=.\res\bitmap1.bmp
# End Source File
# Begin Source File
SOURCE=.\res\noxstring.ico
# End Source File
# Begin Source File
SOURCE=.\res\noxstring.rc2
# End Source File
# Begin Source File
SOURCE=.\P2XDLL.DLL
# End Source File
# Begin Source File
SOURCE=.\res\pause.bmp
# End Source File
# Begin Source File
SOURCE=.\res\paused.bmp
# End Source File
# Begin Source File
SOURCE=.\PERLCRT.DLL
# End Source File
# Begin Source File
SOURCE=.\res\playd.bmp
# End Source File
# Begin Source File
SOURCE=.\res\playu.bmp
# End Source File
# Begin Source File
SOURCE=.\res\stop.bmp
# End Source File
# Begin Source File
SOURCE=.\STRCHECK.EXE
# End Source File
# End Group
# Begin Source File
SOURCE=.\noxstring.reg
# End Source File
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project

View file

@ -0,0 +1,37 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "noxstring"=.\noxstring.dsp - Package Owner=<4>
Package=<5>
{{{
begin source code control
noxstring
.
end source code control
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
begin source code control
noxstring
.
end source code control
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -0,0 +1,74 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// noxstring.h : main header file for the NOXSTRING application
//
#if !defined(AFX_NOXSTRING_H__2BF3124B_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_NOXSTRING_H__2BF3124B_3BA1_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "transdb.h"
/////////////////////////////////////////////////////////////////////////////
// CNoxstringApp:
// See noxstring.cpp for the implementation of this class
//
class CNoxstringApp : public CWinApp
{
public:
CNoxstringApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNoxstringApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CNoxstringApp)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
int ExcelRunning( void );
extern TransDB *NoxstrDB;
extern TransDB *MainDB;
extern char NoxstrFilename[];
extern char MainXLSFilename[];
extern char RootPath[];
extern char DialogPath[];
extern LangID CurrentLanguage;
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NOXSTRING_H__2BF3124B_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,42 @@
// noxstring.odl : type library source for noxstring.exe
// This file will be processed by the MIDL compiler to produce the
// type library (noxstring.tlb).
[ uuid(2BF31247-3BA1-11D3-B9DA-006097B90D93), version(1.0) ]
library Noxstring
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
// Primary dispatch interface for CNoxstringDoc
[ uuid(2BF31248-3BA1-11D3-B9DA-006097B90D93) ]
dispinterface INoxstring
{
properties:
// NOTE - ClassWizard will maintain property information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_PROP(CNoxstringDlgAutoProxy)
//}}AFX_ODL_PROP
methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(CNoxstringDlgAutoProxy)
//}}AFX_ODL_METHOD
};
// Class information for CNoxstringDoc
[ uuid(2BF31246-3BA1-11D3-B9DA-006097B90D93) ]
coclass Noxstring
{
[default] dispinterface INoxstring;
};
//{{AFX_APPEND_ODL}}
//}}AFX_APPEND_ODL}}
};

View file

@ -0,0 +1,566 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
// Generated Help ID header file
#define APSTUDIO_HIDDEN_SYMBOLS
#include "resource.hm"
#undef APSTUDIO_HIDDEN_SYMBOLS
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\noxstring.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\noxstring.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Babylon"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LTEXT "Babylon Version 1.0",IDC_STATIC,40,10,76,8,SS_NOPREFIX
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP,WS_EX_STATICEDGE
LTEXT "Static",IDC_BUILD,7,37,221,11
ICON IDR_MAINFRAME,IDM_PIC,13,13,20,20
PUSHBUTTON "CP",IDC_BUTTON1,119,7,50,14,0,WS_EX_STATICEDGE
END
IDD_NOXSTRING_DIALOG DIALOGEX 0, 0, 320, 257
STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_MINIMIZEBOX | WS_POPUP |
WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Ready",IDC_STATUS,"Static",SS_LEFTNOWORDWRAP |
SS_SUNKEN | WS_GROUP,13,186,291,11,0,HIDC_STATUS
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH |
WS_BORDER,13,174,263,9,0,HIDC_PROGRESS1
GROUPBOX "",IDC_STATIC,7,7,306,243
PUSHBUTTON "&Reload",IDC_RELOAD,19,24,48,15
CONTROL "",IDC_LOG,"RICHEDIT",ES_MULTILINE | ES_AUTOVSCROLL |
ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | ES_NUMBER |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,13,75,291,95,
WS_EX_STATICEDGE
PUSHBUTTON "&DBs",IDC_VIEWDBS,19,54,26,15
GROUPBOX "DataBase",IDC_STATIC,14,15,169,27
PUSHBUTTON "&Update",IDC_UPDATE,74,24,48,15
PUSHBUTTON "&Save",IDC_SAVE,129,24,48,15
GROUPBOX "View",IDC_STATIC,13,45,88,27
PUSHBUTTON "E&xport",IDC_EXPORT,196,24,48,15
PUSHBUTTON "&Import",IDC_IMPORT,251,24,48,15
PUSHBUTTON "&Generate New Game Files",IDC_GENERATE,13,228,291,17,0,
WS_EX_STATICEDGE
PUSHBUTTON "&Warnings",IDC_WARNINGS,221,54,41,15
PUSHBUTTON "&Changes",IDC_CHANGES,50,54,43,15
PUSHBUTTON "&Errors",IDC_ERRORS,267,54,32,15
GROUPBOX "Translations",IDC_STATIC,189,15,115,27
RTEXT "100% ",IDC_PERCENT,280,174,24,9,SS_CENTERIMAGE |
SS_SUNKEN
GROUPBOX "Generals.Str",IDC_STATIC,215,45,89,27
PUSHBUTTON "Dialo&g",IDC_DIALOG,212,208,40,15
PUSHBUTTON "Report",IDC_REPORTS,145,54,49,15
GROUPBOX "Verify",IDC_STATIC,13,198,291,28
COMBOBOX IDC_COMBOLANG,75,209,125,88,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Text",IDC_TRANSLATIONS,259,208,40,15
GROUPBOX "Create",IDC_STATIC,137,45,65,27
PUSHBUTTON "Reset",IDC_RESET,18,208,44,15,0,WS_EX_CLIENTEDGE
PUSHBUTTON "Sent",IDC_SENT,105,52,24,15
END
IDD_VIEWDBS DIALOG DISCARDABLE 0, 0, 361, 173
STYLE DS_MODALFRAME | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "View Internal Databases"
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "",IDC_STATIC,7,7,347,159
CONTROL "Tree1",IDC_TREEVIEW,"SysTreeView32",TVS_HASBUTTONS |
TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
13,16,334,143
END
IDD_EXPORT DIALOGEX 0, 0, 277, 117
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Export Translations"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
PUSHBUTTON "&Export",IDOK,170,56,94,20,0,WS_EX_STATICEDGE
DEFPUSHBUTTON "&Cancel",IDCANCEL,170,83,94,14,0,WS_EX_STATICEDGE
COMBOBOX IDC_COMBOLANG,175,18,89,92,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
GROUPBOX "",IDC_STATIC,7,7,263,103
GROUPBOX "Include",IDC_STATIC,14,14,123,22
CONTROL "Translations",IDC_CHECKTRANS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,22,23,84,13
CONTROL "&All strings",IDC_RADIOALL,"Button",BS_AUTORADIOBUTTON,
24,66,45,10
CONTROL "C&hanges only",IDC_RADIOCHANGES,"Button",
BS_AUTORADIOBUTTON,24,54,59,10
GROUPBOX "Export",IDC_STATIC,14,42,124,62
EDITTEXT IDC_FILENAME,184,35,80,13,ES_AUTOHSCROLL
LTEXT "Filename:",IDC_STATIC,150,37,31,8
LTEXT "Language:",IDC_STATIC,140,20,35,8
CONTROL "&Sample",IDC_RADIOSAMPLE,"Button",BS_AUTORADIOBUTTON,85,
78,39,10
CONTROL "&Dialog only",IDC_RADIODIALOG,"Button",
BS_AUTORADIOBUTTON,85,66,51,10
CONTROL "&Non dialog",IDC_RADIONONDIALOG,"Button",
BS_AUTORADIOBUTTON,85,54,50,10
CONTROL "&Unverified dialog",IDC_RADIOUNVERIFIED,"Button",
BS_AUTORADIOBUTTON,24,90,67,10
CONTROL "&Missing dialog",IDC_RADIOMISSING,"Button",
BS_AUTORADIOBUTTON,24,78,58,10
CONTROL "Unsen&t",IDC_RADIOUNSENT,"Button",BS_AUTORADIOBUTTON,93,
90,39,10
END
IDD_GENERATE DIALOGEX 0, 0, 249, 185
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Generate Game Files"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Generate Files",IDOK,139,124,97,25,0,WS_EX_STATICEDGE
DEFPUSHBUTTON "Cancel",IDCANCEL,139,154,97,14,0,WS_EX_STATICEDGE
GROUPBOX "",IDC_STATIC,7,7,235,171
PUSHBUTTON "&Invert",IDC_INVERT,19,149,47,13,0,WS_EX_STATICEDGE
PUSHBUTTON "Select &All",IDC_SELECTALL,78,149,43,13,0,
WS_EX_STATICEDGE
CONTROL "CSF Format",IDC_UNICODE,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,145,25,53,10
CONTROL """.str"" Format",IDC_NOXSTR,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,145,36,55,10
GROUPBOX "Languages",IDC_STATIC,13,14,118,153
EDITTEXT IDC_PREFIX,170,49,52,12,ES_AUTOHSCROLL
GROUPBOX "File Options",IDC_STATIC,139,14,97,67
LTEXT "Prefix:",IDC_STATIC,146,52,20,8
CONTROL "Static",IDC_FILENAME,"Static",SS_LEFTNOWORDWRAP |
SS_SUNKEN | WS_GROUP,145,65,85,11
LISTBOX IDC_LANGUAGE,19,25,102,117,LBS_SORT | LBS_MULTIPLESEL |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CONTROL "Show string IDs",IDC_IDS,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,145,95,88,10
CONTROL "Show orignal text",IDC_ORIGINAL,"Button",
BS_AUTORADIOBUTTON | WS_GROUP,145,105,70,10
GROUPBOX "For missing translations",IDC_STATIC,139,85,97,34
END
IDD_SETTINGS DIALOGEX 0, 0, 270, 157
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Settings"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,194,126,50,14
PUSHBUTTON "Cancel",IDCANCEL,17,127,50,14
GROUPBOX "",IDC_STATIC,7,7,256,143
EDITTEXT IDC_EDIT1,97,25,90,12,ES_AUTOHSCROLL
LTEXT "Static",IDC_STATIC,27,26,59,8
PUSHBUTTON "File...",IDC_BUTTON1,191,25,50,14,0,WS_EX_STATICEDGE
END
IDD_MATCHDIALOG DIALOGEX 0, 0, 340, 213
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Verify Dialog"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
PUSHBUTTON "Matches",IDOK,196,176,131,24,0,WS_EX_STATICEDGE
DEFPUSHBUTTON "Stop Verifying",IDCANCEL,13,175,56,25,0,
WS_EX_STATICEDGE
GROUPBOX "",IDC_WAVENAME,7,7,326,199
GROUPBOX "Text",IDC_TEXT_TITLE,14,19,313,137
LTEXT "",IDC_TEXT,19,30,302,121,SS_SUNKEN
CONTROL "Slider1",IDC_SLIDER,"msctls_trackbar32",TBS_BOTH |
TBS_NOTICKS | WS_TABSTOP,14,161,266,11,WS_EX_STATICEDGE
CONTROL "IDB_STOP",IDC_STOP,"Button",BS_OWNERDRAW | BS_BITMAP |
WS_TABSTOP,284,162,11,8
CONTROL "IDB_PAUSE",IDC_PAUSE,"Button",BS_OWNERDRAW | BS_BITMAP |
WS_TABSTOP,300,162,11,8
CONTROL "IDB_PLAY",IDC_PLAY,"Button",BS_OWNERDRAW | BS_BITMAP |
WS_TABSTOP,316,162,11,8
PUSHBUTTON "Does not match",IDC_NOMATCH,81,182,68,18,0,
WS_EX_STATICEDGE
END
IDD_PROCEED DIALOG DISCARDABLE 0, 0, 250, 118
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Proceed?"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "&Yes",IDC_YES,26,90,50,14
LTEXT "",IDC_MESSAGE,15,18,220,66
PUSHBUTTON "Yes &Always",IDC_ALWAYS,98,90,50,14
PUSHBUTTON "&No",IDC_BUTTON_NO,170,90,50,14
END
IDD_MATCH DIALOGEX 0, 0, 423, 183
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Retranslate changed text?"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "Skip &All",IDCANCEL,13,142,53,28,0,WS_EX_STATICEDGE
GROUPBOX "",IDC_STATIC,7,7,409,169
GROUPBOX "Unmatched Text",IDC_STATIC,13,19,193,118
GROUPBOX "Current Match",IDC_STATIC,211,19,193,151
PUSHBUTTON "&No Match",IDC_NOMATCH,69,142,53,14,0,WS_EX_STATICEDGE
COMBOBOX IDC_MATCHCOMBO,222,152,174,58,CBS_DROPDOWNLIST |
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP,
WS_EX_STATICEDGE
PUSHBUTTON "&Match",IDC_MATCH,135,156,70,14,0,WS_EX_STATICEDGE
LTEXT "",IDC_NEWTEXT,21,33,174,95,SS_SUNKEN
LTEXT "",IDC_MATCHTEXT,223,33,174,95,SS_SUNKEN
LTEXT "Possible Matches",IDC_STATIC,223,140,159,10
CONTROL "Re-translate",IDC_CHECKRETRANSLATE,"Button",
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,149,143,54,10
PUSHBUTTON "&Skip",IDC_SKIP,69,158,53,12,0,WS_EX_STATICEDGE
END
IDD_VERIFYTEXT DIALOGEX 0, 0, 420, 226
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Translated text mismatch"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
GROUPBOX "",IDC_STATIC,7,7,406,212
GROUPBOX "Translated Text",IDC_STATIC,13,19,191,193
GROUPBOX "Database Text",IDC_STATIC,215,19,189,172
DEFPUSHBUTTON "&Doesn't Match",IDC_NOMATCH,21,191,70,15,0,
WS_EX_STATICEDGE
PUSHBUTTON "&Matches",IDC_MATCH,125,191,70,15,0,WS_EX_STATICEDGE
LTEXT "",IDC_TRANS,21,33,174,151,SS_SUNKEN
LTEXT "",IDC_ORIG,223,33,174,151,SS_SUNKEN
LTEXT "Do the CONTENTS of the above text match? (i.e. apart from gramatical or spelling differences, are they the same?)",
IDC_STATIC,215,194,189,18
END
IDD_CREATE_REPORTS DIALOGEX 0, 0, 249, 185
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Create Report"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
PUSHBUTTON "Create &Report",IDOK,139,124,97,25,0,WS_EX_STATICEDGE
DEFPUSHBUTTON "&Cancel",IDCANCEL,139,154,97,14,0,WS_EX_STATICEDGE
GROUPBOX "",IDC_STATIC,7,7,235,171
PUSHBUTTON "&Invert",IDC_INVERT,19,149,47,13,0,WS_EX_STATICEDGE
PUSHBUTTON "Select &All",IDC_SELECTALL,78,149,43,13,0,
WS_EX_STATICEDGE
GROUPBOX "Languages",IDC_STATIC,13,14,118,153
LISTBOX IDC_LANGUAGE,20,25,102,117,LBS_SORT | LBS_MULTIPLESEL |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Report",IDC_STATIC,139,14,97,104
CONTROL "&Translation status",IDC_TRANSLATION_STATUS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,145,26,87,10
CONTROL "&Dialog status",IDC_DIALOG_STATUS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,145,36,87,10
CONTROL "&Show details",IDC_SHOW_DETAILS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,145,46,87,10
EDITTEXT IDC_LIMIT,167,68,17,12,ES_AUTOHSCROLL | ES_WANTRETURN |
ES_NUMBER
LTEXT "items",IDC_ITEMS,187,70,17,8
CONTROL "If less than",IDC_IFLESS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,157,57,50,10
END
IDD_CHARSET DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
END
IDD_RETRANSLATE DIALOGEX 0, 0, 423, 183
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Resolve Umatched Text"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "Skip &All changes",IDCANCEL,13,142,73,28,0,
WS_EX_STATICEDGE
GROUPBOX "",-1,7,7,409,169
GROUPBOX "New text",-1,13,19,193,118
GROUPBOX "Old Text",-1,211,19,193,118
PUSHBUTTON "&No need to Retranslate",IDC_NOMATCH,111,149,95,14,0,
WS_EX_STATICEDGE
PUSHBUTTON "Requires &Retranslation",IDC_MATCH,309,146,95,20,0,
WS_EX_STATICEDGE
LTEXT "",IDC_NEWTEXT,21,33,174,95,SS_SUNKEN
LTEXT "",IDC_OLDTEXT,223,33,174,95,SS_SUNKEN
PUSHBUTTON "&Skip",IDC_SKIP,231,149,53,14,0,WS_EX_STATICEDGE
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "noxstring MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "noxstring\0"
VALUE "LegalCopyright", "Copyright (C) 1999\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "noxstring.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "noxstring Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_NOXSTRING_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 313
TOPMARGIN, 7
BOTTOMMARGIN, 250
END
IDD_VIEWDBS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 354
TOPMARGIN, 7
BOTTOMMARGIN, 166
END
IDD_EXPORT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 270
TOPMARGIN, 7
BOTTOMMARGIN, 110
END
IDD_GENERATE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 242
TOPMARGIN, 7
BOTTOMMARGIN, 178
END
IDD_SETTINGS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 263
TOPMARGIN, 7
BOTTOMMARGIN, 150
END
IDD_MATCHDIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 333
TOPMARGIN, 7
BOTTOMMARGIN, 206
END
IDD_PROCEED, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 243
TOPMARGIN, 7
BOTTOMMARGIN, 111
END
IDD_MATCH, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 416
TOPMARGIN, 7
BOTTOMMARGIN, 176
END
IDD_VERIFYTEXT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 413
TOPMARGIN, 7
BOTTOMMARGIN, 219
END
IDD_CREATE_REPORTS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 242
TOPMARGIN, 7
BOTTOMMARGIN, 178
END
IDD_CHARSET, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_RETRANSLATE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 416
TOPMARGIN, 7
BOTTOMMARGIN, 176
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_STOPU BITMAP DISCARDABLE "res\\stop.bmp"
IDB_STOPD BITMAP DISCARDABLE "res\\bitmap1.bmp"
IDB_PLAYU BITMAP DISCARDABLE "res\\playu.bmp"
IDB_PLAYD BITMAP DISCARDABLE "res\\playd.bmp"
IDB_PAUSEU BITMAP DISCARDABLE "res\\pause.bmp"
IDB_PAUSED BITMAP DISCARDABLE "res\\paused.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDP_OLE_INIT_FAILED "OLE initialization failed. Make sure that the OLE libraries are the correct version."
IDS_ABOUTBOX "&About Babylon..."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\noxstring.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -0,0 +1,13 @@
REGEDIT
; This .REG file may be used by your SETUP program.
; If a SETUP program is not available, the entries below will be
; registered in your InitInstance automatically with a call to
; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
HKEY_CLASSES_ROOT\Noxstring.Application = Noxstring Application
HKEY_CLASSES_ROOT\Noxstring.Application\CLSID = {2BF31246-3BA1-11D3-B9DA-006097B90D93}
HKEY_CLASSES_ROOT\CLSID\{2BF31246-3BA1-11D3-B9DA-006097B90D93} = Noxstring Application
HKEY_CLASSES_ROOT\CLSID\{2BF31246-3BA1-11D3-B9DA-006097B90D93}\ProgId = Noxstring.Application
HKEY_CLASSES_ROOT\CLSID\{2BF31246-3BA1-11D3-B9DA-006097B90D93}\LocalServer32 = NOXSTRING.EXE

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,156 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// noxstringDlg.h : header file
//
#if !defined(AFX_NOXSTRINGDLG_H__2BF3124D_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)
#define AFX_NOXSTRINGDLG_H__2BF3124D_3BA1_11D3_B9DA_006097B90D93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h"
#include "transdb.h"
typedef enum
{
SAME_LINE,
NEW_LINE
} LogFormat;
typedef struct
{
int new_strings;
int deleted_strings;
int modified_strings;
int new_labels;
int deleted_labels;
int modified_labels;
int skipped_labels;
int updated_comments;
int updated_contexts;
int updated_waves;
int updated_speakers;
int updated_listeners;
int updated_maxlen;
int changes;
} UPDATEINFO;
class CNoxstringDlgAutoProxy;
/////////////////////////////////////////////////////////////////////////////
// CNoxstringDlg dialog
class CNoxstringDlg : public CDialog
{
DECLARE_DYNAMIC(CNoxstringDlg);
friend class CNoxstringDlgAutoProxy;
CProgressCtrl *progress;
CStatic *percent;
int progress_pos;
int progress_range;
int max_index;
CComboBox *combo;
int operate_always;
// Construction
public:
int ValidateStrFile ( const char *filename );
int MatchText ( NoxText *text, NoxLabel *label, NoxText **match );
int RetranslateText ( NoxText *text, NoxText *label );
void VerifyDialog( TransDB *db, LangID langid);
void VerifyTranslations( TransDB *db, LangID langid ) ;
int CanProceed ( void );
int CanOperate ( void );
int SaveMainDB ( void );
int UpdateLabel ( NoxLabel *source, NoxLabel *destination, UPDATEINFO &info, int update = TRUE, int skip = FALSE);
int UpdateDB ( TransDB *source, TransDB *destination, int update = TRUE);
void ProgressComplete ( void );
void SetProgress ( int pos );
void InitProgress ( int range );
int SaveLog ( void );
void Status ( const char *string, int log = TRUE);
void Log ( const char *string, LogFormat format = NEW_LINE );
CNoxstringDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CNoxstringDlg();
int LoadStrFile ( TransDB *db, const char *fileaname, void (*cb ) (void ) = NULL );
void Ready ( void ) { Status ( "Ready", FALSE ); ProgressComplete(); };
// Dialog Data
//{{AFX_DATA(CNoxstringDlg)
enum { IDD = IDD_NOXSTRING_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNoxstringDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CNoxstringDlgAutoProxy* m_pAutoProxy;
HICON m_hIcon;
BOOL CanExit();
// Generated message map functions
//{{AFX_MSG(CNoxstringDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnClose();
afx_msg void OnDropFiles(HDROP hDropInfo);
afx_msg void OnViewdbs();
afx_msg void OnReload();
afx_msg void OnUpdate();
afx_msg void OnSave();
afx_msg void OnWarnings();
afx_msg void OnErrors();
afx_msg void OnChanges();
afx_msg void OnExport();
afx_msg void OnImport();
afx_msg void OnGenerate();
afx_msg void OnVerifyDialog();
afx_msg void OnTranslations();
afx_msg void OnSelchangeCombolang();
afx_msg void OnReports();
afx_msg void OnDblclkCombolang();
afx_msg void OnReset();
afx_msg void OnSent();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
extern CNoxstringDlg *MainDLG;
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NOXSTRINGDLG_H__2BF3124D_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)

View file

@ -0,0 +1,424 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// OLEString.cpp
//
#include "stdAfx.h"
#include <assert.h>
#include "olestring.h"
template void StripSpaces<OLECHAR> ( OLECHAR *string);
template void StripSpaces<char> ( char *string );
template void StripSpacesFromMetaString<OLECHAR> ( OLECHAR *string );
template void StripSpacesFromMetaString<char> ( char *string);
template void ConvertMetaChars<OLECHAR> ( OLECHAR *string);
template void ConvertMetaChars<char> ( char *string);
template int SameFormat<char> ( char *string1, char *string2 );
template int SameFormat<OLECHAR> ( OLECHAR *string1, OLECHAR *string2 );
template void EncodeFormat<char> ( char *string );
template void EncodeFormat<OLECHAR> ( OLECHAR *string );
template void DecodeFormat<char> ( char *string1 );
template void DecodeFormat<OLECHAR> ( OLECHAR *string );
template int IsFormatTypeChar<char> ( char string1 );
template int IsFormatTypeChar<OLECHAR> ( OLECHAR string );
static char *format_type = "cCdiouxXeEfgGnpsS"; // printf type as in %<width>.<presicion>{h|l|i64|L}<type>
template <typename text>int IsFormatTypeChar ( text ch )
{
char *ptr = format_type;
while ( *ptr )
{
if ( (unsigned int)*ptr++ == (unsigned int) ch )
{
return TRUE;
}
}
return FALSE;
}
OLEString::OLEString ( void )
{
ole = NULL;
sb = NULL;
len = 0;
Unlock ();
Set ("");
}
OLEString::~OLEString ( )
{
delete [] ole;
delete [] sb;
ole = NULL;
sb = NULL;
len = 0;
}
void OLEString::Set ( OLECHAR *new_ole )
{
if ( !locked )
{
delete [] ole;
delete [] sb;
ole = NULL;
sb = NULL;
len = wcslen ( new_ole );
{
ole = new OLECHAR[len+1];
wcscpy ( ole, new_ole );
sb = new char[len+1];
sprintf ( sb, "%S", ole );
}
}
}
void OLEString::Set ( char *new_sb )
{
if ( !locked )
{
delete [] ole;
delete [] sb;
ole = NULL;
sb = NULL;
len = strlen ( new_sb );
{
ole = new OLECHAR[len+1];
swprintf ( ole, L"%S", new_sb );
sb = new char[len+1];
strcpy ( sb, new_sb );
}
}
}
void OLEString::StripSpaces ( void )
{
if ( locked )
{
return;
}
if ( ole )
{
::StripSpaces ( ole );
}
if ( sb )
{
::StripSpaces ( sb );
}
}
void OLEString::FormatMetaString ( void )
{
char *str, *ptr;
char ch, last = -1;
int skipall = TRUE;
int slash = FALSE;
if ( !len || locked )
{
return;
}
char *string = new char[len*2];
str = string;
ptr = sb;
while ( (ch = *ptr++) )
{
if ( ch == ' ' )
{
if ( last == ' ' )
{
continue;
}
}
skipall= FALSE;
if ( ch == '\\' )
{
char esc;
slash = !slash;
if ( slash && ((esc = *ptr) == 'n' || esc == 't') )
{
// remove last space
if ( last != ' ' )
{
*str++ = ' ';
}
*str++ = '\\';
ptr++;
*str++ = esc;
last = *str++ = ' ';
continue;
}
}
else
{
slash = FALSE;
}
last = *str++ = ch;
}
if ( last == ' ' )
{
str--;
}
*str = 0;
Set ( string );
delete [] string;
string = NULL;
}
template <typename text> void StripSpaces ( text *string )
{
text *str, *ptr;
text ch, last = -1;
int skipall = TRUE;
str = ptr = string;
while ( (ch = *ptr++) )
{
if ( ch == ' ' )
{
if ( last == ' ' || skipall )
{
continue;
}
}
if ( ch == '\n' || ch == '\t' )
{
// remove last space
if ( last == ' ' )
{
str--;
}
skipall = TRUE; // skip all spaces
last = *str++ = ch;
continue;
}
last = *str++ = ch;
skipall = FALSE;
}
if ( last == ' ' )
{
str--;
}
*str = 0;
}
template <typename text> void StripSpacesFromMetaString ( text *string )
{
text *str, *ptr;
text ch, last = -1;
int skipall = TRUE;
int slash = FALSE;
str = ptr = string;
while ( (ch = *ptr++) )
{
if ( ch == ' ' )
{
if ( last == ' ' || skipall )
{
continue;
}
}
skipall= FALSE;
if ( ch == '\\' )
{
text esc;
slash = !slash;
if ( slash && (esc = *ptr) == 'n' || esc == 't' )
{
// remove last space
if ( last == ' ' )
{
str--;
}
skipall = TRUE; // skip all spaces
*str++ = '\\';
ptr++;
last = *str++ = esc;
continue;
}
}
else
{
slash = FALSE;
}
last = *str++ = ch;
}
if ( last == ' ' )
{
str--;
}
*str = 0;
}
template <typename text> void ConvertMetaChars ( text *string )
{
text *ptr;
text ch;
ptr = string;
while ( (ch = *string++) )
{
if ( ch == '\\' )
{
if ( ch = *string )
{
switch ( ch )
{
case 'n':
case 'N':
ch = '\n';
break;
case 't':
case 'T':
ch = '\t';
break;
}
string++;
}
}
*ptr++ = ch;
}
*ptr = 0;
}
template <typename text> int SameFormat ( text *string1, text *string2 )
{
while ( *string1 && *string2 )
{
while ( *string1 )
{
if (*string1 == '%')
{
string1++;
break;
}
if ( *string1 == '\\' )
{
string1++;
}
if ( *string1 )
{
string1++;
}
}
while ( *string2 )
{
if (*string2 == '%')
{
string2++;
break;
}
if ( *string2 == '\\' )
{
string2++;
}
if ( *string2)
{
string2++;
}
}
if ( !*string1 && !*string2)
{
return TRUE;
}
int found_type = FALSE;
while ( *string1 && *string2 && !found_type )
{
found_type = IsFormatTypeChar ( *string1 );
if ( *string1 != *string2 )
{
return FALSE;
}
string1++;
string2++;
}
}
return TRUE;
}
template <typename text> void EncodeFormat ( text *string )
{
}
template <typename text> void DecodeFormat ( text *string )
{
}

View file

@ -0,0 +1,61 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// OLEString
//
#ifndef __OLESTRING_H
#define __OLESTRING_H
const unsigned int OLESTRING_DEFAULT_SIZE = 256;
class OLEString
{
OLECHAR *ole;
char *sb;
unsigned int len;
int locked;
public:
OLEString ( void ) ;
~OLEString ();
void Set ( OLECHAR *new_ole );
void Set ( char *new_sb );
OLECHAR*Get ( void ) { return ole; };
int Len ( void ) { return len; };
char* GetSB ( void ) { return sb; };
void StripSpaces ( void );
void FormatMetaString ( void );
void Lock ( void ) { locked = TRUE; };
void Unlock ( void ) { locked = FALSE; };
};
template <typename text> void StripSpaces ( text *string );
template <typename text> void ConvertMetaChars ( text *string );
template <typename text> void StripSpacesFromMetaString ( text *string );
template <typename text> int SameFormat ( text *string1, text *string2 );
template <typename text> void EncodeFormat ( text *string );
template <typename text> void DecodeFormat ( text *string );
template <typename text> int IsFormatTypeChar( text string1 );
#endif // __OLESTRING_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,13 @@
//
// NOXSTRING.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View file

@ -0,0 +1,103 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by noxstring.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDM_PIC 0x0010
#define IDD_ABOUTBOX 100
#define IDP_OLE_INIT_FAILED 100
#define IDS_ABOUTBOX 101
#define IDD_NOXSTRING_DIALOG 102
#define IDR_MAINFRAME 128
#define IDD_VIEWDBS 129
#define IDD_EXPORT 133
#define IDD_GENERATE 135
#define IDD_SETTINGS 136
#define IDD_MATCHDIALOG 137
#define IDD_PROCEED 145
#define IDD_MATCH 146
#define IDD_VERIFYTEXT 147
#define IDD_CREATE_REPORTS 148
#define IDD_CHARSET 149
#define IDD_RETRANSLATE 150
#define IDC_BUTTON1 1001
#define IDC_TESTLOG 1001
#define IDC_RELOAD 1001
#define IDC_NOMATCH 1001
#define IDC_INVERT 1001
#define IDC_MATCH 1002
#define IDC_ALWAYS 1002
#define IDC_BUTTON_NO 1003
#define IDC_PROGRESS1 1004
#define IDC_BUILD 1005
#define IDC_STATUS 1006
#define IDC_LOG 1009
#define IDC_VIEWDBS 1013
#define IDC_TREEVIEW 1014
#define IDC_WARNINGS 1014
#define IDC_UPDATE 1015
#define IDC_SAVE 1016
#define IDC_EXPORT 1017
#define IDC_IMPORT 1018
#define IDC_GENERATE 1019
#define IDC_MATCHCOMBO 1019
#define IDC_CHANGES 1020
#define IDC_ERRORS 1021
#define IDC_NEWTEXT 1021
#define IDC_MATCHTEXT 1022
#define IDC_REPORTS 1022
#define IDC_DIALOG_STATUS 1022
#define IDC_CHECKRETRANSLATE 1023
#define IDC_SHOW_DETAILS 1023
#define IDC_SENT 1023
#define IDC_SKIP 1024
#define IDC_COMBOLANG 1026
#define IDC_CHECKTRANS 1027
#define IDC_RADIOALL 1028
#define IDC_RADIOCHANGES 1029
#define IDC_FILENAME 1031
#define IDC_RADIOSAMPLE 1032
#define IDC_RADIODIALOG 1033
#define IDC_RADIONONDIALOG 1034
#define IDC_RADIOUNVERIFIED 1035
#define IDC_SELECTALL 1036
#define IDC_RADIOMISSING 1036
#define IDC_UNICODE 1037
#define IDC_RADIOUNSENT 1037
#define IDC_NOXSTR 1038
#define IDC_PREFIX 1039
#define IDC_LANGUAGE 1040
#define IDC_PERCENT 1041
#define IDC_DIALOG 1043
#define IDC_TRANSLATIONS 1044
#define IDC_EDIT1 1046
#define IDC_TEXT 1047
#define IDC_SLIDER 1048
#define IDC_STOP 1049
#define IDC_PAUSE 1050
#define IDC_PLAY 1051
#define IDC_WAVENAME 1052
#define IDC_YES 1054
#define IDC_MESSAGE 1055
#define IDC_TEXT_TITLE 1056
#define IDC_TRANS 1058
#define IDC_ORIG 1059
#define IDC_IDS 1060
#define IDC_ORIGINAL 1061
#define IDC_TRANSLATION_STATUS 1062
#define IDC_LIMIT 1065
#define IDC_IFLESS 1067
#define IDC_ITEMS 1068
#define IDC_RESET 1069
#define IDC_OLDTEXT 1070
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 151
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1071
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View file

@ -0,0 +1,5 @@
// Microsoft Developer Studio generated Help ID include file.
// Used by noxstring.rc
//
#define HIDC_PROGRESS1 0x806603ec // IDD_NOXSTRING_DIALOG
#define HIDC_STATUS 0x806603ee // IDD_NOXSTRING_DIALOG

View file

@ -0,0 +1,73 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// transcs.cpp
//
#include "stdafx.h"
#include <windows.h>
#include <winnls.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
void CreateTranslationTable ( void )
{
int i;
FILE *out;
unsigned short wc;
unsigned short mb;
DWORD last_error;
if ( ! ( out = fopen ( "utable.c", "wt" )))
{
return;
}
fprintf (out, "static unsigned short Utable[0x10000] =\n{" );
for ( i = 0; i < 0x10000; i++ )
{
if ( ( i %32 ) == 0 )
{
fprintf ( out, "\n\t/* 0x%04x */\t", i );
}
mb = i;
if ( MultiByteToWideChar (CP_ACP, MB_ERR_INVALID_CHARS, (LPCSTR) &mb, 2, &wc, 2 ) == 0 )
{
wc = 0;
last_error = GetLastError ( );
}
fprintf (out, "0x%04x", wc );
if ( i != 0xffff )
{
fprintf (out, "," );
}
}
fprintf ( out, "\n};\n");
fclose ( out );
}

View file

@ -0,0 +1,29 @@
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//
// transcs.h Translate char set
//
#ifndef _TRANSCS_H
#define _TRANSCS_H
void CreateTranslationTable ( void );
#endif // _TRANSCS_H